Skip to Content
author's profile photo Former Member
Former Member

Select Single

Hi Experts,

I have to make a select single into an internal table.

Please suggest how to do it and tell the syntax

Thanks in advance!!! 😊

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2008 at 06:35 AM

    SELECT SINGLE FIELDNAME FROM TABLENAME INTO VARIABLE where Fieldname = conditions

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2008 at 05:02 AM

    Select single <fieldname> from < tablename> into <a_variable> where <condition>.

    http://www.sapdb.org/7.4/htmhelp/40/1311fd2fa511d3a98100a0c9449261/content.htm

    Rgards,

    Midhun Abraham

    Edited by: Midhun Abraham on Oct 20, 2008 7:04 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 20, 2008 at 05:34 AM

    Hi ,

    You cannot use internal table in select single.Insted use work area because select single at a time gets/fetches 1 record.

    Syntax for using work area.....

    REPORT zsample.

    TYPES : BEGIN OF ty_vbak,

    vbeln TYPE vbeln_va,

    erdat TYPE erdat,

    END OF ty_vbak.

    DATA : it_vbak TYPE TABLE OF ty_vbak,

    wa_vbak LIKE LINE OF it_vbak.

    SELECT-OPTIONS : s_vbeln FOR wa_vbak-vbeln.

    SELECT SINGLE vbeln erdat FROM vbak

    INTO it_vbak

    WHERE vbeln IN s_vbeln.

    write:/ 'ssssss'.

    Hope this helps you.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2008 at 05:39 AM

    Hi Midhuin,,

    I need to implement Select single instead of the following Select *....

    SELECT * INTO TABLE< itab> FROM <DB Table> WHERE key= <> AND

    key = <>

    Please Help.

    Thanks and Regards,

    Sahil

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2008 at 05:48 AM

    Hi sahil,

    To know the syntax of any command use the F1 help in abap editor..

    -Goodluck,

    Bhumika

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2008 at 06:06 AM

    Hi Sahil,

    For using select single, try this :

    DATA: l_v_mtart TYPE mtart.

    SELECT SINGLE mtart

    FROM t134

    INTO l_v_mtart

    WHERE mtart IN s_mtart.

    Hope it helped you.

    Regrads,,

    NIkita

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 20, 2008 at 06:23 AM

    Hi

    Use Addition UP TO 1 ROWS in SELECT.

    DATA: itab TYPE TABLE OF mara.
    
    SELECT MATNR FROM mara INTO TABLE itab UP TO 1 ROWS.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2008 at 06:36 AM

    Hi Experts,

    Thanks a lot for your support.

    Its Resolved.....

    Best Regards,

    Sahil

    Edited by: Sahil Mehta on Oct 20, 2008 8:37 AM

    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.