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

Default values

Former Member
0 Likes
911

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
843

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

8 REPLIES 8
Read only

Former Member
0 Likes
844

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

Read only

Former Member
0 Likes
843

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.

Read only

Former Member
0 Likes
843

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,

Read only

Former Member
0 Likes
843

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.

Read only

Former Member
0 Likes
843

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.

Read only

Former Member
0 Likes
843

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.

Read only

Former Member
0 Likes
843

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

Read only

Former Member
0 Likes
843

Thank You Very Much!!!!!!