‎2006 Jul 19 4:35 PM
hi,
does anybody know about a reasonable documentation about conversion exits to data element conversions needed to be done before data is stored to the database?
cheers
ana
‎2006 Jul 19 4:44 PM
Hi Ana,
Please check this online document perhaps it may help.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBDIC/BCDWBDIC.pdf
Regards,
Ferry Lianto
Please reward points if helpful.
‎2006 Jul 19 4:44 PM
Hi Ana,
Please check this online document perhaps it may help.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBDIC/BCDWBDIC.pdf
Regards,
Ferry Lianto
Please reward points if helpful.
‎2006 Jul 19 5:08 PM
hi,
thank you!!!
this helps a bit, nevertheless, i am still not sure, how to add the conversion routines are accessed by the data element, especially, where I need to add these routines...anybody can help here?
cheers
ana
‎2006 Jul 19 5:28 PM
Hi,
Under Domain of a data element of a field, Output Characterestics field 'Convers. routine' is used to create conversion routines, system will do the data changes with in these routines while storing the data into table and retriving the data from table.
Ex: if coversion routine is defined as 'ALPHA' for a standard domain , with this value system will create two function modules.
CONVERSION_EXIT_ALPHA_INPUT
CONVERSION_EXIT_ALPHA_OUTPUT
you can also create your own conversion routines by defining the value in this field. i have defined conversion routine to convert NUMC type data to DEC type data with 'ZCNV'.system will generate two FM's. you need to write the code in those FM's according to your logic.
see the code for this :
CONVERSION_EXIT_ZCNV_INPUT
-
FUNCTION CONVERSION_EXIT_ZCNV_INPUT.
*"----
""Local interface:
*" IMPORTING
*" VALUE(INPUT)
*" EXPORTING
*" VALUE(OUTPUT)
*"----
DATA : ws_output type numc10.
ws_output = input.
output = ws_output.
ENDFUNCTION.
CONVERSION_EXIT_ZCNV_OUTPUT
-
FUNCTION CONVERSION_EXIT_ZCNV_OUTPUT.
*"----
""Local interface:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"----
data : ws_value type dec12.
ws_value = input.
WRITE: ws_value TO output DECIMALS 0.
ENDFUNCTION.
Regards
Appana
‎2006 Jul 19 6:01 PM
tx a lot, that helped a lot.
one more question.
if i use a specific short name fpor the concversion, such as agew, the I would have assumed, that when activating the domain, that the function modules would be generated by sap, instead i get an error message.
the only solution i did find was that I addded my own Function group and then added the respective function modules to this function group.
This of course gave a warning because of naming problems (fg and fm should be in same namespace, but i could proceed nevertheless.
do you know about a nicer solution to handle this?
cheers
ana
‎2006 Jul 19 6:56 PM
‎2006 Jul 20 5:38 AM
Hi,
without giving 'agew' , change it to 'zage' and check it.
Regards
appana
‎2006 Jul 20 8:17 AM
the error message is when trying to activate the domain with the convert name agew (zagew does not solve the problem), that the converting routine agew does not exist, therefore the domain cannot be converted.
cheers
ana
‎2006 Jul 19 5:38 PM
Dude,
The best way would be double click on the domain and check if there is any conversion routines used.
That would be more easier for you to use either Input/Output routine based on your requirements.
Thanks!
Suresh Ganti
‎2006 Jul 20 8:20 AM
Hi buddy
All conversion exits are linked at the domain level, just go the domain of a data-element from se11 & look for rules tab which will give you the required conversion exit for input or output, there is no much funda behind conversion exits available in the documents
Regards
Sudhir
‎2006 Jul 20 8:38 AM
Hi Ana,
1)Create a domain.
<b>Domain</b> ZTEST New
<b>Short Description</b> test field
2)Give the technical Attributes IN <b>Definition</b> Tab.
Data type CHAR Character string
No. characters 40
Decimal places 0
3)
<b>Output length</b> 40
<b>Convers. routine</b> <i>MATN1</i>
4)Save and activate it (No Errors).
This is possible because conversion routines are defined with name <b>MATN1</b>
OMCV Material Number Conversion
CONVERSION_EXIT_<b>MATN1</b>_INPUT Material number conversion (INPUT)
CONVERSION_EXIT_<b>MATN1</b>_OUTPUT Material number conversion (OUTPUT)
Now try giving.
<b>Output length</b> 40
<b>Convers. routine</b> ARUN1
This will give an error(<i>Conversion routine ARUN1 does not exist Domain ZTEST is inconsistent</i>). You will have to create the following FM's for eliminating this error.
CONVERSION_EXIT_<b>ARUN1</b>_INPUT
CONVERSION_EXIT_<b>ARUN1</b>_OUTPUT
Best way to create these FM
1)See if you can use the functionality of any existing Conversion Routines (by adding some custom code).
2)Consider CONVERSION_EXIT_<b>MATN1</b>_INPUT can be used now which is in FG <b>OMCV</b>.
3)Goto SE80 and enter the FG and right click on the FG
4)Copy the whole FG into new FG.
5)It will prompt you to enter the new FM's name enter the name like CONVERSION_EXIT_<b>ARUN1</b>_INPUT
6)Activate it.
7)Now you can use them in Domains.
Hope its clear now.
Regards,
Arun Sambargi.
Message was edited by: Arun Sambargi
‎2006 Jul 20 11:11 AM
cheers,
ok, thats about the way i did it, although i find it a bit strange...nevertheless, thats abap;-)
thanks to all!
ana