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 with itcsy in script

Former Member
0 Likes
704

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.

6 REPLIES 6
Read only

Former Member
0 Likes
678

Hi Subbu,

I think the problem is with your ST-TABIX value. Check the sy-tabix value in debugging. it might be same for all the records. Instead you go for SY-INDEX and try. It might work.

Hope this helps you.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
678

Hi,

When You Are Modifying The Contents Of out_tab

Start with index 1 after That Increase the Value Index by 1 as

value of sy-tabix is remaining the same inside one loop pass.

Regards,

Sujit

Read only

0 Likes
678

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.

Read only

0 Likes
678

Hi,

Instead of using Loop You Can Use

Take a variable for index value.

Do n times.

'Read table itab1 index 1'

After That Read Out_tab table.

Modify out_tab.

And at last increase index by 1.

Enddo.

Read only

0 Likes
678

Hi Subbu,

The sy-tabix value in the loop is remaining the same, and when you are using MODIFY statement, it modifies the current values with the new ones. Now I think you can approach your problem.

Hope this helps you.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
678

use this..................

if the particular field r variable is holding value......then dont allow in to that...

if <field or var> is initial.

endif.

like that use use for everything..........

regards

Anbu