cancel
Showing results for 
Search instead for 
Did you mean: 

how to paas a internal table into Smartform by driver program

S0023931147
Participant
0 Kudos

Hi All,

I am facing a problem while passing a internal table from driver program to smartform below is the step how i am passing:

1. in the driver program i have declared a table:

DATA : it_EKPO TYPE STANDARD TABLE OF EKPO INITIAL SIZE 0,

then select all fields from ekpo and populate my table.

2. in the call function i am expoting table like

*To convert the smartform to the OTF data

CALL FUNCTION form_name

EXPORTING

control_parameters = wa_ctrlop

output_options = wa_outopt

user_settings = 'X'

ekko = it_ekko

ekpo = it_ekpo

3. to pass the table into smartform:

in the import tab of the form interface i have declared table as:

it_ekpo type ekko.

4. in the global definition i have created a structure wa_ekpo type ekpo.

5. When i am trying to use loop on the table it_ekpo in the table.

it_ekpo into wa_ekpo.

it is giving error: %TABLE1 "EKPO" is neither specified under "TABLES" nor is it defined as an internal table.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Narendra,

The way you are passing IT_EKPO table, this way is used to pass only Parameters.

For passing the Tables, just check this example:

Driver Program:

CALL FUNCTION i_fm_name

EXPORTING

control_parameters = control_parameters

output_options = output_options

user_settings = space

vbeln = p_vbeln

TABLES

it_vbak = it_vbak

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.

Smartform:

You have to define the Table into FORM ATTRIBUTES under TABLES Tab.

Then you can access that table Globally in your smartform.

Regards,

Vishal

Answers (2)

Answers (2)

sachin_mathapati
Contributor
0 Kudos

Hi Narendra,

Check the Data decleration of It_ekpo , it is referring to ekko table whereas u r work area wa_ekpo is referring to ekpo table.

Change the decleration of it_ekpo in Table tab of the form interface.

Regards,

Sachin M M

naimesh_patel
Active Contributor
0 Kudos

3. to pass the table into smartform:

in the import tab of the form interface i have declared table as:

it_ekpo type ekko.

Instead of the Import tab, create this parameter in the TABLES tab. This will create a FM with TALBES interface. If you want to avoid the tables with header line:

1) Create a table type of EKPO in SE11

2) Use the table type to refer to the table parameter in the IMPORT tab.

Like:


IT_EKPO    TYPE Z_T_EKPO    "Z_T_EKPO is the table type for the EKPO

Based on your parameter design, you need to change the function call in your driver program.

Regards,

Naimesh Patel