‎2007 Aug 08 7:17 AM
Hi experts,
i used a range in my selection screen and used in a select statement . every thing was doing fine but when it (range field)was empty no data is selected by the select statement.
select * from tab_name into table where matnr IN r_matnr .
what should i do...
thanks and regards
abap.
‎2007 Aug 08 7:23 AM
hi,
r_matnr may be empty as because u have declared as a standard data type. check it.
by default if u dont give any data to select options then all records should be displayed for u.
and also tab_name may be empty check that one also.
if helpful reward some points.
with regards,
Suresh Babu
‎2007 Aug 08 7:23 AM
hi,
r_matnr may be empty as because u have declared as a standard data type. check it.
by default if u dont give any data to select options then all records should be displayed for u.
and also tab_name may be empty check that one also.
if helpful reward some points.
with regards,
Suresh Babu
‎2007 Aug 08 7:27 AM
Hi,
if there is no data in the RNAGE, then clear the Header of that range field and clear the SIGN and the OPTIONS in the body of that Range field before that select.
Regards
Sudheer
‎2007 Aug 08 7:32 AM
Hi
i thick u r not entering any data in range check once with data otherwise
use select option and findout the diff....
Reward points for helpful answers,
Kiran.M
‎2007 Aug 08 7:35 AM
hi,
the declaretion of range is :
RANGES r_matnr FOR mara-matnr.
r_matnr-low = p_matnr.
r_matnr-sign = 'I'.
r_matnr-option = 'CP'.
APPEND r_matnr.
and select is :
SELECT vbeln matnr vgbel vgpos lfimg FROM lips
INTO CORRESPONDING FIELDS OF TABLE it_lips FOR ALL ENTRIES IN it_likp
WHERE vbeln EQ it_likp-vbeln and matnr IN r_matnr..
if range field on selection screen is empty then this select fetch no data.
what went wrong and what should i do for this..
thanks and rgds
abaper.
‎2007 Aug 08 7:37 AM
Hi,
declaration:
ranges: r_matnr type mara-matnr.
Filling ranges is similar to select-options.
r_matnr-low = 'I'.
r_matnr-sign = 'EQ'.
r_matnr-low = '000000000000018'.
append r_matnr.
Usage in Selects
select * from mara into table it_mara
where matnr in r_matnr.
Regards
‎2007 Aug 08 7:38 AM
Hello,
Please check this:
Tables : MARA.
select-options : P_matnr for MARA-MATNR.
where in tables you shouls define the table from where you need the materials and use the table-matnr for declaring P_matnr....
in this case,i believe if you leave matnr it empty also then all your material records will be fetched as per code(into table)
Hope it was helpful,
Regards
Byju
‎2007 Aug 08 7:48 AM
Hi all,
actually if i put some material in the selection screen in the range field (e.g. TK001 or TK* ) it will doing fine but problems arise when it is blank.
‎2007 Aug 08 7:59 AM
PARAMETERS: p_matnr TYPE matnr MATCHCODE OBJECT mat0m.
RANGES r_matnr FOR mara-matnr.
r_matnr-low = p_matnr.
r_matnr-sign = 'I'.
r_matnr-option = 'CP'.
APPEND r_matnr.
SELECT vbeln matnr vgbel vgpos lfimg FROM lips
INTO CORRESPONDING FIELDS OF TABLE it_lips FOR ALL ENTRIES IN it_likp
WHERE vbeln EQ it_likp-vbeln and matnr IN r_matnr.
‎2007 Aug 08 8:10 AM
You range should be filled like a select-options, if no data exists, then REFRESH it and don't CLEAR (or clear range[])
REFRESH myrange.
clear myrange.
myrange-sign = 'I'.
myrange-option = 'BT'
myrange-low = 'low value'.
myrange-high = 'high value'.
append myrange.
clear myrange.
myrange-sign = 'I'.
myrange-option = 'EQ'
myrange-low = 'value'.
append myrange.Regards