2023 Jan 16 11:30 AM
Hi
I am extracting data from excel in internal table, now i wanted to use that internal table and display the data in smartform. If anyone can provide me with some document related to this or tell me how should I approach with this requirement. Some help would be fine.
Thanks
Farhan
2023 Jan 16 11:40 AM
You can use internal table data in a Smartform by creating a table node in the Smartform layout and then binding the internal table data to the table node. Here is an overview of the steps you need to follow:
* Declare internal table
DATA: it_data TYPE TABLE OF ztable.
* Fill internal table with data
SELECT * FROM ztable INTO TABLE it_data.
* Bind internal table to Smartform table node
CALL FUNCTION 'FILL_TABLE'
EXPORTING
formname = 'MY_SMARTFORM'
tablename = 'MY_TABLE'
it_fields = it_data.
* Call the Smartform
CALL FUNCTION 'CALL_FORM'
EXPORTING
formname = 'MY_SMARTFORM'
output_options = 'X'
EXCEPTIONS
form_not_found = 1
OTHERS = 2.
2023 Jan 16 12:17 PM
I am not uploading that data into a standard table i have to use the data in internal table only.
2023 Jan 16 12:04 PM
FILL_TABLE and CALL_FORM are not recommended and supported as far as I know. This is the classic way:
This below code is taken from the demo program SF_EXAMPLE_01, see the BOOKINGS and CONNECTIONS internal tables defined as parameters:
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = p_form
IMPORTING
fm_name = l_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
ls_output_options-tdcopies = 0.
CALL FUNCTION l_fm_name
EXPORTING
control_parameters = ls_control_parameters
output_options = ls_output_options
user_settings = space
customer = customer
bookings = bookings "<=========================
connections = connections "<=========================
2023 Jan 16 12:26 PM
2023 Jan 16 12:36 PM