Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem using MODIFY ztable FROM itab

Former Member
0 Likes
546

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
521

The statement seems to be ok.

Just check that the data in wt_ztsdforetst should be unique in terms of primary key combination.

4 REPLIES 4
Read only

Former Member
0 Likes
521

try this:

loop at wt_ztsdforetst.

MODIFY ztsd_foretst FROM TABLE wt_ztsdforetst.

endloop.

Or clear the work area after modifying.

Read only

Former Member
0 Likes
522

The statement seems to be ok.

Just check that the data in wt_ztsdforetst should be unique in terms of primary key combination.

Read only

Former Member
0 Likes
521

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..

Read only

Former Member
0 Likes
521

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