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

Conversion routine not working

former_member355261
Participant
0 Likes
2,490

Hi,

I created a custom Z table with a field ID attached to a custom Z domain (CHAR10).

I used the conversion routine ALPHA along with the domain.

In a program I'm inserting data into the table like this:

INSERT ZTABLE FROM GT_TABLE.

The problem is that the ID is inserted without being converted (1 and not 0000000001)

I would like to know why il's not being converted and how to solve the problem.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,234

Conversion routines only happen automatically where selection screens and writes are involved.

The _input function is called when screen fields are passed to the program,  and the _output function is called when a variable is written (either to a report or to another field).  In all other cases the conversion routines must be called explicitly.

So,  when you populate your GT_Table you must explicitly call the _input version of the conversion exit with the output going to the relevant ID field.

If however,  you are already using a parameter to enter your ID value,  post the domain definition here and I'll look at it.

Regards

Rich

2 REPLIES 2
Read only

Former Member
0 Likes
1,235

Conversion routines only happen automatically where selection screens and writes are involved.

The _input function is called when screen fields are passed to the program,  and the _output function is called when a variable is written (either to a report or to another field).  In all other cases the conversion routines must be called explicitly.

So,  when you populate your GT_Table you must explicitly call the _input version of the conversion exit with the output going to the relevant ID field.

If however,  you are already using a parameter to enter your ID value,  post the domain definition here and I'll look at it.

Regards

Rich

Read only

Domi
Active Contributor
0 Likes
1,234

Hi

You must convert the value befor appending to GT_TABLE (or loop over GT_TABLE befor the INSERT - but then use a FIELD-SYMBOLS instead a workarea)

eg with string expressions

wa_table-id = |{ wa_table-id ALPHA = IN } |.

or with FM

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

   EXPORTING

     input  = wa_table-id

   IMPORTING

     output = wa_table-id.


Regards