ABAP Code to filter only Numbers in Transformation

Experts,
I have a string which can either have only:
a. Numbers as value - eg is 00000009165240
b. Characters as value - eg is 'PP_INDEP_REQMTS_DIRECT_INPUT'
c. AlphaNumeric as value - eg is IT04
I need to write an abap routine which will do the following:
a. Remove leading zeroes if its a number
b. No action or nothing done on the data which is character or alphanumeric. I pass as it is
I am a novice at ABAP. I need the code for the outcome in the transformation.
Thanks,
Raj

use the FM
CONVERSION_EXIT_ALPHA_OUTPUT

Similar Messages

  • Routine (ABAP Code)  in Transformation error

    Hi Experts
    Please correct the ABAP CODE written as Field routine in Transformations
    Requirment
    If  ZB_AMT = '0.00'
    then result should be '0.00'
    If  ZB_AMT <> '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT'
    the result should be
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    If  ZB_AMT <> '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE'
    the result should be
    CONCATENATE  SOURCE_FIELDS-/BIC/ZB_AMT  '%' INTO RESULT.
    The code below is not working as it should please update me where i went wrong
    Source Fields
    SOURCE_FIELDS-/BIC/ZB_AMT (CHAR)
    SOURCE_FIELDS-/BIC/ZB_TPE1 (CHAR)
    CODE
    IF SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
          RESULT = '0.00'.
        ELSE.
          IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' AND
             SOURCE_FIELDS-/BIC/ZB_AMT <> '0.00'.
            CONCATENATE '$' SOURCE_FIELDS-/BIC/ZBON_AMT INTO RESULT.
            IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE' AND
               SOURCE_FIELDS-/BIC/ZB_AMT <> '0.00'.
              CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
            ENDIF.
          ENDIF.
        ENDIF.

    Your logic will not work, if your first check on amount is 0.00 fails, the other checks fail as well. I am not sure of the requirement but..try this..
    IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' AND SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZBON_AMT INTO RESULT.
    ELSEIF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE' AND SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    ELSEIF SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
      RESULT = '0.00'.
    ELSE.
    Do nothing or throw any message
    ENDIF.

  • Need Abap Code Help

    Hi ,
    I am trying to activate an ODS but it is failing the activation process . When I look into the application log I see this error    "Value 'RAM???¿????????S RAM' (hex. '4D41524B3F3F3FBF3F3F3F3F3F3F3F3F5320574F524B') of characteristic ZEUID contains invalid characters "
    I am new to ABAP and I need an ABAP code to filter this value when loading data into ODS .
    Thanks a lot for your help

    HI,
      Write the code in the start routine.
      IN the start routine you have a table called SOURCE_PACKAGE.
      declare work area x_souce_package type source_package
    data : lv_string(100).
      loop at souce_package into x_source_package.
      lv_string =  x_source_package-value.
    TRANSLATE LV_STRING TO UPPER CASE
      if lv_string CA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' .
      ELSE.
      DELETE SOURCE_PACKAGE INDEX SY-TABIX.
      ENDIF.
      endloop

  • ABAP Code Corrections

    Hi Experts
    Please correct the ABAP CODE written as Field routine in Transformations
    Requirment
    If ZB_AMT = '0.00'
    then result should be '0.00'
    If ZB_AMT '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT'
    the result should be
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    If ZB_AMT '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE'
    the result should be
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    The code below is not working as it should please update me where i went wrong
    Source Fields
    SOURCE_FIELDS-/BIC/ZB_AMT (CHAR)
    SOURCE_FIELDS-/BIC/ZB_TPE1 (CHAR)
    CODE
    IF SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
    RESULT = '0.00'.
    ELSE.
    IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' AND
    SOURCE_FIELDS-/BIC/ZB_AMT '0.00'.
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZBON_AMT INTO RESULT.
    IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE' AND
    SOURCE_FIELDS-/BIC/ZB_AMT '0.00'.
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    ENDIF.
    ENDIF.
    ENDIF.

    If ZB_AMT '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT'
    the result should be
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    If ZB_AMT '0.00' and
    SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE'
    the result should be
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    if zb_amt = '0.00' and SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT'.
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    endif.
    if zb_amt = '0.00' and SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE'.
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    endif.
    you can use a case statement as well
    if zb_amt = '0.00'.
    case SOURCE_FIELDS-/BIC/ZB_TPE1.
    when 'AMOUNT'.
    CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
    when 'PERCENTAGE'.
    CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
    endcase.
    endif.

  • ABAP code in transformation

    Hello,
    I have a transformation routine as follows:
    DATA:l_lifnr1 TYPE /BI0/MBATCH-VENDOR,
             l_greybatch TYPE /BI0/MBATCH-BATCH,
             oref   TYPE REF TO cx_root,
              l_num type i,
              l_len  type i,
              l_len1(2)  type c.
        l_len = strlen( SOURCE_FIELDS-/BIC/ZBAT_SUP ).
        l_len1 = ( l_len - 1 ).
        try.
            concatenate SOURCE_FIELDS-/BIC/ZBAT_SUP+0(l_len1) 'G' into
            l_greybatch.
          catch CX_SY_CONVERSION_NO_NUMBER INTO oref.
        ENDTRY.
    =============
    this transformation is between a infosource and infoobject. When i run the DTP, it gives an error at the line "concatenate SOURCE_FIELDS-/BIC/ZBAT_SUP+0(l_len1) 'G' into l_greybatch."
    This -/BIC/ZBAT_SUP is calculated using a routine in the transformation between the datasource and the infosource. The same DTP is used for both load across both these transformations.
    what is wrong? any suggestions?

    Hello Siegfried,
    Thank you very much.
    As you rightly pointed out -/BIC/ZBAT_SUP is not filled.
    But i didnt want to fill it in the second transformation(between the infosrc and infoobject) becoz, this is used for populating 2 differnt objects for which there are different rules. I will have to run the logic(for populating -/BIC/ZBAT_SUP) twice in these 2 rules.
    Hence i was trying to populate it in the first transformation(between the datasrc and the infosrc) and then use this value in the 2 rules in the second transformation.
    Can you give me some other logic to do the same with the necessary ABAP code?
    Following is the routine use to populate -/BIC/ZBAT_SUP in the first transformation:
    $$ begin of routine - insert your code only below this line        -
    DATA: l_charg TYPE /BIC/AZMM_O0100-BATCH.
          SELECT SINGLE /BIC/ZBAT_SUP FROM /BIC/AZMM_O0100
          into l_charg
              WHERE BATCH = SOURCE_FIELDS-CHARG.
         RESULT = l_charg .
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "compute_ZBAT_SUP
    ====================================================
    The second transformation populates 2 different vendor fields in 2 different rules. Both the rules use the follwing 2 routines:
    $$ begin of routine - insert your code only below this line        -
        DATA:l_lifnr1 TYPE /BI0/MBATCH-VENDOR,
             l_greybatch TYPE /BI0/MBATCH-BATCH,
             oref   TYPE REF TO cx_root,
              l_num type i,
              l_len  type i,
              l_len1(2)  type c.
        l_len = strlen( SOURCE_FIELDS-/BIC/ZBAT_SUP ).
        l_len1 = ( l_len - 1 ).
          try.
              concatenate SOURCE_FIELDS-/BIC/ZBAT_SUP+0(l_len1) 'G' into
              l_greybatch.
         move SOURCE_FIELDS-/BIC/ZBAT_SUP(l_len1) to l_greybatch.
         move 'G' to l_greybatch+l_len1(1).
            catch CX_SY_CONVERSION_NO_NUMBER INTO oref.
          ENDTRY.
    *Populating Supplying(finished) batch vendor
          select single VENDOR from /BI0/MBATCH
          into l_lifnr1
          where BATCH = l_greybatch.
          RESULT = l_lifnr1.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "compute_0VENDOR
    =====================================================
    METHOD compute_ZVENDOR.
      IMPORTING
        request     type rsrequest
        datapackid  type rsdatapid
        SOURCE_FIELDS-/BIC/ZBAT_SUP TYPE /BIC/OIZBAT_SUP
       EXPORTING
         RESULT type tys_TG_1-/BIC/ZVENDOR
        DATA:
          MONITOR_REC    TYPE rsmonitor.
    $$ begin of routine - insert your code only below this line        -
    DATA:l_lifnr1 TYPE /BI0/MBATCH-VENDOR.
    *Populating Supplying(finished) batch vendor
                select single VENDOR from /BI0/MBATCH
                into l_lifnr1
                where BATCH = SOURCE_FIELDS-/BIC/ZBAT_SUP.
         RESULT = l_lifnr1.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "compute_ZVENDOR
    ===================================
    thank you....

  • ABAP code for BI 7.0 transformations start routine

    Hi all,
    I am trying to update data from DSO1 (Source1: transaction data) to Infocube(TARGET)
    In the transformations Start routine, I have to read DSO2(Source2: Master data) for some fields.
    DSO1 has CUSTOMER as part of key
    DSO2 has CUSTOMER (key) and other fields....FIELD1, FILED2, FIELD3
    Infocube to be updated with FIELDS1,2 & 3 WHILE READING DSO2.
    WHERE DSO1 CUSTOMER matches with DSO2 CUSTOMER.
    Also, data NOT TO BE UPLOADED into Infocube if FIELD1 in DSO2= NULL
    Please give me the abap code for the above logic.
    Appreciate any help in this regard.
    Thanks.

    This is a doc from this site:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19
    Ravi Thothadri

  • Execute ABAP code in Start Routine only once

    I have ABAP code in a start routine that I only want to execute once. Is there a way to tell this is first execution of the start routine?
    Also can I find out these value in the start routine ABAP:
    1. How many data packets there are?
    2. What data packet I am processing?
    Regards,
    Mike...

    Hi,
    I've just setup a little test:
    TRules, Start Routine Global Decl:
    DATA: GVI TYPE I, GVN(5) TYPE N.
    Start Routine:
    IF GVI IS INITIAL.
    GVI = 1.
    ELSE.
    ADD 1 TO GVI.
    ENDIF.
    MOVE GVI TO GVN.
    This is basically counting the times the start routine is executed and populating the var GVN; I am posting GVN in a char ZTESTGV in the target cube. I am posting as well the datapakID in my cube.
    I have loaded two requests (each 4 packets)
    the first one first to PSA and then from the PSA to the target: this is Serially using one single process. Here's the result in the cube:
    Request________________________________DATAPAKID_____ZTESTGV
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________1____________1
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________2____________2
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________3____________3
    REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________4____________4
    In this case the global variable is persistent accross packets.
    the second request is loaded in paralell: this is, multiple processes are executed at the time. Here's the result in the cube:
    Request________________________________DATAPAKID_____ZTESTGV
    REQU_14QVH21BSVH44FAJW94BD7N2H____________1____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________2____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________3____________1
    REQU_14QVH21BSVH44FAJW94BD7N2H____________4____________1
    In this case the global variable is always1 !!
    This is logic since several a process cannot access the internal memory used by another one...
    Conclusion; the global variable will work only if the load is serial...
    hope this helps...
    Olivier.

  • Convert ABAP code in start routine/update rule to transform. start routine

    Dear BW ABAPers,
    I have created a custom purchasing info cube (YCP_PURC1) based on 0CP_PURC1 standard cube. I would like to convert this new data flow to BI7 (from 3.x), and convert the standard update rule to transformation. I would need to rewrite the below start routine from the standard update rule to a start routine ABAP code in the newly created  transformation / start routine. My ABAP knowledge is limited. Will you please help?
    *this is the start routine from the update rule. As a side note, the data source is 2LIS_02_SCL.
    LOOP AT SOURCE_PACKAGE.
        IF (     SOURCE_PACKAGE-cppvlc  EQ 0
             AND SOURCE_PACKAGE-cppvoc  EQ 0
             AND SOURCE_PACKAGE-cpquaou EQ 0 ).
          DELETE SOURCE_PACKAGE.
          CONTINUE.
        ENDIF.
    no_scl is initial ( e.g. for good receipts, billing)
    value has to be set depending on storno
        IF SOURCE_PACKAGE-no_scl IS INITIAL.
          IF SOURCE_PACKAGE-storno = 'X'.
            SOURCE_PACKAGE-no_scl = -1.
          ELSE.
            SOURCE_PACKAGE-no_scl = 1.
          ENDIF.
          MODIFY SOURCE_PACKAGE.
        ENDIF.
      ENDLOOP.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    Many thanks and look forward to your kind feedback.
    Kind regards,
    Csaba

    Dear All, Durgesh,
    thanks to you all for your valuable input. Mainly the ABAP part was more interesting for me.
    Durgesh, thanks for your input, it was useful. I just had to change the info objects to data source fields and add the lines before the loop:
    DATA: I_PACKAGE TYPE TYT_SC_1.
        FIELD-SYMBOLS <i_package> TYPE tys_sc_1.
        I_PACKAGE[] = SOURCE_PACKAGE[].
        LOOP AT SOURCE_PACKAGE assigning <i_package>.
          IF ( <i_package>-BWGEO EQ 0
          AND <i_package>-BWGEOO EQ 0
          AND <i_package>-BWMNG EQ 0 ).
            DELETE SOURCE_PACKAGE index sy-tabix.
            CONTINUE.
          ENDIF.
    no_scl is initial ( e.g. for good receipts, billing)
    value has to be set depending on storno
          IF <i_package>-NOSCL IS INITIAL.
            IF <i_package>-ROCANCEL = 'X'.
              <i_package>-NOSCL = -1.
            ELSE.
              <i_package>-NOSCL = 1.
            ENDIF.
          ENDIF.
        ENDLOOP.
    Points have been assigned accordingly.
    Thanks,
    Csaba

  • Can I use OLAP variable in ABAP Code of infoobject filter

    I have 0FISCPER infoobject in filter section of info-package while loading data.
    Below OLAP varaibles has below dynamic values that are being calculated at run time.
    0P_PRFP2 -  (Current fiscal period - 2)   ex: 2010010
    0P_PRFP1 -  (Current fiscal period - 1)   ex: 2010011
    0FPER    -    (Current fiscal period )        ex: 2010012
    I want to write ABAP CODE FOR using filter values from 0P_PRFP2 to 0FPER. (Last 3 fiscal periods - ex: 2010010 to 2010012).
    how to  use above standard OLAP variables in ABAP CODE to assign l_t_range (low or  high).

    try this using ABAP routine option (6)
    DATA: curryear(4)           type N,
                 currperiod(2)         type N,
                 prevper1(2)           type N,
                 prevyear1(4)         type N,
                 prevper2(2)           type N,
                 prevyear2(4)         type N,
                 prevfiscperYr1(7)   type N,
                 prevfiscperYr2(7)   type N,
                 prevfiscper1(3)      type N,
                 prevfiscper2(3)      type N,
                 w_length1              type i,
                 w_length2              type i.
      curryear = SY-DATUM+0(4).
      currperiod = SY-DATUM+4(2).
      If currperiod EQ '01'.
        prevyear1 = curryear - 1.
        prevper1   =  '12'.
        prevyear2 = curryear - 1.
        prevper2   = '11'.
      elseif currperiod EQ '02'.
        prevyear1 = curryear.
        prevper1   = '01'.
        prevyear2 = curryear - 1.
        prevper2   = '12'.
      else.
        prevyear1 = curryear.
        prevper1   =   currperiod - 1.
        prevyear2 = curryear.
        prevper2   = currperiod - 2.
      endif.
      w_length1 = STRLEN( prevper1 ).
      If w_length1 = 1.
        concatenate '0' prevper1 into prevper1.
      Endif.
      w_length2 = STRLEN( prevper1 ).
      If w_length2 = 1.
        concatenate '0' prevper2 into prevper2.
      Endif.
      concatenate '0' prevper1 into prevfiscper1.
      concatenate '0' prevper2 into prevfiscper2.
      concatenate prevyear1 prevfiscper1 into prevfiscperYr1.
      concatenate prevyear2 prevfiscper2 into prevfiscperYr2.
      l_t_range-low = prevfiscperYr2.
      l_t_range-high = prevfiscperYr1.
    *  modify l_t_range index l_idx from l_t_range.
    l_t_range-sign   = 'I'.
    l_t_range-option = 'BT'.
    modify l_t_range index l_idx.

  • How to read Filter selection variable values into ABAP code

    HI IP Gurus,
    Requierement: In my filter characterstics, i have assigned variables, which use will enter when running th e planning sequence.
    so  variable values entered by user , i would like to get those values into ABAP code and pass them to some function module.
    SO please give me step by step detail how to achive this.
    MY understanding use the below method . but not sure how to proceed.Please let me know abap code to get values.
    GET_TAB_PARAM_DATA_SEL and GET_PARAM_DATA_SEL.
    Please help me.
    Thanks in advance.Will Assign points
    Sania

    Hi Srinivas,
    So In RSPLF1 , in paramters tab, Do i have create structure(str1) and then create component Data selection (Dtsel1) under str1(what setting i have to do here, where should i enter variable value and do i need to give info object name and how do it in code.i tried to following example, not able to get any values in tab_sel .
    It will be great, if you could explain in detail.
    other thing i found out is in Initialization method i can read i_t_data_charsel table values , where it contains filter slected values.but could not pass  these values to execute method
    Is there is any way that i can pass values from init method to execute method.
    A tabular structured parameter with name "MY_TABSTRUC" is defined for the function type. "MY_TABSTRUC" consists of the two parameter components "MY_ELEM" and "MY_DATASEL". You access the parameter values as follows:
    DATA: TAB_PARAM_STRUC TYPE RSPLFA_T_PARAM_STRUC,
           REF_PARAM_STRUC    TYPE REF TO IF_RSPLFA_PARAM_STRUC,
          REF_PARAM_ELEM     TYPE REF TO IF_RSPLFA_PARAM_ELEM,
          REF_PARAM_DATASEL  TYPE REF TO IF_RSPLFA_PARAM_DATESEL,
           L_VAL(20)          TYPE C,
           TAB_SEL            TYPE RSPLF_T_CHARSEL.
    get table of parameter MY_TABSTRUC:
      TAB_PARAM_STRUC = I_R_PARAM_SET->GET_TAB_PARAM_STRUC( 'MY_TABSTRUC' ).
    process all lines:
      LOOP AT TAB_PARAM_STRUC into REF_PARAM_STRUC.
      get component MY_ELEM:
        REF_PARAM_ELEM = REF_PARAM_STRUC->GET_COMP_ELEM( 'MY_ELEM' ).
      get internal value of MY_ELEM:
        REF_PARAM_ELEM->GET_VALUE( IMPORTING E_VALUE = L_VAL ).
      get component MY_DATASEL:
        REF_PARAM_DATASEL = REF_PARAM_STRUC->GET_COMP_DATA_SEL( 'MY_DATASEL' ).
      get data selection table of MY_DATASEL:
        TAB_SEL = REF_PARAM_DATASEL->GET_T_SEL( ).
      ENDLOOP.
    Thanks in Advance..please help me

  • Not able to remove the ABAP code from Transformation

    Hello Experts,
    We have transformation for DSO in that for one infoobject, field routine is written, Break Point is hard coded there and it's move to production. Now we are trying to remove that break point from development and then move it production.
    we are doing following activity to remove the break point.
    1. Open the transformation.
    2. Open the field routine.
    3. Going to ABAP code in field  routine.
    4. Remove the hard coded Break Point from ABAP code.
    5. Saving the code.
    6. It's taking to again filed routine window.
    7. We close the window and activate the transformation.
    8. When again check the ABAP code in field routine then it shows hard coded Break Point again.
    9. Not able to remove the hard coded break point.
    Can anyone know how to do this.
    Help will be appreciated.
    Thanks

    Hi,
    As pointed above, after point 6 don't simply close the window but click on Transfer Value and then activate your transformation. Refresh the system and check again.
    Regards,
    Arminder

  • I have Photoshop CS6, Windows 7, I have no entry at the accesscode. When i will write the code into the nummeric fields. I can write only numbers, but no letters. What can I do?

    I have Photoshop CS6, Windows 7, I have no entry at the accesscode. When i will write the code into the nummeric fields. I can write only numbers, but no letters. What can I do?

    If you are talking about the serial number, as far as I know serial numbers are entirely numeric so there is no need to enter letters.  Maybe you are using the incorrect code.
    To locate the serial number:
    http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • I purchased Elements 13 and everything downloaded great.  When I go to license the software before use the code wont accept letters, only numbers. My serial number has both.

    I can't use the software before a license it.  I am on the page to type in the serial number and it won't take letters only numbers.  This is very frustrating.

    Hi John,
    It seems you have got a redemption code. Try to follow the link mentioned below.
    Redemption Code Help
    https://helpx.adobe.com/x-productkb/global/find-serial-number-student-teacher.html
    https://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Thanks,
    Atul Saini

  • Improve data load performance using ABAP code

    Hi all,
             I want to improve my load performance using ABAP code, how to do this?. If i writing ABAP code in SE38 how i can call
    in BW side? if give sample code to improve load performance it will be usefull. please guide me.

    There are several points that can improve performance of your ABAP code:
    1. Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE.
    2. Use WHERE clause in your SELECT statement to restrict the volume of data retrieved.
    3. Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot.
    4.Avoid using nested SELECT and SELECT statements within LOOPs.
    5. Avoid using INTO CORRESPONDING FIELDS OF. Instead use INTO TABLE.
    6. Avoid using SELECT * and select only the required fields from the table.
    7. Avoid Executing a SELECT multiple times in the program.
    8. Avoid nested loops when working with large internal tables.
    9.Whenever using READ TABLE use BINARY SEARCH addition to speed up the search.
    10. Use FIELD-SYMBOLS instead of a work area when there are more than 200 entries in an internal table where some fields are being manipulated.
    11. Use MOVE with individual variable/field moves instead of MOVE-CORRESPONDING.
    12. Use CASE instead of IF/ENDIF whenever possible.
    13. Runtime transaction code se30 can be used to measure the application performance.
    14. Transaction code st05 can be used to analyse the SQL trace and measure the performance of the select statements of the program.
    15. Start routines can be used when transformation is needed in the data package level. Field/individual routines can be used for a simple formula or calculation. End routines are used when you wish to populate data not present in the source but present in the target.
    16. Always use a WHERE clause for DELETE statement. To delete records for multiple values, use SELECT-OPTIONS.
    17. Always use 'IS INITIAL' instead of equal to '' because null for a character is '' but '0' for an integer.
    Hope it helps.

  • Needs sample ABAP code for field routine

    Dear Expert,
    There is a field "Pay Scale Group" in my DSO which stores the data in the format
    AA1/B1/CCC2/DD2/EEE1, A1/BB2/CC2/DDD3/EE2 etc. These data has to be transferred to
    InfoCube where "pay Scale Group" in the InfoCube will store the data like EEE1,EE2 etc.
    I need to write a field routine on the transformation between DSO and Cube.
    Can any one please help me with the sample ABAP code for this scenario.
    Some more examples for better understanding of the requirement:-
    Data in DSO(Source)            Data in Cube(Target)
    ===================            ===================
    AA1/B1/CCC2/DD2/EEE1            EEE1
    AAA1/BB2/CC1/DDD3/EE2           EE2
    A2/BBB2/CC2/DDD3/EEE5           EEE5
    AA2/BB1/C1/DDD3/EE3             EE3
    A3/B1/CC2/DDD1/EE4              EE4
    Many thanks in advance.
    Regards,
    Prakash
    Please do not dump your code requirements in SDN
    Edited by: Pravender on May 18, 2011 11:37 AM

    Hi,
    You can use the following code :
    Suppose the technical name of the field coming from DSO is ZPAY_SGRP.
    And also for example let me take one record, that is ZPAY_SGRP = AA1/B1/CCC2/DD2/EEE1 .
    My assumption is that there will always be 4 '/'.
    In the field routine write the below code
    data: V1(5) type c,
              V2(5) type c,
             V3(5) type c,
              V4(5) type c,
             V5(5) type c.
    data : VAR1 TYPE /BIC/OIZPAY_SGRP.
    split VAR 1  at '/' into V1 V2 V3 V4 V5.
    result = V5.
    V5 will be having the characters after the last '/' .That is V5 = EEE1.
    Hope the above reply was helpful.
    Kind Regards,
    Ashutosh Singh
    Edited by: Ashutosh Singh on May 17, 2011 3:53 PM
    Edited by: Ashutosh Singh on May 17, 2011 4:17 PM

Maybe you are looking for

  • I can't open My document

    Hi I can't open a document

  • Unable to Activate Windows 2012 Data Center Evaluation Copy

    I installed a Windows Server 2012 Data Center Preview Evaluation Copy.  I am trying to Activate it now so that it stops rebooting every hour.  I obtained the Activation Key for a Full Version and tried all of the following to activate it: 1.  Ran the

  • Active vs. Inactive Transformations

    HI, Just wondering the reason for inactive transformations (white ribbon)?  Why would you have inactive transformations?  Do inactive transformations get executed, or only active transformations?  Also, I'm seeing an inactive transformation based on

  • Time overlapping of data record

    Hi All, I am facing the problem Time overlapping of data record while loading Infopackage. Error: Record 46 :YGTMARKET : Time overlapping of data record 46 with 47 : '['99991231'/'19000101'] '[to/fr whats the remedy? Thanks sonal

  • Signing in on a second computer

    I have two computers. Creative cloud is installed on computer #1. I'm trying to use the same login/password (that i'm using on Computer #1) to install Creative Cloud on computer #2. Every time I enter that same login/password, it tells me "you've bee