09-08-2009 3:25 PM
Hi,
I need to pass select-options value to a function module.
Code is like the following:
SELECT-OPTIONS seltab FOR object-type.
CALL FUNCTION 'Z_MY_FM'
EXPORTING
sel_tab = seltab
IMPORTING
result_tab = it_result
I have found a similar problem in the SDN forum:
However, that could not help me much in solving my problem.
So far I have tried to created a structure in DDIC with the following components for the select-options:
SIGN - BAPISIGN
OPTION - BAPIOPTION
LOW - ZBWOBJECTTYPE (my type)
HIGH - ZBWOBJECTTYPE (my type)
and subsequently a table type for this structure which is specified in the "Import" tab of my function module.
Unfortunately, when I ran the program a runtime exception occured (CALL_FUNCTION_CONFLICT_TYPE).
Could anyone please help me on this issue?
Thanks in advance.
Regards,
Joon Meng
09-08-2009 3:33 PM
Hi,
Declare an internal table in your program of the same dictionary table type which you created and then append the entries on the select-option to this table.
Pass this internal table to your Function Module.
Regards,
Ankur Parab
09-08-2009 3:33 PM
Hi,
Declare an internal table in your program of the same dictionary table type which you created and then append the entries on the select-option to this table.
Pass this internal table to your Function Module.
Regards,
Ankur Parab
09-08-2009 3:44 PM
Define a new type in a type-pool.
types: mytype type range of obect-type.
Then you can define the parameter of your Function module with the new type.
You can pass SELTAB[] to the parameter of the FM and it should work.
Best Regards
Rafa
09-08-2009 4:00 PM
Hi Rafa,
what is the meaning of the square bracket in "SELTAB[]"?
Thanks,
Joon Meng
09-08-2009 4:03 PM
Hello Joon,
CALL FUNCTION 'Z_MY_FM'
EXPORTING
sel_tab = seltab
IMPORTING
result_tab = it_result
You have defined SELTAB as a SELECT-OPTION.
So when you pass only SELTAB, the header line is transferred to the FM. When you pass SELTAB[] the whole table(range) is passed.
It is similar to the concept of an internal table with header line.
Hope i am clear.
Anyways how have you defined result_tab and sel_tab ?
BR,
Suhas
09-08-2009 4:16 PM
Hi,
@Ankur: Thanks for your tip. It works now! I have shown my appreciation with the points 😃
@Suhas: Thanks for the information too. I am clear about the use of the squared bracket in ignoring the header line.
Thanks everyone.
Regards,
Joon Meng
09-09-2009 11:10 AM
Hi Joon.
The select-option is an internal table with header line. You should pass the content of it, not the header. So you refer to the content of the select option (the content of the table) using brackets.
Hope it helps.
Regards
Rafa
09-09-2009 6:04 PM
09-08-2009 3:49 PM
09-08-2009 3:57 PM
Hi Joon ,
You have to change the FM parameter and make it a table or you have to loop at the select - option and then call the FM.
Hope it solves your issue.
09-08-2009 4:27 PM
You can pass a table without structure and copy it to an internal table type range
08-01-2013 4:28 PM
CALL FUNCTION 'Z_MY_FM'
EXPORTING
sel_tab = seltab
IMPORTING
result_tab = it_result
here pass seltab[] instead of seltab.