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

Similar Messages

  • End routine for Currency conversion

    Hi,
    I have a requirement in which i have to convert sales and cost into three types of currency as GBP, INR and EUR in cube. i made 3 different fields for sales as well as for cost. But i am unable to write end routine for it.
    Can anyone please help me that how can i solve this problem.
    Roma

    Hi,
    In transformation itself you can do your currency conversion.
    http://help.sap.com/saphelp_nw70/helpdata/en/de/6372426f0f9041e10000000a1550b0/content.htm
    If you want to write a routine in to do conversion, you have to go for start routine instead of end routine.
    Thanks
    BVR

  • 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

  • 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

  • Infostructure update routine : debug problem

    Hi All,
    We have created three update routines for three corresponding infostructures. But I am not able to debug this routine. I tried to put a hard breakpoint also, but it was of no use. The Infostructure logs the changes in the sales order.
    How can I get the list of objects that are accessible in these routines?
    How can I view the values of MCVBAP and MCVBAK(communication structures) that are used in the update routines?
    How can I debug such routines?
    From where does these structures, MCVBAK and MCVBAP, get value? Are these runtime values? How much time does it take normally take for the infostructure to be updated? or is it updated immediately when the sales Order is saved?
    Thanks,
    Jiten

    Hello,
    some hopefully helpful answers:
    - the MCVBAK / MCVBAP are structures, that are built from the orderdata in the function MCV_STATISTICS_ORDER. There are two exits EXIT_SAPLMCS1_001 (header Data) and EXIT_SAPLMCS1_002 (position data) where you could fill additional user fields in these structures. Additional fields you could define in the structures MCVBAKUSR or MCVABPUSR.
    - the time that it takes to get an infostructure updates depends on it's customizing of updating (transaction OM01). the possibilities are: no update, update in V1-posting, update in V2-posting, update in batch.
    - Helpful are folling transactions: MC30 ( shows the update logs, you have to set the parameter MCL = 'X' in your userdate, see OSS - Note 77427) , MCVR (simulation of update).
    Regards Wolfgang

  • Help with Update Routines

    Hello!
    I'm quite new to writing Update routines & need help regarding the same.
    I need to write some Update routines for Time Characteristics.
    Here is some info:
    (1) Period to analyze (Custom Char) is in Cal Month/Year (ex:01/2007)
          -- Map 01/2007 to Fiscal Pd/year (007/2006)
    (2) Map Fiscal Pd/year (007/2006) to Planning period (ZDOT_FISCPER -->New Char).
    Planning period (ZDOT_FISCPER) periods are as follows:
    July – Oct      Pd 1
    Nov – Mar      Pd 2
    April – June   Pd 3
    So, Fiscal Pd/year of 007/2006 will be Planning period 02/2006.
    Please advise on how to go about this. Any code for these updates will be of great help.
    Thanks!

    Roberto,
    Appreciate your response. I got a clarification done now, The PERIO is Cal Month/Year. So my Question (1) has an answer now )
    Coming to Question (2):
    Ranges for ZDOR_FISCPER(Planning Period) ranges to Fiscal Period.
    I'm thinking, from the result of (1) which is Fiscal year/period ((lets ignore the year(since it is mapped to Fiscal year(GJAHR) always)), can we do this:
    Fisc pd                  Planning Period
    001-004                               1
    005-009                               2
    010-012                               3
    You think this would work, any clue how to go about this?
    Thanks Again!

  • 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 - Can I add new items for an InfoOBject

    In the update rules (for one of the Info object) of a BW-ODS1 to another BW-ODS2 - I might end up reformatting the Info Object. If reformatted I need to create a new entry in the Master tables [maintain the Info Object]
    Praactical...
    If MATERIAL in ODS1 is reformatted during the update-rule-processing [the MATERIAL in ODS2 has new value]. Then using the same update rule can I create a new material (populate attributes)?
    Please ask me more If u don’t understand my post.
    Please check this post I have more questions to follow.
    Thank You

    Hi,
    I assume you have all necessary attributes of your new material in ODS2? Or, at least the attributes can be read from the old material (either from ODS1 or MasterData)?
    Then you could update your MasterData from ODS2 via a flexible Update Rule. Just connect the InfoSource 8<ODS2> to 0MATERIAL and fill the fields you need (either directly oder with a routine) and your attributes will be filled.
    Best regards
    Frank
    Message was edited by: Frank Glahe, type-o's corrected

  • Can routine replace "master data attribute of" update rule for performance?

    Hi all,
    We are working on CRM-BW data modeling, We have to look up agent master data for agent level and position for each transaction data. So now we are using "Master data attribute of" update rule. Can we use routine instead of "Master data Attribute of" ? Will it improve the loading performance? Since we have to load 1 lack transaction records , where as we have 20,000 agent details in agent master data.My understanding is, for each record in data package the system has to go to master data table and bring the agent details & store in cubes. Say one agent created 10 transactions, then this option "master data attribute of" will read the agent master data 10 times even though we are going to pull same details for all 10 transactions from master data. if we use routine, we can pull the agent details& storing in internal table removing all duplicates and in update routine we can read the internal table.
    Will this way improve performance?
    let me know if you need further info?
    Thanks in advance.
    Arun Thangaraj

    Hi,
    your thinking is absolutely right!
    I don't recommend to use the standard attribute derivation since it will perform a SELECT to the database for EACH record.
    Better implement a sorted table in your start routine; fill it with SELECT <fields> FROM <master_data_table> FOR ALL ENTRIES OF datapak WHERE OBJVERS = 'A' etc...
    In your routine perform a READ itab ... BINARY SEARCH.... I believe that you won't be able to go faster...
    hope this helps...
    Olivier.

  • How to write conversion routine for key figure?

    Our customer has this requirment:
    we need to know the last time of some TV program in BEx report, If a TV program last 500 seconds, we need show the key figure like this:  00:08:20, If a TV program last 100000 seconds, we need show the key figure like 27:46:40 (27 hours and 46 minitues and 27 seconds), If we define a key figure as time,  BW system will report a error that say it is not acceptable time.  If we want to define a integer, but we need display it like hhmmss format.  We know we can write conversion routine for char.  but I don't how to write conversion routine for key figure.   Please give me any hint if any other solutions?
    Edited by: SY DONG on Dec 2, 2010 3:36 AM

    If you want to do in Transformation Layer :
    You can use routine ...break up the seconds into minute hour and seconds
    you will have to handle few cases in this:
    let say your variable lv_seconds holds the number of seconds you want to convert to hour min and seconds
    DATA: lv_seconds type i,
               lv_hrs  type  i,
              lv_sec type i,
              lv_min type i.
    lv_hrs = lv_seconds / 3600
    if lv_hrs >= 1.
    lv_min = (lv_hrs - trunc(lv_hrs))*60
    here again handle seconds if min >60.
    else.
    lv_hrs = '00'.
    lv_min = lv_hrs*60
    It is just hint ..how you can manipulate the seconds to get it...you will have to think about the complete algorithm
    Regards,
    RK

  • Update rule/routine for 0PUR_C04

    hi experts,
    can someone give the update rule/routine for uploading 0ORDER_VAL(effective order value) into the cube 0PUR_C04 and the calculations for it?
    and also some explantion on how this effective purchase order value 0ORDER_VAL is calculated*??
    thanks

    Hi Surya,
    If you are using standard content for 0PUR_C04, you can get the update rule in standard update rules, which you can see in Business content on Metadata repository. For standard content four data source used to fill cube. Purchasing Group (2LIS_02_S011 ), Purchasing Data (2LIS_02_HDR), Pur.Data  (2LIS_02_SCL) and Purchasing Data (2LIS_02_ITM). The mapping for different update rules are done as:
    2LIS_02_S011: Direct Mapping
    2LIS_02_HDR: No Update
    2LIS_02_SCL: Routine (mm_convert_effwr)
    fill the internal table "MONITOR", to make monitor ent *ries
    IF ( COMM_STRUCTURE-PROCESSKEY = '001' or "Bestellu *ng
    COMM_STRUCTURE-PROCESSKEY = '011' or
    COMM_STRUCTURE-PROCESSKEY = '021' or
    COMM_STRUCTURE-PROCESSKEY = '004' or "LP
    COMM_STRUCTURE-PROCESSKEY = '014' or
    COMM_STRUCTURE-PROCESSKEY = '024' )
    AND COMM_STRUCTURE-BWAPPLNM EQ 'MM'
    AND COMM_STRUCTURE-ORDER_VAL <> 0.
    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.
    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.
    2LIS_02_ITM: No Update
    Hope this will give you some lead.
    Regards,
    Kams

  • Conversion Exit/Routines for Project ID

    Hello All,
    I am from the BI forum.
    I would like to have conversion exit for Project ID, The Problem i am facing in BI is, that in my BI report , the project iD displays in internal format , but i need in External format.
    For Ex the Project ID in Master data is P000291 but it displays as 0002189, which is wrong.
    I have found routines like CONVERSION_EXIT_ABPRJ_OUPUT,.
    I have also written a code in my BI system, also, but it still it shows me the internal format.
    The Source field is PSPID coming from PROJ table.
    I need to know the list of conversion routines for Project ID,,(to Convert Internal to External format).
    Thanks and Regards

    use the below FM "CONVERSION_EXIT_ABPSN_OUTPUT"

  • Start routine for  Update Rules

    I need to write a start routine for the update rules for an DSO with main idea as follows:
    I must compare the record that comes from the infopackage with the record that's already in my DSO. If the X date for the same 0PM_ORDER is the same as one in my DSO - do nothing
    If the X date is previous to the X date in my DSO for the same 0PM_ORDER - the new record must be created and at the same time all the records with subsequent(later) X dates for this 0PM_ORDER must be deleted.
    If the X date is later than the X date in my DSO for the same 0PM_ORDER - the new record must be created.

    Hi,
    Find the below code.
    DATA: BEGIN OF ITAB1,
    ZDATE TYPE /BIC/DATE
    END OF ITAB1.
    SELECT zdate FROM /BI0/QEMPLOYEE INTO corresponding
    fields
    of ITAB1 where employee = SOURCE_FIELDS-EMPLOYEE.
    IF ITAB1-ZDATE COMMUNICATE_STRUCT-DATE
    RESULT = ITAB1-CLM_IPAA.
    ENDIF.
    ENDSELECT.
    There will be an table for each DSO if you go for an manage DSO you will get three table i.e New,Active and Change Log take Active tables date field and compare with the communication structure that comes to routine.
    The above example is just an example table will be different from DSO to DSO.
    Let me know your thoghts.
    Regards,
    Shivu.

  • Routine for Update rule in cube

    Hi Friends,
           I have added a field to a cube, now i need to populate the same during the data is loading from the DSO to Cube.  Inupdate rule since we will get only te key figures, is it possible to access the dimensions in the routine. Please help me in giving some coadings for the routine for update rule.
    Thanks
    Prem

    Hi,
    one more suggestion..
    create a end routine and update the key figures based on ur dimension values by useing resuly_package.
    sample code:
    [Transformation end routine|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/203eb778-461d-2c10-60b3-8a94ee91cbfc]
    thnks.

  • HT6058 well, could someone help me please, i want to update the software to be ios 7.0.4, my question is, if i did update will whats app conversation delete? thank you for help

    Dear sirs,
    Could someone help me please, my version is 5.1.1 i want to update the software to be ios 7.0.4, my question is, if i did update will whats app conversation be deleted? thank you for helping me
    <E-mail Edited by Host>

    If you areupdating your idevice nothing will be deleted the i know of. I have updated my iPhone 5 to the lastest IOS 7.0.4 and everthing that i had on my iPhone 5 is still there, Just got all the awesome IOS7 features,
    iPhone tech
    Robbieeeee.

Maybe you are looking for

  • In sales order the total doc value

    when ever i created a sales order, the customer should pay amount 50% in order value then only system will allow to delivery automatically otherwise system should not allow to delivery. How it is possible please give me solution.

  • Ongoing problems with Flash in Firefox 8

    I am still having problems with Flash player since upgrading to Firfox 8 - see previous posts. Symptoms: When I try to access any flash containing page, the flash content does not load or play - the area it should be is blank or shrunk out - not even

  • Accessing Shell script form Safari

    Hello All, I have a shell script that i use for rdp. At the moment when i run "connect.sh rdp://myserver" from command line, it works perfectly calling rdesktop and querying the authentication servers. However i have been trying to use the automator

  • WRT160NL cannot connect to USB

    hello,     I just purchased a new 160NL router and installed on my home network.  Everything works fine.  I plugged in my fat32 USB drive.  the router sees the drive I shared the proper folder.  I cannot access the drive from my PC.  I get a windows

  • What's up with 10/24/06 cfapplets.jar hotfix?

    When I download the supposed "cfapplets.jar" 10/24/06 hotfix, it is really a zip file containing a bunch of stuff. The instructions on http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=b9c2d61c don't seem to apply. What's up with this? -bg