on 11-05-2007 7:23 AM
Hi friends,
I want to print serial number for the line items in the main window of a script, Please help me regarding this, if possible give me the sample code.
I want to print like this
sl.no. material no.
1. 100-100
2. 100-101
thanks in advance,
Arundhathi.
for this just keep a counter which will update it by 1 everytime a matyerail prints .
for ex.
sr_no. = sr_no. + 1 .
Thanks
Rohit
Reward if helpfull
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
to increase a sapscript counter you put a symbol in front
Like for example
You can increase or decrease the value of a SAPSCRIPT-COUNTER_x (x=0.. 9) counter variable by 1, before the current counter value is printed.
Syntax:
&SAPSCRIPT-COUNTER_x(+)& Increases by 1 the contents
of the counter variable x
(x=0.. 9)
&SAPSCRIPT-COUNTER_x(-)& Decreases by 1 the contents
of the counter variable x
(x=0.. 9)
If you want to change the value of a counter variable without actually printing the new value, use this formatting option together with an additional option to set the output length to 0 (see above). If you want to set a counter variable to some specific value, use the DEFINE control command.
Assume that &SAPSCRIPT-COUNTER_1& initially has the value 2.
&SAPSCRIPT-COUNTER_1& -> 2
&SAPSCRIPT-COUNTER_1(+)& -> 3
&SAPSCRIPT-COUNTER_1(-)& -> 2
&SAPSCRIPT-COUNTER_1(-)& -> 1
&SAPSCRIPT-COUNTER_1(+0)& ->
&SAPSCRIPT-COUNTER_1(+)& -> 3
Or in your report give this coding
FORM increase_line_count TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
DATA: line_count TYPE i.
READ TABLE in_par WITH KEY 'COUNTER'.
IF sy-subrc = 0.
*---Increase Counter
line_count = in_par-value + 1.
*---Set Counter
READ TABLE out_par WITH KEY 'COUNTER'.
IF sy-subrc = 0.
out_par-value = line_count.
MODIFY out_par INDEX sy-tabix.
ENDIF.
ENDIF.
ENDFORM. " INCREASE_LINE_COUNT
Then in your main window call this form as:
/: PERFORM INCREASE_LINE_COUNT IN PROGRAM ZPROGRAMNAME
/: USING &COUNTER&
/: CHANGING &COUNTER&
/: ENDPERFORM
Regards
Pavan
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.