Canu2019t u201Ccommentu201D lines in Update Routine although in Change mode

Hi,
There is an update rule between a datasource (2LIS_02_SCL) and ODS1 that I need to modify. When I double click on it, instead of seeing the old update rule that I am used to, showing the list of the fields I get some graphics with the links between fields in one group to the other.
The u201CRule groupu201D is set to u201CStandard Groupu201D.
I double click on the link between the fields of interest and changed u201CRule Typeu201D to u201CRoutineu201D and changed it to the change mode for changes.
I have an INCLUDE program from another project which performs the same tasks that I am trying to implement.
At a location where it states u201Cu2026insert your code here u2026u201D, I am able to bring in the lines from the other routine which does the desired job.
1.
The problem at this moment is that I canu2019t get COMMENT on all the previous codes which were in there. I tried deleting, and that also fails. As a result, I am getting errors.
Any help on this?
2.
Is that the right place to modify the routine?
3.
What is the difference between between between this approach of modifying update routines compare to the old one?
Thanks

Hi,
thanks so far:
I did exactly what you described. When I got to where to insert my code, I see that the system by default has METHODS, with declaration etc.
I want to ignore all those and simple insert the following. Donu2019t I need to comment on all the existing information that I do not need:
e.g. when I inserted the code below, and performed a u201Cchecku2019, it failed at a line (TYPE RSODSOCHECKONLY READ-ONLY,) which existed originally in the default code which read. I though I should be able to comment those out, but the system is not allowing me:
Attributs
    DATA:
      p_check_master_data_exist
            TYPE RSODSOCHECKONLY READ-ONLY,
*--my insert begins--
INCLUDE MY_UPDTE_RULE.
$$ end of global - insert your declaration only before this line   -
FORM Calc_Data
  TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
  USING    COMM_STRUCTURE LIKE /BIC/CS2LIS_02_SCL
           RECORD_NO LIKE SY-TABIX
           RECORD_ALL LIKE SY-TABIX
           SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
  CHANGING RESULT LIKE /BI0/V0PUR_C01T-GR_QTY
           RETURNCODE LIKE SY-SUBRC
           ABORT LIKE SY-SUBRC.
$$ begin of routine - insert your code only below this line        -
fill the internal table "MONITOR", to make monitor entries
IF ( COMM_STRUCTURE-u2026u2026.
    perFORM ZZZZZZZ
       USING    COMM_STRUCTURE-u2026u2026
       u2026u2026
       u2026u2026
       CHANGING RESULT.
if the returncode is not equal zero, the result will not be updated
    RETURNCODE = 0.
else.
    RETURNCODE = 4.
endif.
if abort is not equal zero, the update process will be canceled
  ABORT = 0.
$$ end of routine - insert your code only before this line         -
ENDFORM.
*--end of my code--
Thanks

Similar Messages

  • Update routine infinite loop

    Hello Experts,
    For loading ODS2 we are making a lookup on ODS1 for 0material based on
    purchaing document number, item line item.
    Is there any mistake in the start routine or update routine.
    Because the load goes in infinite loop. I think update routine should be changed.
    Any suggestions are appreciated
    Start routine:
    data: begin of itab occurs 0,
            pur_doc like /BIC/AZODS100-OI_EBELN,
            item like /BIC/AZODS100-OI_EBELP,
            material like /BIC/AZODS100-material,
          end of itab.
    clear itab.
    select OI_EBELN OI_EBELP MAT_PLANT from /BIC/AZODS100
             into table itab.
    Update routine for 0material
    loop at itab where pur_doc = COMM_STRUCTURE-OI_EBELN
                       and item = COMM_STRUCTURE-OI_EBELP.
           RESULT = itab-matplant.
    endloop.

    Hi,
    this takes a long time, because with each record of your data packaged it is doing the loop and scanning each row of the internal table. Use the following instead.
    Start routine:
    types: begin of t_itab,
    pur_doc like /BIC/AZODS100-OI_EBELN,
    item like /BIC/AZODS100-OI_EBELP,
    material like /BIC/AZODS100-material,
    end of t_itab.
    data: itab type hashed table of t_itab with unique key pur_doc item.
    select OI_EBELN OI_EBELP MAT_PLANT from /BIC/AZODS100
    into table itab order by oi_ebeln oi_ebelp mat_plant.
    I hope these fields are the key of the ods object.
    Update routine for 0material
    data: wa_itab type t_itab.
    read table itab into wa_itab with table key pur_doc = COMM_STRUCTURE-OI_EBELN
    item = COMM_STRUCTURE-OI_EBELP.
    if sy-subrc = 0.
    RESULT = wa_itab-matplant.
    else.
    clear result.
    endif.
    Hope this helps
    regards
    Siggi

  • Will these five UPDATE ROUTINE lines accomplish the stated requirement?

    Hi,
    In an attempt to assign a source date field to a BW target field, based on the condition sourceA1 = A or B, I modified the update routine as follows and a syntax check reveals no errors:
    $$ begin of 2nd part global - insert your code only below this line  *
    Data: V_CCCC D.
    $$ begin of routine - insert your code only below this line        -
    IF ( SOURCE_FIELDS- sourceA1 = '002' or
           SOURCE_FIELDS- sourceA1 = '012' ).
        RESULT = V_CCCC.
          If SY-SUBRC NE 0 .
          EndIf.
    ENDIF. 
    i.      Will the above routine meet the stated requirement?
    ii.     So as it is now, what happens if sourceA1 is not '002' or '012'
    iii. Any reason why the check error dis not report u201CRESULTu201D as unknown although it was not declared?
    iv. Is there a better way of writing that I have above?
    Thanks

    Hi,
    Your code will accomplish what you are looking for.  It will assign the value V_CCC if your sourceA1 field is 002 or 012.  If sourceA1 is not 002 or 012, the result field will not be filled.
    If you want to clean up your code, you can use the following:
    IF SOURCE_FIELDS- sourceA1 = '002' or
        SOURCE_FIELDS- sourceA1 = '012'.
      RESULT = V_CCCC.
    ENDIF.
    i. Will the above routine meet the stated requirement?
    >as I understand your requirement .... yes!
    ii. So as it is now, what happens if sourceA1 is not '002' or '012'
    >result will be 0 or space depending on the data type.
    iii. Any reason why the check error dis not report u201CRESULTu201D as unknown although it was not declared?
    >Result doesn't need to be declared by you, SAP does that for you already.
    iv. Is there a better way of writing that I have above?
    If this is going into an ODS, you will overwrite non-002/012 values with a space, so be careful.  If sourceA1 is not part of the key, you could be overwriting data with nulls.
    Brian

  • Can I use the Debugger to debug why a line in UPDATE RULE gives no values?

    Hi,
    in a simple Update Rule, I had the routine below:
    RESULT = SOURCE_FIELDS-QTY.
    "( The goal was to calculate the field MyCclQTY in the cube; Routine was between ODS and Cube ):
    The cube output gave a BLANK while QTY has 300; although I expected to see 300 for MyCclQTY:
    e.g. of Cube Output:
    QTY---MyCclQTY
    300------BLANK
    In the attempt to see what is going on, I used the Debugger for the first time.
    In the update routine for MyCclQTY, I added the line break-point as follows as a booklet I am reviewing, directs:
    Break-Point.
    RESULT = SOURCE_FIELDS-QTY.
    Now when I switched to the debugging mode, I run Single Step.
    I was not too sure what to do here other than, continuously clicking on Single Step.
    When it got to the line:
       == >    catch cx_sy_move_cast_error.
    A message appeared at the bottom of the screen
    u201CException from the class CX_SY_MOVE_CAST_ERROR was caught u201C appeared at bottom of screen.
    1. Any hints on this message?
    2. On the screen in the booklet that I am review, there was a split screen with the one on the right side showing values but I could not get that on my screen. Any hints on that?
    Thanks.

    Hi........
    You can try to catch this exception :
    Dynamic Proxies in ABAP Part 2: RTTI Retrieval
    Regards,
    Debjani..........

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

  • Can you help me interpret the following lines in UPDATE rule?

    Hi,
    Can you help me interpret the following lines in UPDATE rule?
    1. What is the role of role of u201CCHANGING RESULT.u201D and u201CCHANGING lc_local_value.u201D?
    2. What is the role of the CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY', in particular the Exporting and Importing parts?
    3. Can I say that u201CCOMM_STRUCTURE-ORDER_VALu201D in the subroutine is passed to u201Clc_document_valueu201D in the u201CFORM loc_curr_convertu201D; and further passed to u201Cforeign_amountu201D in the u201CCALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'u201D?
    4. Finally, what becomes of my original u201CActual Goods receipt quantityu201D( 0GR_QTY ) which I am writing the routine for? I donu2019t see any where in the code that it is being referred to? Do any of these codes affect the value of 0GR_QTY?
    5. Also, if there are 3 different subroutines in the INCLUDE and I am making the change described in #4 above, how do I know which of the 3 subroutines to call?
    ===============================
    ===============================
    So I am reviewing a transfer routine in for u201CActual Goods receipt quantityu201D and routine an INCLUDE statement: INCLUDE RS_BCT_MM_UPDATE_RULES.
    The update rule also includes the following properties to run the following subroutine in the Include:
    IF u2026..
    perFORM LOC_CURR_CONVERT
               USING    COMM_STRUCTURE-ORDER_VAL
                        COMM_STRUCTURE-DOC_DATE
                        COMM_STRUCTURE-ORDER_CURR
                        COMM_STRUCTURE-LOC_CURRCY
                        COMM_STRUCTURE-EXCHG_RATE
               CHANGING RESULT.
    I verified in the INCLUDE (RS_BCT_MM_UPDATE_RULES) and the subroutine is as follows:
    FORM loc_curr_convert
      USING    lc_document_value
               lc_date
               lc_document_currency
               value(lc_local_currency)
               lc_rate
      CHANGING lc_local_value.
    conversion of lc_rate from floating-point to decimal. Necessary for *
    call of CONVERT_TO_LOCAL_CURRENCY.
    data lc_rate_dec type p decimals 5.
    lc_rate_dec = lc_rate.
      IF lc_document_currency = lc_local_currency
      no conversion necessary -> Main case 1
        AND NOT ( lc_document_currency IS INITIAL
               OR lc_local_currency IS INITIAL ) .
        lc_local_value = lc_document_value.
      ELSEIF NOT ( lc_document_currency IS INITIAL
      OR lc_local_currency IS INITIAL OR lc_date IS INITIAL ) .
      conversion necessary with lc_date -> Normally not possible
        CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
          EXPORTING
            date                 = lc_date
            foreign_amount       = lc_document_value
            foreign_currency     = lc_document_currency
            local_currency       = lc_local_currency
            rate                 = lc_rate_dec
          IMPORTING
          EXCHANGE_RATE        =
            local_amount         = lc_local_value
          EXCEPTIONS
            NO_RATE_FOUND        = 1
            OVERFLOW             = 2
            NO_FACTORS_FOUND     = 3
            NO_SPREAD_FOUND      = 4
            DERIVED_2_TIMES      = 5.
        IF sy-subrc NE 0.
      message a802 with lc_date lc_document_currency lc_local_currency
                        sy-subrc.
        ENDIF.
      ELSE.
      if conversion not possible -> assign target values
        lc_local_value = lc_document_value.
        lc_local_currency = lc_document_currency.
      ENDIF.
    ENDFORM.

    HI,
    Thanks so much the explanations.
    I just verified again on our dev system and the update rule for 0GR_QTY (Actual goods receipt quantity) include the following:
        perFORM QUANTITY_CONVERT
           USING    COMM_STRUCTURE-CPQUAOU
                    COMM_STRUCTURE-po_UNIT
                    COMM_STRUCTURE-base_uom
                    COMM_STRUCTURE-numerator
                    COMM_STRUCTURE-denomintr
           CHANGING RESULT
    Now, in the include, I also found:
    FORM QUANTITY_CONVERT
      USING    QC_SOURCE_VALUE
               QC_SOURCE_UNIT
               VALUE(QC_TARGET_UNIT)
               QC_UMREZ
               QC_UMREN
      CHANGING QC_TARGET_VALUE.
    i.  Does it mean it actually does quantity conversion?
    ii. If you have access to the INCLUDE I will appreciate some hints on what the subroutine QUANTITY_CONVERT is doing. It does not appear do to be saying anything about quantity conversion; but it is supposed to be doing something with the parameters being passed from the update routine.
    iii. In your response to #5, after all the computation in the INCLUDE, what comes back to the Update rule  i.e. what comes back to become the value of 0GR_QTY?
    Is it the u201CRESULT.u201D in the update rule or u201CQC_TARGET_VALUE.u201D in the subroutine in the INCLUDE.
    iv. So, am to create an Update rule for 0PSTNG_DATE and the source is BUDAT; and I need to write a routine using the include INCLUDE RS_BCT_MM_UPDATE_RULES.
    I looked through the INCLUDE and identified all the subroutines in this INCLUDE as follows:
    QUANTITY_CONVERT
    LOC_CURR_CONVERT
    GET_WEEK
    WEEK_DAY
    QUARTER_DAY
    --Does it mean that to use this subroutine, I can only use the USING parameters of one of these listed subroutines?
    --Also, does it mean that because 0PSTNG_DATE is a date, I can only use one of
    GET_WEEK
    WEEK_DAY
    QUARTER_DAY
    --Or, are there other includes to be used for 0PSTNG_DATE
    Thanks

  • Update routine to populate value for field ZDOCCATG(Document category)

    Hi Experts,
       I need to populate  data for field ZDOCCATG(Document Category) based on the value of the below  two fields,
    1. 0deb_cre_lc(Debit / credit Amount)
    2. 0ac_doc_typ(Belegart)
    The logic is as follows:
    if 0deb_cre_lc > '0'.
         if 0ac_doc_typ == 'dz'.
          ZDOCCATG = Disputes.
         else
      ZDOCCATG = Invoices.
       end If.
    else
    if 0ac_doc_typ < '0'.
    ZDOCCATG = Credits.
    end if.
    I need to write the update routine to get the values assigned for Document category based on these two fields. When i open the routine for the field ZDOCCATG, i can see the below screen:
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    FORM compute_data_field
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS80FIAR_O03 - (Communication structure)
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BIC/AZOARFSCM00-/BIC/ZDOCCATG
               RETURNCODE LIKE SY-SUBRC "Do not use!
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
    result value of the routine
      RESULT = .
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    Please let me know the code to be inserted (based on the logic mentioned above) in the above screen . Thanks
    Regards,
    Kavitha Jagannath

    Hi Kavitha,
          Supposing the technical name of fields is /bic/0deb_cre_lc and /bic/0ac_doc_typ use the code below at the marked position.
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line -
    TABLES: ...
    DATA: ...
    $$ end of global - insert your declaration only before this line -
    FORM compute_data_field
    TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
    USING COMM_STRUCTURE LIKE /BIC/CS80FIAR_O03 - (Communication structure)
    RECORD_NO LIKE SY-TABIX
    RECORD_ALL LIKE SY-TABIX
    SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
    CHANGING RESULT LIKE /BIC/AZOARFSCM00-/BIC/ZDOCCATG
    RETURNCODE LIKE SY-SUBRC "Do not use!
    ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line -
    fill the internal table "MONITOR", to make monitor entries
    result value of the routine                 
    <----- Paste the code below as shown here --->
    if comm_structure-/bic/0deb_cre_lc > 0.
      if comm_structure-/bic/0ac_doc_typ == 'DZ'.
       result = 'DISPUTES'.
      else
       result = 'INVOICES'.
      endIf.
    elseif comm_structure-/bic/0deb_cre_lc < 0.
      result = 'CREDITS'.
    end if.
    <----
    >
    if abort is not equal zero, the update process will be canceled
    ABORT = 0.
    $$ end of routine - insert your code only before this line -
    ENDFORM.
    Regards:
    Jitendra
    Edited by: Jitendra Gupta on Oct 15, 2009 3:05 PM

  • Update routine for 0proc_unit conversion

    Hi all,
    My infoobject 0OPR_ACTWRK uses 0PROC_UNIT for units. It holds data in days and in hours. When I load it to a cube, I want to convert all values to working hours.
    I figured out that I have to use an update routine in my update rules. A lot of forum threads about unit conversion mention the function module UNIT_CONVERSION_SIMPLE. Can I use this function for my problem? Or should I use a different function module?
    This will be my first ABAP code, so can anyone help me and tell me what I have to fill in exactle in the routine format below?
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
    result value of the routine
      RESULT = .
    result value of the unit
      UNIT = .
    if the returncode is not equal zero, the result will not be updated
      RETURNCODE = 0.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    Thanks in advance!
    Regards, Pieter

    Dear Pieter,
    I am not infront of the system..
    the following surely will give error.. :).. so post back here.. so that me or someone else will reply you..
    So let us start witht he following coding in the 'Start routine'.
    LOOP AT DATA_PACKAGE.
    IF DATA_PACKAGE-UNIT= 'DAY'.
       DATA_PACKAGE-opr_pldwrk = DATA_PACKAGE-opr_pldwrk * 8.
    ELSE.
    Do nothing.
    ENDIF.
    MODIFY DATA_PACKAGE.
    ENDLOOP.
    Regards,
    Hari
    Message was edited by: Hari Kiran Y
    Message was edited by: Hari Kiran Y

  • How to create monitor entries from an update routine?

    Hi,
    Does anyone try to create monitor entries in ABAP routine in update rules?
    I have How-to guide "How to... Create monitor entries from an update routine". I applied code from it.
    RETURNCODE = 1.
    MONITOR-MSGID = 'RSM'.
    MONITOR-MSGTY = 'W'. *** I also tried MONITOR-MSGTY = 'E'
    MONITOR-MSGNO = '799'.
    MONITOR-MSGV1 = 'My message '.
    MONITOR-MSGV2 = COMM_STRUCTURE-<MY_FIELD>.
    append MONITOR.
    EXIT.
    But it doesn't work. I don't see new lines on Details tab in AWB Monitor.
    What's wrong?
    BW 3.0B

    Hi, hope you had a good weekend.
    I tried with MSGTY = 'I' and I didn't get any errors or warnings at load.
    In the monitor, on the detail tab, I find hidden under:
    Processing (data packet)
    -> Data Package x
       -> Transfer rules
          -> Data records for package x
             -> Record 0:
             -> Record 0:
             -> Record 0:
    When I select "Display Message(s)" from the dropdown-menu on one of these "Record 0:" lines, I get to see
    my message text: S:RSM:000 test1 test2
    1) how can I change the text that appears in the monitor tree ("Record 0:") ?
    2) The status of these nodes is always a green led (also with MSGTY = 'W')... shouldn't it be a yellow triangle?
    Like this it is hell to find your warnings/information messages.
    3) I cannot find my monitor messages with transaction SLG1... should I be able to find them there?
    Kind regards,
    Edwin

  • Look up at master data in  update routine

    Hi all,
    I am loading from flat file in to an infocube. My transaction data comes in the format Subcategory, Area,Date, Sales qty,UOM. But my infocube should be filled with Category,Subcategory,Region,Area,Date,SalesQty,UOM. My business requirements want me to model Category, Subcategory,Region area as characteristics of dimension. ie I cannot model Category as navigational attribute of Subcategory and Region as navigational attribute of Area.
    But I can get the master data file for Subcategory in Sucategory, Category format and Area in Area, Region format. So when I load the transaction data I can make a table lookup on these master data table and fill the required fields.
    But the problem is I donot have much experince in ABAP routines.
    Can any one help me with a sample start/update routine on how to do this.
    Any help will be appreciated.
    Regards,
    Amith

    Amith,
    Actually, you may everything do in a start routine of the URs (including lookup itself).
    There is no need to declare internal table in a global part of routine and then read values in routines.
    The code may look the following. (Don't have the system on hand. So, some syntax may require some modification.)
    TABLES: <Your Master Data Table>.
    DATA: wa_temp TYPE DATA_PACKAGE_STRUCTURE OCCURS 0 WITH HEADER LINE,
         wa_md TYPE <Your Master Data Table>  OCCURS 0 WITH HEADER LINE.     
    SELECT * FROM <Your Master Data Table> INTO wa_md.
    SORT wa_md ASCENDING BY <Basic Char Key>.
    LOOP AT DATA_PACKAGE INTO wa_temp.
       READ TABLE wa_md WITH KEY <Basic Char Key> = wa_temp-<Basic Char Key>.
       wa_temp-<YourLookupIO> = wa_md-<YourLookupAttribute>.
       MODIFY DATA_PACKAGE FROM wa_temp.
    ENDLOOP.
    Best regards,
    Eugene

  • Hints why all Update Routines are coming with 0.00. Even the simple ones?

    Hi,
    any hints why about 5 update routines that I have written are coming with 0.00 or blanks.
    Even very simple ones such as the one for MyCclQTY in the cube, which has the only line in the update routine between ODS and Cube:
    RESULT = SOURCE_FIELDS-QTY.
    shows in the cube output as blanks while QTY has data:
    e.g. of Cube Output:
    QTY-Field2-MyCclQTY----MyCalField2
    300--125--BLANK--
    0.00
    600--42.9-BLANK--
    0.00
    Basically all my routines, e.g. MyCclQTY, MyCalField2
    are not showing values while the direct mappings show the correct data.
    In the above simple case, with the routine shown above, I expected to see 300 and 600 for MyCclQTY but they come out blank.
    Any hints as to what may be wrong?
    Thanks

    <Font Face="Tahoma" Color="Blue">
    Dear Friend,
    Can you please try
          RESULT = COMM_STRUCTURE-Qty.
    Also please check that you have assigned correct Unit of Measure in the field "Unit of Routine".
    Hope it helps.
    Regards,
    Abhijit
    </Font>
    Edited by: Siegfried Szameitat on Nov 3, 2008 12:23 PM
    deleted request for points. it is against the rules.

  • Please tell me what this update routine do?

    Hi,
    Please see the update routine below for calculating the difference between two dates..In ODS I am getting different values like (30/06/2006-26/10/2005=170 & 02/02/2006-19/10/2005=0 ).
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    *&      Form  calc_num_working_days
          calculate the number of working days between two dates using
          the 'GB' factory calendar
    FORM calc_num_working_days  USING    P_DATE1
                                         P_DATE2
                                         P_NO_DAYS.
      Data: FAC_DATE1 LIKE SCAL-FACDATE,
            FAC_DATE2 LIKE SCAL-FACDATE.
      check p_date1 <> '00000000'.
      check p_date2 <> '00000000'.
      CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
        EXPORTING
          CORRECT_OPTION                     = '-'
          DATE                               = p_date1
          FACTORY_CALENDAR_ID                = 'GB'
       IMPORTING
      DATE                               =
          FACTORYDATE                        = FAC_DATE1
      WORKINGDAY_INDICATOR               =
    EXCEPTIONS
      CALENDAR_BUFFER_NOT_LOADABLE       = 1
      CORRECT_OPTION_INVALID             = 2
      DATE_AFTER_RANGE                   = 3
      DATE_BEFORE_RANGE                  = 4
      DATE_INVALID                       = 5
      FACTORY_CALENDAR_NOT_FOUND         = 6
      OTHERS                             = 7
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
        EXPORTING
          CORRECT_OPTION                     = '-'
          DATE                               = p_date2
          FACTORY_CALENDAR_ID                = 'GB'
       IMPORTING
      DATE                               =
          FACTORYDATE                        = FAC_DATE2
      WORKINGDAY_INDICATOR               =
    EXCEPTIONS
      CALENDAR_BUFFER_NOT_LOADABLE       = 1
      CORRECT_OPTION_INVALID             = 2
      DATE_AFTER_RANGE                   = 3
      DATE_BEFORE_RANGE                  = 4
      DATE_INVALID                       = 5
      FACTORY_CALENDAR_NOT_FOUND         = 6
      OTHERS                             = 7
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      P_No_DAYS = FAC_DATE1 - FAC_DATE2.
    ENDFORM.                    " calc_num_working_days
    $$ end of global - insert your declaration only before this line   -
    FORM compute_data_field
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
      USING    COMM_STRUCTURE LIKE /BIC/CS8ZSAL_O03
               RECORD_NO LIKE SY-TABIX
               RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING RESULT LIKE /BIC/AZQS_O0400-/BIC/ZCRDQUST2
               RETURNCODE LIKE SY-SUBRC "Do not use!
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal table "MONITOR", to make monitor entries
      Data: wa_ACREC type dats,
            wa_no_days type i.
    Clear wa_ACREC.
    Clear wa_no_days.
    break-point.
    look-up the Acceptance Received Date for the corresponding Quote:
      Select single /BIC/ZCR_ACREC
      into wa_ACREC
      from /BIC/AZQOT_O0200
      where CRM_OHGUID = COMM_STRUCTURE-CRM_QUOGUI.
      IF sy-subrc <> 0.              "wa_ACREC is initial.
        RESULT = 0.
      ELSEIF COMM_STRUCTURE-/BIC/ZCR_PL_ON is initial.
        RESULT = 0.
      ELSE.
      compare AccR date with the planned-on date (in the comm_structure):
        perform calc_num_working_days
                USING    COMM_STRUCTURE-/BIC/ZCR_PL_ON
                         wa_ACREC
                         wa_no_days.
        RESULT = wa_no_days.
      ENDIF.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.

    The code may return zero in case
    - /BIC/AZQOT_O0200 table (ODS ZQOT_O02) has no entry for
    CRM_QUOGUI value coming in the record, or, ZCR_PL_ON is blank in the record.
    If both above conditions are not true, then only it calls to find the difference of date.
    Another thing to note (as I understand) is that it gets the factory calendar date corresponding to these two dates and then gives you a difference of those dates. I am not sure if that will return the no_of_workdays correctly (am not on system so can't check at the moment).
    However, I understand your primary concern is 0 values; those likely come because one of the conditions mentioned above is true for that record.

  • Update Routine & Start Routine in BI 7.0

    Hi Experts,
    We have recently upgraded from BI 7.0 , I am confused about where to write start routine & update routine in transformations of BI 7.0?
    Please mention any pointers?
    Thanks.
    Sharat.

    Hi
    When you open the start routine you will see a routines info which gives you help on this.
    A summary would be:
    Update routine in transformation.
    RESULT = source_field-material.
    Basically you can acess the value of the record by using source_field.
    Start routine.
    The data comes in the form of an internal table with name SOURCE_PACKAGE.
    You can access the values by looping into a work area.
    LOOP AT SOURCE_PACKAGE assigning <source_fields>.
    ENDLOOP.
    End routine(This is a new feature in BI 7.0 where you can modify data when transformations are complete and before data is updated to info-providers)
    The data comes in the form of an internal table with name RESULT_PACKAGE.
    You can access the values by looping into a work area.
    LOOP AT RESULT_PACKAGE assigning <result_fields>.
    ENDLOOP.
    Hope this helps you to understand the basics of the abap used in the transformations .
    Regards
    Samarpita

  • Update Routine to populate 0VENDOR from either of the 2 data source fields

    Hi,
    I have a requirement to write an update routine for 0VENDOR based on the below logic :
    Create routines to populated BW Info Object u201CVendoru201D (0VENDOR) based on the following logic:
    IF field u201CVendoru201D (ITM_VENDOR_ID) is populated from data source 0BBP_SC_TD_1, THEN populate 0VENDOR with that value
    ELSE IF u201CPreferred Vendoru201D (ITM_PROPVEN_ID) is populated from data source 0BBP_SC_TD_1, THEN populate 0VENDOR with that value
    ELSE IF neither u201CVendoru201D (ITM_VENDOR_ID) or u201CPreferred Vendoru201D (ITM_PROPVEN_ID) are populated from data source 0BBP_SC_TD_1, then 0VENDOR = NULL
    Can anyone help me in converting this logic into ABAP routine.
    Thanks,
    Suchitra

    Hi Suchitra,
    In the Transfer Rules ... You will be mapping each field then the mapping field click on the button with Triangle then you can see the which type you want.
    Then select the routine and select the datasource fields (don't forget to select the both fields VENDOR and PROPITM)...
    Then give a name to routine ...
    and in the code just change the COMM_STRUCTURE to TRANSFER_STRUCTURE.
    Then you can get this .... done..
    Regards,
    Ravi Kanth

  • New field to be filled by update routine

    Deltas are running, and added a new char to the cube and written update routine to fill the new char. How should i fill this new value for history. I don't want to reshedule the job from r/3. Will i be able to do from reconstruction (i doubt since our PSA Data is deleted every week). there is no ods between. What are options available.
    Kunal

    Hi Kunal,
       If data is available in BW then you can write some coding(routine) to fill the data for history data you have to loop back(CUBE to CUBE) to CUBE.
    Have a look:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f421c86c-0801-0010-e88c-a07ccdc69601
       Provide some more details. Which character, is available as attribute of any object...etc..
    Hope it Helps
    Srini

Maybe you are looking for