2008 Aug 14 3:08 PM
hii all,
my code is according this..................
the three KEY field which is commom in IT_CDPOS & IT_CDHDR are
1. objectclass = 'VBERCGH'
2. tabname = 'VBAP'
3.changind = 'U'.
loop at it_cdpos into wa_cdpos.
z_var = wa_cdpos-tabkey.
wa_cdhdr-vbeln = z_var+3(10).
wa_cdhdr-posnr = z_var+13(6).
modify it_cdhdr from wa_cdhdr transporting vbeln posnr.
endloop.
now the problem is that when i execute the code DUMP is come due to modify statement.
apart from that if i use in place of MODIFY......
APPEND.
Data will move but not in proper position.like it appends from the last position.
As IT_CDHDR has data before this code.
so according the data that IT_CDHDR contain i want to move vbeln and posnr value in IT_CDHDR at correct position.
Please provide me the suitable code for that......
thanks
Babbal.
2008 Aug 14 3:17 PM
Hi there,
Try using
modify it_cdhdr from wa_cdhdr index sy-tabix transporting vbeln posnr.
Hope that will not give you short dump and update the appropriate records.
Let me know if you need further help.
Thanks-
2008 Aug 14 3:14 PM
Add a READ TABLE before moving the data,
- READ TABLE it_cdhdr into wa_cdhdr WITH KEY objectclass = wa_cdpos-objectclass tabname = wa_cdpos-tabname changind = wa_cdpos-changind.
- saved_tabix = SY-TABIX. " store the SY-TABIX
- move fields (wa_cdhdr-vbeln = z_var+3(10). etc.)
- MODIFY it_cdhdr FROM wa_cdhdr INDEX saved_tabix ....
An internal table is not updated like a table via SQL
Regards
2008 Aug 14 3:17 PM
Hi there,
Try using
modify it_cdhdr from wa_cdhdr index sy-tabix transporting vbeln posnr.
Hope that will not give you short dump and update the appropriate records.
Let me know if you need further help.
Thanks-
2008 Aug 14 3:17 PM
Assuming that you have declared it_cdhdr with the correct data type, I would first read the table it_cdhdr and modify the read line after checking the sy-subrc.
2008 Aug 14 3:23 PM
Hi,
data l_idx type sy-tabix.
loop at it_cdpos into wa_cdpos.
*Read table it_cdhdr into wa_cdhdr with key objectclass = wa_cdpos-objectclass*
* tabname = wa_cdpos-tabname*
*changind = wa_cdpos-changind*
if sy-subrc = 0.
*l_idx = sy-tabix.*
z_var = wa_cdpos-tabkey.
wa_cdhdr-vbeln = z_var+3(10).
wa_cdhdr-posnr = z_var+13(6).
modify it_cdhdr from wa_cdhdr transporting vbeln posnr *index l_idx.*
clear l_idx.
endif.
endloop.
Edited by: Kamesh Bathla on Aug 14, 2008 4:24 PM