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...

aris_hidalgo
Contributor
0 Likes
917

How come my program(sapscript) still writes on the same page even though I explicitly called

a new-page via FM CONTROL_FORM? My condition is, for every change of dealer, I would call on a new page

then write the details of that dealer on the new page. I debugged my sapscript and noticed that it calls a new-page

based on the condition that I made but I noticed that it does not immediately create a new page but writes the details

of that new dealer on the current page where its supposed to be for the new page.

Hope to hear from you guys. Again, thank you!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
894

the new-page command has to be put in the MAIN window. Pl chk if its written within any other window,...

9 REPLIES 9
Read only

Former Member
0 Likes
895

the new-page command has to be put in the MAIN window. Pl chk if its written within any other window,...

Read only

0 Likes
894

Hi,

I've written it in the report. If it has to be written in the main window, what would be the code?

Read only

0 Likes
894

/:NEW-PAGE

Read only

Former Member
0 Likes
894

hi viray,

instead of checking the conditon from the main program

do it in the script itself ..

just store the last value in a temporary variable and check if it matches the current value..

if not call a new page..


 /: IF v_tmp NE v_curr
 /: NEW-PAGE	
 /: ENDIF

regards

satesh

Message was edited by: Satesh R

Read only

Former Member
0 Likes
894

Hi viraylab,

1. I explicitly called

a new-page via FM CONTROL_FORM

Instead of using CONTROL_FORM,

we can do simply like this

2. a) create a new ELEMENT in layout

/E mynewpage

/: NEW-PAGE

b) In your driver program,

write the IF condition for page break

,and then using WRITE_FORM

call this ELEMENT mynewpage.

regards,

amit m.

Read only

0 Likes
894

I wrote an IF condition in my MAIN window that if a certain valuable is initial, it would trigger a new page. Here is the code below:

/: IF &XKOPFDR& EQ ''

/: NEW-PAGE

/:ENDIF

I am currently debugging my sapscript and found out that even though the condition is TRUE, it would not immediately trigger a new page so value that are supposed to be written on the next page are written on the current page.

Help would be greatly appreciated.Again, thank you guys and take care!

Read only

0 Likes
894

Hi again,

1. u may write this logic

inside the driver program, and test.

(instead of writing the logic in layout itself)

regards,

amit m.

Read only

0 Likes
894

Hi again,

That was what I did before trying to code it in the layout itself but it also didn't work. Sorry for being so stubborn but I really can't seem to figure this out since this a Z version of WASCHEIN and I'm kinda new to ABAP. Again, thank you guys for your help!

Read only

0 Likes
894

Hi Viray,

have u checked if the variables that u want to print in next page are getting triggered AFTER the new-page command in SAPSCRIPt??

also, is ur cursor really goin within the IF condition, ie in the NEW-PAGE command?? pl chk that carefully...

apart from that i dont c any reason why this is happening..