‎2006 Sep 27 6:27 AM
hi friends,
I am using ranges in my fm...to correspond with the select-options for plant in a calling program in se38.
i have definied ranges as DATA plant TYPE RANGE OF marc-werks.
now i want to know how to get values which i gave in select-options in calling program to the range in FM..pls help
‎2006 Sep 27 6:30 AM
define like this :
RANGES : r_werks for marc-werks.
and check.
regards
prabhu
‎2006 Sep 27 6:32 AM
hi,
in the <b>tables</b> parameter of function module define the ranges.
plant like marc-werks.
also in the calling proram, pass select-options for plant <s_werks>.
reward if useful...
‎2006 Sep 27 6:36 AM
Hi,
use the table type SD_WERKS_RANGES in the FM importing parameter..
When calling the FM give the select-options variable with the body operator.
Call function 'zdsf'
exporting
so_werks = so_werks[].
Hope this works..
Thanks,
Naren
‎2006 Sep 27 6:42 AM
hi,
chk this simple example.
Define a range:
Ranges: r_field for <table>.
if not field1 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field1.
append r_field.
endif.
if not field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field2.
append r_field.
endif.
if field1 is initial and field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
append r_field.
endif.
select * from <table> where field1 in r_field.
if helped mark points.
rgds,
anver
‎2006 Sep 27 7:07 AM
Hi shakir,
1. U will have a WERKS select-options
on the selection screen.
(This same thing, u want to pass in FM)
2. So in FM, the
parameter has to be
TABLES parameter (Not import, nor export)
3. And the type will be
WERKS_RANG
(This WERKS_RANG has 4 fields,
just like a select option
SIGN
OPTION
LOW
HIGH
)
4. Then inside your fm,
u can use SELECT Query,
and use IN WERKS.
regards,
amit m
‎2006 Sep 27 7:40 AM
Define :
RANGES : r_werks for marc-werks.
if not so_werks[] is initial.
r_werks[] = so_werks[].
endif.
Now pass on the r_werks to the function module as a table.Surely, it works.
‎2006 Sep 27 7:51 AM
hi Rajesh, thank you for your response...
but so_werks is definied in the calling program, how can FM identify it..pls clarify..
am getting an error message " the field so_werks is unknown ..in the FM..much thanks
‎2006 Sep 27 7:53 AM
Hi again,
1. In the FM we have to pass
using TABLES parameter.
2. Also see my previous reply.
regards,
amit m.
‎2006 Sep 27 7:55 AM
Hello,
RANGES : r_matnr for mara-matnr.
Now in the FM use the type SELOPT in the table parameters
Regs,
Venkat
‎2006 Sep 28 7:55 AM
thanks guys!!...the issue has been resolved..i used werks like selopt in FM, nd defined plant1 length as 24 before using it as select option in se38. i am tring to reward points but the site is givin error...but i will keep trying...
Cheers !!