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: Changing following page logic

Former Member
0 Likes
988

Hello NG,

I've got a SAPSCRIPT-Form with 4 pages.

Page FIRST with follow page AGB, page AGB with follow page NEXT,

page NEXT with follow page NEXT and page AGB2 with no follow page.

The page AGB2 is called by command NEW-PAGE in a element at the main window at page FIRST, as we don't want to print a clear sheet, when we use the normal follow page logic and the new-page command if the is only one formpage to print ( the pages AGB and AGB2 don't have a main-window).

This logic is correct if we have to print a PO for foreign customer.

But for interior customer we need the following logic:

FIRST->NEXT->NEXT->...->NEXT

Thanks for help.

Best Regards Stefan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
845

Hi,

The AGB2 page is calling externally from the Program, so that will be in the CONTROL_FORM function module, so here you need to write the simple if condition .

If Customer = interior customer.

Call the CONTROL_FROM Fucntion moduel and call the NEW page.

ENDIF

Hello NG,

I've got a SAPSCRIPT-Form with 4 pages.

Page FIRST with follow page AGB, page AGB with follow page NEXT,

page NEXT with follow page NEXT and page AGB2 with no follow page.

The page AGB2 is called by command NEW-PAGE in a element at the main window at page FIRST, as we don't want to print a clear sheet, when we use the normal follow page logic and the new-page command if the is only one formpage to print ( the pages AGB and AGB2 don't have a main-window).

This logic is correct if we have to print a PO for foreign customer.

But for interior customer we need the following logic:

FIRST->NEXT->NEXT->...->NEXT

Thanks for help.

Best Regards Stefan

5 REPLIES 5
Read only

Former Member
0 Likes
845

Hi!

For the interior customer the normal program flow is correct. You only have to implement the coding for foreign customer.

In your ABAP you have to identify the foreign customer with a variable like gv_foreign_customer TYPE c.

Your ABAP will seems like this:

LOOP AT itab...

...

IF gv_foreign_customer = 'X'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'NEW_PAGE_AGB2'.

ENDIF.

...

ENDLOOP.

And the SAPScript in MAIN window:

/E NEW_PAGE_AGB2

/: NEW-PAGE AGB2

Regards

Tamá

Read only

Former Member
0 Likes
845

try to use

START_FORM

CLOSE_FORM

for handling this scenario.

regards,

vijay

Read only

Former Member
0 Likes
846

Hi,

The AGB2 page is calling externally from the Program, so that will be in the CONTROL_FORM function module, so here you need to write the simple if condition .

If Customer = interior customer.

Call the CONTROL_FROM Fucntion moduel and call the NEW page.

ENDIF

Read only

Former Member
0 Likes
845

Hi,

I try to explain the problem more.

I use a modified 'SAPLMEDRUCK' for printing the form, a modified 'MEDRUCK'.

I just need the point where the is the change from page FIRST to the follow page, so I can differ between foreign and interior customer by the field 'LFA1-LAND1' the logic therefore I have.

The best point in my opinion is the end of the first page, but at the end of the main window of page first there is automatically the change the next page with a main window.

If there were a special event I could catch, it would help me to solve the problem.

Thx Stefan

Read only

0 Likes
845

I just solved the problem with changing the complete logic.

Page First -> Next -> ... -> Next -> if foreign customer page AGB .

Thanks for all your Help and suggestions.

Best Regards Stefan