Application Development 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: 

INCREMENTING

Former Member
0 Kudos

HI ALL

i'm have a field PINCR which holds the value 10 n i've to move this value to another field ANFPS n the value of ANFPS should increment by 10 .

like

10

20

30...

in table conrol

can u please find me the solution .

regards

suprith

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Suprith,

In the Internal Table that you are passing to the Table control, put another field ANFPS. And Loop this table and write

itab-ANFPS = itab-ANFPS + itab-PINCR.

This should be passed to the TAB Control.

5 REPLIES 5

former_member208856
Active Contributor
0 Kudos

Hi,

use

ANFPS = PINCR + 10.

Sandeep Kaushik

Former Member
0 Kudos

Hi Suprith,

In the Internal Table that you are passing to the Table control, put another field ANFPS. And Loop this table and write

itab-ANFPS = itab-ANFPS + itab-PINCR.

This should be passed to the TAB Control.

Former Member
0 Kudos

I have the same in my program which will have similar to VA01 salesorder.

Sort itab by posnr by descending.

read table itab index 1.

l_posnr = itab-posnr.

with in internal table....when ever u r entering a new record use

l_posnr = l_posnr + 10.

itab-posnr = l_posnr .

Former Member
0 Kudos

hi,

try this:

data : begin of itab occurs 0,

i1 type i,

i2 type i,

end of itab.

*

do 10 times.

itab-i1 = 10.

itab-i2 = itab-i1 * sy-index.

append itab.

enddo.

*

loop at itab.

write: / itab-i1, itab-i2.

endloop.

regards, Dieter

former_member375669
Participant
0 Kudos

hi suprith,

take a feild in your internal table and fill it by the desired values ,

that is simpally can do by using a loop on the internal table and by using the modify statement. and then use that table in the table control..

USE THIS AFTER THE SELECT QUERY.

READ TABLE I_TEMP INDEX 1.

i_temp-ANFPS = i_temp-PINCR .

modify i_temp.

loop at i_temp.

i_temp-ANFPS = i_temp-ANFPS + 10.

modify i_temp.

endloop.

REWARD THE POINTS