‎2020 Jul 03 8:45 AM
I wrote a SQL like below..
SELECT substring( cosp_bak~objnr,7,10 ),
cosp_bak~kstar,
cosp_bak~wkg001,cosp_bak~wkg002,cosp_bak~wkg003,cosp_bak~wkg004,cosp_bak~wkg005,cosp_bak~wkg006,cosp_bak~wkg007,cosp_bak~wkg008,cosp_bak~wkg009,
cosp_bak~wkg010,cosp_bak~wkg011,cosp_bak~wkg012
FROM cosp_bak
WHERE
cosp_bak~wrttp = '01'
and cosp_bak~vrgng = 'RKP1'
AND cosp_bak~gjahr = @s_gjahr
AND cosp_bak~objnr in @t_objnr
INTO TABLE @DATA(gt_data_p).
And it has error below. It looks like the error is caused by the substring function. then How to add alias name for it? Thanks.
inline declarations are used, all expressions in the projection list must have an alias name.
‎2020 Jul 03 8:47 AM
Hello loki_luo15
SELECT substring( cosp_bak~objnr,7,10 ) AS DESIRED_COLUMN_NAME,
Kind regards,‎2020 Jul 03 8:47 AM
Hello loki_luo15
SELECT substring( cosp_bak~objnr,7,10 ) AS DESIRED_COLUMN_NAME,
Kind regards,‎2020 Jul 03 10:20 AM
Hello loki_luo15
Whenever you are using any functions with Select in the selection of fields you need to provide an alias name for the field. Same you have to do here after the substring function.
Regards,
Amit