Posted: Wed Feb 06, 2013 11:55 am Post subject: print SMARTFORM
u menya yest nijeukazannaya programma.ctobi perebrasival zakrivayusisya i otkrivayuwiysya shtati na itab i on normalnio rabotayet.
ya xocu button piostavit naverxu i nazvat k primeru 'PRINT'
pri najatiyi 'PRINT' polucat etu informasiyu iz smartforma.
mojete pomoc
Code:
*&---------------------------------------------------------------------*
*& Report ZHRR_POST_MOVE
REPORT ZHRR_POST_MOVE.
TYPE-POOLS slis.
infotypes : 0001.
TABLES: hrp1001,hrp1000,hrp1005.
DATA gt_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA gs_fieldcat LIKE LINE OF gt_fieldcat.
DATA : org_assing TYPE zztorg WITH HEADER LINE.
DATA : is_0001 TYPE pa0001.
data nn TYPE i VALUE 0.
data it_sort type SLIS_T_SORTINFO_ALV WITH HEADER LINE.
DATA: BEGIN OF itab OCCURS 0
, ORDER LIKE tkean-offset
, objid LIKE hrp1001-objid
, sobid LIKE hrp1001-sobid
, stextv LIKE hrp1000-stext
, stexts LIKE hrp1000-stext
, stextd LIKE hrp1000-stext
, tarix LIKE hrp1001-begda
, begda LIKE hrp1001-begda
, endda LIKE hrp1001-endda
, AEDTM LIKE hrp1002-AEDTM
* , plans like p0001-plans
* , stell like p0001-stell
* , tabnr LIKE hrp1002-tabnr
* , tline LIKE hrt1002-tline
* , orgtx LIKE t527x-orgtx
, actn(8)
, say(10)
, count1 LIKE tkean-offset
, count2 LIKE tkean-offset
, count3 LIKE tkean-offset
, count4 LIKE tkean-offset
, END OF itab.
DATA: a_itab LIKE TABLE OF itab WITH HEADER LINE,
b_itab LIKE TABLE OF itab WITH HEADER LINE.
*******************
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-b01.
SELECT-OPTIONS: t_begda FOR hrp1001-begda.
PARAMETERS: p_AEDTM LIKE hrp1002-AEDTM DEFAULT sy-datum.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN : END OF BLOCK b1.
SELECT * FROM hrp1001 INTO CORRESPONDING FIELDS OF TABLE a_itab
WHERE otype = 'S'
AND sclas = 'O'
AND plvar = '01'
* AND ( objid = '30000123' )"OR objid = '30001033')
AND ( begda IN t_begda ).
SELECT * FROM hrp1001 INTO CORRESPONDING FIELDS OF TABLE b_itab
WHERE otype = 'S'
AND sclas = 'O'
AND plvar = '01'
AND ( endda IN t_begda ).
*GET PERNR.
LOOP AT a_itab." where ( begda IN t_begda ).
CLEAR: itab.
* itab-count = 1.
itab-objid = a_itab-objid.
itab-sobid = a_itab-sobid.
itab-begda = a_itab-begda.
itab-tarix = a_itab-begda.
itab-actn = 'Açılıb'.
SELECT SINGLE AEDTM FROM hrp1002 INTO a_itab-AEDTM
WHERE begda = a_itab-begda.
itab-AEDTM = a_itab-AEDTM.
********************************************************
itab-count1 = 1.
itab-count2 = 0.
itab-count4 = 0.
SELECT SINGLE ZNORM_U2 FROM hrp1005
INTO itab-count3
WHERE plvar = '01' AND
otype = 'S' AND
objid = a_itab-objid AND
begda <= a_itab-begda AND
endda >= a_itab-begda.
"AND langu = sy-langu.
****************************************************
SELECT SINGLE stext FROM hrp1000
INTO itab-stextv
WHERE plvar = '01' AND
otype = 'S' AND
objid = a_itab-objid AND
begda <= a_itab-begda AND
endda >= a_itab-begda AND
langu = sy-langu.
SELECT SINGLE stext FROM hrp1000
INTO itab-stexts
WHERE plvar = '01' AND
otype = 'O' AND
objid = a_itab-sobid AND
begda <= a_itab-begda AND
endda >= a_itab-begda AND
langu = sy-langu.
* SORT a_itab BY sobid.
********
DATA : lv_orgeh LIKE p0001-orgeh.
lv_orgeh = a_itab-sobid.
CLEAR : org_assing,org_assing[] .
CALL FUNCTION 'Z_ERP_HR_LAST_ORGEH'
EXPORTING
orgeh = lv_orgeh
date = a_itab-begda
CHANGING
org_assing = org_assing[].
READ TABLE org_assing INDEX 1.
itab-stextd = org_assing-obtxt.
IF itab-stextd = itab-stexts.
CLEAR : itab-stexts.
ENDIF.
APPEND itab.
ENDLOOP.
********************VEZIFELERIN BAGLANMASI
LOOP AT b_itab.
* itab-count = 1.
itab-objid = b_itab-objid.
itab-sobid = b_itab-sobid.
itab-begda = b_itab-begda.
itab-endda = b_itab-endda.
itab-tarix = b_itab-endda.
itab-actn = 'Bağlanıb'.
SELECT SINGLE AEDTM FROM hrp1002 INTO b_itab-AEDTM
WHERE begda = itab-begda.
itab-AEDTM = b_itab-AEDTM.
********************************************************
itab-count1 = 0.
itab-count2 = 1.
itab-count3 = 0.
SELECT SINGLE ZNORM_U2 FROM hrp1005
INTO itab-count4
WHERE plvar = '01' AND
otype = 'S' AND
objid = b_itab-objid AND
begda <= b_itab-begda AND
endda >= b_itab-begda.
"AND langu = sy-langu.
****************************************************
SELECT SINGLE stext FROM hrp1000
INTO itab-stextv
WHERE plvar = '01' AND
otype = 'S' AND
objid = b_itab-objid AND
begda <= b_itab-begda AND
endda >= b_itab-begda AND
langu = sy-langu.
SELECT SINGLE stext FROM hrp1000
INTO itab-stexts
WHERE plvar = '01' AND
otype = 'O' AND
objid = b_itab-sobid AND
begda <= b_itab-begda AND
endda >= b_itab-begda AND
langu = sy-langu.
* SORT a_itab BY sobid.
********
* DATA : lv_orgeh LIKE p0001-orgeh.
lv_orgeh = b_itab-sobid.
CLEAR : org_assing,org_assing[] .
CALL FUNCTION 'Z_ERP_HR_LAST_ORGEH'
EXPORTING
orgeh = lv_orgeh
date = b_itab-begda
CHANGING
org_assing = org_assing[].
READ TABLE org_assing INDEX 1.
itab-stextd = org_assing-obtxt.
IF itab-stextd = itab-stexts.
CLEAR : itab-stexts.
ENDIF.
APPEND itab.
ENDLOOP.
LOOP AT itab.
nn = nn + 1.
IF sy-subrc = 0.
itab-order = nn.
ENDIF.
modify itab.
ENDLOOP.
** sort itab by itab-TABNR.
END-OF-SELECTION.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.