Application Development 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: 

Pass a Select-Option as Input Parameter to a BAPI

Former Member
0 Kudos

Hello All,

I would like you can help me. I neet to pass a Select-Option parameter to a BAPI who does a query using the condition WHERE field IN values.

What I get until now is activating the function to WHERE field = value.

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

HI Roberto,

If the parameter is defined to hold a range then youcan pass that select-option values as a tables parameter. If it is not defined to hold a range , then you cannot pass the select-option.

REgards,

Ravi

0 Kudos

Hi Ravi,

Thanks for your anwser.

My parameter is defined in the import part so:

P_MATERIAL TYPE MSEG-MATNR

Are you suggesting me to declare as a table parameter to accept a range of values? I need to create a structure with a single field (MSEG-MATNR) ?

Thanks in advance.

0 Kudos

Hi Roberto,

Yes declare it as a table parameter so that it can accept the multiple values.

Regards,

Atish

former_member181962
Active Contributor

for example if you have a bapi which returns the material related data for asingle material, you cannot pass a range of materials at once.

In such case, you have to get all the materials into an internal table and then call the bapi for each loop.

select matnr from mara into table itab

where matnr in s_matnr.

loop at itab.

call function 'BAPI.....

exporting

material = itab-matnr

endloop.

REgards,

Ravi