‎2007 Dec 14 10:46 AM
Hi all
I have two fiedls it_hbank-hkont and it_skat1-txt50 and i want to pass them into one table am using the below piece of code but both the fields are npt getting passed into the one table.
LOOP AT it_skat1.
READ table it_skat1 WITH key saknr = it_sele-hkont.
LOOP at it_hbank.
READ TABLE it_hbank WITH KEY bukrs = p_bukrs.
it_sele-txt50 = it_skat1-txt50.
it_sele-hkont = it_hbank-hkont.
APPEND it_sele.
CLEAR it_sele.
endloop.
endloop.
Please make the necessary changes and get back to me..
With Regards
Vijay
‎2007 Dec 14 11:10 AM
Hi,
The READ statements in your code seems wrong.
First one it_sele-hkont would be empty and it_skat1-txt50 would be empty. So change it accordingly. Second READ can be avoided too.
Use this code : Hopefully this works.
LOOP AT it_skat1 where SAKNR = p_saknr. ( use appropriate filter or leave it).
LOOP at it_hbank where bukrs = p_bukrs.
it_sele-txt50 = it_skat1-txt50.
it_sele-hkont = it_hbank-hkont.
APPEND it_sele.
CLEAR it_sele.
endloop.
endloop.
Cordially,
Shankar Narayanan.
‎2007 Dec 14 4:22 PM
can u tell me fields in the tables,
it_skat1,
it_hbank with detialed structures . it mean structure of these tables.
‎2007 Dec 14 4:33 PM
Try:
SORT it_hbank BY hkont.
LOOP AT it_skat1.
READ TABLE it_hbank WITH KEY hkont = it_skat1-hkont
BINARY SEARCH.
it_sele-txt50 = it_skat1-txt50.
it_sele-hkont = it_hbank-hkont.
APPEND it_sele.
CLEAR it_sele.
ENDLOOP.
rob