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

Looping in a SAP Script ??

Former Member
0 Likes
647

Hi folks,

Iam hooked up with the following situation.

The user enters some text which can go upto multiple lines and then calls a correspondence request which will read the PARAM from BKORM table. This parameter is passed to the function module READ_TEXT and then the text entered by the user is printed on the SAP Script output.

To acheive this, iam using a subroutine pool whichi calls the subroutine from the SAP Script as follows:

PERFORM <Subroutine name> IN PROGRAM <Prog.Name>

USING <par1>

USING <par2>

Changing <text>.

ENDPERFORM.

But the problem here is that this returns only one line of the trext entered by the user. And one cannot be sure about how many lines the user enters. Moreover, i cannot use Do or LOOP in an SAP Script.

Is there anyway by which i can print all the lines the user enters ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
590

In which transaction the user enters text. And what is your message output.

Can you not use INCLUDE TEXT .... in your sapscript to print the text . You need to know the TEXT ID & TEXT NAME which I guess you know as you are using READ_TEXT.

So if you dont have the ID & NAME then you can get it using PERFORM in SAPSCRIPT and then use these values with INCLUDE TEXT .....

Cheers.

Sanjay

3 REPLIES 3
Read only

manuel_bassani
Contributor
0 Likes
590

Hi Vijay,

I think it will be neccessary to use a custom print program.


call function 'READ_TEXT'...

loop at lines.
  call function 'WRITE_FORM'
  element = 'ZROW'
endloop.

Regards, Manuel

Read only

Former Member
0 Likes
591

In which transaction the user enters text. And what is your message output.

Can you not use INCLUDE TEXT .... in your sapscript to print the text . You need to know the TEXT ID & TEXT NAME which I guess you know as you are using READ_TEXT.

So if you dont have the ID & NAME then you can get it using PERFORM in SAPSCRIPT and then use these values with INCLUDE TEXT .....

Cheers.

Sanjay

Read only

0 Likes
590

Hi Sanjay

The solution was spot on. It solved the problem. 10 points coming your way

Thanks and Regards,

Vijay