01-14-2009 12:29 PM
Hi All,
I have created IDOC conversion rules for customer master data under segment E1KNA1M in BD79.
One of the conversion rule is to add a "P" in front of the customer numbers in the target client. For example - source client: cust num = 1234567, target client: cust num = P1234567
How do I add this conversion rule? Which rule type should I use?
Appreciate any help!
Thanks,
Charlene
01-15-2009 12:09 PM
Hi Charlene,
You can create a new conversion routine and associate it to the field kunnr.
For example, to create conversion routine ZEDG, create the following functions:
FUNCTION conversion_exit_zedga_input.
*"----------------------------------------------------------------------
*"*"Interface local:
*" IMPORTING
*" REFERENCE(INPUT) TYPE KUNNR
*" EXPORTING
*" REFERENCE(OUTPUT) TYPE KUNNR
*"----------------------------------------------------------------------
DATA: l_input TYPE kunnr.
l_input = input.
replace 'P' in l_input WITH '0'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = l_input
IMPORTING
output = output.
ENDFUNCTION.
FUNCTION conversion_exit_zedga_output.
*"----------------------------------------------------------------------
*"*"Interface local:
*" IMPORTING
*" REFERENCE(INPUT) TYPE KUNNR
*" EXPORTING
*" REFERENCE(OUTPUT) TYPE KUNNR
*"----------------------------------------------------------------------
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = input
IMPORTING
output = output.
CONCATENATE 'P' output INTO output.
ENDFUNCTION.
01-15-2009 2:17 AM
01-15-2009 12:09 PM
Hi Charlene,
You can create a new conversion routine and associate it to the field kunnr.
For example, to create conversion routine ZEDG, create the following functions:
FUNCTION conversion_exit_zedga_input.
*"----------------------------------------------------------------------
*"*"Interface local:
*" IMPORTING
*" REFERENCE(INPUT) TYPE KUNNR
*" EXPORTING
*" REFERENCE(OUTPUT) TYPE KUNNR
*"----------------------------------------------------------------------
DATA: l_input TYPE kunnr.
l_input = input.
replace 'P' in l_input WITH '0'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = l_input
IMPORTING
output = output.
ENDFUNCTION.
FUNCTION conversion_exit_zedga_output.
*"----------------------------------------------------------------------
*"*"Interface local:
*" IMPORTING
*" REFERENCE(INPUT) TYPE KUNNR
*" EXPORTING
*" REFERENCE(OUTPUT) TYPE KUNNR
*"----------------------------------------------------------------------
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = input
IMPORTING
output = output.
CONCATENATE 'P' output INTO output.
ENDFUNCTION.
01-15-2009 12:22 PM
oh, parameters input and output should not have a type, they should be generic.