Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

prepare output table

Former Member
0 Likes
690

hi,

i have data in three itab.

using loop i am trying to move the data from itab's to output table workarea then appending it to final output table.

for the first itab loop data is getting appended but for next two its not.

am not getting whts happening.

pls help

hi,

i have data in three itab.

using loop i am trying to move the data from itab's to output table workarea then appending it to final output table.

for the first itab loop data is getting appended but for next two its not.

am not getting whts happening.

pls help

5 REPLIES 5
Read only

Former Member
0 Likes
632

Hi,

please post your coding how you fill the new tables.

Regards

Nicole

Read only

0 Likes
632

LOOP AT t_mara INTO w_mara.

MOVE w_mara-matnr TO w_output-matnr.

MOVE w_mara-matkl TO w_output-matkl.

APPENDw_output TO t_output.

CLEAR w_output

ENDLOOP.

LOOP AT t_makt INTO w_makt

MOVE w_mara-makt TO w_output-makt.

APPENDw_output TO t_output.

CLEAR w_output

ENDLOOP.

LOOP AT t_mard INTO w_mard.

MOVE w_mara-werks TO w_output-werks.

APPENDw_output TO t_output.

CLEAR w_output

ENDLOOP.

Read only

0 Likes
632

The first think that is notice is, that you have no relation beetween the 3 internal tables, but you move a few fields into t_output.

How should the system now, at which line you want to insert it??

Or is it right that you have one dataset for each entry outside t_mara, for each entry outside t_makt and also for each entry outside t_mard??

Read only

0 Likes
632

hi,

LOOP AT t_mara INTO w_mara.

MOVE w_mara-matnr TO w_output-matnr.

MOVE w_mara-matkl TO w_output-matkl.

read table t_makt INTO w_makt where matnr = w_mara-matnr.

if sy-subrc = 0.

w_output-makt = w_makt-makt.

endif.

read table t_mard INTO w_mard where matnr = w_mara-matnr.

if sy-subrc = 0..

w_output-werks = w_mard-werks .

endif.

APPENDw_output TO t_output.

CLEAR w_output

ENDLOOP.

Regards,

Subramanian

Read only

Former Member
0 Likes
632

Hi,

Check to see if you are clearing the workarea before the other appends.

Regards,

Subramanian