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

FM

Former Member
0 Likes
888

Hi,

can we have a range for a F.M Source Code and if so may i know the steps pls

EG : SELECT-OPTION : S_VBELN FOR VBAP-VBELN,

S_POSNR FOR VBAP-POSNR.

Can you please provide an example .

Thanks,

Vind

7 REPLIES 7
Read only

Former Member
0 Likes
854

A range/select-option can be handle like an internal table by your FM.

You just have to add it in the "Table" section of your FM.

Hope this helps,

Erwan

Read only

Former Member
0 Likes
854

Hi ,

Can explain what is u r requirment..

Regards

Suresh.d

Read only

anversha_s
Active Contributor
0 Likes
854

hi,

Ranges : r_one for mara-matnr.
Data : wa_ran like line of r_one.
 
wa_ran-sign = 'I'.
wa_ran-option = 'EQ'.
wa_ran-low  = '0018'.
append wa_ran to r_one.

wa_ran-sign = 'I'.
wa_ran-option = 'EQ'.
wa_ran-low  = '0025'.
append wa_ran to r_one.

 
Data : it_one type table of mara.
 
select *
into table it_one
from mara
where matnr in r_one. “now query will fetch only matnr 0018 and 0025.

Some tips:

What does SIGN "I" & "E" mean?

The 'I' value in the SIGN field denotes 'Include', that means to Include the values given in the LOW and HIGH fields.

U may use 'E' here to exclude these values, when u r using the range in a SELECT query.

What is OPTION?

Option can be a whole range, which includes:

EQ (Equal)

BT (Between)

CP (Contain Pattern)

Rgds

Anversha

Read only

Former Member
0 Likes
854

hi

FORM GET_MULTIPLE .

  • Dynamically holding Field name

FIELD-SYMBOLS: <FST> TYPE STANDARD TABLE.

IF R_UNAME[] IS INITIAL.

IF NOT V_USERNAME IS INITIAL.

R_UNAME-SIGN = 'I'.

R_UNAME-OPTION = 'EQ'.

R_UNAME-LOW = V_USERNAME.

APPEND R_UNAME.

CLEAR R_UNAME.

ENDIF.

ENDIF.

ASSIGN R_UNAME[] TO <FST>.

CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'

EXPORTING

TITLE = 'Select Multiple Value'(059)

TEXT = 'Finish Group'(058)

SIGNED = 'X'

LOWER_CASE = ' '

NO_INTERVAL_CHECK = 'X'

JUST_DISPLAY = ' '

JUST_INCL = 'X'

TABLES

RANGE = <FST>

EXCEPTIONS

NO_RANGE_TAB = 1

CANCELLED = 2

INTERNAL_ERROR = 3

OTHERS = 4.

IF SY-SUBRC = 0.

READ TABLE R_UNAME INDEX 1.

IF SY-SUBRC = 0.

V_USERNAME = R_UNAME-LOW.

ENDIF.

ENDIF.

ENDFORM. " GET_MULTIPLE

Read only

Former Member
0 Likes
854

Hi

Range or select option is nothing but holding multiple values for a field in the form a internal table

So declare a Import parameter like TABLES paramter for the fun module and use it.

declare a field like in TABLES PARAMETER

ITAB LIKE WSELKUNNR and use

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
854

HI,

You can use the Structure RANGE_C10 for these Select-options, if you want more length fields, use RANGE_CXX, here the XX is the length.

For Material use the Structure WSELMATNR

Regards

Sudheer

Read only

Former Member
0 Likes
854

Hi

Range or select option is nothing but holding multiple values for a field in the form a internal table

So declare a Import parameter like TABLES paramter for the fun module and use it.

declare a field like in TABLES PARAMETER

ITAB LIKE WSELKUNNR and use

Reward points for useful Answers

Regards

Anji