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

Passing Range to Function

Former Member
0 Likes
4,219

Hi all

I would thank and reward with points to a correct answer.

I have one range with many lines. Example of one line:

mob-sign = 'I'.

mob-option = 'EQ'.

mob-low = '50010031'.

append mob.

Then I have to pass this range to a Function module to use in it. This means I will check some values if it's in this range. For example:

IF xpto IN mob.

ENDIF.

How do I pass the range? Through tables? Parameter?

And do I define in FM?

Message was edited by:

André Jordã

6 REPLIES 6
Read only

Former Member
0 Likes
1,577

Hi,

Yes you can populate the range and use it further in the code

like

If not itab-field in mob.

< do some calculation>

endif.

reward if useful

regards,

ANJI

Read only

Former Member
0 Likes
1,577

Hi...

Pass this in the tables option to the function module.

Reward points if useful......

Suresh......

Read only

Former Member
0 Likes
1,577

in ur function module u can to define a field in the Tables section. This field needs to be reffer to a structure.... for this u need to create a structure with the fields ur passing in the range. now u can pass the range details to this FM using the table field which will hold data same as like an internal table.... u can use this data for ur validations.

Read only

Former Member
0 Likes
1,577

yeah thru tables only.

call Function 'zpbc'.

export

import

tables

ranges = r_ranges.

Regards

Prabhu

Read only

Former Member
0 Likes
1,577

No, I pass it through tables, I define it on FM LIKE EFG_RANGES (range type). It gives me the error: "MOB is not an internal table" on function call.

Read only

Former Member
0 Likes
1,577

Hi,

We have standard Structures

/SDF/RANGES Ranges for data selection

/SDF/RANGESC1 Ranges for data selection CHAR 1

/SDF/RANGESC10 Ranges for data selection CHAR 10

/SDF/RANGESC14 Ranges for data selection CHAR 14

/SDF/RANGESC4 Ranges for data selection CHAR 4

/SDF/RANGESC5 Ranges for data selection CHAR 5

/SDF/RANGESD15 Ranges for data selection DEC 15

/SDF/RANGESD18 Ranges for data selection DEC 18

/SDF/RANGESI1 Ranges for data selection INT 1

/SDF/RANGESI2 Ranges for data selection INT 2

/SDF/RANGESI4 Ranges for data selection INT 4

You can make use of these and create the parameter in the TABLES, so that we can get more than 1 data at a time

Regards

Sudheer