cancel
Showing results for 
Search instead for 
Did you mean: 

Select column with default value

Former Member
0 Kudos

Hi,

I can write query like this in SQL.

SELECT VBELN, '1' AS Flag FROM VBAK WHERE.......

How can i do this in ABAP.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Please search SDN before posting such questions.

There are 2 ways to write select query:

1. Select single record

SELECT SINGLE * FROM VBAK INTO <structure name> WHERE VBELN = '1'.

2. Select multiple records

SELECT * FROM VBAK INTO TABLE <table name> WHERE VBELN = '1'.

-Manish

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi sathya

if you want to select data where vbeln  = 1 then simply write

select * from vbak where vbeln = '1' and ...... into corresponding fields of table it.

where it is the name of internal table with header line of the same type as that of vbak.

this is a basic questions so try and search before posting for better scn help and also post such discussions under abap development  .cheers !!

regards

vaibhav

Former Member
0 Kudos

Just like in SQL.

select <field1> <field2> ... into table itab from dtab  "VBAK in this case

                                                                     where flag = '1'.

or

select  single <field1> <field2> ... into wa from dtab  "VBAK in this case

                                                                       where flag = '1'.