‎2007 Mar 27 11:15 AM
i am extrating data for inbound and outbound both are in different tables, know i need to print first
at new
material no desctiption date unit
in next line i need to print inbound qty for that material unit
after printing all the inbound qty i need to start printing the outbound
qty and unit from the last value of inbound qty, under one material,
if i am writing with in a loop then the inbound and outbound are getting one by one else if i am using outside the loop then all the outbound qts are printing at last .
<b>Here is my code</b>
LOOP AT i_temp_final INTO wa_temp_final.
AT NEW matnr.
READ TABLE i_temp_final INTO wa_temp_final INDEX sy-tabix.
*Converting to start date and end date.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = wa_temp_final-fbuda
IMPORTING
ev_month_begin_date = l_bdate
ev_month_end_date = l_edate.
NEW-PAGE.
WRITE: /8 wa_temp_final-matnr NO-ZERO,
16 wa_temp_final-arktx NO-ZERO,
32 l_bdate NO-ZERO,
48 wa_temp_final-obalance ,
58 wa_temp_final-vrkme_in NO-ZERO.
ENDAT.
WRITE:/32 wa_temp_final-fbuda NO-ZERO,
55 wa_temp_final-fkimg_in NO-ZERO,
72 wa_temp_final-vrkme_in NO-ZERO,
75 wa_temp_final-inbound_flag NO-ZERO,
108 wa_temp_final-vrkme_in NO-ZERO,
113 wa_temp_final-vbeln_in NO-ZERO,
120 wa_temp_final-posnr_in NO-ZERO,
129 wa_temp_final-vgbel NO-ZERO,
135 wa_temp_final-vgpos NO-ZERO,
146 wa_temp_final-vbeln_out NO-ZERO,
154 wa_temp_final-posnr_out NO-ZERO,
169 wa_temp_final-kunag NO-ZERO.
ENDLOOP.
*loop at i_outbound into wa_outbound.
WRITE:/77 wa_outbound-fkimg_out LEFT-JUSTIFIED NO-ZERO,
94 wa_outbound-vrkme_out NO-ZERO.
*endloop.
‎2007 Mar 27 11:42 AM
try this.....
LOOP AT i_temp_final INTO wa_temp_final.
AT NEW matnr.
READ TABLE i_temp_final INTO wa_temp_final INDEX sy-tabix.
*Converting to start date and end date.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = wa_temp_final-fbuda
IMPORTING
ev_month_begin_date = l_bdate
ev_month_end_date = l_edate.
NEW-PAGE.
WRITE: /8 wa_temp_final-matnr NO-ZERO,
16 wa_temp_final-arktx NO-ZERO,
32 l_bdate NO-ZERO,
48 wa_temp_final-obalance ,
58 wa_temp_final-vrkme_in NO-ZERO.
ENDAT.
WRITE:/32 wa_temp_final-fbuda NO-ZERO,
55 wa_temp_final-fkimg_in NO-ZERO,
72 wa_temp_final-vrkme_in NO-ZERO,
75 wa_temp_final-inbound_flag NO-ZERO,
108 wa_temp_final-vrkme_in NO-ZERO,
113 wa_temp_final-vbeln_in NO-ZERO,
120 wa_temp_final-posnr_in NO-ZERO,
129 wa_temp_final-vgbel NO-ZERO,
135 wa_temp_final-vgpos NO-ZERO,
146 wa_temp_final-vbeln_out NO-ZERO,
154 wa_temp_final-posnr_out NO-ZERO,
169 wa_temp_final-kunag NO-ZERO.
at end of matnr.
*loop at i_outbound into wa_outbound where matnr eq wa_temp_final-matnr.
WRITE:/77 wa_outbound-fkimg_out LEFT-JUSTIFIED NO-ZERO,
94 wa_outbound-vrkme_out NO-ZERO.
*endloop.
endat.
ENDLOOP.
Reward if helpful..........
‎2007 Mar 27 11:47 AM