2007 Aug 10 8:14 AM
Hi!
I need to create my own Conversion Exit.
I have created FM via se37 and named it CONVERSION_EXIT_ZVAKEY_INPUT.
What else is missing in the process of creating Conversion Exit and how to do it?
One more thing is that SD guy can not see it and SAP does not allow to assign this FM to SD function group, it allows to assign only to custom function group.
Will reward,
M.
2007 Aug 12 7:45 AM
Hi,
1,
SE11--> select your domain --> change mode --> in the convertion routine field enter value ZVAKEY and activate the domain
2, customer function module can only be assigned to customer function group only .
aRs
2007 Aug 10 8:36 AM
2007 Aug 10 8:47 AM
Interesting question as I've never needed to build my own... however, firstly I think your conversion exit name must be like:
CONVERSION_EXIT_xxxxx_INPUT
CONVERSION_EXIT_xxxxx_OUTPUT
i.e. 5 characters long for the conversion routine specific part, not 6... this is because the DD01D-CONVEXIT field is only 5 bytes long. Then in the domain of the field(s) you want to use the conversion exit for you specify the "xxxxx" name there. Of course the parameters for the conversion exits must match the usual "input / output" convention too.
2007 Aug 10 8:55 AM
I just created one which seemed to work OK - I tested it with the following:
report zlocal_jc_conv_exit_zjc99.
start-of-selection.
perform logic2.
*&---------------------------------------------------------------------*
*& Form logic2
*&---------------------------------------------------------------------*
form logic2.
data:
l_text(20) type c.
l_text = 'hello world'.
write: / l_text using edit mask '==ZJC99'.
endform. "logic2
the result was "JChello world" as the conversion exit output had:
function conversion_exit_zjc99_output.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"----------------------------------------------------------------------
output = input.
concatenate 'JC' output into output.
endfunction.
2007 Aug 10 9:03 AM
thanks for help,
but I do not understand the following "in the domain of the field(s)..."
What is the role of the domain here and what exactly I have to do with it?
should I go to se11 for doing something with a domain?
PS: my exit has to change some numbers in a string, so just a few lines of code.
M.
2007 Aug 10 9:06 AM
You don't have to add it to a domain, as my sample code demonstrated with "using edit mask '==ZJC99'."... but this is often the way they are used... have a look in SE11 at BELNR for example and you will see "ALPHA" there... this is the trick that SAP uses to automagically remove and replace leading zeros on FI document numbers. Domain PARVW has another interesting one that does a language translation too from the DB value to the screen value.
2007 Aug 10 9:43 AM
lets say I will assign my conver. routine to domain VAKEY but is it a mandatory thing to create both
CONVERSION_EXIT_xxxxx_INPUT
CONVERSION_EXIT_xxxxx_OUTPUT
in my case I need just INPUT FM?
one more question - SD guy can not see this routine, probably need to assign it somehow, where it is defined?
M.
2007 Aug 12 1:59 AM
I would create both the input and output, just in case... even if you make the logic in the other one just contain "output = input". But where is the SD trying to hook into the conversion routine?
2007 Aug 12 7:30 AM
yes, after all I have created both, just in case.
SD guy tries to search for it by entering conversion rule in tcode /nbd79 and pressing F6, after choosing any of fields and pressing F4 in the conversion routine input window.
M.
2007 Aug 12 12:14 PM
A Conversion Rule is not the same thing as a Conversion Exit.
Conversion Exit is used for changing data format between screen / program / database table.
Conversion rules used in BD79 are created in transaction BD62. These are used in IDOC processing - see SPRO path SAP Netweaver>Application Server> IDoc Interface/Application Link Enabling (ALE)>Modelling and Implementing Business Processes>Converting Data between Sender and Receiver-->Create Rule.
There is documentation attached to the SPRO Node.
Within a field in BD79 you can select conversion exits to be part of the conversion - "Special Conversion Rule". When I create a Z conversion exit function it is available in the drop down list immediately for use. I note that the drop down help on this field ignores what you type in the field - type Z* and press F4 you still get a list starting at A - perhaps the maximum number of hits in F4 help is stopping you from seeing the Z* values?
Andrew
Message was edited by:
Andrew Marshall
2007 Aug 10 8:49 AM
HI,
You need to assign this Converstion exit at Domain levl, so if that is SAP standard Domain then you need to change that Domain for this you need the access key,
Regards
Sudheer
2007 Aug 12 7:45 AM
Hi,
1,
SE11--> select your domain --> change mode --> in the convertion routine field enter value ZVAKEY and activate the domain
2, customer function module can only be assigned to customer function group only .
aRs