Application Development 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: 

FM parameters with RANGES

Former Member
0 Kudos

Hi!

I would like to create an FM in SE37. I would like to pass a RANGE to it, as an Import or Tables parameter.

As a result, I would like to retrieve also a RANGE, as an Exporting or Table parameter.

Unfortunately I don't know, what kind of TYPE do I have to use for ranges in the paramteres?

Thank you

Tamá

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Tamas,

Please pass an internal table to the FM (obviously in the TABLES interface of the FM). Do not assign any associated type to the <b>tables parameter</b> while creating the FM.

Thank you.

Award points if found useful.

9 REPLIES 9

Former Member
0 Kudos

Hi Tamas,

Please pass an internal table to the FM (obviously in the TABLES interface of the FM). Do not assign any associated type to the <b>tables parameter</b> while creating the FM.

Thank you.

Award points if found useful.

Former Member
0 Kudos

Let us assume s_date is the select option for the date range defined like

DATA: s_date for p0001-begda.

Now while calling the FM pass the s_date-low and s_date-high as 2 parameters for the FM.In the FM create 2 parameters begda and endda of type begda. Use the low value and high value in the FM to populate the range table and u can use this range table for further processing of the dates in the FM.The range table can be forwarded as follows:

r_date-low = begda.

r_date-high = endda.

also provide the sign and options for the ranges table.

compared to above method.....passing them as tables parameter is better option i think

JozsefSzikszai
Active Contributor
0 Kudos

hi Tamas,

in your program you have to create a range, than in your FM as tables parameter you define table without any type. It will work.

ec

Don't reward if not useful

0 Kudos

as mentioned in the table section put the parameter there with like

for many fields range structures already exist like

BUKR_RANGE

AUFNR_RANG

TYPE_KOKRS_RANGE

search in se11 for structures which contain you're fieldname to find if its already there otherwise define a new structure where the low and high field reference to you're field

I made for instance an catst status structure for this

name structure: zcats_status_range


component  type component

SIGN	SIGN_RANGE
OPTION	OPT_RANGE
LOW	CATSSTATUS
HIGH	CATSSTATUS

reward if usefull ofcourse

arthur

Message was edited by:

A. de Smidt

ferry_lianto
Active Contributor
0 Kudos

Hi,

You can use structure EFG_RANGES ( In Tables Parameter ).

This structure is same as select options.

Or in Importing parameters use EFG_TAB_RANGES.

This is an internal table type .

Regards,

Ferry Lianto

Former Member
0 Kudos

Hi Tamas,

I'm replying as your query seems to be not answered.

Here is what you have to do.

In the tables parameter define a range under type u mention like and reference type you should be referencing to a range, most of these are pre difined in SAP. Below is an example for Material #.

TABLES: Paramenter -->

Parameter Name Type spec Reference type

R_MATNR LIKE RANGE_C18

NOTE: what ever range you mention should be same as what data you want to send to it, for example MATNR is of 18 char so get a range of 18Char like in below example.

0 Kudos

by saying not answered I refer to the header for this question, which says this is 'the question is not answered'.

Former Member
0 Kudos

Thank you for the answers. However the option to pass only the high and low parameters are not an option, because ranges could have several lines (that's why I'm using them).

Without the type the FM is working, but makes the coding unneccessarily though...

So I had to search after a suitable RANGE in the ddic structure, and because now it is for usernames, I'll use the following one: UNAME_RANGE

Regards

Tamá

0 Kudos

If you debug once a screen field with multiple options you see how multiple lines are filled into the same range. instead of BT (between) you get EQ (equal) and the value is filled into the low field only

because of the multiple lines you need to declare it in the table options instead as a normal export or import paramater.

you get

sign option low

I EQ usernname1

I EQ usernname2

I EQ usernname3

I EQ usernname4

if you have multiple values in a range

and yes uname_range is the correct one to use for usernames

kind regards

arthur