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

Exit using Cancel button from form preview.

Former Member
0 Likes
541

Hi

I am looping into internal table and printing a smartform for every line.

When I do the preview, and press back button, it takes me through the preview of all the items.

Is there a way to come out of this preview.

I am trying to use the cancel button in at user-command, but the program doesnot seem to recognise it.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
457

Hi,

Regarding your qusetion about the preview.: In case you are calling the smartform inside a loop, the preview is going to get called. Incase you want just the 1st form to be shown, you could hardcode it in the program. Your logic could be:

If its print preview, then exit in the 2nd pass of the internal table by checking the sy-tabix.

Let us know if this suits your need. If it doesnt then throww more light on your question so that we cud suggest better!

2 REPLIES 2
Read only

Former Member
0 Likes
458

Hi,

Regarding your qusetion about the preview.: In case you are calling the smartform inside a loop, the preview is going to get called. Incase you want just the 1st form to be shown, you could hardcode it in the program. Your logic could be:

If its print preview, then exit in the 2nd pass of the internal table by checking the sy-tabix.

Let us know if this suits your need. If it doesnt then throww more light on your question so that we cud suggest better!

Read only

0 Likes
457

thanks for your response.

I am using a similar logic.

Within the loop i am reading sy-ucomm and exit if it is SCAN.

That is when users press cancel button then it exits from the loop.