SAPAG.CO.IN in this website you can find SAP Related Tutorials, like SAP ABAP ,SAP Meterial Management (MM),SAP Customer Relationship Management (CRM),MySAP,SAP Finance And Controling (FICO),SAP Sales And Distribution (SD),SAP Business Warehousing (BW),SAP Netweaver,SAP Exhcange Infrastructure (XI ),SAP Enterprise Portal (EP) ,SAP Master Data Management (MDM),SAP Web Application Server (WAS),SAP Mobile Infrastructure (MI ),SAP Business Intelegent (BI ) ,SAP Knowledge Management (KM ) and Maney more..... Tutorials @ single point.
SAP ABAP Scripts Question and Answers Part 3 61. Calling a form from SapScript (*****)
/:DEFINE &CUST& = '00000021'. Dear &NAME& The ABAP routine could be defined as follows: IMPORTANT: The structure itcsy must be used for the parameters. REPORT Z_HENRIKF_SCRIPT_FORM . read table in_tab index 1. select single * from scustom if sy-subrc = 0. ** You could also fill the ouput parameter table this way MODIFY out_par INDEX sy-tabix. endform. Note that if you use more than one parameter you must use Using or Changing before every parameter ! /: PERFORM <form> IN PROGRAM <prog> 62. Structure of a print program 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. Open form printing - Must be called before working with any of the other form function modules. *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 Write text elements to a window of the form Ends form Closes form printing Examples of function calls OPEN FORM CALL FUNCTION 'OPEN_FORM' * MAIL_SENDER = UNCLOSED = 5 START_FORM CALL FUNCTION 'START_FORM' * LANGUAGE = ' ' WRITE_FORM See 'WRITE_FORM' END_FORM CALL FUNCTION 'END_FORM' IMPORTING CLOSE_FORM Structure for Print options (return values) - Pages selected for printing, Number of copies etc. CALL FUNCTION 'CLOSE_FORM' * RDI_RESULT = 63. CONTROL_FORM - Calling Commands Using a program The function module CONTROL_FORM can be used to create SapScript control statements from within an ABAP program. Example: call function 'CONTROL_FORM' call function 'WRITE_FORM'..................... call function 'CONTROL_FORM' Styles Styles are used to predefine paragraph and character formats for forms. SAP provides several standard styles e.g. for Address includes, on-line documentation and so on. You can define your own styles. To find styles, create styles and maintaine styles, use transaction SE72. You assign style to a text by using menu Format -> Style You can make temporary style changes using the control command /: STYLE Using graphics in SapScript Use transaction SE78 to inmport graphics to SAP. In the form painter, you can either include directly to the form using menu Edit->Graphic->Create or using the INCLUDE statement in a window. To use an INCLUDE stanment, goto into the woindow script editor and use menu Include->Graphic. The include can look like this for a bitmap: /: BITMAP MYLOGO OBJECT GRAPHICS ID BMAP TYPE BMON Modifications The standard SAP print program should only be changed when it is absolutely necessary. If additional data is needed, these can in many cases be retrieved using a a PERFORM statement in the form instead of changing the print program.. There can be the following reasons to change the print program: Structureal changes Determine/change which forms and printprograms that are used for printing The forms and print programs for a given output type and application can be found in table TNAPR Processing programs for output Use view V_TNAPR in (Transaction SE30) to change entries |
|---|
.
.