Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to use internal table parameters as export parameters in creating function module?

Former Member
0 Likes
8,217

Hello experts,

I am working on assignment in which i have to use parameters of internal table as export parameters to create function module. The parameters of internal table are defined as radiobutton group on standard selection screen. I didn't understand how to define those parameters in function module.


Export parameters can be 4 different tables decided by these radio buttons:


p_venju, p_samand, p_starfs, p_staski


The tables are named in the program:

  • it_t353i_t for parameter p_samand
  • it_pa_timar for parameter p_starfs
  • it_pa_t353i for parameter p_staski
  • itafla for parameter p_venju

If anybody have any idea regarding this issue please share it with me.

Hello experts,

I am working on assignment in which i have to use parameters of internal table as export parameters to create function module. The parameters of internal table are defined as radiobutton group on standard selection screen. I didn't understand how to define those parameters in function module.


Export parameters can be 4 different tables decided by these radio buttons:


p_venju, p_samand, p_starfs, p_staski


The tables are named in the program:

  • it_t353i_t for parameter p_samand
  • it_pa_timar for parameter p_starfs
  • it_pa_t353i for parameter p_staski
  • itafla for parameter p_venju

If anybody have any idea regarding this issue please share it with me.

14 REPLIES 14
Read only

wol
Active Participant
0 Likes
5,243

Hello Mulay,

you have to create a Table Type in DDIC and use this for typing the export parameter.

That´s it.

Greets

Stefan

Read only

atul_mohanty
Active Contributor
0 Likes
5,243

Hi Avadhut -

Go to SE11, click on data type, create

select radio button 'Structure' and create a structure .

Then

Go to SE11, click on data type, create

select radio button 'TAble type' and create a table type by specifying the line type as structure above step.

As per your requirement you can create the table types and create function module according passing them to the FM

Read only

0 Likes
5,243

Hi Atul,

Thanks for the reply. The structure and table's are defined in the program in which i have to use created Function Module. So what need to carry out same steps? My technical lead has asked me to create a function module for which The import parameters in the new function module should be all the selection options and parameters in the program and

Export parameters can be 4 different tables decided by these radio buttons

  

(parameters: p_venju, p_samand, p_starfs, p_staski )

The tables are named in the program:

  • it_t353i_t for parameter p_samand
  • it_pa_timar for parameter p_starfs
  • it_pa_t353i for parameter p_staski
  • itafla for parameter p_venju
Read only

0 Likes
5,243

Hi Avadhut

You can simply create the structures in SE11 same as the one in your program and use in your function mdouel

Nabheet

Read only

0 Likes
5,243

Hi Avadhut -

1. Are the structure and table created in program referring to any data dictionary structure / tables (are they exists in SE11) . If not, then you need to create those structure equivalent to the structure / internal table in SE11. Because the internal table / structure in the program is local to the program and the function module can not interpret it . The functional module repository will refer to the structure / tables / data elements in SE11.

2. You can populate the data to internal table / work area and pass to function module when you call it using CALL FUNCTION < FM NAME>.

Here the data types in import / export / changing / tables of function module must match with the data types of work area / internal table being passed from program.

3. You can create import parameters of your function modules with same data type as function modules.

Say you have PARAMETERS : P_MATNR type MATNR  in program.

         In FM you can create I_MATNR type MATNR.

For select-options, you need to create  table types and pass it in either import / changing  / tables.

The table type structure should be

(a) With one field of the particular field - In that case you need to loop over select option and populate a internal table ( created of the above type in the program)

Similarly for crate table type (in se11) for the four options

  • it_t353i_t for parameter p_samand
  • it_pa_timar for parameter p_starfs
  • it_pa_t353i for parameter p_staski
  • itafla for parameter p_venju

You can use them changing / exporting / tables of FM.

Regards,

Atul Mohanty

Read only

0 Likes
5,243

Hi Atul,

I dont understand how to create table type for this one

DATA: BEGIN OF it_t353i_t OCCURS 0,

         ilart       LIKE t353i_t-ilart,

         ilatx       LIKE t353i_t-ilatx,

         ismnw       LIKE afru-ismnw,

         hafnad      LIKE afru-ismnw,

         hlutfall(3) TYPE p DECIMALS 2,

         aaetlun     LIKE afru-ismnw.

DATA: END OF it_t353i_t.


Those four tables were defined in the code with BEGIN OF block. Not available in ABAP dictionary

Read only

0 Likes
5,243

you can create table type for those by following code..

data: lt_table like table of  it_t353i_t.

But that will be local to your report/program you can not use as FM parameter, if you want to make global table type first create a structure using required details (take the type of fields from your report program) by se11 tcode and then table type using that newly created structure by same se11 tcode.

Read only

0 Likes
5,243

Hi Avadhut -

To create table types for  it_t353i_t to use in Function Module parameter. You need to create them in SE11.

Create a  a corresponding structure (example - Zt353i) in SE11. For that in SE11, select the radio button Data type (give a name - Zt353i) , click 'create'. It will take to next screen ( you need select structure) then click on tick button. In the next screen, then input the fields for those fields in internal table

(  ilart       LIKE t353i_t-ilart,

         ilatx       LIKE t353i_t-ilatx,

         ismnw       LIKE afru-ismnw,

         hafnad      LIKE afru-ismnw,

         hlutfall(3) TYPE p DECIMALS 2,

         aaetlun     LIKE afru-ismnw.)

You need to menton the proper data element for each field. Please refer to the data elemnt you are refering in LIKE statmenent above.

Now once the structure is created, you need to create a table type with the same structure,

For that in SE11, select the radio button Data type (give a name - Zt353i_t) , click 'create'. It will take to next screen ( you need select table type) then click on tick button. In the next screen, then  here give the line type with the structure created above ( Zt353i) and save.

Now once the table type is created, you can use it in FM.

Let us know, in case any further help.

Regards,

Atul Mohanty

Read only

0 Likes
5,243

Hi Atul,

I have created structure but got this error while activation,

ZIT_T353I_T-AAETLUN (specify reference table AND reference field)

ZIT_T353I_T-HAFNAD (specify reference table AND reference field)

ZIT_T353I_T-ISMNW (specify reference table AND reference field)

after that i have entered Currency/quantity fields I am getting this error

ZIT_T353I_T-AAETLUN (combination reference table/field AFRU-ISMNW does not exist)

ZIT_T353I_T-HAFNAD (combination reference table/field AFRU-ISMNW does not exist)

ZIT_T353I_T-ISMNW (combination reference table/field AFRU-ISMNW does not exist)

How to rectify it? I have searched for few threads but not able to found any answer.

There is one more thing how to define

hlutfall(3) TYPE p DECIMALS 2.


In the structure?

Read only

0 Likes
5,243

Hi Avadhut -

Can you upload the screen shot of the structure that u created through SE11.

Read only

0 Likes
5,243

I have attached screen shots for structure. I don't understand how to define

hlutfall(3) TYPE p DECIMALS 2. In the structure as I am not having access to create new data element.

Read only

0 Likes
5,243

Hi Avadhut -

I was away for some days. For the error for quaantity field please use

reference field as AFRU-ISMNE in curreny /qualnity field tab ( instead of AFRU-ISMNW)

Example for ISMNW should be refered AFRU-ISMNE.

And hlutfall(3) TYPE p DECIMALS 2.

please refer to some standard data element if you can create any data element for your requirement.

Regards,

Atul Mohanty

Read only

0 Likes
5,243

Hi Avadhut,

Use DEC data type with Length 3 & decimals 2 for the field 'hlutfall'.

Thanks,

Sharath

Read only

Former Member
0 Likes
5,243

Go to Se11, Select the Table type and create using your DB table or structure and use those in your exporting parameter section.