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 Statement

Former Member
0 Kudos

HI All,

I want to get three field values from the Table.

Select single Field1 fields from X_Table into X_Field1 X_field2 where Field3 = 'YYYYYY'.

I tried to get two field values Field1 and Field2 to the X_Field1 X_field2(Variables)

I am getting error.

how to use the syntex.

Thanks in advance.

Bye

sha

8 REPLIES 8

Former Member
0 Kudos

Hi,

Check the below code,...

Select single Field1 Field2 from X_Table into (X_Field1, X_field2) where Field3 = 'YYYYYY'

Thanks!

Brunda

Former Member
0 Kudos

Hi,

Try like this...


    SELECT SINGLE <fld1>
                  <fld2>
                  FROM <table>
                  INTO (<fld1>,<fld2>)      "<-----variables
                  WHERE <conditions>.

GauthamV
Active Contributor
0 Kudos

Plz SEARCH in SCN before posting basic questions.

You can get such information from SAP help also.

Use something like this.


tables : e070,e071.

SELECT SINGLE trkorr
                 trstatus
                 as4user
                 as4date
                 as4time
                   FROM e070
                   INTO
                   (e070-trkorr,
                 e070-trstatus,
                 e070-as4user,
                 e070-as4date,
                 e070-as4time)
                   WHERE trkorr = e070-trkorr.

Former Member
0 Kudos

Hi,

You have to declare 3 variables of those types in which you

want your selected fields value to come like:



data: v_field1(15),
        v_field2(15),
        v_field2(15).

Then give your select query like:

SELECT SINGLE FIELD1 FIELD2 FIELD3 FROM TABLE NAME INTO 
(V_FIELD1) (V_FIELD2) (V_FIELD3) WHERE YOUR CONDITION.

Hope it helps

Regards

Mansi

Former Member
0 Kudos

Hi,

can you tell more specific, that is table name and field name so that i can help u.

Former Member
0 Kudos

Hi,


select  field1 field2 from X_Table into (X_Field1, X_Field2) where Field3 = 'YYYYYY'

Regards

Arun

0 Kudos

Thanks to all.

Former Member
0 Kudos

hi do like this,

SELECT SINGLE field1, field2 FROM table

INTO (<field1>,<field2>)

WHERE condition = yyyyyy.

please provide ur code and error. so that wecan help u more.

if resolved plz close the thread.