Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

select single

Former Member
0 Kudos

hi,

i wont to now what is doing this select because it didn't have into




   SELECT SINGLE * 
   FROM tadir
    WHERE pgmid = 'R3TR'
     AND object = 'PROG'
     AND obj_name = tstc-pgmna.

Regards

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

It will select the data from the TADIR into TADIR workarea ... you can access the data like TADIR-PGMID.

Regards,

Naimesh Patel

6 REPLIES 6

Former Member
0 Kudos

This select statement places the d/b table entry in the TABLES work area declared using the <b>TABLES: TADIR</b> statement

naimesh_patel
Active Contributor
0 Kudos

It will select the data from the TADIR into TADIR workarea ... you can access the data like TADIR-PGMID.

Regards,

Naimesh Patel

Former Member
0 Kudos

Hi,

Just check out there might be a endselect statement, in between select & endselect statement there might be some statement getting executed to move the data to internal table.

<b><REMOVED BY MODERATOR></b>

Satish

Message was edited by:

Alvaro Tejada Galindo

harimanjesh_an
Active Participant
0 Kudos

hi ricardo,

This type of SELECT statements are helpful in validations.

Example consider u have parameter or select-options statement for WERKS which takes input from user. In this case, u want to validate the input value. In such cases, we can use SELECT statement without INTO clause......

Example.:

PARAMETERS : p_werks TYPE marc-werks.

SELECT SINGLE *

FROM t001w

WHERE werks = p_werks.

IF sy-subrc <> 0.

MESSAGE 'Invalid Plant' TYPE 'I'.

ENDIF.

Like this, we can validate user input for plant.

<b><REMOVED BY MODERATOR></b>

Harimanjesh AN

Message was edited by:

Alvaro Tejada Galindo

0 Kudos

Hi,

SELECT SINGLE returns just one row from a table and store it in a working area, so thats why you don't need an ENDSELECT...

Now, if you have a definition like

TABLES: tadir.

It define a waorking area for table 'tadir' with the same name... and that's why you don't need an INTO clause in your SELECT statement.

cya,

dimas.

Former Member
0 Kudos

It defines a Header area internally (not Work Area) and you can make use of TADIR-<field1> to acces the fields.