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.

Similar Messages

  • Urgent plz help in currency conversions

    hi to all
             wrbtr = sum of dmbtr
    wrbtr = document currency
    dmbtr = local currency
    how can i match these
    there is any function module to convert one to other.
    plz help me in this issue
    take example wrbtr = 20,000
    sum of dmbtr =200
    i am not understanding does i should use a fm or some other to make
    wrbtr = sum of dmbtr
    does the local currency and document currencies r same.
    plz helpme
    Message was edited by: kranthi reddy

    Hi,
      Local currency & document currencies need not be same, and that is the reason function modules are used ( Convert_to_local_currency & Convert_to_foreign_currency ) to convert the amount either to your Local or to Document currency, if they are same there is no need for conversions,
      Can you elaborate on your query related to summing up the values as it is not clear,
    Rgds,

  • Time Conversion Routine- Help

    I have a requirement where Iam haivng the Value as Input in CSV File for Time Feild as 12:00:00 A or 10:15:00 PM.
    As per BW Standard Time feild object allows HH:MM:SS format .Hence, I need to know if there is any Solution to convert the Input Data into required BW Timefield Format as my Job is failing to upload through CSV File into BW.
    Would appreciate your help in advance
    Thanks
    Ashley

    Hey why are you asking the same question again ???
    Time Conversion Routine- Help

  • Warning in PDF "Field FS -BELNR has a conversion routine"

    Hii
    i hav converted a existing smartform to PDF..
    in PDF its showing Warnings
    Form ZSF_BANK_PAYMENT , Node BELNR
    ' Field <FS>-BELNR has a conversion routine (see sap note 796755) '
    Form ZSF_BANK_PAYMENT , Node EBELN
    ' Field <FS>-EBELN has a conversion routine (see sap note 796755) '
    plz help me out how to solve this...
    Thanks in Advance
    Satya

    Hi,
    I think the messages displayed are warnings, not errors.
    They won't effect the functionality and you can ignore them.
    Thanks.

  • Conversion Routines and Function Modules

    Hi All,
    I have to write the Conversion Routines and Transformation Process for below Fields,
    I have a situation, where am having text files with the data having below fields, and before uploading the data to Database i have to do conversion.
    So anybody Plz help me regarding this conversion topic how to write the process and how to write the code.
    Table       Field Name  Type    Length        Short Text
    BKPF     BLART       CHAR     2     Document Type       
    BKPF     BUKRS       CHAR     4     Company Code     
    BSEG     BUKRS       CHAR     4     Company Code     
    BSEG     HKONT       CHAR     10     General Ledger Account
    BSEG     KOSTL       CHAR     10     Cost Center       
    BSEG     VERTN       CHAR      13     Contract Number     
    KNA1     KUNNR       CHAR     10     Customer Number

    Hi Bala
      Supposing all the fields exist in internal table itab. You can add the code simple as below:
    loop at itab.
       perform conv_fld changing: itab-bukrs,
                                  itab-blart,
                                  itab-hkont,
                                  itab-kostl,
                                  itab-vertn,
                                  itab-kunnr.
    endloop.
    *&      Form  conv_fld
    FORM conv_fld  CHANGING fld.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = fld
    IMPORTING
       OUTPUT        = fld.
    ENDFORM.                    " conv_fld
    So for each field depending on its length the conversion routine acts and gives the right output. Please make sure, that your internal table if defined with the right field references or length.
    Kind Regards
    Eswar

  • How to write code for this logic, plz help me very urgent

    Hi All,
    i am new to sap-abap, i got this work and i m working on this can any body help me in writing code, plz help me, this is very very urgent.
    here  i m giving my logic, can anybody send me the code related to this logic.
    this is very urgent .
    this program o/p should be in ALV format and need to create one commond 'SAVE" on this o/t list  if  user clicks save processedon and processedby fields in ZFIBUE should be updated automatically.
    i am creating one custom table zfibue having fields: (serialno, bukrs, matnr,prdha,hkont,gsber,wrbtr,budat, credate, cretime,processed, processedon, processedby,mapped)
    fields of zfibue:
    serailno = numc
    bukrs = char
    matnr = char
    prdha = char
    hkont = char
    gsber = char
    wrbtr = char
    budat = date
    credate = date
    cretime = time
    processed= char
    processedon = date
    processedby = char
    mapped = char      are   belongs to above type data types
    and seelct-optionfields:  s_bukrs for bseg-bukrs
                                        s_hkont for bseg-hkont,
                                         s_budat for bkpf-budat,
                                         s_processed for zfibue-processed,
                                          s_processedon for zfibue-processedon,
                                          s_mapped. for zfibue-mapped
    parameters: p_chk1 as checkbox,
                      p_chk2 as checkbox.
                      p_filepath type rlgrap-filename.
    1.1 Validate the user inputs (S_BUKRS and S_HKONT) against respective check tables (T001 and SKB1). If the validation fails, provide respective error message. Eg: “Invalid input for Company Code”.
    1.2 Fetch SERIALNO, BUKRS, MATNR, PRDHA, HKONT, GSBER, WRBTR, BUDAT, CREDATE, CRETIME, PROCESSED, PROCESSEDON, PROCESSEDBY, MAPPED from table ZFIBUE into internal table GT_ZFIBUE where BUKRS IN S_BUKRS, HKONT IN S_HKONT, BUDAT IN S_BUDAT, PROCESSED IN S_PROCESSED, PROCESSEDON IN S_PROCESSEDON, and MAPPED IN S_MAPPED.
    1.3 If P_CHK2 = ‘X’, go to step 1.11. Else continue.
    1.4 If P_CHK1 = ‘X’, continue. Else go to step 1.9
    1.5 Fetch MATNR, PRDHA from MARA into GT_MARA for all entries in GT_ZFIBUE where MATNR = GT_ZFIBUE-MATNR.
    1.6 Sort and delete adjacent duplicates from GT_MARA based on MATNR.
    1.7 Loop through GT_ZFIBUE where PRDHA = blank.
              Read Table GT_MARA based on MATNR = GT_ZFIBUE-MATNR.
              IF sy-subrc = 0.
                     Move GT_MARA-PRDHA to GT_ZFIBUE-PRDHA.
                  Modify Table GT_ZFIBUE. “Update Product Hierarchy
                 Endif.
        Fetch PRDHA, GSBER from ZFIBU into GT_ZFIBU for all entries in GT_ZFIBUE where PRDHA = GT_ZFIBUE-PRDHA.
        Read Table GT_ZFIBU based on PRDHA = GT_ZFIBUE-PRDHA.
              IF sy-subrc = 0.
                     Move GT_ZFIBU-GSBER to GT_ZFIBUE-GSBER.
                  Move “X” to GT_ZFIBUE-MAPPED.      
                  Modify Table GT_ZFIBUE.
                 Endif.   
    Endloop.
    1.8 Modify database table ZFIBUE from GT_ZFIBUE.
    1.9 Fill the field catalog table GT_FIELDCAT using the details of output fields listed in section “Inputs/Outputs” (above).
       Eg:                 LWA_ FIELDCAT -SELTEXT_L = 'Serial Number’.
                              LWA_ FIELDCAT -DATATYPE = ‘NUMC’.
                              LWA_ FIELDCAT -OUTPUTLEN = 9.
                              LWA_ FIELDCAT -TABNAME = 'GT_ZFIBUE'.
                              LWA_ FIELDCAT-FIELDNAME = 'SERIALNO'.
              Append LWA_FIELDCAT to GT_FIELDCAT
    Note: a) The output field GT_ZFIBUE-PROCESSED will be editable marking INPUT = “X” in field catalog (GT_FIELDCAT).
             b) The standard ALV functionality will be used to give the user option for selecting all or blocks of entries at a time.
             c) The PF-STATUS STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN will be copied to the program and modified to include a “SAVE” button.
    1.10 Call the function module REUSE_ALV_GRID_DISPLAY passing output table GT_ZFIBUE and field catalog GT_FIELDCAT. Additional parameters like I_CALLBACK_PF_STATUS_SET (= ‘ZFIBUESTAT’) and I_CALLBACK_USER_COMMAND (=’HANDLE_USER_ACTION’) will also be passed to handle user events. Go to 2.14.
    1.11 Download the file to P_FILEPATH using function module GUI_DOWNLOAD passing GT_ZFIBUE.
    1.12 Exit Program.
    Logic to be implemented in  routine “Handle_User_Action”
    This routine will have the following interface:
    FORM Handle_User_Action  USING r_ucomm LIKE sy-ucomm
                                                               rs_selfield TYPE slis_selfield.
    ENDFORM.
    Following logic will be implemented in this routine:
    1.     If r_ucomm = ‘SAVE’, continue. Else exit.
    2.     Loop through GT_ZFIBUE where SEL_ROW = ‘X’. “Row is selected
    a.     IF GT_ZFIBUE-PROCESSED = ‘X’.
    i.     GT_ZFIBUE-PROCESSEDON = SY-DATUM.
    ii.     GT_ZFIBUE-PROCESSEDBY = SY-UNAME.
    iii.     MODIFY ZFIBUE FROM work area GT_ZFIBUE.
    Endif.
    Endloop.

    Hi Swathi,
    If it's very very urgent then you better get on with it, don't waste time on the web. Chop chop.

  • 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

  • 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

  • Query on FBL3N................Urgent  plz help me on this.

    Hi Friends
         Here is my query,
    I am changing the tcode FBL3N to add one extra field into it and to display data in the name1 field for the spcific entries in the selection screen,
    After selecting the All item radio button and giving the range in the select-options when i am pressing F8 it is giving me the correct output,after that when i am trying to display the name1 field by selecting the ctrl+f8 button and pressing the apply button  it is giving me the error as
    "An internal error has arisen in the form routine ANALYZE_ACT_FIELDCAT
    for program RFITEM_INC.
    This is due to inconsistencies between table T021S (special fields) and
    structure RFPOSEXT."
    I changed everything to Y* but still it is giving the error.
    Plz help me in this if someone face the same prob or someone having idea on this.
    Thanks a lot in Advance
    Mrutyun^

    Hi Mrutyunjaya,
    Did you manage to resolve this error?
    Thanks and Regards
    Pras

  • Lsmw issue plz help its urgent

    Hi Experts ,
    i need to create a LSMW using batch input .
    but the requirement is on the basis of conditions my recording need to be changed .
    dat means
    3127POL09 3127POL09-1 CTR 3127-1003E 100 FUL
    3127POL09 3127POL09-2 WBS 3127POL01 60 FUL
    for ctr i ill have to post data in screen number 200
    and for wbs i ill have to post data in screen number 400 .
    can we put some conditions in recording in lsmw ?
    i no we can create multiple recording but how can we use them to fullfill my requirement .
    plz help its urgent
    thanx in advance

    Hi,
    Within LSMW, there is an option to write our own code wherein this code can be incorporated.
    This is in the Field Mapping Option...
    Just go to the Menu Extras->Layout
    and click on the check box Form Routines
    Global Data.
    Here you can define Global Variables and also perform your ABAP Coding.
    Regards,
    Balaji.

  • ORA-03120: two-task conversion routine: integer overflow

    Hello DB Gurus!!
    Need your comments and help once again...
    I am trying to import a DUMP file into My Local Database ie. Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    The file exported was by different user on different Dabase of Oracle 10g i.e. Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
    but while I am trying to import, I getting the following error..
    Please help.. and suggest the alternate..
    Warning: the objects were exported by XYZABC , not by you
    import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    import server uses WE8ISO8859P1 character set (possible charset conversion)
    IMP-00008: unrecognized statement in the export file:
    . importing NEXOS_ADMIN_OLTP_API's objects into SHRICHANDRA_ABC123
    IMP-00003: ORACLE error 3120 encountered
    ORA-03120: two-task conversion routine: integer overflow
    . importing NEXOS_ADMIN_OLTP_TAB's objects into SHRICHANDRA_XYZ123
    IMP-00003: ORACLE error 3120 encountered
    ORA-03120: two-task conversion routine: integer overflow
    Thanks in advance..

    Thank Rajneesh,
    I suspect the same issue as you did, But unfortunately I don't have much option available, as other side all are production DB so All I can do is pull from there that is export and import to my local where I am stuck!!!
    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.***

  • How to use conversion routine?

    hi,
    in my z-table i have a field called matnr for the material number say.
    its domain defines it as 18 char.
    say i have created an entry say 200.
    so it will be saved may be as 000000000000000200.
    i want it should be displayed with as 200.
    and if i search for say 200.
    so it should not look for the proceeding zero's.
    it should not give me an error that record doesn't exists.
    please tell me how to use exaclty conversion routine.
    thanks
    ekta

    hi all,
    the problem has been solved.
    CONVERSION_EXIT_MATN1_OUTPUT   this FM module can only be used where the z-table has matnr of the type MATNR the standard matnr of the table mara.
    so in my program it was not working.
    my data element was not matnr.
    i had used a popup for position finder.
    so it could not read the material number which had zeros as prefixes.
    thanks for all the help
    thanks
    ekta
    below the code is mentioned...................
    *******************************C O D E*******************************************
        WHEN '&POS'.
          popup_title       = 'Choose The Material Number'.
          CLEAR it_fields.
          it_fields-tabname    = 'Z10ET_TAB_MAT01'.
          it_fields-fieldname  = 'MATNR'.
          it_fields-field_attr = ' '.
          it_fields-field_obl  = 'X'.
          APPEND it_fields.
          CALL FUNCTION 'POPUP_GET_VALUES'
            EXPORTING
              no_value_check  = 'X'
              popup_title     = popup_title
              start_column    = '5'
              start_row       = '5'
            IMPORTING
              returncode      = returncode
            TABLES
              fields          = it_fields
            EXCEPTIONS
              error_in_fields = 1
              OTHERS          = 2.
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          IF returncode = ' '.
            MESSAGE i036 WITH it_fields-value.
            SORT it_material_data BY matnr.
            READ TABLE it_material_data INTO wa_material_data
                            WITH KEY matnr = it_fields-value.
            IF sy-subrc = 0.
              tab_ctrl1-top_line = sy-tabix.
              REFRESH it_fields.
              CLEAR returncode.
              CLEAR ok_code_0101.
            ELSE.
              CONCATENATE concat it_fields-value INTO v_matnr.
              READ TABLE it_material_data INTO wa_material_data
                              WITH KEY matnr = v_matnr.
              IF sy-subrc = 0.
                tab_ctrl1-top_line = sy-tabix.
                REFRESH it_fields.
                CLEAR returncode.
                CLEAR ok_code_0101.
              ELSE.
                MESSAGE i037 WITH it_fields-value.
                REFRESH it_fields.
                CLEAR returncode.
                CLEAR ok_code_0101.
              ENDIF.
            ENDIF.
          ENDIF.

  • How to remove conversion routine "ABPSN"

    Dear gurus,
      In my transfer rules, under the tab "DataSource/Trans. Structure", I have a field PSPID whose "Conversion Routine" has the value "ABPSN". This conversion routine converts the external format to the SAP format which, however, is not what I want. I want to remain the original format so I need to remove this "ABPSN" conversion routine. When I double clicked it, it linked to the InfoObject 0PROJECT maintanace screen. On that screen, I removed the conversion routine "PROJ" for 0PROJECT, but still ABPSN remains and the data loaded into the InfoCube have been converted.
       So how can I remove this ABPSN convertion routine?
      Thanks in advance.
      Jin Ming

    Hi Jin Ming,
    Conversion Exit ABSPN is related to WBS element and not project at R/3 side.
    But at BW side this routine internally calls Project routine .
    The Process is,
    1. Delete all transactional data , from related ODS & Cube wherever 0PRoject is used .
    2. Delete master data from 0Project.
    3. Change object 0Project remove the conversion using Tcode RSD1.
    4. Load master data for 0Project.
    5. Load transaction data.
    Hope that helps.
    Regards
    Mr Kapadia

  • Conversion Routine problem

    Hi,
    In one of the info object there is a conversion routine. So, when the query is executed in BeX Query Analyzer the result is comming correct i.e. if in the database the value of info object is 0001234 then at display it is coming as 1234.
    However, in case if its value is "STEP" in database , at output "Not Assigned" is comming. Dont know what is happening. If anybody already encouter this problem please help.

    Hi,
    It is not in the hierarchy.
    I am using alpha routine so as to remove the leading zeros at the time of display.
    There are two info objects, both are same, the only difference between them is one info object is having alpha routine and another one is without it.
    The one info object without any routine is displaying values correctly but the another one with aplha routine is displaying 00123 as 123 but also displaying STEP as Not Assigned.
    Edited by: megamin79 on Feb 9, 2012 7:43 PM

Maybe you are looking for