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

how to pass select-option variable in function

Former Member
0 Likes
720

hi ,

select-option : s_akont for KNB1-akont OBLIGATORY.

i have to pass s_akont in function without using

s_akont-low & s_akont-high.

rightnow i am passing like s_akont but it is giving me a error :

s_akont is followed by niether by an internal table nor by a value list.

what should i write.

regards

raj

6 REPLIES 6
Read only

Former Member
0 Likes
630

Hi Raj,

You have to loop over akont between the s_akont-low and s_akont-high and pass it in the function.

Also check if you are using a Function module then does it support select-option table in the interface.

Regards,

George

Read only

Former Member
0 Likes
630

george,

i passing in my own function. function is for sales & balance calculation (bsid + bsad).

loop is ok but i am having more that 2000 customer if i start looping in s_akont than prog. run time will be very high.

regards,

raj

Read only

Former Member
0 Likes
630

Hi Raj

Either the FM has to be scattered in such a way to handle the ranges or need to do an extraction to find the valid entries in the range and then pass to the FM individually.

Kind Regards

Eswar

Read only

Former Member
0 Likes
630

hi

good

write like this

select-options : s_akont for KNB1-akont OBLIGATORY.

if you r passing any vlaue in the s_akont field than it must not give you error as you have mentioned, and you have not mentioned where actually you r facing the error.

check with your select statement where you r selecting the data.

thanks

mrutyun^

Read only

Former Member
0 Likes
630

it is typing error i wrote select-options only

Read only

uwe_schieferstein
Active Contributor
0 Likes
630

Hello Raj

I assume that you want to import your select-options into your function module(s). Since select-options are, by default, itabs with header lines you have to pass your select-options as following:

CALL FUNCTION 'Z_...'
  TABLES
    it_selopt = s_akont[].

The TABLES parameter it_selopt could be of type ANY or better of type <b>TABLE</b>.

If you want to use generic select-option structure you can use <b>RSDSSELOPT</b> and the table type <b>TT_RSDSSELOPT</b>. In this case you would need to copy your select-options from s_akont to a generic type s_generic (of type RSDSSELOPT).

Regards

Uwe