Regarding SAP SCRIPTS - NEXT PAGE FUNCTIONALITY
Hi all,
Can anybody tell me how to get NEXT PAGE FUNCTIONALITY in SAP SCRIPTS. Means if Data in 1st page does not fit it should go to next page and print.
I had declared 2 PAGES already in my LAYOUT SET.
How can i achieve above functionality.
Thanks in advance.
Thanks & Regards,
Rayeez.
Hi Rich heilman,
I had declared first page as PAGE1 & its Next Page attribute as PAGE2 which is also declared already.
But still it is not showing second page when there is over flow of data.
does we need to write following code any where in layout.
IF &PAGE& EQ = 1
NEXT-PAGE
ENDIF
please solve my issue.
Thanks & Regards,
Rayeez.
Similar Messages
-
Hi!
can any one help me regarding SAP SCRIPT. i unable to write a print program for sap script . can any one can send me sample code using ITCSY structure.
Thanks in advance.
Thanks & Regads,
DurgaPrasad.kHi,
refer this to write print program:
<b>The Print Program</b>
Structure of a print program
OPEN_FORM function
CLOSE_FORM function
WRITE_FORM
START_FORM function
END_FORM function
CONTROL_FORM function
The print program is used to print forms. The program retieves the necesary data from datbase
tables, defines the order of in which text elements are printed, chooses a form for printing and
selects an output device and print options.
<b>Function modules in a printprogram:</b>
When you print a form you must used the staments OPEN_FORM and CLOSE_FORM. To combine
forms into a single spool request use START_FORM and END_FORM.
To print textelements in a form use WRITE_FORM. The order in which the textelements are printed,
is determined by the order of the WRITE_FORM statements. Note: for printing lines in the body, you
can also use the WRITE_FORM_LINES function module.
To transfer control command to a form use CONTROL_FORM.
<b>Structure of a print program</b>
Read data
Tables: xxx.
SELECT *
FROM xxx.
Open form printing - Must be called before working with any of the other form function modules.
Must be ended with function module CLOSE FORM
call function 'OPEN_FORM'.....
To begin several indentical forms containing different data within a single spool request, begin each
form using START_FORM, and end it using END_FORM
call funtion 'START_FORM'.....
Write text elements to a window of the form
call function 'WRITE_FORM'.....
Ends spool request started with START_FORM
call funtion 'END_FORM'.....
Closes form printing
call function 'CLOSE_FORM'...
OPEN_FORM function
Syntax:
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = ' '
LANGUAGE = SY-LANGU
OPTIONS =
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJECT =
RAW_DATA_INTERFACE = '*'
IMPORTING
LANGUAGE =
NEW_ARCHIVE_PARAMS =
RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<b>Some important parameters:</b>
FORM Name of the form
DEVICE PRINTER : Print output using spool
TELEFAX: Fax output
SCREEN: Output to screen
OPTIONS Used to control attrubutes for printing or faxing (Number of copies, immediate output....
The input for the parameter is structure ITCPO.
CLOSE_FORM function
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Paramerters:
RESULT Returns status information and print/fax parameters after the form has been printed.
RESULT is of structure ITCPP.
WRITE_FORM function
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = ' '
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
OTHERS = 9
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Some important parameters:
ELEMENT Specifies which textelement is printed
WINDOW Specifies which window is printed
TYPE Specifies the output area of the main window. This can be:
TOP - Used for headers
BODY
BOTTOM - Used for footers
FUNCTION Specifies whether text is to be appended, replaced or added
Example of how to use the WRITE_FORM function module together with a script.
Form layout of the MAIN window
/E INTRODUCTION
Dear Customer
/E ITEM_HEADER
IH Carrier, Departure
/E ITEM_LINE
IL &SBOOK-CARRID&, &SPFLI-DEPTIME&
/E CLOSING_REMARK
<b>The print program</b>
Writing INTRODUCTION
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'INTRODUCTION'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Writing ITEM_HEADER
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Set ITEM_HEADER into TOP area of main window for subsequent pages
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'SET'
TYPE = 'TOP'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Write ITEM_LINE
LOOP AT .....
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_LINE'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8.
ENDLOOP.
Delete ITEM_HEADER from TOP area of main window
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_HEADER'
FUNCTION = 'DELETE'
TYPE = 'TOP'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
Print CLOSING_REMARK
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'CLOSING_REMARK'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 8
START_FORM function
CALL FUNCTION 'START_FORM'
EXPORTING
ARCHIVE_INDEX =
FORM = ' '
LANGUAGE = ' '
STARTPAGE = ' '
PROGRAM = ' '
MAIL_APPL_OBJECT =
IMPORTING
LANGUAGE =
EXCEPTIONS
FORM = 1
FORMAT = 2
UNENDED = 3
UNOPENED = 4
UNUSED = 5
SPOOL_ERROR = 6
OTHERS = 7
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
END_FORM function
CALL FUNCTION 'END_FORM'
RESULT =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SPOOL_ERROR = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CONTROL_FORM function
The CONTROL_FORM function module alows you to create SapScript control statements from within
an APAB program.
Syntax:
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command =
EXCEPTIONS
UNOPENED = 1
UNSTARTED = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Example:
Protecting the text element ITEM_LINE
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'PROTECT'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
TEXELEMENT = 'ITEM_LINE'.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'ENDPROTECT'.
rgds,
latheesh
Message was edited by: Latheesh Kaduthara -
Regarding sap script how to create first page and next page
could u plz let me explain the steps for creating
WE HAVE " PAGE BUTTOR" IN THE FORM.
THERE WE CAN CREATE MULTIPLE PAGES
I HAVE ONE MAIN WINDOW FOR "FIRST PAGE"
I HAVE ONE MORE MAIN WINDOW FOR "NEXT PAGE"
LIKE THIS
HOW CAN I TEST THE MULTIPLE PAGE S
EXPLAIN CLEARLY
FIRST PAGE
NEXT PAGE
THIRD PAGE
FOUTH PAGE
IN SAP CERIPT FORMhi
in ur script u have page button click to it and now do this
goto
EDIT-->Create Element
after this u have an pop-up
now enter ur page name and description here and press enter
insimilar manner creat the pages that u want
Now once uahve created the pages click to windows button
and do this
EDIT-->Create Element
after this u have an pop-up
now enter ur window name and description here and press enter
Now once u have created the windows click to page window button
here u will give the page name in the box and do the same
EDIT-->Create Element
an popup will apear select the window u want to have on this window ok
now code inside this window
Hope this will solve ur problem
Cheers
Snehi Chouhan -
Issue regarding sap script pages
Hi all ,
my issue is regarding the medruck. when i click on the print preview option on me23n, the sap script attached(that is medurck) will be printed. in my case the sap script is zmm_medruck(the zcopy of medruck). now, the print out of the sap script is 2 or 3 or 5 paged depending upon the p.o. number given.
for example for a p.o. number 2100001564, the sap script contains 4 pages. now, my issue is , the print out should contain only last 2 pages or only 3 rd page.(that is without all pages, we want only specific pages of the sap script to be printed). how to do this. plz reply fast. points will awarded.
this is urgent issue.
thanking u in advance,
sreenu.Hi all ,
my issue is regarding the medruck. when i click on the print preview option on me23n, the sap script attached(that is medurck) will be printed. in my case the sap script is zmm_medruck(the zcopy of medruck). now, the print out of the sap script is 2 or 3 or 5 paged depending upon the p.o. number given.
for example for a p.o. number 2100001564, the sap script contains 4 pages. now, my issue is , the print out should contain only last 2 pages or only 3 rd page.(that is without all pages, we want only specific pages of the sap script to be printed). how to do this. plz reply fast. points will awarded.
this is urgent issue.
thanking u in advance,
sreenu. -
Hi all,
Can anyone tell me the which command i use in sap script for &itab-kunnr&.
so many command are there so please suggest me...........
and give command tutorial or link also....
Zenithi.hi
good
check out all these SAP SCRIPT commands
New-page <page name> Prints the text following this command on a new page (when a page name is specified then that page is taken as the next page)
Protect .. Endprotect This acts like a conditional page break. Putting the text within this command prevents the breaking of the text across multiple pages. If there is not enough space for the entire paragraph to be printed in the space remaining on the page, then the entire paragraph is printed on the next page
Box <xpos> <ypos> <width> <height> <frame> <intensity>
Position <xorigin> <yorigin> <window> <page>
Size <width> <height> <window> <page>
The BOX command draws a box as per the specifications. The x y co-ordinates are for the upper left corner relative to the values in the position command.
POSITION command is used to set the x y co-ordinates with respect to the start position of the window.
SIZE command is used to specify the size of the box that we need to draw.
Varying these parameters also helps to draw a line instead of a box.
IF .. END IF This allows the conditional printing of the text on the output document. The various conditional operators that can be used are as follows
= EQ Equal to
< LT Less than
> GT Greater than
<= LE Less than or equal to
>= GE greater than or equal to
<> NE not equal to
The logical operators that can be used are as follows
NOT, AND, OR
reward point if helpful.
thanks
mrutyun^ -
How to find SAP Scripts to Prepare functional Spec
Hello SAP GURUS,
Could any one help me out how i can find Sap Scripts,or SAP programs to create a functional spec for Billing, user want a writing at the bottom of billing,
Could any one help me out
Thanks
EdieHI,
Pls go to T-Code : NACE. Inside this choose the application as V3 and press the button Output Types in the application toolbar.
If your client is using std output type then choose the type: RD00 and press on processing routines. Here in this screen, we can find out the script/smartform name along with the driver pgm name.
The same procedure is applicable for customized output types.
Hope this helps.
Regards,
JLN -
Hi,
I have some requirement in SAP SCRIPT.
When i will generate print preview for some specific document Ex:Purchase Order using its respective Transaction Code[ME22N], That Print Preview[output] need to be stored other formats such as [PDF,.doc,... etc].
How can we do it!
By using some settings!
Without writing any code[Function Module] from ABAP[SE38].
Can any body solve my problem!
Thanks & Regards,
Rayeez.Hi,
You can convert a spool request to pdf format using report RSTXPDFT4 without writing any code.
Svetlin -
HI experts,
can any body tell me how can i get the current page name in sap script.
In case of smartform we can get it by using sfsy-pagename. is there any way like this.
rgds,
bharat.Hi Bharath,
Follow this procedure...
Got to
Insert (MENU)-> Symbols->System symbols-> TTXSY SAPscript system symbol
(select it )
Click Choose button
- from here select PAGE.
Insert (MENU)-> Symbols->System symbols-> SAPSCRIPT SAPscript system fields
(select it )
Click Choose button
- from here select -> FORMPAGES Total number of pages
In editor it appears as &PAGE& &SAPSCRIPT-FORMPAGES&
just type Of between them as below
&PAGE& Of &SAPSCRIPT-FORMPAGES&
So that it will be in readable format for user.
Regards,
Basheer. -
OBIEE webservice,The "next page" function failure
hi all,
I use webservice access OBIEE,When I click ”next page “ icon, js error:'Action' is empty or is not an object.
I have edit the file OracleBIData\web\config\instanceconfig.xml , add this code:
<URL>
<ForceAbsoluteCommandURL>true</ForceAbsoluteCommandURL>
<ForceAbsoluteResourceURL>true</ForceAbsoluteResourceURL>
</URL>
thanks for your help!Thank yoy try67 !
I am trying this way, now I am creating a new button, and I am trying to put, all the code of the original button in one function.
And, when I am creating de new button btn:
var btn = this.addField(name, type, page, newAddRect)
btn.setAcion("MouseUp","myFunction()");
this not works...
the function is in one file in:
C:\Documents and Settings\user\Datos de programa\Adobe\Acrobat\9.0\JavaScripts\myFile.js
and the contains of the function is a simple alert.....
Any idea...¿?
Thank you!
Regards,
Xavi Marín. -
To add Cover page in SAP Script if pages are more than 10.
Hello Experts,
I want to print a Cover page first if and only if number of pages exceeds 10 in SAP Script.
Cover Page should be the first page and then the remaiing pages.It's not possible to find the no of pages the script will generate, until it's printed. Again, you need the cover letter as the first page.
There could be a solution to your requirement. Call the script and get OTF format without printing it to spool. You will get to know the no of pages in the main script . If it's more than 10, call the secondary script to get the OTF data of cover letter. Merge the OTF of main script to OTF of cover letter and print the OTF data to spool using FM PRINT_OTF.
Check this link for similar code. In your case, the spool of the two sapscripts needs to be merged.
Re: Smartform to Spool -
Hi All,
I have issue in SAP Scripts.
Issue is : I am calling a BOX command in my Layout set as follows : <b>BOX WIDTH '18.75' CM HEIGHT L_SY_TABIX1 CM FRAME 10 TW</b>
I that <b>L_SY_TABX1</b> i need to get the value form Print Program,
Can anybody clarify how can i make varaible L_SY_TABIX1 with value <b>'17.75'</b> with in single quotes.
shall i need to decalre the L_SY_TABIX1 as &L_SY_TABIX1& & then how can i get single quotes on it.
Please clarify.
Thanks in advance.
Thanks & Regards,
Rayeez.You dont have to concatenate quotes.
You can dynamically put any value into a character variable, say, ht, in your print program.
Data : ht(10) type c.
This variable should be within &, in the script. The program takes the value of height without rounding the decimals.
BOX XPOS 0 CH YPOS '+1.5' LN WIDTH 30 CH HEIGHT &HT& CH FRAME 10 TW
Thanks,
Susmitha -
Script 'next page' is not working in IE 10
Hello!
Have you tried to declining or accepting
A user have big problems with javascript’ working in IE 10 but in Google Chrome everything works fine. When he comes to document library all scripts stop working: next page click, show ribbon.
There are errors in development tools:
Script3: the system cannot find the path specified core.js, line 1 character 6957
Script5007: Unable to get property ‘IsAnimationEnabled’ of undefined or null reference inplview.js, line 1 character 29518
I have turned on and turned off compatibility view, checked that site belongs ‘Trusted sites’, re-installed the IE. Nothing helps.
Only one user has the problem.
Please, advise me what should I check else!Hi Anna,
Have you tested on other PC with this user account?
It looks like a client side issue, please try the following:
Reset your IE 10 to it's default settings.
Use IE 10 32-bit version.
Run IE 10 as administrator.
Add SharePoint site URL to IE 10 Local intranet zone.
Un-check protected mode and use low security level for Local intranet zone.
Again add the SharePoint Site URL to compatibility view list.
http://windows.microsoft.com/en-us/internet-explorer/reset-ie-settings
http://windows.microsoft.com/en-us/internet-explorer/use-compatibility-view
Thanks
Daniel Yang
TechNet Community Support -
I have a normal report output with a field "HIDE" to make it interactive. When clicked on any of the values of this field(s), the value (say VBELN) has to be passed to SAP SCRIPT and all the SELECT QUERIES needs to be written in SAP SCRIPT to get the desired output.
How do i get this feature?hi
U have to call perform in SAP script '/:'.
In that u have to pass parameter and get(changing) parameter.
FORM get_value TABLES inpar STRUCTURE itcsy
outpar STRUCTURE itcsy.
u have to read value from inpar and append value in outpar into the form.
Hope thiw will be useful.
regards
vinod -
SAP script extra page at end....
Hi Experts,
I am using SAP Script Form, After executing a script in output one extra page is comming. How to remove that extra page ?
RahulHi,
Check your main Window, may be there is blank line at the last of the main window, so check that abd remove that,so you won't get the blank page.
If U WANT TO GET THE LAST PAGE THEN
You have to check the system variable &NEXTPAGE&, if it's 0 it means you're in the last page.
From SAP Help:
This symbol is used to print the number of the following page. The output format is the same as with &PAGE& .
Note that on the last page of the output, in each window that is not of type MAIN, &NEXTPAGE& has the value 0.
/: IF &NEXTPAGE& = '0'
Last page
/: ENDIF
Reward points
Regards -
Regarding SAP Script Output validation in Layout set
Hi All,
I have a issue in SAP Script Output.
I have a <b>Standard Print Program</b>. and layout set.
I can do validations only in Layout set.
The actual issue is i have a <b>internal table field</b> in <b>print program</b> that i am displaying in <b>layout set</b>. Now i want it to be subtracted with number <b>20</b>, since i can not edit code in <b>Print Program</b>. i want to subtract that internal table field with 20 in layout set itself.
Can anybody tell me how can i solve this issue.
<b>Note:</b> I need to do calculation only in layout set.
Can anybody give me the solution.
Thanks in advance.
Thanks & Regards,
Rayeez.Hi,
Thanks for that reply.
so with <b>SUMMING</b> command i can do calculation.
I am already having <b>i_tab1-sum</b> coming from print program and i have declared one symbol using
DEFINE &v_val& = 20 in layout set.
Then i want to subtract &v_val& with &i_tab1-sum&.
using the follow syntax tell me wether syntax is correct or not.
SUMMING &i_tab1-sum&-&v_val& INTO &i_tab1-sum&.
will it work.
once again thanks for that reply.
Thanks & Regards,
Rayeez.
Maybe you are looking for
-
Pop up is not coming in IC web client
Hi Experts, When i tried to create any CRM Transaction in IC WEBCLIENT(vERSION 7.0 ehp 1) i am unable to get the pop up of the org determination, partner determination, follow up documents in IC AGENT Business role.The same scenarion is working fine
-
Mac os x lion with HP c309a. Printing to cd not supported. Advice?
I'm runing Mac OS X Lion, v 10.7.2 and I have an HP c309a all-in-one printer. I'd like to print onto a cd. The printer was made to do so and has a special insert for the cd. In previous versions of OS X, it has worked fine. When I use MS Word or
-
Lion 10.7.4 with hp4050n
I am trying to get my Mac running lion 10.7.4 to see my old LaserJet HP-4050N. The 4050 is hardwared to a pour port wireless router using Ethernet. When I try to "add a printer" (+) there is no IP tab or anyting to input anything but what was "found"
-
Make DW default for XML files?
I'm sure there's a way to do this that I'm missing, but I'd like to make DW my default app for XML files. I know how this can be done on Windows (using "open with" and changing default), but I'm using Mac OSX. I tried messing with the file types se
-
Importing data into a different tablespace
How do we import an user level export file into another user and a different tablespace from the tablespace clause specified in the export file ? Thanx in advance Abhijit