2012 Aug 29 3:47 PM
Hi guys,
I'm trying to do a Select in a ABAP program, this select has values from SAP tables, but I have to put a default value like in SQL.
In SQL:
Select 'VALUE' , TableField from TABLE
But in my ABAP program it doesn't works.
does anyone knows a way to do it?
TKs
Eric Fioraso
2012 Aug 29 4:08 PM
Hi eric,
please explain the question in detail?
2012 Aug 29 4:08 PM
Hi eric,
please explain the question in detail?
2012 Aug 29 4:20 PM
Hi prasanna,
SELECT
LQUA~WERKS
LGORT
LQUA~LGNUM
LQUA~LGTYP
LQUA~LGPLA
LAGP~VERIF
BESTQ
LQUA~MATNR
LENUM
LQUA~CHARG
MCHA~ZUSTD
GESME
MEINS
FROM LQUA INTO MYCUSTOM TABLE
This is my select, so I need to put a static field in this select like below
SELECT
"DATA" * Static field but doesn't works in this way
LQUA~WERKS
LGORT
LQUA~LGNUM
LQUA~LGTYP
LQUA~LGPLA
LAGP~VERIF
BESTQ
LQUA~MATNR
LENUM
LQUA~CHARG
MCHA~ZUSTD
GESME
MEINS
LQUA~LQNUM
MEINS
LQUA~VFDAT
MCH1~HSDAT
SOBKZ
SONUM
FROM LQUA MYCUSTOMTABLE
regards,
Eric
2012 Aug 29 4:49 PM
Not sure if this works with SAP Open SQL. Probably not.
What will certainly work is to loop over the result table and set the required field.
loop at mycustomtable assigning <fs_customtable>.
<fs_customtable>-field1 = 'DATA'.
endloop.
This will be relatively fast.
2012 Aug 29 5:46 PM
Thanks Yuri,
The main question is this program will be a Job and will be executed every 5 minutes, for about 1000 records. I don't if I'll have performance issues with this approach.
Regards
Eric
2012 Aug 29 9:23 PM
Tks a Lot Yuri,
The solution was use a Loop...
Regards
Eric
2012 Aug 30 12:53 PM
Hello Eric,
don't worry. "Loop assigning" is very fast. For your 1000 records it will take maybe a few milliseconds, not more.
Yuri
2012 Aug 30 2:42 PM
Tks Yuri, In fact it's very fast and I don't have performance issues.
Regards
Eric