2008 May 15 12:16 PM
Hi
can anybody tell me how to trigger a new page in the script on condition.
my problem is i want to print material & its discription based on the MRP controller using scripts.
if the MRP controller changes then it has to trigger a new page in the script.
page 1.
MRP controller 102
material1 material1-discription.
material2 material2-discritpion.
new page shoud trigger here
page 2
MRP Controller 103
material1 material1-discription.
material2 material2-discritpion.
Thanks in advance
2008 May 15 12:22 PM
Hi,
Sort by mrp controller.
loop.
at new mrp controller.
Use CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'NEW-PAGE'.
endloop.
Hi
can anybody tell me how to trigger a new page in the script on condition.
my problem is i want to print material & its discription based on the MRP controller using scripts.
if the MRP controller changes then it has to trigger a new page in the script.
page 1.
MRP controller 102
material1 material1-discription.
material2 material2-discritpion.
new page shoud trigger here
page 2
MRP Controller 103
material1 material1-discription.
material2 material2-discritpion.
Thanks in advance
2008 May 15 12:22 PM
Hi,
Sort by mrp controller.
loop.
at new mrp controller.
Use CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'NEW-PAGE'.
endloop.
2008 May 15 1:45 PM
2008 May 15 12:24 PM
Hi Sami,
U can trigger new page Printing with help of function module "START_FORM".
Try to build the logic as below:
Loop at Itab.
At New <Mrp-Control>
CALL FUNCTION 'START_FORM'
EXPORTING
FORM = 'FORM Name'
STARTPAGE = "Page Name'
EXCEPTIONS
form = 1
format = 2
unended = 3
unopened = 4
unused = 5
OTHERS = 6.
Endat.
At end <Mrp-Contrl>
CALL FUNCTION 'END_FORM'
exceptions
unopened = 1
OTHERS = 2.
Endat.
Endlloop.
This will serve ur purpose.
Regards,
Wasim.
2008 May 15 12:25 PM
Hi,
First Call That text Element Were U Used New-page Coomand.
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 then appears on a new page. The page break is always 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 are printed immediately. If you use the NEW-PAGE command without parameters, the page defined in the current form as the next page will be taken next. If, however, your form contains a number of different pages, then you can specify any one of these as the next page to be used.
Syntax:
/: NEW-PAGE page_name
/: NEW-PAGE
The current page will be completed and the text in the following lines will be written to the page specified in the form.
/: NEW-PAGE S1
As above, except that the page S1 will be taken as the next page.
If, in a NEW-PAGE command, you specify a page not contained in the form, the specification is ignored.
Take care that there are no blank lines immediately before a NEW-PAGE command. If an implicit page break occurs within the blank lines, an unexpected blank page may be printed.
2.it can be set in two way
1 using SE71 ur Script transaction
u can create new page by clicking page tab in Se71 and goto edit->create Element.. that will create a new page..
2 Using ur SE38 itself by setting a flag variable = X u can create a new page..
if page = ' X '. new-page. endif.reward if helpful
Shiva Kumar
2008 May 15 12:49 PM
HI ..
There are two ways in which u can trigger a new page.
1. If the data u want to print is already available then u can call
START_FORM depending on the new MRP.No.. with which u can call a new page and then WRITE_FORM ..in which u specify the text element name which will write the data to the LAyout.
Then Call END_FORM.
2. Suppose the data is held in an internal table then u can try this.
loop at i_data into wa_data.
at new wa_data-mrp.no
Call "WRITE_FORM"
with text element : MATR
endat.
endloop.
In the text Element ( In script Coding )
/E MATR
/: NEW-PAGE xyz
/: &wa_data-matrno& ,, &wa_data-mrp.no&
Hope this helps you.
Thanx,
Navin.