2006 Aug 09 9:17 AM
hello,
i have a little q...
trough SELECT i get data into my it_1. Can you tell me how to put that data to my itab_custdata (structure) trough work area wa_it and wa_custdata and not to put one by one.
eg.
...
SELECT mkpf~xblnr
mkpf~frath
mkpf~awsys
...
mseg~matnr
mseg~werks
mseg~lgort
...
INTO CORRESPONDING FIELDS OF TABLE it_1
FROM
mkpf AS mkpf
INNER JOIN
mseg AS mseg
ON mkpfmandt = msegmandt AND
...
WHERE
mkpf~cpudt >= '20060301' AND
...
LOOP AT it_1 INTO wa_it.
...
<b>NEED CODE HERE!</b>
APPEND wa_custdata TO itab_custdata.
ENDLOOP.
so i don't need to put one by one like this:
wa_custdata-xblnr = wa_it-xblnr.
wa_custdata-werks = wa_it-werks.
NOTE: other parts of Code is missing, 'cause it's too large...
Message was edited by: Maja Zugaj
2006 Aug 09 9:22 AM
If you keep the field structure(names of the fields) of wa_custdata and wa_it similar than you can use MOVE-CORRESPONDING command instead of individual moves.
MOVE-CORRESPONDING wa_it into wa_custdata.
Regards
Anurag
hello,
i have a little q...
trough SELECT i get data into my it_1. Can you tell me how to put that data to my itab_custdata (structure) trough work area wa_it and wa_custdata and not to put one by one.
eg.
...
SELECT mkpf~xblnr
mkpf~frath
mkpf~awsys
...
mseg~matnr
mseg~werks
mseg~lgort
...
INTO CORRESPONDING FIELDS OF TABLE it_1
FROM
mkpf AS mkpf
INNER JOIN
mseg AS mseg
ON mkpfmandt = msegmandt AND
...
WHERE
mkpf~cpudt >= '20060301' AND
...
LOOP AT it_1 INTO wa_it.
...
<b>NEED CODE HERE!</b>
APPEND wa_custdata TO itab_custdata.
ENDLOOP.
so i don't need to put one by one like this:
wa_custdata-xblnr = wa_it-xblnr.
wa_custdata-werks = wa_it-werks.
NOTE: other parts of Code is missing, 'cause it's too large...
Message was edited by: Maja Zugaj
2006 Aug 09 9:21 AM
you can use MOVE CORRESPONDING
MOVE CORRESPONDING wa_it TO ITAB_CUSTDATA
MOVE CORRESPONDING wa_custdata TO ITAB_CUSTDATA
and use APPEND ITAB_CUSTDATA.
clarify bit more about ITAB_CUSTAREA ???
Regards
srikanth
Message was edited by: Srikanth Kidambi
Message was edited by: Srikanth Kidambi
2006 Aug 09 9:22 AM
If you keep the field structure(names of the fields) of wa_custdata and wa_it similar than you can use MOVE-CORRESPONDING command instead of individual moves.
MOVE-CORRESPONDING wa_it into wa_custdata.
Regards
Anurag
2006 Aug 09 9:22 AM
Hi,
You can assign it directly provided both work areas have same structure else you have to assign it one by one ( field by field ).
wa_custdata = wa_it.
Best regards,
Prashant
2006 Aug 09 9:23 AM
HI use this to move all fields at once.
<b>MOVE-CORRESPONDING wa_it TO wa_custdata.</b>
Regards,
HRA
2006 Aug 09 9:56 AM
O.K. I've managed to do that but now when i run my program to check did the alv imported all fields in itab_custdata table i get next error:
...
Field symbol has not yet been assigned.
...
please help!
2006 Aug 09 9:58 AM
If both the structure of it_1 and itab_custdata are same u can directly use the command:
APPEND lines of it_1 to itab_custdata.
If the both the structure are different:
loop at it_1 into wa_it.
Move corresponding wa_it to wa_custdata.
Append wa_custdata to itab_custdata.
Endloop.
Regards,
Prakash.
2006 Aug 09 10:02 AM
O.K. I've managed to do that but now when i run my program to check did the alv imported all fields in itab_custdata table i get next error:
...
Field symbol has not yet been assigned.
...
please help!