Access master data in update rules

Hi,
I try to calculate a weight in my update rules. Therefore I need the product weight and the number of peaces. I try to read the product weight from master data. The problem is, that it always calculates zero as the result. Is it possible to read master data in update rules?
If I try to calculate the weight in the transfer rules, I get the message in the monitor, that the transfer rules don't finish. Do you have an idea what to do?
Regards,
Gabi

Hi Robert,
here is my code in the update rule.
fill the internal table "MONITOR", to make monitor entries
  DATA: l_s_errorlog TYPE RSMONITOR.
  data: temp_prod_weight type /BIC/PZL2_P_ID.
general values
  RESULT = COMM_STRUCTURE-/BIC/ZL2_POTMW.   "weight
  UNIT = COMM_STRUCTURE-UNIT_OF_WT.
  RETURNCODE = 0.
  ABORT = 0.
calculate weight from master data, if it is zero
  IF COMM_STRUCTURE-/BIC/ZL2_POTMW = 0
  or COMM_STRUCTURE-/BIC/ZL2_POTMW = '0'
  or COMM_STRUCTURE-/BIC/ZL2_POTMW is initial.
    select single /BIC/ZL2_NETW UNIT_OF_WT
    from /BIC/PZL2_P_ID
    into corresponding fields of temp_prod_weight
    where /BIC/ZL2_P_ID = COMM_STRUCTURE-/BIC/ZL2_P_ID
    and objvers = 'A'.
    if sy-subrc <> 0.
      l_s_errorlog-MSGTY = 'I'.
      append l_s_errorlog to MONITOR.
      RESULT = 0.
abort, if calculation is not possible
      ABORT = 1.
    else.
      RESULT = temp_prod_weight-/BIC/ZL2_NETW
COMM_STRUCTURE-/BIC/ZL2_POTMQ.
      UNIT = temp_prod_weight-UNIT_OF_WT.
    endif.
ENDIF.
convert unit
  CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    EXPORTING
      INPUT                      = RESULT
    NO_TYPE_CHECK              = 'X'
    ROUND_SIGN                 = ' '
      UNIT_IN                    = COMM_STRUCTURE-UNIT_OF_WT
      UNIT_OUT                   = 'KG'
    IMPORTING
    ADD_CONST                  =
    DECIMALS                   =
    DENOMINATOR                =
    NUMERATOR                  =
      OUTPUT                     = RESULT
    EXCEPTIONS
      CONVERSION_NOT_FOUND       = 1
      DIVISION_BY_ZERO           = 2
      INPUT_INVALID              = 3
      OUTPUT_INVALID             = 4
      OVERFLOW                   = 5
      TYPE_INVALID               = 6
      UNITS_MISSING              = 7
      UNIT_IN_NOT_FOUND          = 8
      UNIT_OUT_NOT_FOUND         = 9
      OTHERS                     = 10
  IF SY-SUBRC <> 0.
    l_s_errorlog-MSGTY = 'I'.
    append l_s_errorlog to MONITOR.
    UNIT = COMM_STRUCTURE-UNIT_OF_WT.
    RESULT = COMM_STRUCTURE-/BIC/ZL2_POTMW.
  ELSE.
    UNIT = 'KG'.
  ENDIF.
I'm loading via PSA, but I have problems to debug the code. If I set a break point in my code (command break-point), I can't stop at it.
Thanks,
Gabi

Similar Messages

  • How to look up master data in update rule

    Hi Friends,
    I want to Fill a characteristic of an info cube using the attribute value in a master data in Update rule.
    Eg: I want to fill a field in cube 0PM_C01 that is got from Master data 0PM_ORDER. I have to do this in upate rule. Can anyone help me.
    Joe

    Eugene, Atlaj
    Your answers were very useful.
    Eugene as you said,
    I read the link you mentioned and I can use code
    like this
    DATA: mat LIKE /BI0/PMATERIAL-MATERIAL.
    SELECT SINGLE MATERIAL FROM /BI0/PMATERIAL INTO mat
    WHERE EANUPC = COMM_STRUCTURE-EANUPC AND OBJVERS = 'A'.
    IF SY-SUBRC = 0.
    RESULT = mat.
    RETURNCODE = 0.
    ELSE.
    RETURNCODE = 8.
    ENDIF.
    But for each record of comm structure the selection quer y will touch the Data base. As Atlaj said, can I fill the internal table in the start routine and look it up in the update rules. I think the performance willbe increased. Could you give me code sample or link?
    Thanks in ADV
    Joe

  • Loading time-dependent master data using update rules/transformations

    Hi
    I am trying to load time-dependent master data to an infoobject. It seems that I get an error message on duplicate records if I use a transformation or update rule. Does this only work with direct update ?

    In the DTP you have the option to ignore duplicate records....
    Just select that and then load data...

  • Extraction time while updating the data from update rule

    Hello Friends,
    Can you please tell me that why it is taking more time while updating the data from update rule to data target.
    I believe that it is taking 40% of total extraction time.
    Is there any specific reason for it?
    Prompt reply will be appreciated.
    Regards,

    hi,
    check if you have complex transformation in that update rules, like calculation, read from other tables, etc.
    take a look 'bw loading performance and analysis' doc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1955ba90-0201-0010-d3aa-8b2a4ef6bbb2
    and bi performance tuning knowledge center
    Business Intelligence Performance Tuning [original link is broken]
    there e-learning for bw performance
    hope this helps.

  • FM for master data creation/update

    Hello all,
    I would like to ask you for a FM for master data creation/update.
    Thanks all for your help.

    The answer is API_SEMBPS_CHA_VALUES_UPDATE.

  • How to access Master Data in ERP2005 for SD

    Hi All,
    I installed ERP2005 in my system with MS SQL.
    I do not know how to Access the Master Data in the system for SD.
    Can anybody guide me.
    Thank you,
    Ravi.

    Hi Ravi,
    Firstly, have you created any Master Data. If yes, you will be able to access the same.
    Sales Order Management Transactions Codes:
    <b>GENERAL ORDER MANAGEMENT</b>
    Reviewing Document Flow VA03
    Searching for a Customer Sales Order by Serial Number ZV11
    Order Inquiry ZV33
    <b>SALES ORDER PROCESSING</b>
    Creating Sales Order VA01
    Maintaining a Sales Order VA02
    Displaying a Sales Order VA03
    Releasing an Order or Delivery from Credit Hold: Non-Flooring VKM1
    Releasing an Order or Delivery from Flooring Hold ZKM1
    Manually Pre-authorizing Blocked Credit Card Orders Z.14
    Display List of RMAs by Customer VA05
    Confirm RMA Goods Receipt VL02
    Generate list of open return orders for deletion VA05
    Display Customer returns eligibility MCSI
    Removing a Billing Block (Approving Credit/Debit Requests) V.23
    <u><b>PRICING MASTER DATA</b></u>
    Create Pricing VK11
    Creating a Sales Deal VB21
    Maintaining a Sales Deal VB22
    Displaying a Sales Deal VB23
    Maintaining Prices VK12
    Displaying Prices VK13
    <u><b>MATERIAL MASTER DATA</b></u>
    Creating Material Substitution Master Data VB11
    Maintaining/Deleting Material Substitution Master Data VB12
    Displaying Material Substitution Master Data VB13
    Creating a Bundled Master MM01
    Creating a Sales BOM CS01
    Maintaining a Sales BOM CS02
    Displaying a Sales BOM CS03
    <u><b>CUSTOMER MASTER DATA</b></u>
    Creating Partner Records XD01
    Maintaining Customer Master Data XD02
    Displaying Customer Master Data XD03
    Deactivating a Partner VD06
    CUSTOMER CREDIT INFO
    Creating/Maintaining New Customer Credit Information FD32
    Displaying Customer Credit Information FD33
    Blocking or Unblocking a Customer VD05
    <b>SHIPPING</b>
    Creating a Delivery VL01
    Displaying a Delivery VL03
    Deleting a Delivery VL02
    Shipment Inquiry / Display VT03
    Adjusting Transfer Order - Confirmation Quantity LT12
    Collectively Confirm Transfer Order LT25
    Batch Shipment Confirmation VL19
    Creating Service Provider/Carrier Master Data XK01
    Maintaining Serive Provider/Carrier Master Data XK02
    Displaying Service Provider/Carrier Master Data XK03
    Maintaining Product Master/Serial # Profile/Unit of Measure/Shipping Unit MM02
    IDoc Inquiry WE02 / WE05
    Workflow Instructions
    <b>BILLING</b>
    Invoicing a Customer Shipment VF01
    Reprinting an Invoice VF31
    Releasing a Sales Order for Billing V.23
    Creating an Invoice by Using the Billing Due List VF04
    Checking Open Billing Documents VF05
    Create Credit/Debit Memo FB01
    <b>A/R</b>
    Controlling Total Debit/Credit bkgs F.03
    Generate FI Account balance F.08
    Generate Month-to-date Inv. register F.02
    Process payments FBZ1
    Rqst Individual Customer Corresp. FB12
    Generate Customer Correspondence F.61
    Enter Batch totals under Control ttl FB07
    Display G/L Acct. totals FBL3
    Reverse Posted Amounts FB08
    Customer Refunds FBL6
    Customer Refund to other than Payer FB05
    Clearing Debit/Credit on Cust. acct. FB1D
    Customer Balance in Local Currency F.23
    G/L Account Balance Report F.08
    Create Invoice - legal entity adjust FB01
    Generate Cust. Acct. statements F.27
    Generate Dunning Letters F150
    Generate Billing Due List VF04
    Generate Blocked Billing Doc list VFX3
    Inq. via Credit Release Screen VKM1
    List orders by partner VA05
    Past Due invoices by customer FD11
    Check number info by G/L account FBL3
    Display customer Line items FBL5
    TREASURY - CASH APPLICATION:
    Post Customer payments FF68
    Verify if A/R is updated FB03
    Hope The above details helps you.
    Regards,
    Rajesh Banka

  • Master Data - Flexible update

    We have C1 master data, Different attributes under this.
          the source for this char is coming from different info pkgs.
          also Transactional data.
      We r loading master data from r/3 into char1 using flexible update mode.
      When looked at the master table using Se11, can view all the data correctly.
    But when view the contents of the C1 master data from RSA1 (Maintain master data ), observed that one of the attribute is not loaded.
    Any idea what could be the reason. 
    any way how to identify how this data is loaded, either master load or transaction data.
    Also how to correct this data.

    look into the transfer rules of the master data infoobject, check where the attribute is getting loaded, else check in the transfer rules of the transaction data infosource if it is marked to get loaded from there.
    proceed accordingly. if u dont find it in both the rules, then it needs to be configured again taking data from available data source.
    **revert on doubts. reward if helpful**

  • Master Data "Simulate Update" and REAL update differences

    Hi there everyone.
    My issue is this. When I load my 0EMPLOYEE Master Data the new records are not written in the infoobject and I don't understand why?
    When I go to the Loading monitor, "Details" tab > Data package then right click and choose "Simulate Update" everything simulates perfectly, but afterwards, in the real infoobject the data is unchanged!!
    I activated the data, so, there is no problem there...
    Any ideas?
    thanx

    That's a little strange, if your data goes to PSA and in simulate is seems that it is sent write, there's something not allowing your data to be written.
    Nevertheless did you check your update rules (transformation) if there is something not allowing the data to be written?
    I'm having no more ideas...
    Try to create another infopackage and running different selections for 0employee. Check the time intervals (time dependent) while executing the infopacakge (if they are ok to bring data).
    Diogo.

  • PSA Data in Update Rules

    I want to get at some data in the PSA table from within an update rule.
    Can anybody tell me how I can access the current request that is being loaded?
    The communication structure does not contain the request and it is possible that the data I want was in more than one request.

    hi Stuart,
    it's good you gave us the 'whole picture', now we understand it's dealing with crm complaints data, my suggestion is fill the header status for item data in crm side (see my reply in your previous posting). there i gave you an overview logic, will need go to system for the details - field name of header status data etc, i guess the table is crmd_orderadm_h for header and using header guid (guid) should get it done - meanwhile perhaps somebody with crm system will help.
    hi Stuart, i was late again, after post the above message, i saw your last reply. still i think better you do it in crm side, i believe later your user will ask for new information that not exist in business content, by that time you have to enhance datasource.
    Message was edited by: A.H.P

  • BP Master Data gets updated when (AR/AP) Invoice is raised

    Hi All,
    I am running SAP B1 8.8 and I discover that whenever AR or AP invoice is raised, it will update the business partner master data. On the master data of the particular BP where the invoice was raised, I went in and click on the change log, the date of latest update is the same as the date when the invoice is raised. I was wondering why SAP B1 8.8 is doing that? I am running the latest PL which is PL 14 hotfix. But I don't think it's PL 14, as I can see the history of te change log was created even before I updated my B1 to PL14 hotfix.
    I have done multiple invoices with the same BP, and it seemed the update only happened once, which was the first time an invoice is raised.  Just curious as to why the BP master data needs to be updated.
    Many thanks.
    Cheers.
    Kevin

    Hi Rahul,
    I have checked, no FMS. But do you get the same pattern though? When AR/AP invoice is raised a BP, then go that BP master data, click on its change log under tools. Do you see the latest date of the change is the same as your invoice date?
    Thank you.
    Regards,
    Kevin

  • Master data queue updates thru /SAPAPO/TS_LCM_QUEUE_UPDATE

    Hello Experts,
    In our present solution, there are frequent master data changes impacting the performance of SNP applications.
    As per SAP recommendation we are planning to schedule /SAPAPO/TS_LCM_QUEUE_UPDATE program.
    I wanted to know following if anyone is already using this program
    1) Appropriate frequency of running this program
    2) Is there any impact on users ( say accessing planning book or product view etc)
    3) Are there any undesirable impacts associated with this program
    Thanks in advance
    Amit

    Hi Amit
    You would probably get your answer in one of the earlier thread for the same topic
    Poor performance / Long run time for opening SNP planning book
    Thanks,
    Prasun

  • R/3 extraction - Missing Messages:No data from Update rules

    Hi SAP Gurus,
                  I'm into the process of R/3 extraction into BW for 0PUR_O01 . The Datasource we r using is 2LIS_02_ITM. The Sceduled infopackage still runs for over 12 hrs. We are getting the typical Missing Messages error. Its in the yellow status with one out of 3 data packets showing Everythin OK.While the other two are "Warning Received".
    PSA and Transfer rules have all the records . But Update rules show 11339 --> 0 records. Please suggest what has to be done to move forward. We have checked and there is no dump in ST22. Also its shows 11339 to 0 in start routine of Update rules. I m giving out all possible hints so that it might help giving in a wide variety of suggestions . Please do suggest a way forward.

    Hi,
    Try if this works for you.
    In this case you can execute the LUWs to get the missing data into BW. Here is the procedure.
    1. Go to manage data target  Monitor OR directly go to Monitor for request that failed
    2. Select: Environment  Transact RFC  In the Data Warehouse
    3. Enter the selection criteria Date and User TCODE and execute
    4. Select EDIT  Execute LUW
    This will restart the loading process only for the data package that failed because of space issues or some server problems thereby avoiding the necessity of reloading the entire request.
    Hope this info helps you.
    Regards,
    Yogesh

  • Master data delta update to data souce not possible

    Hi,
    0material_att data source delta update failed for a few days from the process chain and when I tried to manually run the delta infopackage, I got this message:
    Last delta update is not yet completed
    Therefore, no new delta update is possible.
    You can start the request again
    if the last delta request is red or green in the monitor (QM activity)
    I did "manage" for this data source but none of the failed delta run showed in there. I also looked for cancelled jobs in sm37 but nothing came up either. So I ran a full upload without deleting the data as my user is waiting for this fix to be shown in the report. What can I do now to enable the delta run again without deleting the data?
    sharon

    Hi Sharon,
    chk in RSMO for that master data 0material_attr, if there are any red/yellow req. If so change the QM status to RED again and goto IP and trigger the load again (it wil say that earlier delta has failed and if u want to Repeat ;ast delta,) in that give OK and exe the load again.
    In some cases, the datasource will not support repeat deltas, in that case do a re-init for the master data load. (no need to delete any datas.)
    Hope this helps. If you have any queries please ask.
    Thanks!
    Dharini

  • About data transfer/update rules setup

    Hi All,
    After this BW loading project, I am wondering if anyone can confirm with my issues.
    --What is the difference between'initail load & full load'? Examples to use them, please.
    --If i use V3 to update, can I choose weekly? some expert told me that i can change the setting in OMO1 after first time loading. I tried it and it didn't work. Why???
    --If we loaded into ODS and re-loaded to Cube, should I have the same loading schedules(update rules) for ODS and Cube?? (ex: both full load and weekly)?
    --The update rule in OMO1 is for transfer datasource to BW and is nothing about ODS and CUBE loading, Am I right?
    --Should I have the same keys for ODS and Cube?
    --How can system not replicate loading? EX: every month sales order loading.
    Thank you for helping me to understanding data loading in BW.

    Hi John,
    Here are the answer
    --What is the difference between'initail load & full load'?
    Ans:-Initial load means initialization which is one time activity if you do not provide any selection criteria while initialization ( this will take your all data to BW depends on extractor you are using ) once that is successful you need to switch your load to delta when you do this only records which are changed will be fetched.
    Full load means al records will be fetched and will be aggregated whether you should go for initialization or full load depends on your data requirement.
    --If i use V3 to update, can I choose weekly? some expert told me that i can change the setting in OMO1 after first time loading. I tried it and it didn't work. Why???
    Ans :--> I think if you are using Lo then you can change this in LBWE job control . OMO1 is if you are using LIS and you want to switch your update in LIS delta tables then the procedure is to go in LBW0 first deactivate your delta mechanism by putting your infostructure name then go to OMO1 and change your control parameter to schedule your delta mechanism on.
    --If we loaded into ODS and re-loaded to Cube, should I have the same loading schedules(update rules) for ODS and Cube?? (ex: both full load and weekly)?
    Ans:--> Not compulsory but good to have same schedule I mean as soon as ODS is loaded successfully start the load for cube.
    --The update rule in OMO1 is for transfer datasource to BW and is nothing about ODS and CUBE loading, Am I right?
    Ans -->yes you are right but let me make some correction
    in OMO1  update parameters are for switching of delta tables of LIS .
    --Should I have the same keys for ODS and Cube?
    Ans--> Not compulsory depends on your business logic.
    --How can system not replicate loading? EX: every month sales order loading.
    Ans--> question not clear for me.
    Hope this will help you .
    Suneel

  • Master Data Full Update

    Hi All,
    If I load Master Data everyday (Full Update), does the data overwrites the previous day data or adds the new data to the existing one?

    Hi S.D
      How are you? Yes, its master data always overwrites the data for which the keys match. So you need not worry about any duplicates. Infact, even when we do a delta load for our master data, we do a full load once a week to ensure that we did not lose any data with deltas.

Maybe you are looking for