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


Please Help Members By Posting Answers For Below Questions

How to handle error in session method? : abap bdc

697


Can i know some of the Realtime tickets that anyone has been faced ?

1665


What does the ‘suppress dialog’ do?

869


What does the insert statement in extract datasets do? : abap modularization

583


Why are insert and append statement used in sap abap?

671






What is the difference between the exits created in M.M and S&D?

1613


What are the function modules used in f4 help?

646


A subroutine can contain nested form and endform blocks. State true or false. : abap modularization

780


What are the page windows? How many main windows will be there in a page window?

562


How to write a bdc – how do you go about it?

663


Is there any BAPI to retrieve list of customers and their sales areas i.e., Cust No, Distr Channel and Division for all the customers.

1589


How to set an Enhancement point for a custom report?

1145


any 1 having notes on SAP-ABAP certification, or even if any 1 could provide the url for getting notes on SAP-ABAP certification, would be appreciated.

1958


Which infotype records can not be deleted ? : abap hr

610


What is read line in abap?

640