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 exits

Former Member
0 Likes
2,272

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

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
1,874

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.

11 REPLIES 11
Read only

ferry_lianto
Active Contributor
0 Likes
1,875

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.

Read only

0 Likes
1,874

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

Read only

0 Likes
1,874

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

Read only

0 Likes
1,874

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

Read only

0 Likes
1,874

Hello,

What is the error message you got?

Cheers!

Suresh Ganti

Read only

0 Likes
1,874

Hi,

without giving 'agew' , change it to 'zage' and check it.

Regards

appana

Read only

0 Likes
1,874

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

Read only

Former Member
0 Likes
1,874

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

Read only

Former Member
0 Likes
1,874

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

Read only

Former Member
0 Likes
1,874

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

Read only

0 Likes
1,874

cheers,

ok, thats about the way i did it, although i find it a bit strange...nevertheless, thats abap;-)

thanks to all!

ana