2007 Feb 13 4:15 PM
Hi dear experts,
I'm working on a SELECT from a system generated table that contains a field (the last one from a total of 10) with a dynamic name (and defined as a FLOAT data type, 16/16).
How can I retrieve (within a subsequent loop against the internal table after the SELECT INTO TABLE) the dynamic name of this field and, in the meantime, convert it in NUMC (with 0 decimal)?
Thanks in advance !
Bye,
Roberto
2007 Feb 13 4:28 PM
Hi
I believe your last field has to be of the same type so a float type and so you can read it by field-symbol into the loop:
LOOP AT ITAB.
ASSIGN COMPONENT 10 OF STRUCTURE ITAB TO <FS_FLOAT>.
IF SY-SUBRC = 0.
MOVE <FS_FLOAT> TO <NUMC>.
ENDIF.
ENDLOOP.
U can try to use the FM GET_COMPONENT_LIST in order to get the component of an internal table.
Max
2007 Feb 13 4:43 PM
Grazie Max...
Now I have the value I want to analyze in <FS_FLOAT> thanks to the statement
ASSIGN COMPONENT 10 OF STRUCTURE ITAB TO <FS_FLOAT>.
you suggested before...
But now, how can I convert the value I have in <FS_FLOAT> in a NUMC (or even in a CHAR) data type field ?
I see on my system a FM "FLTP_CHAR_CONVERSION", but I'm not so sure about its output (I see the same thing...)
Do you have some tip about my requirement ?
Again,
Roberto
2007 Feb 13 5:08 PM
Hi Roberto,
is this something new, a database field with dynamic name? Where can I check this?
Regards,
Clemens
2007 Feb 13 5:12 PM
Hi all,
this FM seems working...
CALL FUNCTION 'FLTP_CHAR_CONVERSION'
EXPORTING
DECIM = 0
INPUT = <FS_FLOAT>
IMPORTING
FLSTR = char.
Thanks...
Bye,
Roberto