‎2008 Jun 24 8:46 AM
Hello everyone !
Here is my problem :
DATA : wt_ztsdforetst TYPE TABLE OF ztsd_foretst WITH HEADER LINE. "+cki 23/06/2008
Here I load the internal table wt_ztsdforetst with data..
.....
.....
.....
MODIFY ztsd_foretst FROM TABLE wt_ztsdforetst.
The result is : my internal table wt_ztsdforetst contains 5 lines of data but after the modify, only the content of the headerline is inserted into my ztable (ztsd_foretst )
I don't understand why !!
Any help will be rewarded..
Many Thanks
Ced
‎2008 Jun 24 8:55 AM
The statement seems to be ok.
Just check that the data in wt_ztsdforetst should be unique in terms of primary key combination.
‎2008 Jun 24 8:50 AM
try this:
loop at wt_ztsdforetst.
MODIFY ztsd_foretst FROM TABLE wt_ztsdforetst.
endloop.
Or clear the work area after modifying.
‎2008 Jun 24 8:55 AM
The statement seems to be ok.
Just check that the data in wt_ztsdforetst should be unique in terms of primary key combination.
‎2008 Jun 24 8:55 AM
REPORT YMODIFY.
DATA: ITAB TYPE TABLE OF Z709MARA WITH HEADER LINE.
ITAB-MATNR = 'A101'.
ITAB-MTART = 'FERT'.
APPEND ITAB.
CLEAR: ITAB.
ITAB-MATNR = 'B101'.
ITAB-MTART = 'FERT'.
APPEND ITAB.
CLEAR: ITAB.
ITAB-MATNR = 'C101'.
ITAB-MTART = 'FERT'.
APPEND ITAB.
CLEAR: ITAB.
ITAB-MATNR = 'D101'.
ITAB-MTART = 'FERT'.
APPEND ITAB.
CLEAR: ITAB.
MODIFY Z709MARA FROM TABLE ITAB.
IF SY-SUBRC IS INITIAL.
WRITE: / 'good'.
ENDIF.
I have checked the same it works for me.. check if u have cleared the workarea after appending..
‎2008 Jun 24 8:56 AM
Do like this:
DATA : it_ztsdforetst TYPE TABLE OF ztsd_foretst,
wa_ztsdforetst type ztsd_foretst.
loop at it_ztsdforetst into wa_ztsdforetst.
.....
.....
.....
MODIFY ztsd_foretst FROM wa_ztsdforetst transporting all fields.
endloop.
Regards
Kannaiah