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

Similar Messages

  • Start routine update rules

    Hi Gurus,
    We are nw04s BI SP10 and I've completely implemented Note 981194.  I can't seem to get my start routine update rules to convert using Transformation Erzeugen.  I tried several scenarios, and still no success.
    If somebody has code for BI 7 transformation start routine for datasources 2LIS_03_BX, BF and UM to the 0IC_C03 cube, I would greatly appreciate an email to [email protected] .  Points will be assigned.  I can cut/paste the routines from the update rules, I just need the start routines.
    Kind Regards,
    Alex

    Alex
    Don't trust the converter - you have to check it all from end to end anyway so might as well do it manually.
    I did the whole of _BF yesterday.
    Here's the start routine. 
    *<2004s code>
        field-symbols:
               <fs_SOURCE_PACKAGE> type tys_sc_1.
    only movements from to evaluated stocks are concerned
    if stock-category is not intitial -> Delete from data-packag
    or Header of generic article      -> Delete from data-packag
        loop at SOURCE_PACKAGE assigning <fs_SOURCE_PACKAGE>.
          if not <fs_SOURCE_PACKAGE>-bsttyp is initial
          or ( <fs_SOURCE_PACKAGE>-bwvorg = '450' and
               <fs_SOURCE_PACKAGE>-bwapplnm = 'IS-R' ) .
            delete SOURCE_PACKAGE.
          endif.
        endloop.
    *</2004s code>
    Cheers
    Guy

  • ABAP Program to delete the update rules

    Hi guys,
            Is there any ABAP Program to delete the update rules if any body knows.

    Hi dear,
    try with FM RSAU_UPDR_DELETE...
    Hope it helps!
    Bye,
    Roberto
    ...and please dont forget to reward the answers...it-s THE way to say thanks here !

  • Convert ABAP code to a flowchart

    Is there any tool that can Convert ABAP code to a flowchart? Please give  me the details like download link if there any.
    Please help

    Is there any tool that can Convert ABAP code to a flowchart? Please give  me the details like download link if there any.
    Please help

  • How to upgrade Update rules to Transformations

    Hi
      My is to Update/Upgrade UPDATE RULES to TRANSFORMATIONS
      How can i do it in BI 7.0.
      Is there any programe that will upgrade the update rules to transformations
    Thanks

    Hi,
    Right click on your update rule
    Goto -> additional functions
    say create transformations.
    It will automatically convert your update rule into BI 7.0 transformation.
    Regards
    Githen

  • Migration of update rules to transformations

    Hi Experts,
    We are in process of migrating update rules to Transformations.
    We have following data flow for one info cube.
    *Existing*
    Data source -
    >transfer Rules--->info source->update rules--
    >cube
    New
    Data source -
    >transformations----
    >cube
    When I am trying to create transformations, I am not able to read master data properties for all info objects.
    It gives error that No info object is available.
    Now my question is
    it is not possible to read mster data in one transformation?
    If I change my new scenario to this then it workes.
    Data source -
    >transformations----->info source(new BI7)--
    >transformations -
    >cube
    But then I need to convert All existing info source to new one in BI7 then only I can use read from master data functionality.
    Please advice.
    <removed by moderator>
    Edited by: Siegfried Szameitat on Nov 25, 2008 9:05 AM

    In the Transformation maintenance, open the rule details.
    Here you see the source fields of the rule.
    Update 'IOAssgnmnt' with the InfoObject corresponding to the field from the source system.
    Example
    Field PERNR
    Description Personnel No.
    Type NUMC
    Length 8               
    Conversion
    IOAssgnmnt 0EMPLOYEE  <-- Entered manually
    Then you should be able to use the 'Read master data' functionality.
    Regards,
    Lars

  • Error during converting update rule into transformation

    Hi,
    I'm convertng update rule 2lis_03_bx in to transformation. Not all the keyfigure abap routine are changed in ABAP 00.
    Like 0RECVS_VAL, 0ISSVS_VAL are not converted where as some of them are converted. Will i need to make changes manually..
    Sachin K

    Hi Sachin,
    Please take a look at this OSS note - 981194.
    Hope this helps,
    Bye...

  • How to Code "AND" logic in Update Rule?

    Hi:
    I have minimal ABAP knowledge and need some help....
    I have to use the Query logic and code in my Update rule... (i.e. multiple conditions have to be met)
    IF (COMM_STRUCTURE-Sales_Org = '100' AND  COMM_Structure-Division = 'LA' AND COMM_STRUCTURE-Acct_Grp = '0120')
          RESULT = COMM_STRUCTURE-Credit_Amoutn (I want to assign a specific KF)
    ELSE
         RESULT = 0 (I want to assign Zero)
    ENDIF
    I attempted this logic, but I keep getting an error with 'AND' statement.  I am not sure what is the syntax.
    Can someone please help me out with the  logic/sytax
    Thanks..... Lee

    Hi:
    I responded without checking the logic.... assuming it would work...!~
    Unfortunately it gives me error:
    QUOTE
    E:Incorrect logical expression: ")" must be followed by "AND" or "OR" . .
    UNQUOTE
    Can anyone help me resolving this please....!!!!
    Thanks... lee

  • ABAP Runtime error while activating Update rules.

    Hi Gurus,
    Actually we are in NW 2004's SP9.
    While activating the update rules of cube "0PY_PPC01" it is going to ABAP runtime error. It is giving the key words like "MESSAGE_TYPE_X"
    "%_T005K2" or "INSTANTIATE". And i apply NOTEs also i am unable to fix it.
    Can any one give  correct NOTE number that can fix it or any suggestions.
    Thanks in advance.
    Thanks
    Raju.k

    Hi Sven,
    Now we are also in SP11, But the thing is all the other UR are working fine Except
    this UR. Even there is no perticular NOTE number for this.
    Thanks
    Raju.k

  • ABAP for removing records in update rule

    hello all,
    we have data loading to several infocubes based on sales order type (logical partition).  our entire business and reporting strategy for sales is based on order type.  we have 1 extractor loading these 5 cubes.  we want to code in the update rule to check for each cube a particular value, and if its not this value, remove the record.
    example would be loading order type cube zpt1 we want to check the records coming into this cube that the value for characteristic ziden = z1.  if not, remove the record and do not update the cube.  the other cubes are the same.  cube zpt2 checks if characteristic ziden = z2.  if not, remove all other records.
    can someone inform us how this coding would look like in the update rules?
    thanks so much

    I'm assuming you need code for BW 3.x, since you mentioned Update Rules. There are a couple of ways:
    DELETE
      data_package
    WHERE
      /bic/ziden NE 'Z2'.
    Or
    LOOP AT data_package.
      IF data_package-/bic/ziden NE 'Z2'.
        DELETE data_package.
      ENDIF.
    ENDLOOP.
    If you're on BI 7, then you can create a filter on the DTP to the target so that it only extracts the records needed from the source.
    Edited by: Dennis Scoville on Aug 19, 2009 1:59 PM

  • Convert abap code to HTML

    Hi Experts,
    Can any body tell me, how to convert all abap codes in my SAP system to HTML format for creating backup, in one go.
    Thanx
    Rajiv Ranjan

    HI,
    I don't know if it wil be of any help. But you could always convert a ABAP report into a TXT file
    DATA: I_LINES TYPE T_LINES OCCURS 1000.
    DATA: BEGIN OF I_TEXT OCCURS 1000,
            TEXT(72).
    DATA: END OF I_TEXT.
    Read the source code into the internal table
      READ REPORT ABAP INTO I_TEXT.
      Loop over the source lines
        LOOP AT I_TEXT.
        Setup Transfer
          MOVE C_ID_SOURCE TO S_SOURCE-ID.
          MOVE I_TEXT-TEXT TO S_SOURCE-LINE.
        Fill up download file
           MOVE S_SOURCE-LINE TO WA_LINES.
          APPEND WA_LINES TO I_LINES.
        ENDLOOP.
      CALL FUNCTION 'WS_DOWNLOAD'
           EXPORTING
              BIN_FILESIZE        = ' '
              CODEPAGE            = ' '
                FILENAME            = FILENAME
                FILETYPE            = 'ASC'
                MODE                = ''
              WK1_N_FORMAT        = ' '
              WK1_N_SIZE          = ' '
              WK1_T_FORMAT        = ' '
              WK1_T_SIZE          = ' '
              COL_SELECT          = ' '
              COL_SELECTMASK      = ' '
           IMPORTING
                FILELENGTH          = W_FILE_LENGTH
           TABLES
                DATA_TAB            = I_LINES
           EXCEPTIONS
                FILE_OPEN_ERROR     = 1
                FILE_WRITE_ERROR    = 2
                INVALID_FILESIZE    = 3
                INVALID_TABLE_WIDTH = 4
                INVALID_TYPE        = 5
                NO_BATCH            = 6
                UNKNOWN_ERROR       = 7
                OTHERS              = 8.
    Edited by: Jürgen Degraeve on Jan 15, 2008 3:52 PM
    Edited by: Jürgen Degraeve on Jan 16, 2008 6:42 AM
    Edited by: Jürgen Degraeve on Jan 16, 2008 6:49 AM

  • ABAP program running time-BW update Rules

    Hi All,
    I have an ABAP program that is in one of the update rules from source ODS to destination ODS. Source ODS has 20million records. When we are loading the records to destination ODS , Is there any way I can find howmuch time will take to process 1 record and also when it is running how do I know howmany records it has processed or howmany yet to process ? I have tried with SM50 but not able to find much useful information?
    Please help me and if you have any documents please send it to [email protected]
    Regards
    Vennela

    Hi Vennela,
    just choose one request and click on monitor -> details. Click on processing -> Data Package 1 -> Update Rules. If you put the cursor on the first node, you'll see a date and time field on the screen (below). If you click on the last node you'll see how long it took to process the records.
    Another possibility would be to run it in simulation mode and check the response time. To do so, you'll have to click on 'Response Time' in the SAP GUI field below at the right side of your screen (normally it shows the system name and mandant).
    Hope that helps!
    Regards
    Nicola

  • Update rule to transformation migration error

    Error produced during update rule (BW3.5) to transformation migration. During start routine validation check it states that ' The data object 'COMM_STRUCTURE' has no component called 'BIC/ZCH_FABC1'  but there is a component called 'BIC/ZCH_FAAC1'.
    Even though this component is exist as part of communication structure, migration setup is producing an error.
    System is BI SP 16 level. OSS message is created, if you have experienced any similar issues, pls. share and let us know.
    Thanks, Vijay Rama.

    Hi VJ,
               The ideal best practice is to replace the Routines manually. As BI 7.0 wont hold Comm. structure, You are facing this problem.
    So you replace Comm.Structure to with Source_Fields.
    So while migrating the routines do it manually.
    You can find a lot of info in SDN if you search using the related terms
    regarding Migration.
    Hope this Helps
    Regards
    Karthik

  • 0py_c02 do not have the update rules or transformations in business content

    Dear All,
    I ma installing the Business content 0py_c02 cube with before data floe option , i found the infosource and transfer rules between Data source and info source but i can not found the Update rules betweeen the infosource and target.
    Even if u consider the data source replicated in RSDS update mode, but ther is no transformations. how we can resolve this issue , if any body faced the same issue please update the same.
    For creating mannully also there are routines in that update rules( checked same in IDES version) , i can do it same, but why the SAP not delivered the same, or i am going wrong in some where pls.
    Any update please , Not received any replies pls.
    Please any updates pls on this,  The  issue is open and waiting for responce from Experts.please can anybody update me.
    Thansk in Advance,
    Sathish
    Edited by: sathish kakumudi on Apr 21, 2010 8:48 AM
    Edited by: sathish kakumudi on Apr 21, 2010 10:34 AM
    Not delivered by SAP and SAP raised the same to Development team
    Edited by: sathish kakumudi on Jun 13, 2010 10:07 AM

    Hi Satish,
    Did you get any update from SAP-team on the same.
    Thanks,
    SC

  • Start Routine / Update Rule ABAP

    Hello Gurus
    I am trying to write the code to do the following but I am not getting very far:
    Two parts:
    Load from DSO1 to Cube1
    Only when DSO1-Product also exists in DSO2
    Also lookup a field, FIELD1, from DSO2 which is not in DSO1, but is in DSO2 (based on Product which exists in all three)
    There may be more than one FIELD1 per Product.
    Any help appreciated.
    NB I am in 3.5

    okay , here is how it can be done..
    Step 1:Create an Internal table for SOURE_PACKAGE, DSO2
    Step2: populate the data in the internal table of DSO1 & DSO2
    Step3: create a type to store the list of products and the list of additional fields present in DSO2. move the entries to this table from DSO2.
    Step4: create a range that stores the list of products present
    Loop at IT_Source_package
    delete source  where product = range
    move corresponding values from type table to IT_source_package
    Endloop.
    Append IT_Source_Package to Source_Package
    hope this helps.
    Srivatsan.S

Maybe you are looking for

  • Difference of G.L.balance in FAGLB03

    Dear Experts, We have been executed FAGLB03 by selecting fiscal year 2008 for an account & selected for Specific Profit Center in the selection fields. My Doubt is:   When I double click the cummilatve balance filed it is showing different amount.  I

  • Where is the account: for conect to engine oltp from ssis

    hi For conect to sqlserver I use account and password windows: but its not work: its said: user o passord invalid, i want to know what should be this user and password my setup...

  • Report whit a blob

    Hello!! I need make a report with a blob. I have this table: CREATE TABLE DOCUMENTOS ( ID_DOCUMENTO NUMBER NOT NULL, ID_PROY NUMBER NOT NULL, ENCABEZADO VARCHAR2 (100), TEXTO VARCHAR2 (500), PATH BLOB, FECHA_CREACION DATE, TODOS CHAR (1), DGTM CHAR (

  • A dimension table outer join across two databases

    I have two databases of the same schema but may have different data that I would like to do comparisons on. For this discussion, each has two tables, Dimension and Fact. I created a common dimension which would show dimension data that exists on both

  • Contact manager

    I am trying to convert from using a Blackberry for 8 years and though I like the overall features of the iPhone and I can live with the email issues the contact manager definitely needs work. Is there anyway to search by other fields then First /Last