‎2008 Dec 10 2:46 PM
Dear Experts,
My code is Below. my requirement is all the work area fields are modify comparing ebeln.
but i am use append duplicates entris allowed.only possible to modify.
All the work area is filled.but when debugger is execute modify statement should be short dump error.
loop at it_ekko into wa_ekko.
read table it_ekpo into wa_ekpo with key ebeln = wa_ekko-ebeln.
if sy-subrc = 0.
wa_ekpo-ebeln = wa_ekko-ebeln.
wa_ekpo-bedat = wa_ekko-bedat.
wa_ekpo-reswk = wa_ekko-reswk.
modify it_ekpo from wa_ekpo.
endif.
endloop.
Plz solved it.how to use modify statement is my code.
regards,
raj.
‎2008 Dec 10 2:52 PM
Hi
If you want to update it_ekpo u need to use the INDEX option, because the statament MODIFY is not in a LOOP of IT_EKPO table, so the system can't know which record has to be modified.
loop at it_ekko into wa_ekko.
read table it_ekpo into wa_ekpo with key ebeln = wa_ekko-ebeln.
if sy-subrc = 0.
* wa_ekpo-ebeln = wa_ekko-ebeln.
wa_ekpo-bedat = wa_ekko-bedat.
wa_ekpo-reswk = wa_ekko-reswk.
* modify it_ekpo from wa_ekpo.
modify it_ekpo from wa_ekpo index sy-tabix. <-----------------------------
endif.
endloop.Max
‎2008 Dec 10 2:52 PM
Hi
If you want to update it_ekpo u need to use the INDEX option, because the statament MODIFY is not in a LOOP of IT_EKPO table, so the system can't know which record has to be modified.
loop at it_ekko into wa_ekko.
read table it_ekpo into wa_ekpo with key ebeln = wa_ekko-ebeln.
if sy-subrc = 0.
* wa_ekpo-ebeln = wa_ekko-ebeln.
wa_ekpo-bedat = wa_ekko-bedat.
wa_ekpo-reswk = wa_ekko-reswk.
* modify it_ekpo from wa_ekpo.
modify it_ekpo from wa_ekpo index sy-tabix. <-----------------------------
endif.
endloop.Max
‎2008 Dec 10 3:03 PM
‎2008 Dec 10 2:53 PM
Hi,
PARAMETERS p_carrid TYPE scarr-carrid.
DATA scarr_tab TYPE SORTED TABLE OF scarr
WITH UNIQUE KEY carrid.
DATA: idx TYPE sy-tabix,
scarr_wa TYPE scarr.
SELECT *
FROM scarr
INTO TABLE scarr_tab.
READ TABLE scarr_tab
WITH TABLE KEY carrid = p_carrid
TRANSPORTING NO FIELDS.
idx = sy-tabix.
scarr_wa-currcode = 'EUR'.
MODIFY scarr_tab INDEX idx FROM scarr_wa
TRANSPORTING currcode.
Thanks
P.S.Rajesh
‎2008 Dec 10 2:56 PM
Hi,
data : it_ekko type sorted table of Unique-KEY ebeln.
loop at it_ekko into wa_ekko.
read table it_ekpo into wa_ekpo with key ebeln = wa_ekko-ebeln.
if sy-subrc = 0.
wa_ekpo-ebeln = wa_ekko-ebeln.
wa_ekpo-bedat = wa_ekko-bedat.
wa_ekpo-reswk = wa_ekko-reswk.
modify it_ekpo from wa_ekpo.
endif.
endloop.
Then it will solve u r pbm.
Thanks,
‎2008 Dec 10 3:00 PM
EKPO is item level data.
There could be duplicate entries being created for the same ekko-ebeln. Hence the short dump.
Keep POSNR too in ekpo if you dont have it.
‎2008 Dec 10 3:03 PM
>
> Dear Experts,
> My code is Below. my requirement is all the work area fields are modify comparing ebeln.
> but i am use append duplicates entris allowed.only possible to modify.
> All the work area is filled.but when debugger is execute modify statement should be short dump error.
>
> loop at it_ekko into wa_ekko.
> read table it_ekpo into wa_ekpo with key ebeln = wa_ekko-ebeln.
> if sy-subrc = 0.
> wa_ekpo-ebeln = wa_ekko-ebeln.
> wa_ekpo-bedat = wa_ekko-bedat.
> wa_ekpo-reswk = wa_ekko-reswk.
> modify it_ekpo from wa_ekpo.
> endif.
> endloop.
> Plz solved it.how to use modify statement is my code.
> regards,
> raj.
Hi Raj,
Use Modify it_ekpo from wa_ekpo index and transporting the fileds which you require .