Q. How to found a name of sap-script or smartform? A. For SapScript set break-point in FM OPEN_FORM or SELECT_FORM or START_FORM.
For SmartForm in FM SSF_FUNCTION_MODULE_NAME.
For PDF in FM FP_FUNCTION_MODULE_NAME.
Q. How to transport SAPSCRIPT A. Use the program RSTXSCRP to upload and Download the SAPSCRIPT files to different systems
Q. How to upload Grafic Image to Sapscript/Smartform A. Use SE78
Q. What are the differences between SAP Scripts and Smartforms?
A.
SAP Scripts are client dependent whereas Smartforms are client independent.
SAP Scripts require a driver program to display the output whereas in smartforms the form routines can be written so that it is standalone.
An integrated Form Builder helps to design Smartforms more easily than SAP Scripts
An Table Painter and Smartstyles to assist in building up the smartforms
On activation a function module is generated for Smartforms
It is possible to create a Smartform without a main window
Smartforms generates XML output which can be viewed through the web
Multiple page formats is possible in smartforms
Q. How can I insert symbols in Smartforms?
A. Select the Text node.
Change Editor (Click the button above Check near the Editor)
Go to menu Include->Characters->SAP Symbols
Choose the SAP symbol that you want to insert.
I have a smartform which works fine in DEV. After trasnsporting it to PROD, there is no Function module generated for this smartform. As a result my program dumps in PROD?
Q. The Smartform that is created in the Development may not have the same name in the Production server. So it is always advised to use the Function Module SSF_FUNCTION_MODULE_NAME to get the Function Module name by passing the Smartform name.
A.
Code:
DATA: fm_name TYPE rs38l_fnam.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSMARTFORM'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 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.
CALL FUNCTION fm_name
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 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.
Q. How can I make the Smartforms to choose a printer name by default?
A. In the CALL FUNCTION of the Smartform Function Module, set the output options parameter to set the printer name.
The output options is of the type SSFCOMPOP which contains the field TDDEST. Set the TDDEST field to your default printer name.
Q. How can I make the Smartforms to display a print preview by default without displaying the popup for print parameters?
A. In the SSF_OPEN function module,
Set the OUTPUT OPTIONS paramter TDDEST to your printer name.
Set the CONTROL PARAMETERS and control parameters as shown below,
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Q. How can I display the total number of pages in Smartforms?
A. Use SFSY-FORMPAGES to display the total number of pages in the Smartforms
&SFSY-PAGE& Current page number
&SFSY-FORMPAGE& Total number of pages in the currently formatted layout set
&SFSY-JOBPAGE& Total number of pages in the currently formatted print request
&SFSY-COPYCOUNT& Original-1,1st copy-2
&SFSY-DATE& Date
&SFSY-TIME& Time
&SFSY-USERNAME& Username
Q. I'm using the variable SFSY-FORMPAGES, I get a star "*" instead of the total number of pages.
A. There may not be enough space in the window to display the variable, either increase the window dimensions or condense the spaces using &SFSY-FORMPAGES(C)&
Q. What are the various text formatting options in Smartforms?
A.
&symbol(Z)& Omit Leading Zeros
&symbol(S)& Omit Leading Sign
&field(K)& Deactivates a conversion routine specified in the Data Dictionary.
&symbol(<)& Display Leading Sign to the Left
&symbol(>)& Display Leading Sign to the Right
&symbol(C)& Compress Spaces
&symbol(.N)& Display upto N decimal places
&symbol(T)& Omit thousands separator
&symbol(R)& Right justified
&field(F<filler>)& Replaces left-justified blanks in the value by the fill character <filler>.
&symbol(I)& Suppress output of the initial value
&field(L)& Converts and a date field to a local date and displays it. The date is then formatted using edit mask JPDAT.
Since this representation uses Japanese characters, use it in the
Japanese version of the SAP System only.
Q. How can I provide a background shading to the table?
A. In the Table Painter, you can specify the color and shading for the table lines.
Q. Where can I provide the input parameters to the smartform?
A. The input parameters for the smartform can be defined in Global Settings->Form Interface.
Note! The Associated Type must be defined in the ABAP Dictionary.
Q. Where can I define my own global types for the smartform?
A. The global types(within the smartform) can be defined in Global Settings->Global Definitions->Types
The types defined here will be global through the entire smartform.
Also the form routines can be defined Global Settings->Global Definitions->Form Routines
Q. I have defined my own Program Lines, where I have used a global variable G_TEXT. I get an error G_TEXT is not defined?
A. Whenever using the global variables in the Program Lines, enter the variable name in Input Parameters if you are going to use(read) the variable. If you are going to both read/write the variable value enter the same in Output Parameters.
Q. I have created a table node for display. Where can I check the condition which must satisfy to display the table?
A. The conditions can be defined in the Conditions tab. In smartforms all the nodes have a condition tab where you can specify the condition to be satisfied to access the node.
Q. How can I define Page Protect in Smartforms?
A. To define Page Protect for a node go to the Output options and check the Page Protection checkbox.
Q. What is the difference between Template and Table in Smartforms?
A. The Template contains a fixed number of rows and columns, where the output is fixed.
The Table can have variable number of rows
Q. Where can I define the paragraph and character format for the smartforms?
A. The paragraph and character format for the smartforms can be defined in the transaction SMARTSTYLES
Q. How to add watermark to smartform output?
A. Go to the properties of 'PAGE', tab 'Background Picture'. Add the grapic image name here.
Q. I would like to use a special font such as Frutiger-Roman, OCR-A or Arial. What must I do?
A.Note 606923 - FAQ: SAPscript/Smart Form: Fonts
Three different cases may apply here:
- Up to Release 46B, you can only activate the fonts that are pre-installed in the printer from R/3. It must therefore be possible to call the font using a a simple control sequence. If the required font is pre-installed on your printer with an additional module, for example, you can implement it quite easily into your R/3 System. The necessary procedure is described in note 12462.
- If the printer cannot print the font itself, you have the option of using device type SAPWIN (see note 21738). When using SAPWIN, the print formatting takes place in Windows instead of R/3. You can therefore access all fonts that are installed in Windows. The procedure is described in note 48803, based on the example of the OCRA font.
- Since Release 46C, you can use transaction SE73 and the 'Install True Type Font' button to load a TTF file into R/3 and print it on different printers. For more information, see note 201307. In this case, the font is added to the print data as a soft font. 40-200 kB, depending on the size of the TTF file per font. If you experience any problems, refer also to note 398646. For transport problems, refer to note 421518.
Q. How to create a New smartfrom, it is having step by step procedure
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
Code:
REPORT ZSMARTFORM.
* Calling SMARTFORMS from your ABAP program.
* Collecting all the table data in your program, and pass once to SMARTFORMS
* SMARTFORMS
* Declare your table type in :-
* Global Settings -> Form Interface
* Global Definintions -> Global Data
* Main Window -> Table -> DATA
*
* Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
* http://sapr3.tripod.com
*
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
* At the end of your program.
* Passing data to SMARTFORMS
Q. How do I create Boxes in SAPScript?
A. You can create Boxes in the SAPScript using the BOX command specifying the x,y co-ordinates and the width and the height
Code:
BOX XPOS '0' CM YPOS '0.5' CM WIDTH '9.2' CM HEIGHT '3.5' CM FRAME 8 TW
Q. How do I set tabs between the fields in display?
A. In the Paragraph Format tab, create a new paragraph format. In the "Tabs" Tab, enter the tab position and the alignment for the fields.
Q. How do I create standard texts for the scripts?
A. You can create standard texts using the transaction SO10. Then to insert these standard texts in the SAPScript choose the menu,
Insert->Text->Standard and choose the standard text that you want to choose.
Alternatively, you can display standard texts in your SAP Scripts using the command:
Code:
INCLUDE ZSTEXT OBJECT TEXT ID ST LANGUAGE EN
where ZSTEXT refers to the Standard Text name.
Q. How can I debug my SAPScript?
A. Go to the transaction SE71.
Enter the form name.
Choose the menu Utilities->Activate Debugger to enable debugging.
Q. I have created a script in language DE. Now I need to translate it to EN. How could I do this?
A. Open your script in transaction SE71.
In the Header screen, in the Language Attributes Option, choose Translate to... Option to translate to other languages.
Q. How can I Word Wrap the text being displayed in SAPScript?
A. Use the Function Module RKD_WORD_WRAP to wrap the text and use this for output.
Q. How can I display barcodes in SAPScripts?
A. Create a character format in the SAPScript.
Choose the Bar Code for the character format.
And finally to display barcodes, in the command enter:
Code:
<C1>&vbeln&</>
where C1 is the character format created and vbeln is the variable for which the barcode is to be created.
Q. How can I print logos in SAPScripts?
A. Convert the logo to a TIFF(*.tif) file.
Use the program RSTXLDMC to convert the TIFF file to standard text.
Print this using the INCLUDE command:
Code:
INCLUDE ZLOGO OBJECT TEXT ID ST
For bitmaps (*.bmp)
Go to transaction SE78
Choose BMAP under GRAPHICS
Choose Import Graphic (F5)
Select the image and upload
In SE71 choose Insert->Graphics and then choose the image for display
Q. How can I copy SAPScripts from one client to another?
A. In the transaction SE71, enter the Form name and choose the menu, Utilities->Copy from client to copy SAPScripts from one client to another.
Use RSTXSCRP to import/export SAPScripts.
Q. How can I trigger new page in SAPScripts?
A. Use the command NEW-PAGE to trigger a new page in SAPScript.
Q. How can I prevent page-break in the message that is to be displayed?
A. Enclose the text that you want to prevent page-break in PROTECT... ENDPROTECT
SAPscript will ensure that each line of this text is printed together on the same page.
Code:
/: PROTECT
* Text
* Within
* The same page
/: ENDPROTECT
Q. How can I set the position of the leading sign to left/right?
A. You can use the SET SIGN command to output the leading sign at the left or right.
Code:
/: SET SIGN LEFT
/: SET SIGN RIGHT
Q. What are the various text formatting options in SAPScript?
A.
&symbol(Z)& Omit Leading Zeros
&symbol(S)& Omit Leading Sign
&symbol(<)& Display Leading Sign to the Left
&symbol(>)& Display Leading Sign to the Right
&symbol(C)& Compress Spaces
&symbol(.N)& Display upto N decimal places
&symbol(T)& Omit thousands separator
&symbol(R)& Right justified
&symbol(I)& Suppress output of the initial value
Q. Frequently Used System Variables in SAPScript?
A.
&DATE& Currentdate
&DAY& Day
&MONTH& Month
&YEAR& Year
&TIME& Time of the day
&HOURS& Hours
&MINUTES& Minutes
&SECONDS& Seconds
&PAGE& Page
&NEXTPAGE& Next page number
&SPACE& Blank
&ULINE& Underline
&VLINE& Vertical line
&NAME_OF_MONTH& Name of the Month
&SAPSCRIPT-FORMPAGES& Total number of pages in currently formatted layout set
&SAPSCRIPT-JOBPAGES& Total number of pages in currently formatted print request
Q. What are the different types of windows in SAP Scripts?
A. Windows are defined in the Layout sets which define the position and the text to displayed.
The different types of windows are:
MAIN - Main Window
The main window is a continous window which can extend over several pages. If the text in the main window fills up a page, a new page is created.
Only one main window can be defined in the SAP Script whereas upto 100 instances of main window can be created in a page.
VAR - Variable Window
This window can have the variable contents displayed on them. The contents of the window cannot exceed the window size. The content can be formatted for each page.
CONST - Constant Window
The constant window can have a fixed content and is formatted only once.
Q. How can I format the date being displayed in the SAP Script?
A. The date fields in SAP Scripts can be formatted using the SET DATE MASK control command.
Eg.:
Code:
/: SET DATE MASK = 'MMMM DD, YY'
This displays the date as : September 26, 07
The following are the codes that can be used in the date mask:
YY Year (2 digits)
YYYY Year (4 Digits)
MM Month (2 Digits)
MMM Month Name (Abbreviated)
MMMM Month Name (Full)
DD Day as two digits
DDD Day name (Abbreviated)
DDDD Day name
Note! Using the SET DATE MASK causes the subsequent date fields to be displayed using the same formatting. To return to the default formatting use the following command:
Code:
/: SET DATE MASK = ' '
Q. How can I format the time in the SAP Script?
A. Similar to SET DATE MASK for date fields we can use SET TIME MASK for formatting time fields.
Eg.:
Code:
/: SET TIME MASK = 'HH hrs MM min SS sec'
This displays the time as : 11 hrs 43 min 37 sec'
The following are the codes that can be used in the time mask:HH Hours
MM Minutes
SS Seconds
The time formatting can be reset to the default setting using:
Code:
/: SET TIME MASK = ' '
Q. How can I apply shading for the BOXes in SAP Script?
Use the addition INTENSITY in the BOX command to apply gray shading to the boxes.
Eg:
Code:
BOX XPOS '0' CM YPOS '0.5' CM FRAME 8 TW INTENSITY 10
Q. What is the difference between the SAP Script texts, 'Customer &KNA1-KUNNR&' and '&Customer KNA1-KUNNR&'?
A.
In the first case of 'Customer : &KNA1-KUNNR&',
the text 'Customer : ' is displayed regardless of the variable KNA1-KUNNR even if it is having Initial value.
In the second case of '&Customer : KNA1-KUNNR&',
The text 'Customer :' and KNA1-KUNNR is displayed only when the variable KNA1-KUNNR has non-initial values.
Q. How can I change the page size of the layout?
A. In the SAP Script, Goto -> Header -> Basic Settings
Here you could configure the page settings and their orientation.
Q. How can I set the header and footer in the main window?
A. The TOP...ENDTOP and BOTTOM...ENDBOTTOM commands are used to set the header and footer texts in the main window respectively.
These texts will be displayed on the start and end of every new page in the output.
To disable these texts enclose empty commands between the commands.
Eg.:
Code:
/: TOP
/: ENDTOP
Q. What the conditional statements used in SAP Scripts?
A. The following conditional statements are used in SAP Scripts:
Code:
IF..ELSE...ENDIF
CASE...ENDCASE
Q. What is the use of the POSITION and SIZE command in SAP Scripts?
A. The POSITION command is used to x, y coordinate position which is used by the BOX command. The offset from the current window positions are specified which could be either positive or negative.
Code:
/: POSITION XORIGIN YORIGIN WINDOW PAGE
Eg.:
Code:
/: POSITION XORIGIN '2' CM YORIGIN '-1.5' CM
Similarly the SIZE command sets the width and height parameters.
Code:
/: SIZE WIDTH HEIGHT WINDOW PAGE
Eg.:
Code:
/: SIZE WIDTH 10 TW HEIGHT 10 TW
Q. How to find the Driver Program for the given SAPscript ?
A.
Step:1: Goto to the Table TNAPR using SE11
Step:2: Get the Contents of the Table(CNTRL+SHIFT+F10)
Step:3: On the Table Content Selection Screen, Type the SAPScript Name for which we have find the Driver Program in the field FONAM and execute( F8 )
Step:4: PGNAM field of the result display contains the Driver Program Name for our SAPscript
Q. How many MAIN windows are allowed for SAPscript?
A. SAPscript allows for 99 MAIN windows
Q. How to change development class of a SAPscript
A. Use program RSWBO052 (provided by Alan Cecchini)
Q. How to transport Standard Texts
A. Use Program RSTXTRAN or enter directly in transport
Put entry directly into the transport:
R3TR TEXT TEXT,Text Name,ST,Language
R3TR TEXT TEXT,Z_ALLERGAN_SWISS_DISTRIBUTOR,ST,E
Q. Importing Graphics (Logos) into SAPScript
A. The program RSTXLDMC can be used to upload graphics (file extension .tif on PC files) into individual standard text.
Other useful programs for SAPScript (provided by Paul Kjaer)
RSTXFCON Converts SAPScript page formats
RSTXSCRP Upload and download SAPScript layout sets
Calling an ABAP form from SAPScript (provided by Paul Kjaer)
Example:
In Layout Set:
Code:
DEFINE &X& = ...
DEFINE &Y& = ...
DEFINE &Z& = ...
PERFORM XXXXXX IN Zxxxxxxx
USING &X&
USING &Y&
CHANGING &Z&
In ABAP program Zxxxxxx
Code:
FORM XXXXXX TABLES INPUT1 STRUCTURE ITCSY
OUTPUT1 STRUCTURE ITCSY
*get input parameters
LOOP AT INPUT1.
CASE INPUT1-NAME.
WHEN 'X'.
INPUT_X = INPUT1-VALUE.
WHEN 'Y'.
INPUT_Y = INPUT1-VALUE.
ENDCASE.
ENDLOOP.
{logic to use program variable input_x and input_y to set say program variable output_z}
You can debug a SAPScript: Use Tools - Word Processing - Layout Set. Enter name of layout set and then Utilities - Activate Debugger.
A further note to the tip above was provided by John Verbestel: It is of no consequence which layoutset you enter when selecting the SAPscript debugger. (Menu path: Tools-Wordprocessing - Forms, Utilities - Activate Debugger) The next layoutset called will invoke the debugger. This is quite handy when verifying which layoutset is being called (Verifying customizing settings).
Another way to set the SAPScript debugger is to run program RSTXDBUG. Thanks to Amanda for this tip.
Sap Notes for SapScripts
77976 Informations for SAPscript BOX command
307414 BITMAP command from SAPscript
12462 How to define a new printer font?
130658 SAPscript: New fonts in the PC-Editor
742662 Word as editor for SAPscript / SmartForms
SAP Notes for PDF 944221 - Troubleshooting if problems occur in forms processing
Есть особенности по совместимости между версиями ADS, ALD, SAP Logon и Adobe Reader. Почитать про это:
Note 1317925 - Maintaining backward compatibility with Designer
Note 1458510 - Designer 8.2/9.0: Restriction for ADS 802 or lower
Note 1496928 - Template can't be translated after modifying by Designer 8.2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.