‎2006 Sep 07 4:05 PM
hi to all,
in this the values of saknr and wrbtr were coming in header line they were not inserted to the body
can any one help me in solving this issue
loop at it_bseg2.
move it_bseg2-saknr1 to it_final-saknr1.
move it_bseg2-wrbtr to it_final-wrbtr1.
append it_final.(it-final already containing other values)
clear it_final.
endloop
thanks in advance
kiran kumar
‎2006 Sep 07 4:10 PM
Hello Kiran if the it_final is already containing some values ..you need to read the table it_final and modify it.
loop at it_bseg2.
Read table it_final with key {key fields-document number}
move it_bseg2-saknr1 to it_final-saknr1.
move it_bseg2-wrbtr to it_final-wrbtr1.
modify it_final index sy-tabix.
clear it_final.
endloop
Message was edited by: Anurag Bankley
‎2006 Sep 07 4:10 PM
Hi,
I think you are trying to fill the SAKNR and WRBTR from bseg in the final internal table which is already having some other fields. In that case read the final internal table in the Loop at it_bseg and then after populating the values modify the Final internal table instead of appending.
Hope this helps.
‎2006 Sep 07 4:10 PM
Hello Kiran if the it_final is already containing some values ..you need to read the table it_final and modify it.
loop at it_bseg2.
Read table it_final with key {key fields-document number}
move it_bseg2-saknr1 to it_final-saknr1.
move it_bseg2-wrbtr to it_final-wrbtr1.
modify it_final index sy-tabix.
clear it_final.
endloop
Message was edited by: Anurag Bankley
‎2006 Sep 07 4:13 PM
Do it like this -:)
Data: w_tabix type sy-tabix.
loop at it_bseg2.
w_tabix = sy-tabix.
Read table it_final with key {key fields-document number}
move it_bseg2-saknr1 to it_final-saknr1.
move it_bseg2-wrbtr to it_final-wrbtr1.
modify it_final index w_tabix
transporting saknr1 wrbtr1.
clear it_final.
endloop
Using transporting, you don't mess with the exiting values -;)
Greetings,
Blag.
‎2006 Sep 07 4:14 PM
HI Kiran,
Use collect it_final statement instead of append.
hope it works.
regards
‎2006 Sep 07 4:15 PM
hi anurag
i have done this but it is transporting the wrbtr which is there in it_final before and keeping it here.
there is any option in modify statemnt that transporting no fields like
‎2006 Sep 07 4:24 PM
Yes there is a variation in MODIFY statement for the same.
Example->
MODIFY it_zwms FROM p_is_zwms TRANSPORTING menge zerfm5
WHERE zwmsc = work-wmsc
AND matnr = p_is_zwms-matnr.
‎2006 Sep 07 4:13 PM
hi Kiran,
Read table statement is missing..
i.e,
loop at it_bseg2.
<b>read table it_final with key ..</b>
move it_bseg2-saknr1 to it_final-saknr1.
move it_bseg2-wrbtr to it_final-wrbtr1.
append it_final.(it-final already containing other values)
clear it_final.
endloop
‎2006 Sep 07 4:13 PM
hi,
Instead of appending the data to the final internal table first you need to read that particular row with key field and then modify that row with the fields saknr1 and wrbtr.
loop at it_bseg2.
read table it_final with key {key-field}
move it_bseg2-saknr1 to it_final-saknr1.
move it_bseg2-wrbtr to it_final-wrbtr1.
<b>modify it_final index sy-tabix</b>.: You should not append, use modify
clear it_final.
endloopRegards,
Richa
‎2006 Sep 07 4:14 PM
Hi,
Follwo below logic
loop at it_bseg2.
read table it_final with key bukrs = it_bseg-bukrs
belnr = it_bseg2-belnr.
if sy-subrc eq 0.
lv_index = sy-tabix.
move it_bseg2-saknr1 to it_final-saknr1.
move it_bseg2-wrbtr to it_final-wrbtr1.
modify it_final index lv_index.
clear lv_index.
endif.
endloop
Regards
Amole
‎2006 Sep 07 4:14 PM
hi,
Remove the code in bold italics. Insert the code which is in bold.
loop at it_bseg2.
<b> clear it_final.
read table it_final with key fld = it_bseg2-fld1.
if sy-subrc = 0.</b>
move it_bseg2-saknr1 to it_final-saknr1.
move it_bseg2-wrbtr to it_final-wrbtr1.
<b> modify it_final index sy-tabix.</b>
<b><i>append it_final.(it-final already containing other values)
clear it_final.
</i></b>
endif.
endloop
Regards,
Sailaja.