‎2010 Jan 25 11:16 AM
Hi,
I have to create a varible dynamically and i need to pass that varible for conversion
ie : in my internal table i have matnr , vbeln , kunnr like this it can be any field.
now i need to do a conversion for leading zeros.
but when i pass the <value > to conversion exit it is giving me a runtime error..
for example iam using field kunnr and in the importing parameter if i pass v_kunnr it is giving me result , but if i pass <value> it is giving me runtime error.
PARAMETERS :
Field_name TYPE fname.
DATA:
wa_ref TYPE REF TO data.
FIELD-SYMBOLS: <level> TYPE ANY.
CREATE DATA wa_ref TYPE (tab_name).
ASSIGN wa_ref->* TO <level>.
ASSIGN '1000' TO <level> .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = <level>
IMPORTING
output = <level>.
.
How can i correct it
Regards
Kumar
‎2010 Jan 25 11:31 AM
‎2010 Jan 25 11:34 AM
any alternative to work with conversion exits for different data types.
Regards
Kumar
‎2010 Jan 25 11:36 AM
Hi,
The dump appears because the field symbol assignment gets changed.
Do something like this.
data : tab_name type fieldname.
DATA:
wa_ref TYPE REF TO data.
data : lv_kunnr type kunnr.
FIELD-SYMBOLS: <level> TYPE ANY.
tab_name = 'KUNNR'.
CREATE DATA wa_ref TYPE (tab_name).
ASSIGN wa_ref->* TO <level>.
lv_kunnr = '1000'. "The field which contains the data ( can be customer or vendor or document etc)
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_kunnr
IMPORTING
output = <level>.
Regards,
Ankur Parab
‎2010 Jan 25 11:39 AM
Dont assign a constant to field symbol.
You cannot change a constant value.
Instead do it like..
data:field1 type char10 value '1000'.
FIELD-SYMBOLS: <level> TYPE ANY.
ASSIGN field1 TO <level> .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = <level>
IMPORTING
output = <level>.
‎2010 Jan 25 11:59 AM
Hi Kumar I have also got the same error.
actually in function module conversion_exit_alpha input .. in eporting parameters whatever value you are giving it should be assigned with data element of tabname-fldname.
So you can go ahead with this code.
*&-- Convert Numeric data with zero.
concatenate i_table '-' i_fldname into lv_dtyp.
create data value type (lv_dtyp).
assign value->* to <fs> .
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = i_fld_value
importing
output = <fs>.
here i_table is the table name and in case of you it is KNA1 and i_fieldname is Kunnr.
this will work for sure.
Let me know if you have any concern.
‎2010 Mar 01 8:26 PM