Regarding SAP Scripts
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
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 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. -
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 -
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,
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 -
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. -
can anyone send me a sample program for downloading sapscript into pdf ?
in detailsHello,
please try out the Code in Topic: Regarding Converting Report Outputs & SAP Script Outputs to PDF Format.
Regards
Gregor -
Hi All ,
When i print a SAP script then in spool request it is completed but no print is actually printed from printer . So what's reason for that ???.
I have spool no now what i do for printing in my printer?????
Give me suggetion
ThanksHi,
As above said, check you spool no and print output in SP01 or SP02.
But just check whether you printer settings. By Sysytem->User Profile->Own Data hereselect tab defaults then enter Spool Control data. Now you will get output at printer.
TCode: su3.
If useful, Rewards points
Thanks,
Sam -
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^ -
Hi Experts,
What is the procedure we have to follow to transfer the scripts and smartforms once created ?
Regards
Raghavendra.D.SHi,
Nothing to take care about this, the only thing is if the script or smartform has any standard texts, even if you save those, they are not saved under any request. So what you can do, execute the program 'RSTXTRAN' and add standard text to the corresponding script or smartform request.
Rgds,
Bujji -
How to Modify the standard invoice and sales order form to generate purchase order for printing and upload the company logo. plz mention the detail coding
Thanks,
Priya RanjanHi,
To create a logo in SAP printouts just do the following
1. Save a Logo using Imaging, Paint shop Pro or Corel Draw as Tiff file.
2. Run program RSTXLDMC and enter the following parameters
Enter file name C:\COMPLOGO.TIF
UOM CM
Line width for text 132
Text name ZHEX-MACRO-COMPLOGO
Text ID ST
Text language = E
Number of Tiff gray levels (2,4,9) 2
3. Then Create a new window 'COMP' with attributes;
Window COMP description Company Logo
Left margin 7.00 CH window width 10.00 CH
Upper margin LN window height 8.00 LN
Finally in the text element, mention
/: INCLUDE 'ZHEX-MACRO-COMPLOGO' OBJECT TEXT ID ST LANGUAGE 'E'.
Please note that if object name is not indicated as 'ZHEX... the logo may not be printed!
You will not be able to see the logo in a test print. The same will be printed in actual printout.
Regards,
Satish -
Problem regarding SAP Script Template
Hi All,
In SAP 4.7, after creating TEMPLATE when I am applying any pattern on that TEMPLATE the border line of that TEMPLATE becomes very thick. But when I am doing the same in E.C.C 6.0 the border line is displayed as normal. How to solve the problem in 4.7 version?
With regards,
From SatyajitHi satyajit,
Download the form from ECC 6.0 and upload in 4.7 version check the template whether the template is dispalyed thick if yes the change the thickness of the template.
Regards,
Sravanthi -
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 -
Regarding SAP Scripts Address printing
Hi All,
I am using ADDRESS ... ENDADDRESS to print country specific adress for vendors.
In this i am not using 'Title' but still it is printing can anybody tell me how to discard this.
If i remove ADDress no from this syntax it is not getting printed but some other fields are also not getting printed so this option is not working, I have tried with Priority & LINES options but they are not correct.
Can anybody resolve this issue!
Thanks,
Deep.refer below lines
TITLE
Title or form of address. Used only with addresses of types 1 and 3.
TYPE
Specifies the type of address. The following types are possible:
-->Normal address (ADRS1). This is the address of a company or organization. It corresponds to the address structure that is expected in most SAP applications.
--->Private or personal address (ADRS2). This is the address of a natural person, a private or home address.
--->Company addressDienstadresse (ADRS3) with contact person. This is the address of a colleague or contact within a company or organization. The company name should be specified in the TITLE and NAME fields; the ATTN: contact person should be named in PERSON and TITLE.
Should you enter another address type or leave the field blank, then type 1 is used for formatting.
Maybe you are looking for
-
hi guys i have 2 ? 1 my daughters iphone is trying to update on my mac cant get it off help please ,,, 2 i have an old apple id and when i try to up date it keeps looking for the password how do i delete this old apple id help
-
Class Not Found Error while using dcm 9.0.3 jar
I am getting the following exception while trying to stop an application deployed in oracle 10g app server using dcm utility.Can anyone please help me how to resolve this because it is very urgent for my work to progress Thanks in Advance 04/10/18 07
-
Stocking aging for on hand item
hello all, i DUNO if i am posting in the correct section , I need to design a report for stock aging showing onhand item with received date, cost, and the supplier of the items, i have a problem is that the onhand item may be mixed with different rec
-
Hello friends, I am getting problem in smartforms style. i had created my own style for one of my Tax invoice form because i want fonts in smaller and for heading i want to increase font size. But when i am applying my own style to paragraph the
-
What is Double.NaN for?
I'm trying to understand what is Double.NaN for. I did understand the use od Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY. I did try double value = Double.parseDouble("123ws34"); and then if (value == Double.NaN)