when you are using 2 internal table in program, you have
decided to use for all entries statement to retrieve data
but unfortunately there are no records in the first internal
table. What will be the result? (2nd internal table contains
records).
Answer Posted / nitin gautam
If the first itab[] is initial, then it will select all the rows of the table because we are comparing two tables with where condition.
There are two important tips:
1. Declare all primary keys of your database table in your select statement. It ensures that you have no duplicates in you hit list
2. Check that the table used in the "For all entries" statement is not empty. This avoids executing the select statement if no result is expected.
Please refer the following example code:
IF LT_OBJNR[] IS NOT INITIAL.
SELECT
LEDNR
OBJNR
GJAHR
WRTTP
VERSN
KSTAR
HRKFT
VRGNG
VBUND
PARGB
BEKNZ
TWAER
into table LT_WKG
FROM COSP
FOR ALL ENTRIES IN LT_OBJNR
WHERE OBJNR = LT_OBJNR-OBJNR.
ENDIF.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
where do we store all custom programs in SD module?
How do you validate the selection criteria of a report? And how do you display initial
Fallback class
Can we display a list in a pop-up screen other than full-size stacked list?
Module Pool Programming: Events and Table Control handling.
Describe data classes? : abap hr
How to define selection screen?
What are the Control levels in internal tables?
What is the difference between pnp and pnpce? : abap hr
What is meant by hot spots? : abap data dictionary
What is the difference between the function module and a normal abap/4 subroutine?
In which table the material master data is stored?
What is the logo in sap script?
Give 3 scenario of reporting due to which you require reporting help of ABAP consultant?
What is an update type with reference to a match code id? : abap data dictionary