2009 Jan 27 8:56 AM
Hi Experts,
Please help me,
Here i have final internal table with all my fields except one description field.
I need to fetch that from another table and i have to update correspondingly.
Can any one tell me how to do that.
Right now my data as below:
Materialno description deptno section
101 1 xyz
102 2 pqr
Now i don't have description field in my final internal table. now i have to pick up from another table and i have to update correspondingly,
Thanks and regards,
2009 Jan 27 8:59 AM
hi,
use modify internal table transporting statement.
eg:
PARAMETERS: p_carrid TYPE sflight-carrid,
p_connid TYPE sflight-connid,
p_plane1 TYPE sflight-planetype,
p_plane2 TYPE sflight-planetype.
DATA sflight_tab TYPE SORTED TABLE OF sflight
WITH UNIQUE KEY carrid connid fldate.
DATA sflight_wa TYPE sflight.
SELECT *
FROM sflight
INTO TABLE sflight_tab
WHERE carrid = p_carrid AND
connid = p_connid.
sflight_wa-planetype = p_plane2.
MODIFY sflight_tab FROM sflight_wa
TRANSPORTING planetype WHERE planetype = p_plane1.
Edited by: guest on Jan 27, 2009 10:00 AM
2009 Jan 27 9:00 AM
Try like this.
Loop at final table.
Read table with key matertial no. ( another table which contain description )
Move value into final table field.
Modify final table
Endloop.
Hope this helps...
2009 Jan 27 9:02 AM
Hi Amit,
Use this code:
Let us suppose u have the initial data in ITAB.
data: l_maktx type maktx.
Loop at ITAB.
select maktx into l_maktx
from mara
where matnr = ITAB-MATNR.
if sy-subrc = 0.
ITAB-MAKTX = l_MAKTX.
MODIFY ITAB.
endif.
clear l_maktx.
endloop.
Hope this will help you.
Regards,
Vinod.
2009 Jan 27 9:05 AM
Hi,
Use MODIFY statement to append the description to the final itab.
This is link for sample code,
http://help.sap.com/saphelp_40b/helpdata/en/fc/eb37b2358411d1829f0000e829fbfe/content.htm
Hope this helps you.
2009 Jan 27 9:05 AM
Loop at your final internal table int_final into
work area wa_final.
Read other table into int_other into work area
wa_other with key field = key field of your wa_final.
If sy-subrc = 0.
Take the description field in wa_final-desc = wa_other u2013desc.
Then modify int_final with wa_final transporting desc.
Endif.
Endloop.
Hopefully it helps you.
Thanks,
Sanjeet
2009 Jan 27 9:14 AM
Hi,
write ur query using inner-join.
data: begin of itab occurs 0,
matnr like mara-matnr,
maktx like makt-maktx,
end of itab.
select * into corresponding fields of table itab
from ( mara as a
inner join makt as b on a~matnr = b~matnr ).
loop at itab.
write:/ itab-matnr, itab-maktx.
endloop.
thanks\
Mahesh
2009 Jan 27 9:25 AM
Hi
Check out Modify Statements at: [Modify|http://help.sap.com/abapdocu/en/ABAPMODIFY_ITAB.htm]
Loop at itab2 into wa2. " Loop at your final itab
modify itab1 from wa2 transporting description. " Change your first itab according to final wa
Endloop.
Hope this helps
Regards,
Jayanthi.K
2009 Jan 27 10:19 AM
Hi,
LOOP AT it_desc INTO wa_desc.
wa_final-description = wa_desc-description.
MODIFY it_final FROM wa_final
TRANSPORTING description
WHERE material_no = wa_desc-material_no. "If you have other keys use those also
ENDLOOP.
Regards,
Manoj Kumar P
2009 Jan 27 10:42 AM
hi,u can do like this
1.loop on first table
2.inside loop using key(the one ur using to fetch the decription should b in the first table),get the values inser into the first table.modify it.