‎2008 Jun 30 2:52 AM
I have data for 3 fields in one internal table. Now I have a Z table with 4 fields, of which last 3 fields are same the 3 fields of internal table. Now I need to move the data from the Internal table to Z Table, by calling the FM 'ABC', whose output shoud be transferred to the first field in the Z Table and the rest 3 fields from internal table. Please suggest.
‎2008 Jun 30 4:34 AM
I have data for 3 fields in one internal table. Now I have a Z table with 4 fields, of which last 3 fields are same the 3 fields of internal table. Now I need to move the data from the Internal table to Z Table, by calling the FM 'ABC', whose output shoud be transferred to the first field in the Z Table and the rest 3 fields from internal table. Please suggest.
internal table it_tab
with fields : field1 field2 field3.
Ztable with zfield1 zfield2 zfield3 zfield4.
zfield2 is same as field1
zfield3 is same as field2
zfield4 is same as field3
my suggestion.
table: ztable.
call function ABC
importing
value = zfield1.
Loop at it_tab.
zfield2 = field1.
zfield3 = field2.
zfield4 = field3.
Modify ztable.
endloop.
‎2008 Jun 30 4:32 AM
data wa_tab type ztab.
loop at itab into wa.
CALL FUNCTION 'ABC'
EXPORTING
<ur_parameters>
IMPORTING
ztab-field1 = wa_tab-field1
.
IF SY-SUBRC = 0.
move wa-field1 to wa_tab-field2.
move wa-field1 to wa_tab-field3.
move wa-field1 to wa_tab-field4.
insert ztab from wa_tab.
ENDIF.
endloop.
plz reward points if this helps..
‎2008 Jun 30 4:34 AM
I have data for 3 fields in one internal table. Now I have a Z table with 4 fields, of which last 3 fields are same the 3 fields of internal table. Now I need to move the data from the Internal table to Z Table, by calling the FM 'ABC', whose output shoud be transferred to the first field in the Z Table and the rest 3 fields from internal table. Please suggest.
internal table it_tab
with fields : field1 field2 field3.
Ztable with zfield1 zfield2 zfield3 zfield4.
zfield2 is same as field1
zfield3 is same as field2
zfield4 is same as field3
my suggestion.
table: ztable.
call function ABC
importing
value = zfield1.
Loop at it_tab.
zfield2 = field1.
zfield3 = field2.
zfield4 = field3.
Modify ztable.
endloop.