Application Development 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: 

how to go to next page on condition

Former Member
0 Kudos
193

hi experts,

i have two pages and in page one i have to chack a condition .

if it is true it has to print the first page else it has to go to next page .how to achieve it ???

ragrds,

mani

8 REPLIES 8

Former Member
0 Kudos
130

write the code in the script text element

/: if &cond& eq 'X'.

/: new-page.

/:endif.

0 Kudos
130

what is this new-page????

my page name is

first and next ..

0 Kudos
130

Hi manikandan,

New-page is an abap command which is used at sapscript side.

You just write;

/: New-page

if the condition is true...

Thanks.

Reward if helpful.

0 Kudos
130

Hi Manikandan,

SAPscript automatically inserts a page break when the main window of a page (MAIN) is full. You can use the NEW-PAGE command to force a page break in the text at any point you want one. The text following this command will appear on a new page. The page break will always be performed (it is an unconditional page break).

The NEW-PAGE command completes the current page.

This means that all the windows that are still on the page will be output immediately. If you use the NEW-PAGE command without parameters then the page defined in the layout set for the current page as the next page will be taken next. If, however, your layout set contains a number of different pages then you can specify any one of these as the next page to be used.

Check this code.

/: IF <CONDITION IS TRUE>

    • Continue on FIRST page*

/: ELSE

/: NEW-PAGE NEXT ->This will trigger NEXT as next page

/: ENDIF

Thanks,

Vinay

Edited by: Vinaykumar G on Dec 27, 2007 6:53 PM

0 Kudos
130

hi vinay,

i am in another window not main window.for a particular condition alone it is not going to main window.it is going to anothet window.now i want to put the control to main window back from the second window.

what shall i do???

-


main

statements

-


-


second window

(here i have to write a code to put the control back to main window)

something like this.

if <condition>

goto main window

endif

is that possible????

regards,

mani

0 Kudos
130

you can specify new page command in script...

but not the window name...

0 Kudos
130

ya i tried that also

if <condition>

new-page next

endif

but the control is not going to that next page .it continues in the same page

mani

Pawan_Kesari
Active Contributor
0 Kudos
130

/: IF <condition>

/: &NEXTPAGE& = 'FIRST'

/: ELSE

/: &NEXTPAGE& = 'NEXT'

/: ENDIF

/: NEW-PAGE