10-08-2007 4:04 PM
hello friends,
I have one internal table with 6 fields like-
vbeln posnr kunnr name1 username changed_dt
Now, I have already appeneded this table with 5 fields,
beln posnr kunnr name1
now there is some operation.
i got username and changed_dt in to another internal table.
Now i want to get vbeln which is related to username.
So how can i get 1 whole record ?
Please give me example
thanks in advance !!
n.master
10-08-2007 4:08 PM
sort itab1 by username.
loop at itab2.
read table itab1 with key username = itab2-username.
if sy-subrc EQ 0.
<< itab1-vbeln will contain value.. u can use it>>
endif.
endloop.
10-08-2007 4:07 PM
Hi,
Can you tell us how u got the username and changed_dt?
Regards,
Niyaz
10-08-2007 4:08 PM
10-08-2007 4:08 PM
sort itab1 by username.
loop at itab2.
read table itab1 with key username = itab2-username.
if sy-subrc EQ 0.
<< itab1-vbeln will contain value.. u can use it>>
endif.
endloop.
10-08-2007 4:08 PM
The link between these 2 tables is USERNAME and CHANGED_DATE.
You can loop at one table. In the loop read another table with above keys, If the READ is successful, get the VBELN value and modify the internal table.
LOOP AT ITAB.
L_TABIX = SY-TABIX.
READ TABLE ITAB1 WITH KEY USERNAME = ITAB-USERNAME
CHANGED_DATE = ITAB-CHANGED_DATE.
IF SY-SUBRC EQ 0.
ITAB-VBELN = ITAB1-VBELN.
MODIFY ITAB INDEX L_TABIX TRANSPORTING VBELN.
ENDIF.
ENDLOOP.
Hope this helps.
ashish
10-08-2007 4:08 PM
hi Master
what is the connection between the two internal tables? If my understanding is right in one internal table you have beln posnr kunnr name1, and in the other one username change_dt.
ec
10-08-2007 4:25 PM
10-08-2007 4:28 PM
if there is no direct link between itab1 and itab2 you have to go back to the database...
10-08-2007 4:16 PM
try below.. i don know if this is ur exact requirement.
sort itab2 by username.
loop at itab1.
read table itab2 with key username = itab1-username.
if sy-subrc EQ 0.
itab1-changed_dt = itab2-changed_dt.
modify itab1.
endif.
endloop.