step by step smartforms
TRANSCRIPT
![Page 1: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/1.jpg)
Search:
The Web
Tripod
Report Abuse « Previous | Top 100 | Next »
Select Rating
share: del.icio.us | digg | reddit | furl | facebook
Stefanos Moschidis - SAP Certified Technical Consultant - How to build a Form with SMARTFORMS
Call the transaction SMARTFORMS . Enter a name of a new Form to be built with SMARTFORMS and press the Create command button.
![Page 2: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/2.jpg)
The Form Builder appears on the screen. Any node can be selected or expanded from the left hand side tree menu.
![Page 3: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/3.jpg)
![Page 4: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/4.jpg)
Select the Form Interface node and provide the names of the internal tables containing the data. (In this example we have a Customer table and a Customer's Transaction Table connected with an one to many relationship).
![Page 5: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/5.jpg)
Select the Global Definitions and provide the names of two variables for controlling the page break after finishing a section of a Customer.
![Page 6: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/6.jpg)
![Page 7: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/7.jpg)
In the initialization tab of the Global Definitions node, give the code calculating the number of Customers. Input and output parameters should be provided so that the code works correctly.
![Page 8: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/8.jpg)
After expanding the %PAGE1 node, we can notice that a Main Window exists. From the context menu (appearing by clicking the right mouse button) of the Main window select Create -> Complex Section.
![Page 9: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/9.jpg)
This Section has data which are processed repeatedly and the Output Type (the format) is Unstructured.
![Page 10: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/10.jpg)
The data of this Section are retrieved from the internal table I_ZCUST and are stored in the data structure I_ZCUST in each iteration.
![Page 11: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/11.jpg)
At this point select the context menu of the Section and create a Text Element.
![Page 12: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/12.jpg)
Type the names of the fields of the internal table in the General Attributes tab. The field names are enclosed in ampersands.
![Page 13: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/13.jpg)
From the context menu of the Text Element create a series of Program lines.
![Page 14: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/14.jpg)
This series of Program lines, (actually a single Program line), increases the index of Customers printed by one (Variable INDEX_CUST_PRN). Input and Output
![Page 15: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/15.jpg)
parameters should be declared on the appropriate fields of the tab (In this case the Input and the Output parameter is the variable INDEX_CUST_PRN).
![Page 16: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/16.jpg)
From the context menu of the Program Lines create a second Complex Section.
![Page 17: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/17.jpg)
This Section has data which are processed repeatedly. The Output Type (format) is a table.
![Page 18: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/18.jpg)
Specify a Table Width and a Line Type.
![Page 19: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/19.jpg)
Select the Data tab and specify the Loop in the I_ZTRANSACTIONS table and the Where condition.
![Page 20: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/20.jpg)
On the Events tab select the Header and Footer events and specify a Height of the Footer.
![Page 21: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/21.jpg)
Select the Header node and check the New Line checkbox.
![Page 22: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/22.jpg)
At this point from the %Section2 context menu select Create -> Text.
![Page 23: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/23.jpg)
On the Global Attributes tab of the Text Element type the fields of the internal table we wish to show on the form enclosed in ampersands. The Text node is Appended directly (check the relevant radio button).
![Page 24: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/24.jpg)
From the context menu of the Footer Event select Create -> Command .
![Page 25: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/25.jpg)
Drag the %Command1 created and drop it on the %Section2 node. A popup window appears and select After the node %Section2.
![Page 26: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/26.jpg)
So the %Command1 is aligned to the Footer of %Section2. Check the Go to New Page checkbox.
![Page 27: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/27.jpg)
![Page 28: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/28.jpg)
Select the Conditions tab of the Command element an set the condition that a new page is created if the last customer is not reached by the printing process (I e the Index of the Customers printed is less than the Number of Customers).
![Page 29: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/29.jpg)
Start another session and call the transaction SE78.
![Page 30: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/30.jpg)
Expand the Graphics node on the left hand side tree menu, select BMAP Grid screens node and double click on it. On the right hand side provide the SAP name of a new graphic and check the Color radio button. Press the Import command
button.
![Page 31: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/31.jpg)
![Page 32: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/32.jpg)
On the appearing popup window provide the path where the bitmap image is stored and check the checkbox stating that Resides in the Printer Memory. Press
the Continue command button.
![Page 33: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/33.jpg)
The appearing screen shows that the graphic has been successfully imported into the SAP graphics management.
![Page 34: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/34.jpg)
Go back to the session of SMARTFORMS and select the %PAGE1 node. From the context menu select Create -> Graphic .
![Page 35: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/35.jpg)
On the General Attributes tab of the %Graphic1 created type the SAP Name of the graphic and provide the Object, ID, Color attribute and Resolution.
![Page 36: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/36.jpg)
Activate the Form from the menu path Form -> Activate.
![Page 37: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/37.jpg)
The function module SSF_FUNCTION_MODULE_NAME has as its import parameter a name of a Form created with SMARTFORMS and gives as output a
![Page 38: Step by Step SmartForms](https://reader033.vdocuments.mx/reader033/viewer/2022061116/546656edb4af9f833e8b47c3/html5/thumbnails/38.jpg)
function module name. The latter when executed with table parameters the internal tables of the SMARTFORMS Form, gives the final printout. The following code is an example of calling the Form created on the previous steps.
Further reading in the SAP Library on link http://help.sap.com/saphelp_46c/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm . Or through the path Basis Components -> Basis Services / Communication Interfaces (BC-SRV) -> SAP Smart Forms (BC-SRV-SCR) .