cancel
Showing results for 
Search instead for 
Did you mean: 

Delete contents of the window dynamically in sap-scripts

Former Member
0 Kudos

Hi Friends,

I have issue regarding deletion of secondary window in sap-scripts.. I have to delete the header window after satisfying a particular condition.

I have to display the long text from the main window in the last page after printing all the data.

The condition is " if the data printing from the main window ends in the same page.... then the next-page which will be the last-page should not display the header window."

if possible, is there any system variable or the sapscript symbol which gives information ...that next-page has been triggerd or not.. just like sy-tabix or end-0f-page event like...that may be helpful...

Thanks...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

You can use the condition

if &next-page& ne 0

print the header window what you need

endif.

you can find the next-page is last or not using the same sap-script symbol &next-page&

if next-page is zero then it is the last page

Regards

Sarves

Edited by: Sarves Sombhatla on Sep 17, 2009 5:05 PM

Former Member
0 Kudos

Hii.. Thank you for the promt reply...

But, let me give you the clear details about the condition.

1. if the data printed in the main window ends in the same page and also the remarks (which is a long text ) ends in the same page then header should be printed.

2. if the data printed in the main window ends in the same page and remarks continues and ends in the next page then the header should not be printed in the next page which is the last page.

so overall... "the condition is if the data printed in the main window ends in the current page then header should not be printed in the next-page...."

Hope I am clear with the conditions..

&next-page& ne 0 wil work for the 2nd condition and not for the first condition..

I need a statement which will work for both the conditions..

looking for a solution asap...

Regards....

Former Member
0 Kudos

Hi,

Check for both these conditions

/: IF &NEXTPAGE& NE '0' OR &SAPSCRIPT-FORMPAGES(C)& EQ '1'.
*  Header
/: ENDIF

then you will get the result as you need

Regards

Sarves

Former Member
0 Kudos

Thank you Sarvesh, Brillaint... The solution you gave worked...!!! Really thanks..

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi !

You can do as below...

If you want a particular text element under which u have written some command to be printed on the page conditions

your condition checking can go as &PAGE& which contains the current page number you can check it in the script and write your particular code.

&nextpage& always gives the next page.

/: if &page(C)& NE &SAPSCRIPT-FORMPAGES(C)&

  • write the data you want to get.(this gets printed in all pages leaving the last page)

/: endif.

&SAPSCRIPT-FORMPAGES(C)& is for the last page.

accordingly you can use these fields as desired.

Regards.

Former Member
0 Kudos

HI,

you can use &page& for current page, &nextpage& for the next page & &formpages& for total number of pages.

Rgds,

Pavan