‎2015 Dec 31 11:01 AM
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.
‎2015 Dec 31 11:13 AM
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
‎2015 Dec 31 11:13 AM
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
‎2016 Jan 03 6:39 PM
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