Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Error in : SELECT statement with FOR ALL ENTRIES IN

Hi Guys,

I am using SELECT statement with FOR ALL ENTRIES. when I check the syntax, it is saying ENDSELECT is needed for select statement below

I verified internal table it_all_data has 5 unique records.

SELECT abkrs

FROM t549a

INTO it_t549a

FOR ALL ENTRIES IN it_all_data

WHERE abkrs EQ li_info_all-abkrs.

If I use ENDSELECT in above statement then internal table it_t540a is blank.

But this SELECT statments below works fine.

    • SELECT bukrs belnr gjahr buzei mwskz umsks prctr hkont xauto koart

    • dmbtr mwart hwbas aufnr projk shkzg kokrs

    • FROM bseg

    • INTO TABLE it_bseg

    • FOR ALL ENTRIES IN it_bkpf

    • WHERE bukrs EQ it_bkpf-bukrs AND

    • belnr EQ it_bkpf-belnr AND

    • gjahr EQ it_bkpf-gjahr.

Can somebody help to figure it out.

Thanks.

Tags:
Former Member
Former Member replied

Hi,

Modify the code as shown below

SELECT abkrs
FROM t549a
INTO <b>TABLE</b> it_t549a
FOR ALL ENTRIES IN it_all_data
WHERE abkrs EQ li_info_all-abkrs.


You have to use the TABLE addition in the select statement. If you are using SELECT and ENDSELECT then there must be a APPEND statement in between the two to get the data inthe internal table.

Cheers

VJ

Message was edited by:

Vijayendra Rao

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question