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

SAPscript problem: writing data based on a condition.

aris_hidalgo
Contributor
0 Likes
444

Hello experts,

I am currently having a problem on how to solve my problem. Now, my forms(write form, new-page, etc) are inside a loop. Now, what I want to do is for example, in the first loop, customer A is present then I would write its details on the corresponding windows. Now on the 2nd loop, customer B is present so I would trigger a new page for him. But what if on the 3rd loop customer A again is present so I need to write his details on the original page where the customer A appeared(during the first loop). Is there a way to this? again, thank you very much guys and I appreciate your help...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
406

Hi Viray,

Use the control events for the internal table.

First sort the internal table and use AT NEW customer to first print all the customer A related info on first page and then use AT END and trigger a new page and start printing the second data of the new customer on the next page.

You can also use CONTROL_FORM to control it from the program.

Message was edited by: American Dreams

3 REPLIES 3
Read only

Former Member
0 Likes
407

Hi Viray,

Use the control events for the internal table.

First sort the internal table and use AT NEW customer to first print all the customer A related info on first page and then use AT END and trigger a new page and start printing the second data of the new customer on the next page.

You can also use CONTROL_FORM to control it from the program.

Message was edited by: American Dreams

Read only

Former Member
0 Likes
406

Hi Viray,

You can <b>sort the table depending on the customer</b> and then use trigger a new page for each customer.

I dont think you can return back to a previous page in SAPScript.

Regards,

Wenceslaus.

Read only

Former Member
0 Likes
406

Hi Viraylab,

The best way to achieve your functionality will be to follow the following steps :

1.Sort the table according to customer.

2.Print the details of a customer on a page.

3.As soon as you get a new customer, trigger the command new-page and then do print the details of the new customer on the new page.

Regards,

Kunal.