Conversion exit: numbers in database, two decimals on screen

Hi,
I need to save a numeric value in database containing only numbers. At the same time I need to display the value on a screen with two decimals. For example, the value of "12" should be saved in database as "1200", and it should be displayed on a screen like "12,00" (or "12.00", depending on user decimal settings). Furthermore, when user enters either a value of "12" or "12,00" on the screen and press enter, the program should display the value as "12,00" in both cases.
Therefore, I created a domain and added a conversion routine to it. This routine performs the conversion from display format to internal format and vice versa.
However, after trying with several options with MOVE and WRITE input TO output DECIMALS 2 statements and with different data types with different decimals places, I haven't been able to do this conversion.
I am a bit frustrated, since this task is rather simple. Is there a standard function module doing this conversion? What is the best and most efficient way to do this conversion?
I have also find the following standard function modules:
- CONVERSION_EXIT_QUANT_INPUT and CONVERSION_EXIT_QUANT_OUTPUT
- CONVERSION_EXIT_DEC_3_INPUT and CONVERSION_EXIT_DEC_3_OUTPUT
Regards,
Jarmo Tuominen

Hi Jarmo,
1. I don't whether i understood ur query properly!
2. U said u used a conversion routine in domain.
3. U can use the same routine(xxxxxx)
    (Say xxxxx is the name of conversion routine
     u specified in the domain)
     Now u can use the Function Module
     CONVERSION_EXIT_xxxxx_INPUT 
     CONVERSION_EXIT_xxxxx_OUTPUT
   in your programs for WRITE Purpose.
I hope it helps.
Regards,
Amit M.
Message was edited by: Amit Mittal

Similar Messages

  • Assigning Conversion Exit to a Select-Option on Selection Screen.

    Hi,
    Is it possible to assign Conversion Exit (Like ALPHA) to a Select-Option on a Selection Screen. If so can anyone please tell me how is this achieved.
    Thanks & Regards,
    Goutham.
    P.S.: Points will be definitely awarded.

    Hi Anjaneyulu,
    Thanks for the Reply.
    But the problem comes here, when he enters both the ranges as well as single values, using the extension button provided for the select-option.
    One option i found was in the layout of selection screen, to the select-option i assigned the ALPHA as conversion exit. But it says that this will be over-written once program/screen is generated.
    Kindly let me know if any one has a solution for this.
    Thanks & Regards,
    Goutham.

  • Web Dynpro ABAP: Assigning of Conversion Exits in ALV

    Hi,
    We are currently developing a generic data display application using ALV technology in Web Dynpro ABAP. "Generic" means that the structure of the data is created dynamically during runtime (using RTTS) and that even the contained data elements are created dynamically without any relation to DDIC. The generation is based on metadata like field name, data type, length, decimals, conversion exit.
    Our problem is that we were not able to find a way to assign the conversion exit of a data element ("column") in Web Dynpro ALV. Without this feature, no output conversions will take place since the data elements have no relation to DDIC. In the "classical" ALV, this could be easily done using method SET_EDIT_MASK of class CL_SALV_COLUMN.
    Is there a similar method in WebDynpro ALV or at least an alternative approach to assign a conversion exit to a column or cell?
    Thanks for your help in advance.
    Best Regards,
    Sven

    Hello Sven Hader,
    As you said you are generatiing the metadata like field name, data type, length, decimals, conversion exit dynamically.
    Can you please let me know how you are diong this?
    Meanwhile, you can try this approach to assign a Conversion exit to ALV Table column attribute dynamically.
    DATA:     lv_data                         TYPE  dd04v,
                  lv_mode_ext2int          type   ESEBOOLE. "Conversion mode that you are in
      read the data from the database
        CALL FUNCTION 'DDIF_DTEL_GET'
          EXPORTING
            name                = lv_ddobjname
            state               =   iv_object_state
            langu               =   iv_langu
          IMPORTING
            dd04v_wa         =   lv_data
          EXCEPTIONS
            illegal_input       = 1
            OTHERS           = 2.
        CHECK NOT lv_data-convexit IS INITIAL.
        CONCATENATE 'CONVERSION_EXIT_' lv_data-convexit '_INPUT'
          INTO cl_im_imp_ehs_material_erp=>mv_conversion_exit_input.
        CONCATENATE 'CONVERSION_EXIT_' lv_data-convexit '_OUTPUT'
          INTO cl_im_imp_ehs_material_erp=>mv_conversion_exit_output.
      IF lv_mode_ext2int = 'X'.
        ASSIGN cl_im_imp_ehs_material_erp=>mv_conversion_exit_input
            TO <lv_funcname>.
      ELSE.
        ASSIGN cl_im_imp_ehs_material_erp=>mv_conversion_exit_output
            TO <lv_funcname>.
      ENDIF.
    (3) call the conversion exit
      CHECK <lv_funcname> IS ASSIGNED.
      TRY.
          CALL FUNCTION <lv_funcname>
            EXPORTING
              input  = iv_value
            IMPORTING
              output = ev_value.
          IF sy-subrc <> 0.
          ENDIF.
        CATCH cx_sy_dyn_call_illegal_func
              cx_sy_dyn_call_illegal_type
              cx_sy_dyn_call_param_missing
              cx_sy_dyn_call_param_not_found.               "#EC NO_HANDLER
      ENDTRY.
    Endif.
    I hope it should work.
    Thanks,
    Bharath.K
    Edited by: Bharath Komarapalem on Dec 16, 2008 2:47 PM

  • Conversion exit ALPHA, external- internal

    What does the below Alpha Conversion do :
    <b>Conversion exit ALPHA, external->internal</b>
    An example wud help me understand better!!

    Hi,
    A conversion routine is identified by its five-place name and is stored as a group of two function modules. The function modules have a fixed naming convention. The following function modules are assigned to conversion routine xxxxx:
    CONVERSION_EXIT_xxxxx_INPUT
    CONVERSION_EXIT_xxxxx_OUTPUT
    The INPUT module performs the conversion from display format to internal format. The OUTPUT module performs the conversion from internal format to display format.
    E.g. If you specify ALPHA conversion for Material number then when user enters the value for MATNR as 123; internally it is converted to 0000123 and is stored in that format in the database. In this case, conversion is done from external format to internal format and the other way if you are reading value from database; it is converted from internal to external format and value is shown as 123, instead of 0000123.
    Hope this helps.
    PB

  • I would like to know about conversion exits.

    i would like to know about conversion exits.

    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.
    Thanks & Regards,
       Sunil

  • Conversion exits before value mapping in AIF

    Hi All
    I'm trying to use conversion exits before mapping in define value mapping, where I want to truncate leading zeroes in the source field before the value mapping is executed.
    I'm using the conversion exit 'ALPHA' (internal->external) to achieve this, but the leading zeroes do not get truncated. Below is an example-
    Conversion Exit: ALPHA
    Data Element for conversion:
    Direction: Internal->External
    Source Value: 0000012345
    Expected Value after conversion: 12345
    Actual Value after conversion: 0000012345
    A similar issue Error in reading a value from database table is noted here, however note 1892571 that is suggested does not seem to resolve the issue I'm facing.
    Am I missing something here?
    Regards
    Chandra

    Hi Glenn Bumanlag,
            I think the values that you have given for source values (Agency and scheme)
    and Target values (Agency and scheme) may be mismatching so kindly chek that...even i got the same error in the past..........
    If you the this problem kindly change it accordingly and also refresh the cache once you that with this.........
    Kindly follow the below mentioned link and check if you have followed these steps.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00ee347e-aabb-2a10-b298-d15a1ebf43c5
    Thanks
    Sai     
    PS: kindly reward points if helpful

  • Custom Conversion Exit for a Custom InfoObject

    Has anyone created a custom conversion exit for an InfoObject?
    I have a requirement to mask the first five digits of the Social Security Number on output only. I created a custom conversion exit ZCONV, for example and added code to the output function module CONVERSION_EXIT_ZCONV_OUTPUT to accomplish the masking. In the CONVERSION_EXIT_ZCONV_INPUT, I just passed INPUT to OUTPUT.
    It works OK for masking the output results but any input variables return an "Invalid Format" error. So I am not able to have a selection screen variable where you enter the SSN number and run the query for it. It tries to convert it to the masked form and then run the query.
    Any pointers. Helpful answers will be promptly rewarded.
    Thanks
    Vineet

    Since the ultimate goal was not to display Social Security Numbers, I changed the custom Conversion exit to display SID values. In case anyone needs to do the same, The output function module CONVERSION_EXIT_ZCONV_OUTPUT  is coded to read the SID value for the SSN number from the SID table of the InfoObject and the input function module CONVERSION_EXIT_ZCONV_INPUT does the reverse by reading the SSN number for the SID.
    Dropdowns on variable values work OK by displaying the SID value and the employee name. The only drawback is that you cannot input a SSN number on the selection variable. You have to do the dropdown and select.
    Thanks
    Vineet

  • Conversion exit missing in BI - Best practice to install missing exits

    Hi,
      We are on BI 7.0 SP10.
      While doing mappings, I found two conversion Exits MATN2 & SCOPE missing from the BI box. Hence SAP was throwing error while trying to activate the 7.0 datasource.
    On more analysis, I found that the function groups are altogether missing.
    What is the best practice to install these missing objects (Func Groups, Func Mods) in the system.
    Our ABAP person suggested to create these objects as "Repair objects" in the system. Is that the right procedure?
    Please advise.
    Thanks
    Vishno

    I have been through the following steps:
    Entered this URL http://help.sap.com/bp/initial/index.htm
    Clicked on 'Cross-industry Packages'
    Clicked on 'CRM'
    Clicked on 'Englilsh'
    Then the following page is displayed:
    http://help.sap.com/bp_crm70/CRM_DE/HTML/index.htm displayed
    But now what?. How do I get the Best practice instructions for a CRM implemenation?.
    Jason

  • Is possible to work with more than two decimals

    Hi,
    my CRM OD environment shows only two decimals, but the customer needs four decimals. Is possible these change? How can I do it?
    Regards.

    Hello Gayathri,
    The version is OBISE1 10.1.3.2.1
    The scenario is the following:
    I have two connection pools
    - One is mapping the DWH and it is using the System's variables :USER and :PASSWORD. Then I have an Initialization Block that get these values and I have created the logins as users in the database.
    - The other is mapping the DWH tables.
    I want to create directly users into the repository. The problem is the users of the repository cann't do the login because the first connection pool is trying to validate then against the database.
    Would be possible to validate the users against the connection pool and the repository simultaneously?
    Thank you and regards,
    Mónica.

  • Question on Language Conversion exit

    Does anybody know whether Language Conversion exit gets executed when sourcing data from SAP systems (R/3, CRM)?
    I am sourcing data from CRM, SPRAS(2 digit) is mapped to 0LANG(1 digit) in the transfer structure. Spanish(ES) and English(EN) for some reason is interpreted as English(E) instead of E and S.
    In T002 table I see both the entries for english (E) and spanish (S) and if the conversion exit would have applied, these two digit language code from the datasource should be converted to the corresponding one digit code.
    Can I assume that these conversion routines are executed only when sourcing data from non-sap systems.
    Please let me know your ideas.
    thanks
    George

    Conversion routine ISOLA converts the two-digit ISO language abbreviation INPUT into its SAP internal OUTPUT presentation. These are assigned using the LAISO and SPRAS fields in table T002. An INPUT that cannot be
    converted (because it is not defined as T002-LAISO) produces an error message and triggers the UNKNOWN_LANGUAGE exception.
    Because they are compatible, single-digit entries are supported in that they are transferred to OUTPUT unchanged. They are not checked against table T002.
    The difference between upper and lower case letters is irrelevant with two-digit entries however with single-digit entries, upper and lower case letters stand for different languages.
    Now I have no system availabilty...try to search in SE37 with ISOLA and then F4...
    Did you debug your transfer rules ?
    Bye,
    Roberto

  • When is a conversion exit triggered?

    Hi,
    are conversion exits only triggered via GUI:s ?

    Hi
    Conversion Exits will triggered when u r input/output to a perticular data element which is associated with domain which is attached with conv routine.
    take an example
    suppose
    kunnr a domain whih is attached with ALPHA
    if i am giving 80 to store it in database it will store 0000000080 as its length is 10 char
    and while ouput it will show me 0000000080.
    i think now u got
    if helpful
    Reward me points
    Regs
    Manas Ranjan Panda

  • Error in conversion exit CONVERSION_EXIT_CUNIT_INPUT

    Dear all
    I got the following error
    " Error in conversion exit CONVERSION_EXIT_CUNIT_INPUT "
    This is an original sample data.
    ~
    CUST007,SREP07,MAT008,3,DZ,1,,19990424
    CUST008,SREP08,MAT008,3,DZ,2,,19980328
    CUST008,SREP08,MAT009,2,CS,3,,19980203
    CUST008,SREP08,MAT010,1,LB,4,,19991104
    CUST009,SREP09,MAT011,1.5,LB,5,,20000407
    CUST010,SREP10,MAT011,1.5,LB,6,,20000701
    ~
    you can download it from [ http://safariexamples.informit.com/0201703661/IC_DEMOBC.csv ]
    As you can see , [T-Code CUNI screenshot] ( http://static.flickr.com/35/71412534_4998517812_o.jpg )
    there is no LB.
    so i tried to create LB. but... i couldn't ..
    Because, LB already exists in the Table T600 & T600A
    T600 screenshot ( http://static.flickr.com/35/71412793_dcbae3d11a_o.jpg )
    T600A screenshot ( http://static.flickr.com/34/71412535_96f9278862_o.jpg )
    What do you think ?
    The value of SPRAS is DE.
    is it possible to cause the error ?
    Well, i deleted the value of UNIT column from the original data so that i could escape the error " Error in conversion exit CONVERSION_EXIT_CUNIT_INPUT ".
    ~
    CUST007,SREP07,MAT008,3,,1,,19990424
    CUST008,SREP08,MAT008,3,,2,,19980328
    CUST008,SREP08,MAT009,2,,3,,19980203
    CUST008,SREP08,MAT010,1,,4,,19991104
    CUST009,SREP09,MAT011,1.5,,5,,20000407
    CUST010,SREP10,MAT011,1.5,,6,,20000701
    ~
    But i don't think it is a right way. isn't it?
    Thanks in advance.
    David.Kang

    Dear Eugene
    Thanks a lot today.
    Yeah, my incoming data do not match with the transfer structure.
    Take a brief look at my case studies.
    [Data Selection] tab
    http://static.flickr.com/34/71452760_2117e1d4c0_o.jpg
    [Data targets ] tab
    http://static.flickr.com/34/71452762_035aaa8d78_o.jpg
    [Processing ] tab
    http://static.flickr.com/34/71452763_fa322fe8f1_o.jpg
    [External Data] tab
    1) IC_DEMOBC.csv  ( It includes the value of UNIT column. )
    ( The original data file is   http://safariexamples.informit.com/0201703661/IC_DEMOBC.csv )
    http://static.flickr.com/20/71452764_fb4a24a809_o.jpg
    - Preview result screenshot
    http://static.flickr.com/35/71452765_07a4ae8e12_o.jpg
    2) IC_DEMOBC2.csv ( It inculdes only two rows with UNIT values : CS. )
    http://static.flickr.com/20/71452766_da7b2c46b7_o.jpg
    - Preview result screenshot
    http://static.flickr.com/35/71453112_348077e31a_o.jpg
    3) IC_DEMOBC3.csv ( It inculdes all rows without UNIT values. )
    http://static.flickr.com/34/71453113_301afeca73_o.jpg
    - Preview result screenshot
    http://static.flickr.com/20/71453114_8438122d06_o.jpg
    I try to solve it by myself.
    ( i already spend almost one week~~ . )
    but i feel the end is coming soon.
    with kind regards
    david

  • Time field and domin  should have conversion exit

    hai exports,
    i need time field from any table but it should be having conversion exit in the domin..
    my requirement is to add two time field in ztable and it  reflects in the one report program......when i was get print out time will shows like hh:mm:ss.......
    can any one met this?
    award avail for useful reply.......
    thanks in advance...
    regards,
    jai.m

    Hi Jaya
    I din't really understand why we need conversion exit for this purpose. Even if we do have then how can you make a time fields data type to hold ':', it is not allowed.
    If you want to output to in the format of 'hh:mm:ss', then use the edit mask with edit mask as '__:__:__' in your write statement.
    ~ ranganath

  • Conversion Exit is called twice

    Hi all,
    I have a database table which I load into my context and display in an ALV.
    For one of the field, it seems that the conversion exit is called twice.
    Once when the data is loaded into the context, and once when it is displayed in the ALV. Is there are way to tell the ALV that is shall ignore conversion exists at all?
    Best regards,
    Daniel

    hi,
    just ignore the binding to the dictionary of the special field in the context and make it as type string or something else...

  • How to find conversion exit MATN1 for the field MATNR

    Hi Friends !
    I want to run the infopackage with selection on material. But when put some value in the infopackage selection screen, it says "cannot find conversion exit MATN1 for the field MATNR".
    Ques is how to find where this conversion exit is written? Will it be written in ECC side or BI side?
    Source System Datasource : 0MAT_SALES_ATTR
    InfoObject in BI : 0MAT_SALES
    With Regards
    Rekha

    HI ,
    It will be available in the BI system itself as FM , you can find them in TCODE : SE37 --> provide the converstion exit name
    with star on both sides like MATN1 and press F4 key , every convertion exit will have two FM s , one for INPUT and
    one for OUT put , you can try the Test Run ofFM to check how it works
    For MATN1
    CONVERSION_EXIT_MATN1_INPUT
    CONVERSION_EXIT_MATN1_OUTPUT
    Regards,
    Sathya

Maybe you are looking for

  • CS5.7 cannot open CS5.5 Indesign files

    Hi, we have several designers located around the globe, that all need to be able to access & change the same design files, mostly Indesign.  They are all using Applemacs, but all have different CS versions, i.e. CS5.5, 5.7 and 6.8.0.1.  We already ha

  • Startup Full Disk Error

    I have a Mac Book Air and last night I let it getting a plug in in order to watch videos, this morning I turned it on and all I got was a blue screen whit this message: YOUR DISK IS FULL. It only opens messenger but it is impossible to get to the fin

  • Creating U3D files

    Can I create a standalone U3D file with Acrobat 3D? I realize that I can make a pdf with a U3D file in it, but I just want to create U3D files so I can insert them into an existing pdf. Thanks! Ari

  • Clementine 100 percent CPU use after quit

    after i quit clementine, pause it or stop playback get 100 percent cpu.  any ideas ? when i start clementine from console this is what i get, the second part is after i hit the pause button Couldn't load icon "clementine-panel" Couldn't load icon "cl

  • Numbers -iCal. Wan t to set up Roman Calen dar

    I'd like to set up the roman Kalends on my ical. As the Latin names for the days are pretty much repetitive, the best way to set up a year's worth is to create the entries in Numbers (or excel) and port them in to iCal. For example: Column 1 column 2