‎2007 Jan 16 11:13 AM
Hi friends, I'd like if I could have a table in a module function with default values.
I know that I can do this with Import parameters, Can I do the same with the tables?.
A lot of thanks in advance.
‎2007 Jan 16 11:17 AM
Hi,
Yes You can do this with the TABLES statments, just give the name in the TABLES parameters, when you calling the Function module, you can pass the Same structure Internal table, and write the code in the Source code of the Function module,
if you specify the Import parameters, and once call the Function module then it will appear in the Export Parametrs, same as if you define the Table in the TABLES parameters, that will appear in the TABLES statement.
Regards
Sudheer
‎2007 Jan 16 11:17 AM
Hi,
Yes You can do this with the TABLES statments, just give the name in the TABLES parameters, when you calling the Function module, you can pass the Same structure Internal table, and write the code in the Source code of the Function module,
if you specify the Import parameters, and once call the Function module then it will appear in the Export Parametrs, same as if you define the Table in the TABLES parameters, that will appear in the TABLES statement.
Regards
Sudheer
‎2007 Jan 16 11:18 AM
it can be done...Check <b>GUI_DOWNLOAD</b> function module...in the TABLES parameter u need to input values and the same gets accumulated in another after execution.
‎2007 Jan 16 11:24 AM
Hi Jose,
If you want to have a table in a module function/function module with default values.
You can write the default value in your codes.
e.g.: your table name is TMARA.
IF TMARA[] IS INITIAL.
TMARA-MATNR = '1000'.
APPEND TMARA.
ENDIF.
The above codes will make table TMARA has default value.
Regards,
‎2007 Jan 16 11:31 AM
Thank You, I thought that I could insert the values directly into the table and when I run then function module, this one carries the default values that I inserted before, without code I mean.
Best regards.
‎2007 Jan 16 12:10 PM
that is what <b>GUI_DOWNLOAD</b> does...in selection screen u will specify values and when u run the FM it will internally do some logic and outputs the data into other table.
‎2007 Jan 16 2:51 PM
Well, I understand what do you want to say, but my explanation it's horrible I'm terrible sorry.
What I want to say is e.g:
I have a Function Group of two Function Modules and one has a table of parameter, when I call one Function Module that don't has a table parameter the other one wich has the table, this one fills up and is ready to use with table full without put the data manually and without selection screens and others.
It's possible?
Thanks for your answers.
‎2007 Jan 16 2:58 PM
Hi,
You need to Declare the Table in the TOP include of the Function group, so that the Table/Internal table will avilabe for all the Function modules, You can fill the Table without the Selection screen but you need to execute the Function module to fill the data in to that, once it is fill then you can use the Table for entire Function group. make sure the Table should be declared in the TOP include of the Function group.
Regards
Sudheer
‎2007 Jan 16 3:44 PM