‎2008 Jun 25 6:23 AM
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.
‎2008 Jun 25 6:32 AM
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
‎2008 Jun 25 6:33 AM
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
‎2008 Jun 25 6:41 AM
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.
‎2008 Jun 25 7:04 AM
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.
‎2008 Jun 25 7:08 AM
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
‎2008 Jun 25 7:10 AM
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