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

REGARDING SAP SCRIPT

Former Member
0 Likes
462

Hi experts!

i have a problem in sap script.can anyone help me out.

my scenerio is that i have to use a loop in two windows.

name of first window h1 type var

name of 2nd window main type main.

when i use that loop in main it gives me required output that is

e.g.

material

s1

s2

s3

but when i use that loop in h1 window

it gives me output

material

s3

s3

s3

can anyone help me with that

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
441

Actually you can't use the LOOPs in the VAR windows.

So, I would suggest to take the max number variables of the lines for that window.

Assign each lines of the table to that varaible and print all variables in that window.

Like:

read table itab index 1.

mat1 = itab-matnr.

read table itab index 2.

mat2 = itab-matnr.

......

.....

and in the VAR type window

&MAT1&

&MAT2&

....

...

Regards,

Naimesh Patel

2 REPLIES 2
Read only

naimesh_patel
Active Contributor
0 Likes
442

Actually you can't use the LOOPs in the VAR windows.

So, I would suggest to take the max number variables of the lines for that window.

Assign each lines of the table to that varaible and print all variables in that window.

Like:

read table itab index 1.

mat1 = itab-matnr.

read table itab index 2.

mat2 = itab-matnr.

......

.....

and in the VAR type window

&MAT1&

&MAT2&

....

...

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
441

Jawad,

Some where you are not clearing the work area.

clear work areas after append, modify statements.

Reward points if it helps,

Satish