Anda di halaman 1dari 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Smartforms Step by Step (Continued) Creating TABLE node


Select the MAIN window (Right click) Select Create -> Table from the Popup menu.

Rename the Table to Bookings_Table

Page: 1 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Setting Table properties Select the Table Pattern (Border lines) , Box and Shading options

Click on the Details button to Switch from Table Painter View to Details View. Create the Line Types, which determines the structure of data to be displayed in table.

Note: Table Width has to be equal to the Sum of all Cells Width in every Line type. Here First line type (Data_Line) has 5 Cells. And second line type (Footer_line) has 2 cells. Page: 2 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Select the Data Tab. (To Specify the Processing on internal table)

Table is divided into 3 Sections: 1. Header (For displaying Field Labels) 2. Main Area (For displaying Field Values) 3. Footer (For displaying footer info)

Page: 3 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Creating the Structure of Table - Header:

In the following Screen you have to set the TABLE LINE properties Line : Header_Row Line Type: DATA_LINE (Contains 5 Cells - for displaying column headings)

Page: 4 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Creating the Structure of Table Main Area:

Line : Data_Row Line Type: DATA_LINE (Contains 5 Cells - for displaying data records from internal table)

Page: 5 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Creating the Structure of Table Footer :

Line : Footer_Row Line Type: FOOTER_LINE (Contains 2 Cells - for displaying Footer info)

Displaying Footer only at the End of Table (i.e in Last page only) :
Select the CONDITIONS tab. Select the END OF TABLE Checkbox and Deselect the PAGE BREAK Checkbox Page: 6 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Creating TABLE node TEXTS Create the Node under the Cell(%CELL1) of Table line (Header_Row)

Maintain the Properties of the Text node as below.

Create Text Under each Cell of the Header row as listed below. Cell Name Text Name Description Text type %CELL2 CONNID_LABEL Connid label text Text element %CELL3 FLDATE_LABEL Fldate label text Text element %CELL4 AMOUNT_LABEL Amount label text Text element %CELL5 CURRKEY_LABEL Curr key label text Text element

Text in Editor Connection Date Amt in Local Curr Local Currency Page: 7 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Select the Field List Button from App. Toolbar Field list will be displayed below the Navigation of Pages & Windows.

Page: 8 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Create Text Under each Cell of the Header row as listed below. While placing the field names in the editor use Drag & Drop of fields from Field List (Field Symbols - <FS_BOOK>) Note: When we create the TABLE node in the Data tab we assigned the LOOP on IT_BOOK to Field symbol <FS_BOOK> Cell Name %CELL6 %CELL7 %CELL8 %CELL9 %CELL10 Text Name CARRID_FIELD CONNID_FIELD FLDATE_FIELD AMOUNT_FIELD CURRKEY_FIELD Description Carrid Field Connid Field Fldate Field Amount Field Curr key Field Text type Text element Text element Text element Text element Text element Text in Editor &FS_BOOKCARRID& &FS_BOOKCONNID& &FS_BOOKFLDATE& &FS_BOOKLOCCURAM& &FS_BOOKLOCCURKEY&

Sample for Carrid Field

Page: 9 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Creating Footer Texts for Table:

Create the Text under Cell (%CELL11)

Page: 10 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Create the Program Lines under Cell (%CELL11) Note: Using Program Lines node we can execute ABAP coding in form. Logic: Calculation of total bookings

Page: 11 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Create a Text node after the Program lines node (Code_count) as shown below.

Drag & Drop the Field V_Count from Global data in Field List.

Save and Activate the Form. Find the Generated Function Module. Page: 12 of 14

infyTree Software Solutions Author: Narayana Varma

Smartforms Learning Step by Step

Code in Print Program.


*&-----------------------------------------------------------------*& Report YSFORM1_PRINT *&----------------------------------------------------------------REPORT ysform1_print TABLES scustom. DATA : t_book TYPE TABLE OF sbook. DATA : v_fmname TYPE rs38l_fnam. PARAMETERS : p_id TYPE scustom-id DEFAULT 3890. START-OF-SELECTION. SELECT SINGLE * FROM scustom WHERE id = p_id. IF sy-subrc = 0. SELECT * FROM sbook INTO TABLE t_book WHERE customid = p_id. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YSFORM1' VARIANT ='' DIRECT_CALL ='' IMPORTING fm_name = v_fmname 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 '/1BCDWB/SF00002030' EXPORTING * ARCHIVE_INDEX = * ARCHIVE_INDEX_TAB = * ARCHIVE_PARAMETERS =

Page: 13 of 14

infyTree Software Solutions Author: Narayana Varma


* * * * * * * * * * * * * * * * * *

Smartforms Learning Step by Step

CONTROL_PARAMETERS = MAIL_APPL_OBJ = MAIL_RECIPIENT = MAIL_SENDER = OUTPUT_OPTIONS = USER_SETTINGS = 'X' wa_cust = scustom IMPORTING DOCUMENT_OUTPUT_INFO = JOB_OUTPUT_INFO = JOB_OUTPUT_OPTIONS = TABLES it_book = t_book 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. ENDIF.

Page: 14 of 14

Anda mungkin juga menyukai