10-18-2020 7:55 AM
Hi,
Case : in one select query where condition it don't allow to pass multiple for all entries.
In that's case : I used to write like select single in loop i can pass as required fields( From different wa ) in where condtion fields. .
For that any other shortcut or other than multiple query .
Kindly post ur using methods in that case.
10-18-2020 6:30 PM
Hi,
Select all required table with all conditions and store it on relevant Internal table.
loop the main table and read all other values with Read statement instead of select single...
10-19-2020 5:09 AM
Hi,
Thank you for response.
Yes, As you said i feel its works if it contains less data.
10-19-2020 6:39 AM
10-19-2020 7:29 AM
Hi,
Yes i can use joins but there also i can use one for all entries, In my case i have two different internal table one is having material number,
another one sales order number i cant merge also.
10-18-2020 6:59 PM
You say "don't allow to pass multiple for all entries".
I think it's not even needed: why wouldn't you convert those "multiple for all entries" into one "for all entries", by joining the internal tables into one?
10-19-2020 5:18 AM
Hi Sandra,
I am not joining multiple table into one, if join also it won't achieve my requirement.
for my required field i need to pass Different table field in where condition.
10-19-2020 8:49 AM
How many records do you expect in internal tables used for selection, can you consider converting some into range (select-options)
How are your selection internal tables built, could you consider join (or subquery) between the final table(s) and the table used to build those internal tables.
* Replace
SELECT * FROM mara INTO t_mara WHERE...
SELECT * FROM mseg INTO t_final FOR ALL ENTRIES IN t_mara... WHERE ...
* with
SELECT * FROM mseg INTO t_final WHERE ... EXISTS( SELECT * FROM mara WHERE ...
Is it possible to combine internal tables into a single table or do you get a much too big internal table (e.g. thousands x thousands records)
LOOP AT itab1 ASSIGNING <fs1>.
LOOP AT itab2 ASSIGNING <fs2>.
APPEND INITIAL LINE TO itall ASSIGNING <fs>.
<fs>-field1 = <fs1>. " or <fs1>-field1.
<fs>-field2 = <fs2>. " or <fs2>-field2.
ENDLOOP.
ENDLOOP.
SELECT ( fiedlist ) FROM ...
FOR ALL ENTRIES IN itaball
WHERE file1~field1 EQ itabll-field1 AND file2~field2 EQ itaball-field2 ...
in this last case consider breaking one (or more) of the criteria into smaller packages suitable for a range (select-option) within SQL tolerance (SQL statement size)
LOOP AT itab ASSIGNING <fs>.
l_tabix = sy-tabix.
APPEND INITIAL LINE To wrange ASSIGNING <so>.
<so>-sign = 'I'.
<so>-option = 'EQ'.
<so>-low = <fs>. " or <fs>-somefield
IF lines( wrange ) EQ 200 OR l_tabix EQ lines( itab ).
SELECT ( fiedlist ) APPENDING finaltable
FROM ...
FOR ALL ENTRIES IN anotheritab
WHERE somefieeld IN wrange
AND antoherfield EQ anotheritab-anotherfield...
REFRESH wrange.
ENDIF.
ENDLOOP.