03-08-2010 10:03 AM
Hi Experts,
I have a problem with 2 internal tables.
I have an internal table with some 7 records with the project details with some fields..
like proj num,proj year.....etc
and
2nd internal table with only 3 records and structure is
Proj Number (Only 1 field).
I need to display the 2nd internal table proj number details with 1 st internal table structure for only 3 records which are part of 7 records.
which statement can i use ?
please let me know.
regards
vishnu
Moderator message: subject corrected (at least I tried), please use a more meaningful one next time!
Edited by: Thomas Zloch on Mar 8, 2010 12:42 PM
03-08-2010 10:04 AM
How about reading the forum rules and using a meaningful subject line first?
03-08-2010 10:07 AM
Hi
<li>Use meaningful subject
<li>Try this way .
Thanks
Venkat.O
LOOP AT 2nd_itab.
LOOP AT 1st_itab where proj_no = 2nd_itab-proj_no.
ENDLOOP.
ENDLOOP.
03-08-2010 10:15 AM
Hi,
Try this,
LOOP AT 2nd Internal.
Read 1st Internal Table with key where projnumber = 2ndinternaltable-projnumber.
if sy-subrc eq 0.
Modify the records or append it to the new internal table ( of required Structure)
clear: itab2,itab1.
endif
Endloop.
Regards,
Sathish.
03-08-2010 11:28 AM
I used the same code but it is throwing an error saying that "PSPID is not expected" in where condition.
Loop at t_out into wa_out.
Read TABLE t_proj with table key where pspid = wa_out-pspid.
modify t_proj index sy-tabix.
if sy-subrc = '0'.
Message
endif.
endloop.
03-08-2010 11:21 AM
hi...
try this statement
select proj.no ...... .... from it_tab1into it_tab
for all entries in it_tab2 where proj.no = it_tab2-proj.no.
where it_tab1 and it_tab2 are your internal tables and it_tab have same structure like it_tab.
Regards,
Lokeswari.
03-08-2010 11:32 AM
Hi Lokeshwari,
You have missed the names..
Please let me know what it refers to ..
thanks for response.
regards
vishnu
03-08-2010 11:35 AM
hi!
Declare Work area for the table t_proj and try.
Read TABLE t_proj into wa_prog with key where pspid = wa_out-pspid.
03-08-2010 11:39 AM
hi...
Those are your first internal table fields.
Regards,
Lokeswari.
03-08-2010 1:04 PM
Hi,
Loop at the 2nd internal table into work area.
read the 1st internal table into work area where proj num = wasecond table-projnum( frm 2nd internal table)
now this will read only those records wher project number from 2nd matches those in the first , This is how you can get only records for the 3 project numbers which are in the 2nd internal table.
03-10-2010 6:15 AM