‎2008 Dec 16 3:57 PM
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
‎2008 Dec 16 4:05 PM
‎2008 Dec 16 4:01 PM
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
‎2008 Dec 16 4:02 PM
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?
‎2008 Dec 16 4:07 PM
I'm getting : "Only table types may be used as the reference type for a table parameter"
‎2008 Dec 16 4:05 PM
‎2008 Dec 16 4:08 PM
thanks a®s it worked !
Edited by: Tom . on Dec 16, 2008 5:09 PM
‎2008 Dec 16 4:08 PM
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.