Conversion Exit on ALV fieldcatalog ?

Hi all,
I have an editable ALV grid and one of the column displays a field which is of the floating type.
Now instead of the regular 1.2870001E+00, can I make it display 1.28 ( Decimal rounded to 2 decimal places).
I am trying to modify the fieldcat. I am able to get rid of the E+00 by having wa_fieldcat-exponent = 0.How can I get it to round to 2 decimal places ? Do I have to use any wa_fieldcat-convexit = .... ? or wa_fieldcat-round = ... ?
      when 'TEST_API_GRAVITY'.
        wa_fieldcat-edit = 'X'.
        wa_fieldcat-NO_ZERO = 'X'.
        wa_fieldcat-exponent = 0.
        wa_fieldcat-ROUNDFIELD = 'TEST_API_GRAVITY'.
      wa_fieldcat-round = 2.
      wa_fieldcat-DECIMALS = 2.
      wa_fieldcat-CONVEXIT = 'P'.
MODIFY gi_fieldcat FROM wa_fieldcat.
Thanks.
SHK

Hi,
I tried it. It works...
Try decimals_out of the fiedcatalog.
wa_fieldcat-edit = 'X'.
wa_fieldcat-NO_ZERO = 'X'.
wa_fieldcat-exponent = 0.
wa_fieldcat-ROUNDFIELD = 'TEST_API_GRAVITY'.
<b>wa_fieldcat-DECIMALS_OUT = '2'.</b>
MODIFY gi_fieldcat FROM wa_fieldcat.

Similar Messages

  • 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

  • ECC6 - ALV Grid Output Conversion Exit

    Hi,
    I'm creating a program in ECC6 to display the report in ALV grid by called FM: REUSE_ALV_GRID_DISPLAY.
    EG: Select field (TPLNR) from table IFLOT. Value retrieved are: ?0100000000000000029. However, the output doesnt do the conversion exit to change the TPLNR value to format MY.FO.001.
    I did the same in 4.6C system, the ALV report able to display the correct value of TPLNR. Eg: MY.FO.001 instead of
    ?0100000000000000029.
    If anyone encountered the same issues in ECC6 system which In an ALV grid, it doesnt to display data that is based on a domain with a conversion exit?

    Hi Simone,
    Check this NO_CONVEXT in the Structure LVC_S_FCAT. Populate with SPACE in the FCAT Build.
    If you have conversion Exit to that field then use the CONVEXIT in the same structure while building Field Catalog. sometimes you have Z converions so you need to check this.
    If you a Table field in the FCAT then you dont need all these things. because conversion exits are automatically done. Also COL_OPT = 'X' this will align the ALV in the correct format for output. hope this helps.

  • 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...

  • Field EDIT_MASK in ALV fieldcatalog

    Hi,
    How can I use edit_mask of ALV field catalog in order to
    format the currency value sign to be on the left of the value instead of on the right?
    Example: - 100.00 instead of:  100.00  -
    My field to be displayed in the ALV column is of type CURR 13.
    Is there any conversion routine or mask format?
    Thanks,
    Eyal.

    Hi,
    If you set a conversion exit (for example,
    conv = ' ==ALPHA ' for function module CONVERSION_EXIT_ALPHA_OUTPUT ), you enforce output conversion for the associated output field.
    WRITE amount TO output USING EDIT MASK 'RRV_____,___'.
    Have a look at keyword documentation;
    - RR = right justified
    - V = sign
    - _ = place holder for number
    - , = decimal separator
    - _ = place holder for decimals
    Refer this link to get idea.
    Re: Curreny $ display in ALV Grid
    Or you can even solve this problem by moving it into char fields and then concatenating minus sign with it.
    Hope it helps.
    Rgds,
    J.Jayanthi

  • No Conversion exit entered

    Hi,
    I am new to SAP BW ,while creating a Datasource i am experiencing this error as "No Conversion exit entered" .Please help me on this .
    Thanks & Regards
    Sameer Khan

    Hi Vibhuti,
    How you created customer name and address, I mean to say data element? You can not have data with space except for short, medium and long text.
    Check if you are excluding first row as header in info package, if you have header in Flat file. Check if Lower case is ticked in Customer name and customer address.
    Regards,
    Kams

  • Conversion exit error while activating the transfer rules

    Hello gurus,
    We are doing a function module extraction with 3.X data sources.
    On activating the transfer rules , i am getting a conversion exit error for "0fiscyear", but in the infoobject we don't have the conversion exit for it.
    Points will be awarded for any kind of response.
    Thanks and Regards,
    Anu.

    Hi,
    1. Please check in the transformation, its necessary to provide the fiscal variant mapping as well when ur mapping fiscal year object. as on the basis of that value fiscal period will be derived.
    2 I guess ur doing direct mapping (Time conversion) and there is no routine written for that.  if any u can check that as well for any error.
    Thanks
    dipika
    Edited by: Dipika Tyagi on Jun 25, 2008 7:39 AM

  • How to find out the conversion exit format for VBRP-VRKME

    Hi Gurus,
               I am writing a report to fetch delivery details based on storage location'123'. My requirement is tat i shud convert the Billed Quantity unit TO Base unit of measure. In my VBRP table the field value/contents of VBRP-VRKME have values PAK for PAC( packets) and KAR for CAR(carton). When i click on User-specific Settings - - Check the filed CHEECK CONVERSION EXITS , i am able to get see the PAC and CAR respectively.
          But unfortunately when i selecting te fields form vbrp in my internal table i am getting the values 'PAK' for PAC and 'KAR' for CAR'. AS i am writing a report can any one suggest me how to convert this , as i wud b making use of FM MD_CONVERT_MATERIAL_UNIT  to convert to base unit of measure, n this FM is not accepting the values like PAK and CAK.
          Your Sugesstions are of utmost importance for me.
    Thanking you,
    ZIa

    Hi,
    Conversion routines are maintained at Domain Level(Definition Tab), Meins is the domain for VRKME data element.
    You have to use the following routines,
    CONVERSION_EXIT_CUNIT_INPUT
    CONVERSION_EXIT_CUNIT_OUTPUT
    Regards
    Srini

  • 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

  • Flat file Error in conversion exit CONVERSION_EXIT_PERI6_INPUT

    Hello Experts!
    I´m trying to upload a flat file data to an infocube and appears an error which diagnosis is:an error ocurred in record 1 during execution of conversion exit CONVERSION_EXIT_PERI6_INPUT for field CALMONTH.
    Procedure: Check That the record where the error ocurred has the correct format , and correct it accordingly.
    The characteristics in this fields (CALMONTH) are:
    - Data Type: numc-character string with only digits.
    - Length: 6
    - Convers.rout. PERI6
    - Output Length 7
    I hope You can help me soon.
    Thank you!

    Hi Eduardo Vergara,
    You just have to make sure the 0CALMONTH format is exactly the same. We have to match the format in the both columns. So in DataSource/Trans.Structure File “CALMONTH” change the Type to “Numc” and length o “6” . This is our problem but the tip is to match the proprieties.
    Regards,
    Alberto.

  • How to suppress automatic keyfigure conversion in WD ALV?

    Dear experts,
    I am having a problem with automatic input conversion in WD ALV.
    I have a key-figures (type P length 9, decimals 2)in my ALV which has reference field of type if_salv_wd_c_field_settings=>reffieldtype_curr.
    I process the changes by event ON_DATA_CHANGE which passes this change object:
    r_param->t_modified_cells
    r_param->t_inserted_rows
    r_param->t_deleted_rows
    r_param->t_error_cells
    The thing is that the changes in table r_param->t_modified_cells are already converted into internal format. When user enters "1", I get here in this table value "1.00". But this internal value is not always correct because corresponding reference field with currency key may not be known yet (it is calculated later on background from other fields).
    Therefore, for example for currency JPY which has no decimal places external value "1" is converted into wrong internal value "1.00" (the correct internal value is "0.01").
    Therefore, I need to suppress the conversion by the ALV and do it myself once the currency key is known.
    How can I suppress the automatic input conversion which is done by ALV?
    There is no such problem in SAP GUI ALV! There is event DATA_CHANGE with similar change object:
    io_data_change->mt_good_cells
    io_data_change->mt_mod_cells
    io_data_change->mt_inserted_rows
    io_data_change->mt_deleted_rows
    But all the changes in table io_data_change->mt_mod_cells are in an external format (exactly the way user entered them on the screen)!
    Any idea?
    Thank you in advance for your help.
    Tomas
    Edited by: Tomas Havlik on Oct 5, 2010 10:24 AM

    I have contacted the Web Dynpro ALV support directly to find out the answer.
    There is no solution!
    The WD ALV always convert the key figure into internal format. It is not possible to get the raw user input in WD as it is in SAP GUI.
    Therefore, I use a workaround in my application - I remeber the number of decimal places of the old currency key and if the new currency key has different number of decimal places, then I shift the decimal point to the right or left correspondingly.

  • Short Dump DYNPRO_MSG_IN_HELP in Conversion Exit

    Hi Gurus,
    I've written the following conversion exit:
    FUNCTION CONVERSION_EXIT_ZBZEI_INPUT.
    *"*"Lokale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(INPUT)
    *"  EXPORTING
    *"     VALUE(OUTPUT)
    *"  EXCEPTIONS
    *"      INPUT_NOT_VALID
      DATA : CPI_OUT(4) type n, CPI_IN(5), cpi_in2(5), cpi_in3(5).
      DATA : CPI_YEAR(4), CPI_PERIOD(3).
      DATA : CPI_NUM2(2) TYPE N.
      DATA : CPI_NUM3(2) TYPE N,
             index(2)    type n,
             index2(2)   type n,
             merker(1).
      DATA : CPI_C8, CPI_C7, CPI_C6, CPI_C5.
      DATA: SONDERZ.                    "nimmt das Trennungszeichen auf
    *-initializations-----------------------------------------------------*
      check not input is initial.
      CPI_IN2 = INPUT.
      CLEAR : cpi_in, cpi_in3, cpi_out, OUTPUT, index, index2, merker,
              cpi_num2, cpi_num3.
      do.
        if cpi_in2+index(1) co '0123456789' and merker ne 'X'.
          cpi_in+index2(1) = cpi_in2+index(1).
          add 1 to index2.
        endif.
        if cpi_in2+index(1) = ':'.
          merker = 'X'.
          clear index2.
        endif.
        if cpi_in2+index(1) co '0123456789' and merker = 'X'.
          cpi_in3+index2(1) = cpi_in2+index(1).
          add 1 to index2.
        endif.
        add 1 to index.
        if index = 5.
          exit.
        endif.
      enddo.
      if cpi_in3 is initial.
        cpi_out = cpi_in.
      else.
        cpi_num2     = cpi_in.
        cpi_num3     = cpi_in3.
        cpi_out(2)   = cpi_num2.
        cpi_out+2(2) = cpi_num3.
      endif.
      if cpi_out(2) > 23.
        message e000 raising input_not_valid.
      endif.
      if cpi_out+2(2) > 59.
        message e001 raising input_not_valid.
      endif.
      output   = cpi_out.
    *  output+2(2) = cpi_in+3(2).
    endfunction.
    The problem is when the user inputs an invalid value and presses directly after this F4 the conversion exit will call and I get the short dump DYNPRO_MSG_IN_HELP  when I trigger the error message.
    Is there any way to know that the program is in value-request? Maybe a system field? Can I catch this error?
    Thanks for help.
    Lars

    Hello Lars,
    refering to OSS 84510 SAP does not allow error messages in this environment. However, to find out if you are in a F4- context you can use the kernel function 'DY_GET_DYNPRO_EVENT'
      data: event(3).
      "check if we are in F4 environment
      call 'DY_GET_DYNPRO_EVENT' id 'EVENT' field event.
      if sy-subrc <> 0 or ( event <> 'PAI'
                        and event <> 'INP' )."PAI also POV
        " not F4 help
        message e000 raising input_not_valid.
      else.
        "F4 help -> only S message
        message s000 display like 'E' raising input_not_valid.
      endif.
    Kind regards, miro

  • 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

  • Data collection: Conversion exit and Input Conversion of Local Currency

    Hi,
    I'm collecting transaction data from BI where the local currency for one company has no decimal places.
    Therefore if I collect the data with no conversion, the value is multiplied by 100 in BCS .
    has anyone used the Conversion Exit or Input Conversion options?
    - any feedback, tips or useful documentation/links you can point me to?
    All help much appreciated.
    TheScotsman

    Hi TheScotsman,
    I'm almost sure that the reason of this behaviour but the special treatment of some specific currencies (see the OSS note 153707). Just check if you have the currency in the TCURX table.
    If yes, then please go through the links:
    Re: Local Currency COP, KRW values wrong in report
    (I described symptoms)
    Re: Currency conversion cube to report
    (see the document in the link)
    Edited by: Eugene Khusainov on Sep 8, 2008 4:20 PM

  • 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.

Maybe you are looking for

  • Oracle tuxedo and Oracle tuxedo message queue on top of a virtual machine.

    Hi buddies. how is it going? A quick question. So we are going to go live  using Oracle Tuxedo 12.1.1.0 with Distinguished Bulletin Board Liaison and Oracle Tuxedo Message Queue 12.1.1.0  on top of a Virtual Machine (VMWARE) running Oracle Linux 6.2.

  • Using parallels software

    I just purchased a new Imac. am in the process of installing paralles software with winxp. unfortunately, i need to utilize windows for work. anyways, i don't know if i am supposed to install with <fat> or <ntfs> file system. please help. i only use

  • T400 CD-R & DVD-R write error

    Hi All, I have a T400 that came with Windows XP installed and a recovery disk with a Windows 7 image.  When XP was discontinued, I used the recovery disk to upgrade to 7.  Since doing so, I have not been able to use the optical drive to record media.

  • How do I get Itunes to have consistant vol Levels with Mainstage

    does anyone have a good way to get consitant volume levels when first 1. creating them in logic. Second 2. kepping the volume levels consistat between Mainstage (my acoustic & vocal) and Itunes (The Backing Track).

  • Scheduling through Forms 9i???

    Is it possible to scheduling Reports through Oracle forms??? If so, please suggest me how it will work?