‎2007 Jun 01 2:50 PM
I am selecting from a database table a field of type char and assigning
it to a data object of abap type c.
I want to process the data object further, but as an abap type n since
the function I am calling only operates on this data type.
How can I do this?
‎2007 Jun 01 3:07 PM
‎2007 Jun 01 3:00 PM
Hello,
Can u elaborate so that we can actually help u out ?
Regards,
Deepu.K
‎2007 Jun 01 3:08 PM
data: charvar type c.
data: numvar type n.
move charvar to numvar.
Message was edited by:
A. de Smidt
‎2007 Jun 01 3:05 PM
You can move it type N ,but when you save the data into database table,please convert into original format after calculation.
‎2007 Jun 01 3:05 PM
Hi
Use the function module CONVERSION_EXIT_ALPHA_OUTPUT.
Regards
Haritha.
‎2007 Jun 01 3:06 PM
hi
For this u can use the FM CONVERSION_EXIT_ALPHA_INPUT.
In this FM , give ur source field as exporting and target field as imporitng.
Then u may get the required solution.
regards
sreeni
‎2007 Jun 01 3:07 PM
‎2007 Jun 01 3:08 PM
Sure. The data is processed further in preparing an ALV grid. I want
to set various attributes of the displayed columns, including hiding
any leading zeroes. The function below (set_leading_zero) requires
that the column (in my case the data object referred to above) be
of abap type n.
DATA: salv_column TYPE REF TO cl_salv_column.
TRY.
MOVE salv_columns->get_column( name ) TO salv_column.
salv_column->set_leading_zero( if_salv_c_bool_sap=>false ).
salv_column->set_alignment( alignment ).
salv_column->set_long_text( long_text ).
salv_column->set_tooltip( tooltip ).