2014 Jan 10 9:51 AM
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:
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:
If anybody have any idea regarding this issue please share it with me.
2014 Jan 10 9:57 AM
Hello Mulay,
you have to create a Table Type in DDIC and use this for typing the export parameter.
That´s it.
Greets
Stefan
2014 Jan 10 10:16 AM
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
2014 Jan 10 10:24 AM
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:
2014 Jan 10 11:08 AM
Hi Avadhut
You can simply create the structures in SE11 same as the one in your program and use in your function mdouel
Nabheet
2014 Jan 10 11:43 AM
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
You can use them changing / exporting / tables of FM.
Regards,
Atul Mohanty
2014 Jan 14 6:50 AM
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
2014 Jan 14 6:58 AM
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.
2014 Jan 15 7:26 AM
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
2014 Jan 15 1:14 PM
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?
2014 Jan 16 8:54 AM
Hi Avadhut -
Can you upload the screen shot of the structure that u created through SE11.
2014 Jan 16 9:15 AM
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.
2014 Jan 20 3:34 PM
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
2014 Jan 21 9:26 AM
Hi Avadhut,
Use DEC data type with Length 3 & decimals 2 for the field 'hlutfall'.
Thanks,
Sharath
2014 Jan 10 10:17 AM
Go to Se11, Select the Table type and create using your DB table or structure and use those in your exporting parameter section.