‎2008 Jan 27 4:43 AM
CONCATENATE 'WTG0' LV_MON INTO LV_FNAME.
ASSIGN (LV_FNAME) TO <FS>.
SELECT SINGLE <FS> FROM COSP INTO LV_SAPRST
WHERE OBJNR = LV_OBJ AND GJAHR = LV_YEAR AND WRTTP = '4' AND KSTAR
= GT_INOUT-SAKNR
Error message :
Unknown column name "<FS>" . field list. . field list.
field list.
actually , if i use if command, i can do, but i want to use simple
code by fieldsymbol.
‎2008 Jan 27 9:07 AM
I think you are mixing a few things up here. The field symbol <fs> is
now pointing at a field (that does not exist), for example WTG001.
I think the statement should be: SELECT SINGLE (lv_fname) FROM COSP INTO
<fs>
(lv_fname) is called a dynamic token and replaced at runtime by the
fieldname .
Actually, I also think the field-symbol assignment doesn't work either.
Just check the sy-subrc after the assign statement! You also need the
COSP- part of the name.
Have a look at this example:
DATA: wa_t001
TYPE t001.
DATA: tp_fieldlist TYPE string VALUE 'BUKRS'.
DATA: tp_fieldname TYPE string VALUE 'WA_T001-BUKRS'.
FIELD-SYMBOLS: <fs> TYPE ANY.
ASSIGN (tp_fieldname) TO <fs>.
IF <fs> IS ASSIGNED.
SELECT SINGLE (tp_fieldlist) FROM t001 INTO <fs>.
WRITE <fs>.
ENDIF.
Just check help on SELECT statement.
‎2008 Jan 27 8:41 AM
Sashi
Try using the addition NO-GAPS (or NO GAPS) in the Concatenate statement.
Reward if it helps.
Regards,
Aabhas
‎2008 Jan 27 9:07 AM
I think you are mixing a few things up here. The field symbol <fs> is
now pointing at a field (that does not exist), for example WTG001.
I think the statement should be: SELECT SINGLE (lv_fname) FROM COSP INTO
<fs>
(lv_fname) is called a dynamic token and replaced at runtime by the
fieldname .
Actually, I also think the field-symbol assignment doesn't work either.
Just check the sy-subrc after the assign statement! You also need the
COSP- part of the name.
Have a look at this example:
DATA: wa_t001
TYPE t001.
DATA: tp_fieldlist TYPE string VALUE 'BUKRS'.
DATA: tp_fieldname TYPE string VALUE 'WA_T001-BUKRS'.
FIELD-SYMBOLS: <fs> TYPE ANY.
ASSIGN (tp_fieldname) TO <fs>.
IF <fs> IS ASSIGNED.
SELECT SINGLE (tp_fieldlist) FROM t001 INTO <fs>.
WRITE <fs>.
ENDIF.
Just check help on SELECT statement.