cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with itcsy structure

Former Member
0 Kudos

Hi friends,

I have created a layout fo medruck for which i'm using the standard driver program. In one window i'm using the perform statement for collecting values from the program for which im using the itcsy structure intab & outab. Here in my internal table i'm getting 2 values. My second value is over-writing the first value and getting displayed in the lay-out.

This is myy code.

LOOP AT it_cdpos.

IF sy-subrc = 0.

READ TABLE outab INDEX 6.

MOVE it_cdpos-matnr TO outab-value.

SHIFT outab-value LEFT DELETING LEADING '0'.

MODIFY outab INDEX sy-tabix.

READ TABLE outab INDEX 7.

MOVE it_cdpos-desp TO outab-value.

MODIFY outab INDEX sy-tabix.

READ TABLE outab INDEX 8.

MOVE it_cdpos-meins TO outab-value.

MODIFY outab INDEX sy-tabix.

READ TABLE outab INDEX 9.

MOVE it_cdpos-value_old TO outab-value.

MODIFY outab INDEX sy-tabix.

READ TABLE outab INDEX 10.

MOVE it_cdpos-value_new TO outab-value.

MODIFY outab INDEX sy-tabix.

READ TABLE outab INDEX 11.

MOVE it_cdpos-prdat TO outab-value.

MODIFY outab INDEX sy-tabix.

READ TABLE outab INDEX 12.

MOVE it_cdpos-maktx TO outab-value.

MODIFY outab INDEX sy-tabix.

ENDIF.

ENDLOOP.

here only my latest value is updating, but i need all the values to get updated... PLZ help me...

Thanks and regards,

subbu.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

self answered

Former Member
0 Kudos

Hi,

Change the code such that read the table with name instead of index and update the same.

ITCSY contain name and value, use the name while reding from input table and update outtable.

Bye

former_member195383
Active Contributor
0 Kudos

sy-tabix will be same for all the Modify statements here...Thats wy the modification is done for the last read statement...

Rather u use

MODIFY outab INDEX 6.

MODIFY outab INDEX 7.

:

:

and so on ..in place of the modify statements that u have used....

Reward points...if the above helps....

Edited by: Rudra Prasanna Mohapatra on Jun 25, 2008 7:35 AM

Former Member
0 Kudos

Hi,

Thanks for your reply. My Problem is same field is having multiple values which is not getting displayed in my lay-out. Values are correctly getting updated in correct fields in outab. But in case of multiple values for same field... last values is over-writing the previous field value.

Subbu.

Former Member
0 Kudos

Hi,

When u read outtab, take that value if index in a variable say mytabix and then modify in the end using this mytabix, not sy-tabix.

Nayan

Former Member
0 Kudos

hi...

when u r modifying the out_tab index should be the index using which u have read the table... not the sy-tabix

check that

that should solve ur problem

regards

padma

Edited by: Padmavathi Palli on Jun 25, 2008 7:33 AM