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

Table parameter in FM

Former Member
0 Likes
1,939

Hi,

i would like to create a function module that takes a list of messages(BAL_S_MSG) and a log object (BAL_S_LOG) (basically it will be used to add log messages in different programs)

I can't put directly the type BAL_S_MSG in the table definition tab because it is not defined as a table.

Do i have to create a table with the same structure as BAL_S_MSG or is there some other trick i could do ?

Thanks a lot.

Tom

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
1,360

Use BAL_T_MSG instead of BAL_S_MSG

a®

6 REPLIES 6
Read only

Former Member
0 Likes
1,360

Just create a table type with the structure 'BAL_S_MSG' and use that. You should also use the importing or exporting parameters instead of the tables parameter. Just do:

IMPORTING

X_parameter TYPE your_table_type

or

EXPORTING

y_parameter TYPE your_table_type

This will create an import or export table.

Hope that helps,

Michael

Or just use an existing table type which uses structure BAL_S_MSG (e.g. BAL_T_MSG).

Edited by: Michael Wackerbauer on Dec 16, 2008 11:02 AM

Read only

Former Member
0 Likes
1,360

BAL_S_MSG is defined as a structure so you should be able to use it in the FM 'tables' tab as 'TYPE'.

How are you adding it? What error message are you getting?

Read only

0 Likes
1,360

I'm getting : "Only table types may be used as the reference type for a table parameter"

Read only

former_member194669
Active Contributor
1,361

Use BAL_T_MSG instead of BAL_S_MSG

a®

Read only

0 Likes
1,360

thanks a®s it worked !

Edited by: Tom . on Dec 16, 2008 5:09 PM

Read only

Former Member
0 Likes
1,360

Hi,

You no need to declare the table in the database same like BAL_S_MSG structure. If you have this structure in the database or you can create the structure using SE11.

Different ways of declaring the table in FM.

1. Exporting Tab - need to refer to table type for all the parameters delcared in this tab ..which will behave as table in the FM.

2. Tanle Tab - need to refer to structure type for all the parameters delcared in this tab ..which will behave as table in the FM.