06-23-2009 12:32 PM
Hi,
I need to capture all entries coming in the range of select option into one internal table.
How to do get that?
For E.g
select-options: matnr for mara-matnr.(select option)
IF I enter G0100013507892 as lower value of matnr and G0100014873947 as higher value
and if there are 10,000 materials in the above range, then I want to capture all theses 10000 materails in one internal table. How to do that?
Regards,
Mrunal
06-23-2009 12:34 PM
Hi,
Just SELECT the materials from MARA using the select-options by matching the MATNR field.
Regards,
Ankur Parab
06-23-2009 12:35 PM
select matnr from mara into corresponding fields of itab where matnr in so_matnr.
This shd give u all the materials which are a part of selection range u have specified from low to high.
06-23-2009 12:36 PM
'define ranges
r_matnr for mara-matnr.
'fill the range
r_matnr-low = s_matnr-low.
r_matnr-high = s_matnr-high.
r_matnr-sign = 'I'.
r_matnr-option = 'BT'.
'Now select
select * from MARA into table IT_MARA
where matnr IN R_MATNR.
Hope this helps.
06-23-2009 12:37 PM
select-options: s_matnr for mara-matnr.(select option)
SELECT matnr FROM MARA into table i_mara
where matnr in s_matnr.
Hope it helps......
06-23-2009 12:42 PM
select-options: s_matnr for mara-matnr.(select option)
SELECT matnr FROM MARA into table i_mara
where matnr in s_matnr.
but If I add like above code, then I can get only those materails which are exist in mara,(valid materials)
I need to find the invalid materials which are not exist in MARA but entered on selection screen.
Regards,
Mrunal
06-24-2009 6:07 AM
Hello Mrunal Mhaskar ,
What i understand you can do one thing go in debug mode
Try this code : -
LOOP AT s_matnr_ex.
IF s_matnr_ex-low IS NOT INITIAL.
i_matnr-matnr = s_matnr_ex-low.
i_matnr-option = s_matnr_ex-option.
APPEND i_matnr.
CLEAR : i_matnr.
ENDIF.
ENDLOOP.
LOOP AT s_matnr_ex.
IF s_matnr_ex-high IS NOT INITIAL.
i_matnr-matnr = s_matnr_ex-high.
i_matnr-option = s_matnr_ex-option.
APPEND i_matnr.
CLEAR : i_matnr.
ENDIF.
ENDLOOP.
In the i_matnr table high and low values are there.
Regards,
Vandana.
06-23-2009 12:45 PM
Hi .
use
SELECT matnr FROM MARA into table i_mara
where matnr in s_matnr.
Hope this works.
Please let me know if you still have any issues on this.
Thanks and regards,
Rajeshwar.
02-10-2014 6:29 AM
Get data from the database using select options.
now loop over the range table. Prepare a list respecting the Option value. 'BT', 'EQ', ...... We can start incrementing the LOW value until the High value.
Loop over the list and read the records that are already drawn from the database. We have the invalid records.
Regards,