Skip to Content

Cannot fetch data from Select Query

Hi,

I am developing a simple BSP application in which I am using a simple select query like:

DATA: gt_zemp TYPE TABLE OF zemp_detail.
FREE: gt_zemp[].
SELECT * FROM zemp_detail INTO TABLE gt_zemp.

The table ZEMP_DETAIL has 3 entries but I am still getting SY-SUBRC = 4 and the GT_ZEMP is not getting filled. But when I am executing the same query in a demo report GT_ZEMP is getting filled.

The table ZEMP_DETAIL has TMG and and there is no restriction on this table.

Can anyone please help me where I am doing wrong?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 26, 2017 at 10:48 AM
    -1

    Maybe you have run the program from the wrong client (mandant)?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 26, 2017 at 06:17 AM
    -3

    Hi Subhajit,

    DATA: gt_zemp TYPETABLEOF zemp_detail.
    
    FREE: gt_zemp[].
    
    SELECT*FROM zemp_detail INTOTABLE gt_zemp.

    instead of Free write refresh.

    i.e REFRESH : gt_zemp[].

    Regards,

    Bhagaban.P

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.