05-20-2022 11:40 AM
Hi everyone,
Maybe it is a begginer question, please be kind! 🙂
I am making a simple query in SAPB1 version 10, and I would like to modify the name of one column. I know that I could use the method 'AS' to create an alias for the column, but that alias is permanent, if I needed to change it I would have to edit the code every time.
So I would like to use an specific value from another table for the column name.
Is it possible? If not, how can I use dynamic column names instead?
Here an example of my original code for your reference:
SELECT
T0.Atrib_1 as "ITEM COLOR"
FROM ATRIBUTES T0
WHERE T0.ITEMCODE = 'MP1001'
Here what I've tried unsuccessfully:
SELECT
T0.Atrib_1 as (SELECT T1.NAME FROM ATRIBUTESLIST T1 WHERE T1.CODE = 'ATR001') -- it should return "ITEM COLOR"
FROM ATRIBUTES T0
WHERE T0.ITEMCODE = 'MP1001'
Thanks in advance!!