‎2007 Mar 26 8:17 PM
‎2007 Mar 26 9:18 PM
Hi,
Please check this sample code.
TABLES: LFB1.
RANGES: R_BUKRS FOR LFB1-BUKRS
R_BUKRS-SIGN = 'I'
R_BUKRS-OPTION = 'EQ'
R_BUKRS-LOW = '0001'
APPEND R_BUKRS.
R_BUKRS-SIGN = 'I'
R_BUKRS-OPTION = 'EQ'
R_BUKRS-LOW = '0002'
APPEND R_BUKRS.
R_BUKRS-SIGN = 'I'
R_BUKRS-OPTION = 'EQ'
R_BUKRS-LOW = '0003'
APPEND R_BUKRS.
LOOP AT ITAB WHERE BUKRS IN R_BUKRS.
....
ENDLOOP.
Regards,
Ferry Lianto
‎2007 Mar 26 8:26 PM
Please explain further what your question is.
A "range" is an internal table - does that help?
‎2007 Mar 26 8:59 PM
Hi John,
in my program i need to build ranges for an field company code and we have to retrive data regarding the range.
so to build range for that field i need help.
is it clear or need more?
‎2007 Mar 26 9:16 PM
Try this....
select-options s_ktokk for lfa1-ktokk.
s_ktokk-low = '1000'.
s_ktokk-option = 'EQ'.
s_ktokk-sign = 'I'.
append s_ktokk.
s_ktokk-low = '2000'.
s_ktokk-option = 'EQ'.
s_ktokk-sign = 'I'.
append s_ktokk.
‎2007 Mar 26 9:44 PM
Hi,
Try this.
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
*--- MACRO - Fill Company Code
DEFINE fill_bukrs.
r_bukrs-sign = 'I'.
r_bukrs-low = &1.
r_bukrs-option = 'EQ'.
append r_bukrs.
END-OF-DEFINITION.
TABLES: t001.
DATA: lit_bkpf LIKE STANDARD TABLE OF bkpf.
RANGES: r_bukrs FOR t001-bukrs.
fill_bukrs '0001'.
fill_bukrs '0100'.
fill_bukrs '1000'.
fill_bukrs '1001'.
* here DBTAB = database table
* & INTAB = internal table
SELECT *
FROM <DBTAB>
INTO TABLE <INTAB>
WHERE bukrs IN r_bukrs.
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
Let me know if you need any other information.
Regards,
RS
‎2007 Mar 26 8:35 PM
Ranges Accepts a range of values. but it doesn't get selection screen like that of select options.
you have to maintain internal table explicitly.....means specify data explicitly.
RANGES <rangetab>FOR <f>
it shud be like
DATA: BEGIN OF <rangetab> OCCURS 0,
SIGN(1),
OPTION(2)
LOW LIKE<f>,
HIGH LIKE<F>,
END OF<rangetab>.
u shud note that the tables created with RANGES have the same structur as selection tables,but they do not have the same functionality.
I hope you find it useful
‎2007 Mar 26 9:18 PM
Hi,
Please check this sample code.
TABLES: LFB1.
RANGES: R_BUKRS FOR LFB1-BUKRS
R_BUKRS-SIGN = 'I'
R_BUKRS-OPTION = 'EQ'
R_BUKRS-LOW = '0001'
APPEND R_BUKRS.
R_BUKRS-SIGN = 'I'
R_BUKRS-OPTION = 'EQ'
R_BUKRS-LOW = '0002'
APPEND R_BUKRS.
R_BUKRS-SIGN = 'I'
R_BUKRS-OPTION = 'EQ'
R_BUKRS-LOW = '0003'
APPEND R_BUKRS.
LOOP AT ITAB WHERE BUKRS IN R_BUKRS.
....
ENDLOOP.
Regards,
Ferry Lianto