Update Routine - ABAP code

Hi,
I am trying to write an update routine to calculate and populate fields in my ODS infoprovider.
one of the key figure field in my update rules is 'No. of Days'. Based on the 'No. of Days' range, I want to send a key figure(Infoobject:Due amount) value to another infoobject(Bucket1, Bucket2, Bucket3 ect.)in my ODS infoprovider. For example, let's say,
IF NO. OF DAYS = >0 AND <=30
   THEN TAKE THE DUE AMOUNT PUT IN BUCKET1
ENDIF.
ELSE IF
   NO. OF DAYS = >31 AND <=60
   THEN TAKE THE DUE AMOUNT PUT IN BUCKET2
ENDIF.
ELSE IF
   NO. OF DAYS = >61 AND <=90
   THEN TAKE THE DUE AMOUNT PUT IN BUCKET3
ENDIF.
I think, I know the data flow logic but I don't know how to code in ABAP language. If someone can give me some psuedo like ABAP code, I would appreciate your help with points.

Hi Roa,
I would do this in the start routine of the update rule.
Here is a sample on how do this. You could use a case statement for this code also.
Loop at Data_Packet.
IF NO. OF DAYS = >0 AND <=30
Data_Packet-BUCKET1 = DUE AMOUNT
ELSEIF
NO. OF DAYS = >31 AND <=60
Data_Packet-BUCKET2 = DUE AMOUNT
ENDIF.
ELSEIF
NO. OF DAYS = >61 AND <=90
Data_Packet-BUCKET3 = DUE AMOUNT
ENDIF.
modify data_packet.
endlloop.
Cheers! Bill

Similar Messages

  • Update Routine ABAP question

    Hi,
    I am updating data between two ODS objects using some update routines. I would like to write the following routine (in pseudo code):
    ++++++++++++++++++++++++++++++++++++++++++++++++++++
    Check if the characteristic i am updating is not null
    IF COMM_STRUCTURE-field1 = 'value1'     AND
             COMM_STRUCTURE-field2 = 'value2'.
    RESULT COMM_STRUCTURE-field3.
    ELSE.
    Don't update anything
    END IF
    +++++++++++++++++++++++++++++++++++++++++++++++++++
    My questions:
    1. How i tell the routine not to update anything (as specified in the pseudo code)?
    2. How i can check that the characteristic i woul like to update is not null?
    3. What is the preferred debug method in case i do not use the PSA?
    BR,
    Xibi

    Thanks Siggi for your prompt and helpful answer. There are however some fundamental things which are not fully clear to me (BTW, where i can find some good documentation on ABAP for BW??):
    > Hi,
    >
    > 1. How i tell the routine not to update anything (as
    > specified in the pseudo code)?
    >
    > set the returncode to a value <> 0.
    I wrote the following:
    returncode = 1.
    Consequently the updated failed. Maybe i am doing something wrong but my intention is not to have the whole thing fail, but rather skip the update for some records.
    > 2. How i can check that the characteristic i woul
    > like to update is not null?
    >
    > if not comm_structure-<fieldname> is initial.
    The problem is that the characteristic i am trying to update is not contained in the source ODS but only in the target one. Will "if not comm_structure-<fieldname> is initial" still work in this case?
    >
    > 3. What is the preferred debug method in case i do
    > not use the PSA?
    >
    > Without psa, you need to add a endless loop:
    > statics: st_flag type c value '0'.
    >
    > while st_flag = '0'.
    > break-point.
    > endwhile.
    >
    >
    > Hope this helps!
    >
    > regards
    >
    > Siggi

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

  • Routine (ABAP Code) in Transformation for the below sceaniro

    Hi Experts,
    Please update me with the routine (ABAP)(transformations)
    Source Char:
    Policy Start Date: ZSTRT_DTE (CHAR:Data Type: DATS)
    Target Char:
    Policy Expiry Date: ZEXP_DTE (CHAR:Data Type: DATS)
    FM: FIMA_VTBKOND_CALC_DATES
    Months(I_MONTHS) = 6
    Using Policy Start Date as input need to call the FM and months input is 6 MOnths and pass that result to Target char.
    Thanks

    Hi,
    try the following :
        CALL FUNCTION 'FIMA_VTBKOND_CALC_DATES'
          EXPORTING
            i_date   = source_fields-/bic/ZSTRT_DTE
            i_months = '6'
          IMPORTING
            e_date   = result.
    hope it helps...
    regards,
    Raju

  • 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

  • Urgent help required to write the code in  update routine

    Hi all,
    i want to calculate open purchase order qty in update routine
    formula is
    open purchase order qty = scl qty - rec qty
    where schd line date is less then or equal to 90 days from the current date.
    I have written one code : but its giving error that comm_structure is not defined in abap dictionary,can any body help to write appropriate routine. this calculation i am making for MM, and data source and cube are 2lis_02_scl and cube is zc_pur01 ( made by coping the 0pur_c01), data source scl has all fields required in the foumula...here is my code
    DATA:  COMM_STRUCTURE LIKE  /BIC/CS2LIS_02_SCL.
    DATA: SCL_QTY LIKE COMM_STRUCTURE-/BIC/ZK_SCLQTY.
    DATA:      GR_QTY LIKE COMM_STRUCTURE -/BIC/ZK_GRQTY.
    DATA: SCL_DATE.
    SCL_DATE = SY-DATUM + 90.
    SELECT COMM_STRUCTURE -/BIC/ ZK_SCLQTY COMM_STRUCTURE -/BIC/ ZK_GRQTY FROM
    /BIC/CS2LIS_02_SCL INTO   SCL_QTY     GR_QTY  
    WHERE
    COMM_STRUCTURE -/0SCHED_DATE LE SCL_DATE.
    IF SYSUBRC  = 0
    RESULT = SCL_QTY - GR_QTY.
    ELSE = NOVALUE.
    ENDIF.
    Can any body help me soon its very urgent.
    thanks

    Hi Anupam,
    I am not a very good ABAP Programmer, but found some things to notify u inyour code..
    DATA: COMM_STRUCTURE LIKE /BIC/CS2LIS_02_SCL,
          SCL_QTY LIKE COMM_STRUCTURE-/BIC/ZK_SCLQTY,
          GR_QTY LIKE COMM_STRUCTURE -/BIC/ZK_GRQTY.
    DATA  SCL_DATE LIKE SY-DATUM.
    SCL_DATE = SY-DATUM + 90.
    SELECT COMM_STRUCTURE -/BIC/ ZK_SCLQTY COMM_STRUCTURE -/BIC/ ZK_GRQTY FROM
    /BIC/CS2LIS_02_SCL INTO SCL_QTY GR_QTY
    WHERE
    COMM_STRUCTURE -/0SCHED_DATE LE SCL_DATE.
    IF SYSUBRC = 0
    RESULT = SCL_QTY - GR_QTY.
    ELSE.
    What should be the return value if you dont have to    calculate the result."
    ENDIF.
    try it.. and see..
    regards,
    kishore.

  • 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

  • ABAP Code Problem in Start Routine to Fill the value from Look-up Table ???

    Hi all,
         I am trying to fill the values of DOC_NUMBER & PLANT from look-up table /BIC/AZSD_O0700 (Billing Item ODS) for each BILL_NUM in Start Routine for Update Rules of Billing Header ODS and modify the data_package.
    What is wrong with the below ABAP code, PLEASE ???
    data: it_data type standard table of data_package_structure
            with header line
            with non-unique default key initial size 0.
    types: begin of billing_item_type,
                 BILL_NUM          like /BIC/AZSD_O0700-BILL_NUM,
                 DOC_NUMBER   like /BIC/AZSD_O0700-DOC_NUMBER,
                 PLANT               like /BIC/AZSD_O0700-PLANT,
             end of billing_item_type.
    refresh it_data.
    clear it_data.
    it_data[] = DATA_PACKAGE[].
    refresh DATA_PACKAGE.
    clear DATA_PACKAGE.
    loop at it_data.
        select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
               from /BIC/AZSD_O0700
               where  BILL_NUM  = it_data-BILL_NUM
               and    FISCVARNT = it_data-fiscvarnt.
        endselect.
        if sy-subrc = 0.
           move-corresponding it_data to DATA_PACKAGE.
        endif.
      endloop.
      modify DATA_PACKAGE.
    Thanks,
    Venkat.

    Hi Venkat,
      Two things -One is the performance and the other ... there is no Append  within the loop.
      Try moving the select statement ousdie the loop to improve performance and move the modify statement into the loop ... change modify to append. Code below.
       Let me know if you need more help.
    Best regards,
    Kazmi
    data: it_data type standard table of data_package_structure
    with header line
    with non-unique default key initial size 0.
    types: begin of billing_item_type,
    BILL_NUM like /BIC/AZSD_O0700-BILL_NUM,
    DOC_NUMBER like /BIC/AZSD_O0700-DOC_NUMBER,
    PLANT like /BIC/AZSD_O0700-PLANT,
    end of billing_item_type.
    refresh it_data.
    clear it_data.
    it_data] = DATA_PACKAGE[.
    refresh DATA_PACKAGE.
    clear DATA_PACKAGE.
    loop at it_data.
    select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
    from /BIC/AZSD_O0700
    where BILL_NUM = it_data-BILL_NUM
    and FISCVARNT = it_data-fiscvarnt.
    endselect.
    if sy-subrc = 0.
    move-corresponding it_data to DATA_PACKAGE.
    Append DATA_PACKAGE.
    endif.
    endloop.

  • ABAP code in update rules to convert the date

    Hi,
    Could any one send me the ABAP code that is written in the update rules to convert the date (DD/MM/YYYY  -- lenght 10) to YYYYMMDD ---  length 8  format.
    Also please let me know where I should write this code; while creating update rules or while creating infosource.
    Thanks,

    Hi Bharath,
    Hi Bharath,
    I suggest you do the conversion of dates in the transfer rules. Here is the correct code you need:
    * Assuming the source data field is called MYDATE
    * Place the ff. in the routine in the transfer rules:
    concatenate tran_structure-mydate+6(4) tran_structure-mydate+3(2) tran_structure-mydate(2) into result.
    replace MYDATE with the name of the source field (10 chars) in the transfer structure. Hope this helps.

  • ABAP Code in Start Routine for restricing the data records from ODS1 - ODS2

    Hi
    I need small ABAP Code in Start Routine Of Update rules Of ODS . Im in BW 3.5 .
    I have records like below in first layer ODS and i want to restrict some records while going to second layer ODS ..
    ODS1 :-
    DocNO   EventType    Date
    123         001             08/08/2008
    123         003             08/08/2008
    123         011              09/08/2008
    I want one record in ODS2 for this document number whose EventType = 001 only and date of third record ... like below
    Doc NO     EventType      From Date          Todate
    123              001               08/08/2008         09/08/2008
    So how can i get like this record in the ODS2 which will get data from ODS1 . So i need to write the code in the start routine of the ODS2 .
    So please give the me the code for start routine ....
    Regards
    Suresh

    Its difficult in BW 3.5 to include this logic in START_ROUTINE as you cannot add the extra to_date field to the DATA_PACKAGE table.
    You need to create a new global internal table with the same structure of DATA_PACKAGE with additional field to_date. then use the logic to fill in the global internal table
    define a internal table new_data_package with the required structure like (docno, eventtype, fromdate todate)
    data: l_w_datapkg_001 type data_package,
    data: l_w_newdatapkg type new_data_package,
    data: l_w_datapkg_011 type data_package
    LOOP AT DATA_PACKAGE INTO l_w_datapkg_001 WHERE event_type = '001'.
    l_w_newdatapkg-docno = l_w_datapkg_001-docno.
    l_w_newdatapkg-event_type = l_w_datapkg_001-event_type.
    l_w_newdatapkg-fromdate = l_w_datapkg_001-date.
    MOVE CORRESPONDING FIELDS OF l_w_datapkg_001 INTO l_w_newdatapkg.
    READ TABLE data_package INTO l_w_datapkg_011
    WITH KEY docno = l_w_datapkg_001-docno
                     event_type = '011'.
    l_w_newdatapkg-to_date = l_w_datapkg_011-date.
    APPEND l_w_newdatapkg TO new_data_package          
    ENDLOOP.
    Now the new datapackage contains the ODS2 data that u needed

  • URGENT !!! - ABAP code in update rule

    Friends,
    With my limited knowledge in ABAP, I need some help from the forum.
    I need to create a routine in update rule to capture 'date of last GR against a PO delivery schedule'. Let's say
    PO # 1234
    IT # 10
    SCL # 1
    There are multiple partial deliveries against SCL # 1 above and I have to capture the last delivery date and subsequently the last invoice date. If I try to set the rule to capture the 'posting date' based of 'transfer type'  - the GR date field gets overwritten by the last invoice date (the date of last activity). My requirement is to separate the two i.e.
    1) Date of last GR against PO - Item - SCL line
    2) Date of lasr INV against PO - Item - SCL line
    Can any one help me with the code ???
    Thanks,
    AK

    Hi,
    check the following link, gives an example of an update routine.
    http://help.sap.com/saphelp_nw70/helpdata/en/80/1a64fae07211d2acb80000e829fbfe/frameset.htm

  • Abap Code help in update rule

    Hi Gurus,
    I have  a requiement, that is if there are 5 line items with in a document and each one has diffeerent tax jurisdiction code, then we should be showing only one tax jurisdiction code for a document. Line items are not displayed in report. The condition to pick up tax jurisdiction code is the one which has least ending zeros among all the lime items with in a document.
    Supppose
    Doc1 Item Tax Jurisdiction code
    1800000002 1 CNQC00000000000
    1800000002 2 CNQC00000000000
    1800000002 3 CN0000000000000
    1800000002 4 CNQC00000000000
    1800000002 5 TXJOHNCLEBUR000
    So here the value of Tax Jurisdiction code is TXJOHNCLEBUR000 as it has least ending zeros compared to other values with in a document.
    Any help how to use the string function and acheive the desired result.
    Thanks,
    Raj.

    Hi Anand,
    Thanks for the reply. we don't expect any non-zeros after seeing first zero. Now i have added another z object which will contain only least zeros for a doc. What I am doing is now after loading the data into the cube from ods  i am doing loop back and updating the new z object. Below is the code I am trying to do
    TABLES: /BIC/AZFGLO10100.
    Defining an internal table as ods table****
    Types: BEGIN OF ITAB_01,
    doc_no LIKE /BIC/AZFGLO10100-AC_DOC_NO,
    item_no LIKE /BIC/AZFGLO10100-ITEM_NUM,
    taxjur LIKE /BIC/AZFGLO10100-TAXJURCODE,
    length like num,  ***** this will hold the length of the zeros
    END OF ITAB_01.
    loading the data from active ods table into defined internal table*****
    select AC_DOC_NO ITEM_NUM TAXJURCODE  from /BIC/AZFGLO10100 into table
      Itab_01 where AC_DOC_NO = /BIC/AZFGLO10100-AC_DOC_NO and
      item_num = /BIC/AZFGLO10100-ITEM_NUM.
    sort itab_01 doc_no item_no
    now I want to use code too populate the vlaue of length field in internal table (which shows how many zeros a tax jurisdiction code has for every corresponding line item)
    then in the update rule of z tax jurisdiction i will wirte a routine such that
    select taxjur into result from itab_01 where doc_no = COMM_STRUCTURE-doc_no and length = min(length).
    now I have one more doubt , the number of items in a document will be varying so how to takecare of this...
    If possible can you please provide me with the abap code that you have mentioned in earlier post.
    Any more help on this is really appreciated.
    Thanks,
    Raj

  • 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

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

  • Abap code in start routine

    hi,
    i have a code in this way in update routine of that info object
    instead of writng that code in update routine i want to write in start routine
    can any one tell me what r the changes i have to made
    please suggest me
    i will assigfn points
    CASE COMM_STRUCTURE-crm_ctstat.
    Contact Achieved
        WHEN '0'.
    Finished faultless
          RESULT = '20'.
          RETURNCODE = 0.
    Contact Not Possible (Missing Communication Data)
        WHEN '1'.
    Finished faulty
          RESULT = '10'.
          RETURNCODE = 0.
    Contact Not Possible (Incorrect Communication Data)
        WHEN '2'.
    Finished faulty
          RESULT = '10'.
          RETURNCODE = 0.
    Contact Not Permitted (Max. Usage BP List)
        WHEN '3'.
    Finished faulty
          RESULT = '10'.
          RETURNCODE = 0.
    Contact Not Permitted (Block Indicator for BP)
        WHEN '4'.
    Finished faulty
          RESULT = '10'.
          RETURNCODE = 0.
    Contact Not Possible (Technical Problems)
        WHEN '5'.
    Finished faulty
          RESULT = '10'.
          RETURNCODE = 0.
      ENDCASE.

    Hi,
    loop at datapackage.
    CASE datapackage-crm_ctstat.
    Contact Achieved
    WHEN '0'.
    Finished faultless
    RESULT = '20'.
    RETURNCODE = 0.
    Contact Not Possible (Missing Communication Data)
    WHEN '1'.
    Finished faulty
    RESULT = '10'.
    RETURNCODE = 0.
    Contact Not Possible (Incorrect Communication Data)
    WHEN '2'.
    Finished faulty
    RESULT = '10'.
    RETURNCODE = 0.
    Contact Not Permitted (Max. Usage BP List)
    WHEN '3'.
    Finished faulty
    RESULT = '10'.
    RETURNCODE = 0.
    Contact Not Permitted (Block Indicator for BP)
    WHEN '4'.
    Finished faulty
    RESULT = '10'.
    RETURNCODE = 0.
    Contact Not Possible (Technical Problems)
    WHEN '5'.
    Finished faulty
    RESULT = '10'.
    RETURNCODE = 0.
    ENDCASE.
    endloop.

Maybe you are looking for