2008 Jan 23 4:02 AM
2008 Jan 23 4:07 AM
hi,
Designing Tables in Smart Forms
Step1: T-code for smart forms is SMARTFORMS. Provide the name of the smart form.
And provide the short text for this smart form YDEMO_TABLE.
Step2: Now go to Global definitions where we can define the Global data, Types, Initialization and etc.
Define Structure using Types Parameter as shown below. In Types parameters we usually define user defined data types.
Step3: Now define the internal table and work area in Global Data parameter.
Step4: In Initialization parameter, we can write a code as shown below. We have to mention the output result in the output parameter so that we can use it further. Here in this case we are outputting IT_TAB and we are going to use this IT_TAB further in the Table painter.
Step5: Now we create a Table painter as shown below.
Step6: Now we define number of table columns in %LTYPE1. Here, %LTYPE1 is renamed as LINE as shown below.
Here, in this scenario we have to divide the LINE area into 4 columns as we have to display 5 columns. To draw a line we have to select Draw lines and columns button as shown above.
Step7: Now we have to create Table line for Header and Main area of Table painter as shown below.
Here we have to provide line type. Here, the line type is LINE.
Step8: Provide the text for all columns.
Step9: Repeat the same process to the Main Area too.
Step10: Now Loop the internal table data as shown below.
Step11: Save and activate the smart form. Execute the smart form now. The output is as shown below.
reward if its useful
2008 Jan 23 4:07 AM
hi,
Designing Tables in Smart Forms
Step1: T-code for smart forms is SMARTFORMS. Provide the name of the smart form.
And provide the short text for this smart form YDEMO_TABLE.
Step2: Now go to Global definitions where we can define the Global data, Types, Initialization and etc.
Define Structure using Types Parameter as shown below. In Types parameters we usually define user defined data types.
Step3: Now define the internal table and work area in Global Data parameter.
Step4: In Initialization parameter, we can write a code as shown below. We have to mention the output result in the output parameter so that we can use it further. Here in this case we are outputting IT_TAB and we are going to use this IT_TAB further in the Table painter.
Step5: Now we create a Table painter as shown below.
Step6: Now we define number of table columns in %LTYPE1. Here, %LTYPE1 is renamed as LINE as shown below.
Here, in this scenario we have to divide the LINE area into 4 columns as we have to display 5 columns. To draw a line we have to select Draw lines and columns button as shown above.
Step7: Now we have to create Table line for Header and Main area of Table painter as shown below.
Here we have to provide line type. Here, the line type is LINE.
Step8: Provide the text for all columns.
Step9: Repeat the same process to the Main Area too.
Step10: Now Loop the internal table data as shown below.
Step11: Save and activate the smart form. Execute the smart form now. The output is as shown below.
reward if its useful
2008 Jan 23 4:08 AM
vasu,
You can write in
1.Global definitions--->INTIALIZATION(tab)
2.Right click on left side nodes
create--->program lines.
Don't forget to reward if useful....
2008 Jan 23 4:21 AM
hi
in smartforms after u create the pages and windows ,you write the code in print program in se38.
in that you declare the internal tables and call the function moduleSSF_FUNCTION_MODULE_NAME in this u need to pass the smartform name.
and in smartform -
form interface you need to give the internal table name in TABLES tab .
here is the code which we write in print program.
DATA : wa_lfa1 TYPE z50875_lfa1,
wa_ekko TYPE z50875_ekko,
wa_ekpo TYPE z50875_ekpo,
it_ekpo TYPE z50875it_ekpo,
vname TYPE rs38l_fnam.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
PARAMETER : p_no TYPE ekko-ebeln OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON p_no.
PERFORM validate.
START-OF-SELECTION.
PERFORM get_vendordata.
PERFORM get_itemdata.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z50875MM_SMARTFORMS'
IMPORTING
fm_name = vname
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 vname
EXPORTING
wa_lfa1 = wa_lfa1
wa_ekko = wa_ekko
wa_ekpo = wa_ekpo
TABLES
it_ekpo = it_ekpo
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.
FORM get_data .
SELECT SINGLE ebeln lifnr
FROM ekko
INTO wa_ekko
WHERE ebeln = p_no.
ENDFORM. " GET_DATA
FORM get_vendordata .
SELECT SINGLE lifnr name1 land1 ort01 regio
FROM lfa1
INTO wa_lfa1
WHERE lifnr = wa_ekko-lifnr.
ENDFORM. " GET_VENDORDATA
FORM get_itemdata .
SELECT ebelp ematn aedat mtart netwr
FROM ekpo
INTO TABLE it_ekpo
WHERE ebeln = wa_ekko-ebeln.
ENDFORM. " GET_ITEMDATA
FORM validate .
PERFORM get_data.
IF sy-subrc NE 0.
MESSAGE 'PURCHASE DOCUMENT DOES NOT EXISTS' TYPE 'E'.
EXIT.
ENDIF.
ENDFORM. " validate
and you can write the performs in smartforms only...
in global defenition------form routines tab write the performs directly.
2008 Jan 23 5:19 AM
you can right click on page and then select program lines or loop to write ur code.
you can also write ur code in global definitions .
reward if useful
regards,
vivek