Application Development and Automation 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: 
Read only

Select Statement

Former Member
0 Likes
850

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
Read only

Former Member
0 Likes
801

Hi,

Check the below code,...

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

Thanks!

Brunda

Read only

Former Member
0 Likes
801

Hi,

Try like this...


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

Read only

GauthamV
Active Contributor
0 Likes
801

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.

Read only

Former Member
0 Likes
801

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

Read only

Former Member
0 Likes
801

Hi,

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

Read only

Former Member
0 Likes
801

Hi,


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

Regards

Arun

Read only

0 Likes
801

Thanks to all.

Read only

Former Member
0 Likes
801

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.