2008 Apr 14 3:29 PM
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
2008 Apr 14 4:00 PM
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 .
2008 Apr 14 3:46 PM
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
2008 Apr 14 3:53 PM
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.
2008 Apr 14 4:00 PM
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 .