Skip to Content

Problem with "select upto 20 rows"

Hii,

I'm writing following query in my RFC =>

SELECT UPTO 20 ROWS

FROM TABLE_1

INTO CORRESPONDING FIELDS OF TABLE g_it_table2

FOR ALL ENTRIES IN g_it_table_1

WHERE salesoffice = g_it_table_1-objid

AND data1_bp_tn IN g_r_phase.

It is giving me following compilation error:-

" Unknown column name UPTO. not determined until runtime, you can not specify field list

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Jan 30, 2008 at 10:51 AM

    The UP TO is in the FROM clause part of the statement

    SELECT * 
        INTO CORRESPONDING FIELDS OF TABLE g_it_table2
        FROM TABLE_1 UP TO 20 ROWS.
        FOR ALL ENTRIES IN g_it_table_1
          WHERE salesoffice = g_it_table_1-objid AND data1_bp_tn IN g_r_phase.

    .

    Look abap online help or [Specifying Database Tables|http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb39c4358411d1829f0000e829fbfe/frameset.htm].

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 10:49 AM

    Hi,

    i dont server to check

    Use the below codeif not works shuffle the upto 20 rows

    SELECT * FROM TABLE_1

    INTO CORRESPONDING FIELDS OF TABLE g_it_table2

    FOR ALL ENTRIES IN g_it_table_1

    WHERE salesoffice = g_it_table_1-objid

    AND data1_bp_tn IN g_r_phase

    UPTO 20 ROWS.

    Regards

    Shiva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 10:50 AM

    Hi Amey,

    I guess you have not specified your field names.

    Regards

    Sourabh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 10:51 AM

    Hi,

    You need to mention selectable fields from the table in the select statement or atleast '*'.

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 10:51 AM

    Hi,

    write like this.

    SELECT

    FROM TABLE_1

    INTO CORRESPONDING FIELDS OF TABLE g_it_table2 UP TO 20 ROWS

    FOR ALL ENTRIES IN g_it_table_1

    WHERE salesoffice = g_it_table_1-objid

    AND data1_bp_tn IN g_r_phase.

    rgds,

    bharat.

    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.