cancel
Showing results for 
Search instead for 
Did you mean: 

serial number in scripts

Former Member
0 Kudos

Hi ,

Is there any system field in scripts to print serial numbers like 1,2,3 for each line item in main window.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor
0 Kudos

You can use &SAPSCRIPT-COUNTER_1&

And you can increment the counter and display serial numbers.

For INCREMENTING.

&SAPSCRIPT-COUNTER_1(+)& " Increases by 1

Regards,

Sairam

Answers (2)

Answers (2)

varma_narayana
Active Contributor
0 Kudos

Hi..

As mentioned in other Posts you cannot use SY-TABIX or SAPSCRIPT-COUNTER fields here.

Step1:

Instead of that Declare an additional Integer field in the Print program

Eg: DATA V_SERNO TYPE I.

Step2:

In the Loop.. Endloop. fill it with SY-TABIX.

LOOP AT ITAB.

V_SERNO = SY-TABIX.

**Calling WRITE_FORM

ENDLOOP.

Step3:

In the Layout set print this varible as Serial no for each line item

&V_SERNO(C)&.

Note: (C) will compress the SPACEs.

<b>Reward if Helpful</b>

Former Member
0 Kudos

Hi!

Try SY-TABIX (internal table index). It is filled within a LOOP.

Regards

Tamá