Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem for conversion exit using field symbols

Former Member
0 Likes
1,510

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

6 REPLIES 6
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
958

The output parameter of the fm must not be a field symbol.

Read only

0 Likes
958

any alternative to work with conversion exits for different data types.

Regards

Kumar

Read only

Former Member
0 Likes
958

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

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
958

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>.

Read only

Former Member
0 Likes
958

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.

Read only

Former Member
0 Likes
958

solved my self