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

Change from Parameter to Select-options.

Former Member
0 Likes
2,002

Hi All,

Requirement is to change the existing program.

One of my requirement is to change parameter(P_VKORG) to Select-options(S_VKORG).

I mean earlier we have only one Slaes Organization, now we have got to use multiple Sales organizations. For this requirement I have used select-options insted of Parmeters.

But the code has:

a)PERFORMS using Parameters( P_VKORG). This inturn is used in the select statement of the FORM-ENDFORM.

b)READ statement also has P_VKORG in where condition.

How should these be replaced with Select-options(S_VKORG)?

What would be the effect if I directly replace them with S_VKORG.

Kalyani T

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,103

hi ,

this is not work directly .

because parameter takes one value and select-option can take multiple values.

so u have to replace comparison operator like = ,'eq'

with 'IN ' condition .may be possible that you need to give the some part of code in loop.

directly replacing not possible .

3 REPLIES 3
Read only

Former Member
0 Likes
1,103

Hi kalyani Thadishetty ,

In your PERFORM statement pass the S_VKORG in the tables option and inside your form routine insted of read statement you have to use "for all entries in table" option for populating the internal table if you do this you don't need to do a read statement as your internal table will hold only values of sales org 's that you have in your select options. If this logic dors not work for your requirement you have to frame your own logic.

Thanks,

Greetson

Read only

Former Member
0 Likes
1,103

you cannot just directly replace with S_VKORG.

select option is a structure with 4 fields, sign, option, low and high, hence it has to be dealt accordingly.

a. performs has to be changed to 'tables S_VKORG'

eg. perform get_data tables s_vkorg.

b. read statement has to be modified to deal with multiple values. best option will be to select for data in s_vkorg, and save in an internal table.

for eg, if select option was for vkorg,

select vkorg from tvko into t_tvko where vkorg in s_vkorg.

now t_tvko has list of possible vkorgs - regardless of we had a range or ne or gt or CP or whatever we had in select option.

now modify the read table to do for entries in T_TVKO.

c. in the select statement which is used in forms, wherever you see ' = P_vkorg' , replace with IN S_VKORG.

Read only

Former Member
0 Likes
1,104

hi ,

this is not work directly .

because parameter takes one value and select-option can take multiple values.

so u have to replace comparison operator like = ,'eq'

with 'IN ' condition .may be possible that you need to give the some part of code in loop.

directly replacing not possible .