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

Ranges

abdulazeez12
Active Contributor
0 Likes
1,309

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

10 REPLIES 10
Read only

Former Member
0 Likes
1,258

define like this :

RANGES : r_werks for marc-werks.

and check.

regards

prabhu

Read only

Former Member
0 Likes
1,258

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...

Read only

Former Member
0 Likes
1,258

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

Read only

anversha_s
Active Contributor
0 Likes
1,258

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

Read only

Former Member
0 Likes
1,258

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

Read only

Former Member
0 Likes
1,258

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.

Read only

0 Likes
1,258

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

Read only

0 Likes
1,258

Hi again,

1. In the FM we have to pass

using TABLES parameter.

2. Also see my previous reply.

regards,

amit m.

Read only

Former Member
0 Likes
1,258

Hello,

RANGES : r_matnr for mara-matnr.

Now in the FM use the type SELOPT in the table parameters

Regs,

Venkat

Read only

abdulazeez12
Active Contributor
0 Likes
1,258

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 !!