‎2012 Oct 31 1:07 PM
Hi all,
I want to write a select query in which i select data from standard table to my internal table, while filling my internal table i want one column in my internal table to be filled though hard code.
For e.g. if my itab has 5column the 4 column will be filled data from the standard table and the 5th column should have e.g "X" data.
Kindly advice me how to write a query.
Regards,
shegar
‎2012 Oct 31 1:11 PM
Loop the internal table and modify the table with the required hard coded value
‎2012 Oct 31 1:17 PM
Thanks Ganti,
I thought there would be something in select query.
Anyway thanks for your reply.
Rohini
‎2012 Oct 31 1:20 PM
AFAIK, OPEN-SQL SELECT statement is not able to fulfill your requirement, so SELECT first data into your internal table and then update the internal table, either with a MODIFY WHERE or a LOOP AT ASSIGNING statements.
As some database SQL allow the use of constants in the resulting columns, you could then consider using a native sql syntax, but there is not much interest in doing so.
Regards,
Raymond
‎2012 Oct 31 2:01 PM
Rohit,
There is a 2 step process in this, first select all the data without that column being populated of any values. In the second step, you need to do following
wa_itab-field4 = 'xxxxxx'.
Modify itab from wa_itab transporting field4 where field4 IS INITIAL.
This will update all the fields with the hard coded values. You will not have to loop.
Regards,
Hardik Mehta