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: 

give me the answer with reason

Former Member
0 Kudos

If this code results in an error, the remedy is:

SELECT fld1 fld2 FROM tab1 WHERE fld3 = pfld3.

WRITE: /1 tab1-fld1, tab1-fld2.

ENDSELECT.

A: Add a SY-SUBRC check.

B: Change the WHERE clause to use fld1 or fld2.

C: Remove the /1 from the WRITE statement.

😧 Add INTO (tab1-fld1, tab1-fld2).

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Prakash,

Option D is the only reason you would get a syntax error. You have to move the data into a target field.

Cheers.

9 REPLIES 9

Former Member
0 Kudos

Hi Prakash,

Option D is the only reason you would get a syntax error. You have to move the data into a target field.

Cheers.

Former Member
0 Kudos

Hi

Here you can D option to move the data to work area of ITAB

the system will check this statement only

Regards

Shiva

Former Member
0 Kudos

Hi,

Option D, becz the selected data should be place in an internal table or work area or stored some where .

Regards,

kavitha.

Former Member
0 Kudos

Hi,

You can also use a declaration

TABLES :tab1.

and then it should not give you the error.

Regards,

Himanshu

Former Member
0 Kudos

thanx to all of u , but i have one more querry , how its possible to select from TAB1 and then again INTO internal table TAB1(both are same).

0 Kudos

Hi

You can use the TAB1 which works as work area but you need to delcare as tables TAB1

then only it works

regards

Shiva

0 Kudos

Hi,

You can at program level you can define a internal table of the same name there are different function related to internal tables and tables there would be some statements that would be used for tables and some that would be used for Internal tables the system would be able to differentiate between the two.

Regards,

Himanshu

0 Kudos

Hi Prakash,

You internal table would have to have a different name e.g. itab or something and then you move the multiple records using INTO TABLE itab.

Otherwise, if you are getting a single record, then you can use the same database table name as a work area by first declaring the table with

TABLES: tab1.

Then move the field into TAB1-<field>

Cheers

Former Member
0 Kudos

in the program at the global declaraions add Tables:TAB1. and due to this the query will run fine. Beacuse tables dclaration makes the defalult work area availabale to put the selected fileds into.