‎2007 Jun 07 10:35 AM
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
‎2007 Jun 07 10:37 AM
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
‎2007 Jun 07 10:38 AM
‎2007 Jun 07 10:38 AM
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
‎2007 Jun 07 10:38 AM
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
‎2007 Jun 07 10:40 AM
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
‎2007 Jun 07 10:40 AM
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
‎2007 Jun 07 10:41 AM
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