What is conversion routine which is found in data element

Hi all,
I was just trying to creating a data element assigned to a particular domain in se11. While i am creating i can see a conversion routine
Can anyone tell me what is the use of that conversion routine with an example.
thanxs in advance
hari

Hi,
Depending on the data type of the field, there is a conversion when the contents of a screen field are converted from display format to SAP-internal format and vice versa. If this standard conversion is not suitable, it can be overridden by defining a conversion routine in the underlying domain.
Conversion routines are identified by a five-place name and are 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 converts from display format to internal format, and the OUTPUT module converts from internal format to display format.
When is a Conversion Routine Executed?
If a screen field refers to a domain with a conversion routine, this conversion routine is executed automatically when entries are saved in this screen field or when values are displayed in this screen field. The conversion routine of the domain is also triggered when the field contents are output with the WRITE statement.
Table SPFLI in the  flight model contains information about the flights offered by the carriers. The time for each flight is recorded in field FLTIME. Enter and display the time of the flight in input templates in the form HHH:MM (hours:minutes). Store the flight time entered in the database as an integer number (number of minutes of the flight). An entry 3:27 is therefore stored in the database as 207 (3 hours, 27 minutes = 207 minutes).
Field FLTIME refers to domain S_DURA, to which conversion routine SDURA is assigned. The value is thus converted by the two function modules <b>CONVERSION_EXIT_SDURA_INPUT</b> and <b>CONVERSION_EXIT_SDURA_OUTPUT</b>.
A conversion routine can also be triggered by specifying its five-place name in the attributes of a field in the Screen Painter or with the addition <b>USING EDIT MASK <Name of conversion routine></b> in the WRITE command in the program. With the USING NO EDIT MASK addition in the WRITE statement, you can skip a conversion routine defined for a domain when outputting.
Parameters
The two function modules of a conversion routine must have precisely two parameters with the names INPUT and OUTPUT for the value to be converted and the converted value.
The INPUT parameter in the INPUT conversion and the OUTPUT parameter in the OUTPUT conversion should not have any reference fields because the value passed in the call could have a different length than that expected.
Programming Conversion Routines
ABAP statements that result in an interruption of processing (such as CALL SCREEN, CALL DIALOG, CALL TRANSACTION, SUBMIT, COMMIT WORK, ROLLBACK WORK, MESSAGE I, MESSAGE W) are not allowed in conversion routines.
Only A messages are meaningful in output conversion, but A, E and S messages can be triggered in input conversion (although S messages are not very meaningful here). E messages result in an error dialog. Exceptions are not intercepted in the call.
The output conversion is also triggered with WRITE and WRITE TO. The conversion routine may therefore occur very frequently with lists. The output conversion should therefore be programmed as efficiently as possible.
No external performs should be used in conversion routines. Programs that are called externally use the table work areas of the first calling main program. In conversion routines this can result in errors that cannot be easily analyzed since they are sometimes called at unpredictable times in the program flow.
<b>Pls refer link which contains code as an example to conversion routine used in abap</b>.
<a href="http://www.bwexpertonline.com/downloads/source_code.doc">http://www.bwexpertonline.com/downloads/source_code.doc</a>
Pls reward points.
Regards,
Ameet

Similar Messages

  • How to debug a ABAP Routine which is in Infopackage Data selection Tab

    Hi ,
       Please let me know How to debug a ABAP Routine which is in Infopackage Data selection Tab.

    Hi,
    You can try to create infinite loop:
    DATA: STOP.
    WHILE STOP IS INITIAL. ENDWHILE.
    Start InfoPackage and then go to SM50 and swich on debugging for your process. Then in debugger you can change value of STOP variable to skip the loop.
    Krzys

  • Conversion routine PROJ in case master data doesn't exist

    Hi gurus!
    I have a problem with info-object 0PROJECT. It has a conversion routine PROJ, which converts the values nicely from external format to internal only if the master data for such project exists. If I use a interval variable in bex query the query user needs to give the upper value in internal value (for example Y3000 instead of Y-3000) in case he or she doesn't know if the value exists in database or not. That is understandable because of the logic of conversion routine PROJ (uses attribute project_ex).
    But what explains the fact that query variable input value Y3000 doesn't give data of Y-3000, but only one smaller (Y-2999). To get data of project Y-3000 one has to give upper variable value Y3001.
    Has anyone better understanding of this query/conversion behaviour?
    Sari

    Check the example here
    http://help.sap.com/saphelp_nw04s/helpdata/en/dd/f470375fbf307ee10000009b38f8cf/frameset.htm
    In master data updates, you can either load time-dependent and time-constant data individually, or together.
    Hope it Helps
    Chetan
    @CP..

  • What is parameter id and default component in data element? Help!

    Hi experts,
          In the further characteristics, What is parameter id and default component name in data element? what are they used for?
    Example: S_CARR_ID.
    Thanks
    Gopal

    Hi,
    Parameter ID :- Is used for assigning value to field.
    Suppose u call a transaction in u porgram.
    and u want to assign some value to field before executing the transaction.
    if the field has parameter id u can assign value to field before calling the transaction.
    that is it take the default value from the memmory.
    and u set value in the memmory using parameter id.
    <b>----
    GET PARAMETER -
    </b>
    Basic form 3
    GET PARAMETER ID pid FIELD f.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See ABAP Unicode - Other Changes
    Effect
    First, the value stored under the key pid is transferred from the local SAP memory into the field f. If this key is not available in the local SAP memory, the value stored under the same key pid is transferred from the global user-related SAP memory to the field f.
    A parameter ID can have up to 20 characters. You can find an overview of the keys (parameters) used in the SAP system description or the appropriate function in the ABAP Workbench.
    The Return Code is set as follows:
    SY-SUBRC = 0: A value was read from SAP memory. SY-SUBRC = 4: No value was found in SAP memory under the specified key.
    Notes
    The global user-related SAP memory is available to each user for the entire duration of a terminal session. For this reason, set values are retained when you leave a program.
    You should not use SAP memory for temporary storage because a user's parallel sessions use the same global memory.
    Example
    Read the program name from SAP memory:
    DATA : REPID LIKE SY-REPID.
    GET PARAMETER ID 'RID' FIELD REPID.
    <b>----
    SET PARAMETER -
    </b>SET PARAMETER ID pid FIELD f.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See ABAP Unicode - Other Changes
    Effect
    Writes the contents of the field f to the global user-specific SAP memory and the local transaction-specific SAP memory under the ID pid. Any existing values under the same ID are overwritten.
    Parameter IDs can be up to 20 characters long. They cannot consist entirely of spaces. The SAP system description contains an overview of parameter IDs. You can also produce a list using the ABAP Workbench.
    Notes
    The global, user-specific SAP memory is available to a user for the duration of a single terminal session. Values written to it are retained even when the user exits a program.
    Do not use SAP memory as a temporary storage area, since parallel sessions belonging to the same user all use the same memory area.
    Only store data of the types C, N, D, and T, as well as structures that consist of these types, in the SAP Memory.
    You can create new parameter IDs using the ABAP Workbench.
    Parameter IDs may have a namespace prefix.
    Example
    DATA REPID like sy-repid VALUE 'RSPFPAR'.
    SET PARAMETER ID 'RID' FIELD REPID.
    Message was edited by: Manoj Gupta

  • SAP CONVERSION AGENT - XPATH not found in DATA HOLDER?

    Hi Eperts,
    I'm trying to work on this Tool, getting some problem in Conversion Agent Studio..
    I Had created my project with PARSER in Conversion Agent, source file will be Pipeline separated Text File , which has multile rows...And I had created XSD for my Message Interface in XI..
    When i'm defining my ANCHORS/MARKERS/CONTENT/ .
    getting error in DATA Holder, I'm not able see my Schema / XPATH in the respective namespace...
    Could anyone can guide me pl.
    Thanks in Advance..
    regards,
    vasantj.

    Hi vasantj,
    Did you manage to resolve this issue?
    I face the same problem.
    Please ellaorate.
    Nimrod.G

  • Conversion Routines

    How to use Conversion Routines in Production Support?What is Conversion Routine?How it is Working in real time?

    hi..
    i'm not too sure abt it.. check out if the below helps ya.
    you can create customer routines. According to OSS Note 41474 it is safe to create a function module that has the conversion exit naming standard (Begins with CONVERSION_EXIT*). You will get a warning that you can ignore. The important part is to have the first letter of your rountine name begin with Z or Y. That way you won't have a conflict with SAP. An example would be:
    CONVERSION_EXIT_Z0001_INPUT .
    i browsed n found these details as none had answered ur question.

  • Regarding "TYPES & "CONVERSION ROUTINES"............

    Hi abapers,
    Can we have a code snippet as given below,
    TYPES : NUMB TYPE I VALUE 100.
    DATA : NUM1 TYPE NUMB.
    WRITE : / NUMB, NUM1.
    what will be the output?. Will the value 100 be copied to the field NUM1?
    Next question is regarding "conversion routines". I read that "conversion routines" can be assigned to fields(variables) in abap?. What are "conversion routines"? What are their purpose? Also explain me the purpose of "EDIT MASK"?
    Thanks in advance.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Jun 27, 2008 1:29 PM

    Hi,
    Conversion Routine..
    I will just give you an example.....
    For us in user interface English language is EN... but for system it is Just 'E'...
    There conversion will happen from user to system and while retrieving from system to user..
    So there are two routines for that.
    CONVERSION_EXIT_ <conversion routine name> _OUTPUT
    CONVERSION_EXIT_ <conversion routine name> _INPUT.
    These coversion routines do the conversion job
    check this link..
    http://help.sap.com/saphelp_erp2004/helpdata/en/33/206bc8012e11d3b495006094192fe3/content.htm
    Hope this would help you..
    Regards
    Narin Nandivada.

  • Use Conversion Routine in Infopackage

    Hello friends,
    I would like to know whats the purpose and function of 'Use Conversion Routine' in the Infopackage  under 'Data Selection' tab. I wasnt able to get any data as long as that box was checked.As soon as I unchecked the box, i was able to get data.Please explain in detail.
    Points will be assigned.
    Thanks.

    Hi,
    The function of "Use Conversion Routine" is to convert the data that user enter in the field (is called external format) into internal format (database format).
    example Alpha Conversion (general used): in the field ABC (assume this char is 8 characters long) you enter value '1234' and you check that box, this will look up into your data source with value ABC = '00001234' and match then data will be extracted, but if <u>in your data source</u> the value of field ABC is '1234'  the data won't be extracted.
    in your case, please check in your data source at field you selected whether the data format match or not with value that you have entered(with condition checked or unchecked).
    I hope it helps
    Cheers
    IR

  • What does CUNIT, ABPSP & ABPSN conversion routines do?

    What does CUNIT, ABPSP & ABPSN conversion routines do?
    There is no help on SAP documentation on how these  conversion routines work?Can someone  tell me in simple english on how to they the padding logic.
    Something like if <b>all numeric</b> then <b>pad  spaces on the left side</b> etc
    thanks
    Rao

    Hi Rao,
    I can help you with CUNIT. SAP manages units of measure in an internal and external format. That its, when it is saved in database, it uses a code (for example for units it uses ST), and when it shows you the value, it uses another one (in this case UN). So, what basically does CUNIT conversion routines (A.H.P mentioned the function modules) is to switch between those formats.
    Hope to help!
    Regards,
    Diego

  • What is use of  Conversion Routine in  Abap dictionary

    Hi,
    Can any body please tell me the proper use of <b>Conversion Routine in  Abap dictionary.</b>
    Please give me a practical example where it has been used.
    Thanks
    prabhudutta

    hi,
    here is help for conversion routine
    Conversion takes place when converting the contents of a screen field from display format to SAP-internal format and vice versa and when outputting with the ABAP statement WRITE, depending on the data type of the field.
    If standard conversion is not suitable, it can be overridden by specifying a conversion routine in the underlying domain.
    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.
    If a screen field refers to a domain with a conversion routine, this conversion routine is executed automatically each time an entry is made in this screen field or when values are displayed with this screen field.
    regards,
    Raghavendra

  • What is meant by matn1 conversion routine in info object

    hi,
    Can i know the exact meaning and usage of matn1 (type of conversion routine) in the infoobject level.
    thanks in advance

    Hi Sankar,
    Conversion takes place when converting the contents of a screen field from display format to SAP-internal format and vice versa and when outputting with the ABAP statement WRITE, depending on the data type of the field.
    Check the info here:
    http://help.sap.com/saphelp_nw04/helpdata/en/2b/e9a20d3347b340946c32331c96a64e/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/07/6de91f463a9b47b1fedb5be18699e7/content.htm
    Hope this helps...

  • What are the commonly used conversion routines apart from alpha conversion?

    hi all,
    Can any one let me know the commonly used conversion routines apart from alpha conversion routines ?
    thanxs ina dvance
    hari

    Hari
    There are lot of conversion routines, like
    BUCAT Conversion Routine. eg. The BUCAT conversion routine converts the internal presentation of the budget type
    (0BUD_CAT) into the external presentation (0BUD_CAT_EX), using the active entries in the
    master data table for the budget type InfoObject (0BUD_CAT).
    see the link below for all the routines.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b9119290-0201-0010-69af-96fe3bf00243
    assign points if helpful
    Kalyan

  • WBS element conversion routines

    Hey guys,
    I recently added PS_PSP_PNR to 2LIS_11_VAHDR in order to extract the WBS element from the sales document header. So far so good and everything works fine. In the extractor checker I get the data as expected e.g. 'S-00017.02.09'.
    The problem occurs as soon as the data is transferred to BW. In the transfer structure I see that PS_PSP_PNR har conversion routine ABPSP that converts the WBS from external format CHAR(24) to internal NUMC(8). And this is what is causing me the trouble! In the PSA the WBS from above is converted to '00029788'.
    I tried several different approaches. If the field is mapped directly to 0WBS_ELEMT the value '00029788' is obviously also written to the DSO and further up the data flow.
    I tried coding an ABAP routine in the transfer rules which does not seem to work:
    call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
    exporting
    input = TRAN_STRUCTURE-ps_psp_pnr
    importing
    output = RESULT.
    RETURNCODE = 0.
    ABORT = 0.
    Since the routine above did not help me at all I tested the FM in SE37 and it does not return any values for '00029788'.
    Any clues on this? How to proceed?
    BR
    Stefan.

    Well... Didn't want to wait any further for an answer, so I appended PS_POSID to the extract structure and filled this field in ZXRSAU01. In the exit I used 'CONVERSION_EXIT_ABPSP_OUTPUT' to convert to the correct format.
    BR
    Stefan

  • Conversion Routine... plz help

    Dear Gurus,
    There is a text field in R3 called as SGTXT related to some finance table... some of the records in this field directly start with '#' character and then the details.. Well here is the problem.. I m loading to ODS 0FIAR_O04 and it ends up in error due to the above mentioned problem.. the infoobject which carry the data from SGTXT field is 0POSTXT...
    I decided to go for a conversion routive in transfer rule for this field.. but i dont know how to write routines.. can you plz help me with the steps as well as the code to remove '#' from SGTXT.... Thanks.
    For more help i m attaching the conversion routine with is automatically generated by system... only i hv to add code to remove '#' character... kindly go thru it and suggest me where to add and what to add...
    here it is
    PROGRAM CONVERSION_ROUTINE.
    Type pools used by conversion program
    TYPE-POOLS: RS, RSARC, RSARR, SBIWA, RSSM.
    Declaration of transfer structure (selected fields only)
    TYPES: BEGIN OF TRANSFER_STRUCTURE ,
    InfoObject 0POSTXT: CHAR - 000050
    SGTXT(000050) TYPE C,
    END OF TRANSFER_STRUCTURE .
    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line -
    TABLES: ...
    DATA: ...
    $$ end of global - insert your declaration only before this line -
    FORM COMPUTE_POSTXT
    Compute value of InfoObject 0POSTXT
    in communication structure /BIC/CS0FI_AR_4
    Technical properties:
    field name = POSTXT
    data element = /BI0/OIPOSTXT
    data type = CHAR
    length = 000060
    decimals = 000000
    ABAP type = C
    ABAP length = 000120
    reference field =
    Parameters:
    --> RECORD_NO Record number
    --> TRAN_STRUCTURE Transfer structure
    <-- RESULT Return value of InfoObject
    <-> G_T_ERRORLOG Error log
    <-- RETURNCODE Return code (to skip one record)
    <-- ABORT Abort code (to skip whole data package)
    FORM COMPUTE_POSTXT
    USING RECORD_NO LIKE SY-TABIX
    TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
    G_S_MINFO TYPE RSSM_S_MINFO
    CHANGING RESULT TYPE /BI0/OIPOSTXT
    G_T_ERRORLOG TYPE rssm_t_errorlog_int
    RETURNCODE LIKE SY-SUBRC
    ABORT LIKE SY-SUBRC. "set ABORT 0 to cancel datapackage
    $$ begin of routine - insert your code only below this line -
    DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
    RESULT = .
    returncode 0 means skip this record
    RETURNCODE = 0.
    abort 0 means skip whole data package !!!
    ABORT = 0.
    $$ end of routine - insert your code only before this line -
    ENDFORM.
    FORM INVERT_POSTXT
    Inversion of selection criteria for InfoObject 0POSTXT
    This subroutine needs to be implemented only for SAP RemoteCubes
    (for better performance) and for the Report/Report Interface
    (drill through).
    --> I_RT_CHAVL_CS Ranges table for current InfoObject
    --> I_THX_SELECTION_CS Selection criteria for all other InfoObjects
    <-- C_T_SELECTION Selection criteria for fields of
    transfer structure
    <-- E_EXACT Flag: Inversion was exact
    FORM INVERT_POSTXT
    USING I_RT_CHAVL_CS TYPE RSARC_RT_CHAVL
    I_THX_SELECTION_CS TYPE RSARC_THX_SELCS
    CHANGING C_T_SELECTION TYPE SBIWA_T_SELECT
    E_EXACT TYPE RS_BOOL.
    $$ begin of inverse routine - insert your code only below this line-
    DATA:
    L_S_SELECTION LIKE LINE OF C_T_SELECTION.
    An empty selection means all values
    CLEAR C_T_SELECTION.
    L_S_SELECTION-FIELDNM = 'SGTXT'.
    Selection of all values may be not exact
    E_EXACT = RS_C_FALSE.
    $$ end of inverse routine - insert your code only before this line -
    ENDFORM.

    It has been solved.. thanks everyone for inputs.. points awarded to concerened.. thanks.

  • Conversion routine for time key figure

    Hi,
    i have a filed in datasource which has length 5 ( of numeric char ).it may be coz time can be represented as "hh:mm" which has of course of length 5.
    this particular field is mapped to a key figure of type time ( which is only 4 numc ).
    because of this mismatches transfer rules are not getting activated.
    what i need to do now? is it neccessary to write a conversion routine again?if yes, can any body write here the code required for it?
    thanks,
    Ravi

    Hi Ravi,
    Assuming time comes in 'HH:MM' , colon placed explicitly , Code should look like ...
    bwtime(2) = r3time+1(2) .
    bwtime2(2) = r3time3(2).
    Where BW_Time stands for info object.
              R3time stands for transfer structure field.
    Normally time field is of type  numc lenght 6 ( HHMMSS) and inthat case should not be any issue when used in BW system.
    Hope that helps.
    Regards
    Mr Kapadia
    ***Assigning points is the way to say thanks in SDN.***

Maybe you are looking for

  • Imported photos to ipad they are not looking the same

    i had synced photos to ipad from PC(windows XP) using itunes on PC. After Syncing they are not looking similar they are looking like negatives of original images on PC..

  • Capturing Footage that has been shot in Long Play?

    Good Morning All, I have been giving a tape that has been shot in Pal Long Play and I can not log and capture this DV Tape at all. Everytime I do try the footage is just useless. This may sound like a silly question but : Does anyone know the setting

  • Installing Oracle 8i on server with SQL Server 2000

    We have One Server (HP with: 4 processors XEON, 100 GB HD Raid 5, 8GB RAM). And this server has SQL Server 2000 running with some databases. We NEED to install ORACLE 8i for a product that they use that DB. IS THERE a problem to install and use ORACL

  • No bootable device. Insert disk and press any key

    My hard drive died recently. I installed a new one. Now I'm gettig no bootable device--insert boot disk and press any key. What should I do to fix this? This question was solved. View Solution.

  • How do you manage configs?

    I'm more curious than anything. I have ASAs at our primary site and ASAs at the DR site. I'm curious to see what you guys do with syncing those configs. The primary site has some differences from the DR site, so for now, I've been tftp'ing the config