Doubt regarding data declaration in update routine!

Hi,
i had added one field in cube, update rotuine for which is in due.
in the update routine logic i have to assign this field to another field if some condition satisfies!
the logic is --
if Hstatus=c
close_date=stdatum.
close_date is the field i had created and added in info cube definition.
now, how to declare these fileds in routine as it is asking me to declare the fields
can any body suggest me how to declare those fields!
Thanks,
Ravi

Hi,
In cube, for updating every keyfigure, all the characteristics will be taken into account. So, in cube if you choose a keyfigure in characteristic tab you can find all the characteristics. Likewise you can find for all the keyfigures.
So, Transfer routine for all kefigures will transfer the same routine of the characteristic for all the keyfigure. (that means if you choose different keyfigure and if you choose a the same characteristic you can find the same routine, no need to create separate ) If you choose no, it wont transer the same routine to all the keyfigures for the characteristic. You can define the separate routine for the characteristic for every keyfigure.
in ODS this is not the case. There only Keyfields only will be common for all the datafields.
rgrds,
v.sen.
Message was edited by:
        Senthilkumar Viswanathan

Similar Messages

  • Doubts in Data Declarations

    Hi Xperts
    I'm posting this thread seeking for a clear clarification on the following and the impact in using them in our program:
    1. <u><b>TYPE REF TO</b></u>  VS <u><b>LIKE REF TO</b></u>
    2. Use of <u><b>ANY</b></u> Vs <u><b>DATA</b></u>
    kindly let me know how much difference it makes when making use of these
    thkx
    Prabhu

    Hi,
    <b>Reference Types</b>
    You can define reference types locally in your programs or globally in the ABAP Dictionary. You use the following syntax:
    TYPES <t> TYPE REF TO ...
    After TYPE, there is no reference to an existing data type. Instead, the type constructor occurs:
    The type constructor
    REF TO DATA
    declares a reference <t> to a data object. Fields with type <t> can contain references (pointers) to data objects, that is, instances of data types
    The type constructor
    REF TO <class>|<interface>
    defines a reference type <t> to the class <class> or interface <interface>. Fields with type <t> can contain references (pointers) to instances of the class <class> or of classes that implement the interface <interface>
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb30ea358411d1829f0000e829fbfe/content.htm
    Regards
    Sudheer

  • Doubt regarding Data transfer from R3 to BW

    Hello Experts,
    I have a basic questions to ask,I am curious to know that how the data is transfered from a
    remote system (let say R3 or CRM) to BW system.Though i know that two systems
    make a RFC connections and make use of idocs.
    But if somebody can through more light on this and help me clear my doubts.
    Also case when the data is transfered with in BW.
    Thanx and Regards
    Priyanka

    Hi,
    Chek in teh follwoing PDF you will get some Idea.
    http://sap-idoc2edi-consulting.com/pdfFiles/EDI_IDoc_Overview.pdf
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/908836c3-7f97-2b10-4cb8-e6790361c152
    Thanks
    Reddy

  • Regarding data declaration

    I am writing a report based on the number of customers.
    For ex: if the number of customers are greater than 50, peform this, if the number of customers are greater than 100, perform that etc.
    My question is - Should I declare 'number of customers' as integer or numeric ? What difference does it make?
    Thanks in advance for your input,
    Krishen

    hi,
    Better you declare it as integer.
    If you declare it as numeric, you need to know what will be the upper limit to the no. of customers. Ofcourse, integer also has a limit.
    data:  v_cnt(4) type n.
    it can not hold greater than 9999. So, better declare as integer instead of numeric as you dont know the no of customers.
    Regards,
    Sailaja.

  • Doubt Regarding Dates

    Hello,
    I want a list of dates of last 15 days from the date i pass ... how to achieve this ia a sql query...
    & i also want to display 'January - December' in a query ..
    plz help.

    Try this,
    SQL> SELECT &p_date - LEVEL dt
      2    FROM DUAL
      3  CONNECT BY LEVEL <= 15;
    Enter value for p_date: sysdate
    old   1: SELECT &p_date - LEVEL dt
    new   1: SELECT sysdate - LEVEL dt
    DT
    25-APR-11
    24-APR-11
    23-APR-11
    22-APR-11
    21-APR-11
    20-APR-11
    19-APR-11
    18-APR-11
    17-APR-11
    16-APR-11
    15-APR-11
    14-APR-11
    13-APR-11
    12-APR-11
    11-APR-11
    15 rows selected.
    SQL> SELECT TO_CHAR ( ADD_MONTHS ( TRUNC ( SYSDATE, 'YYYY'), LEVEL - 1), 'MONTH') mnth
      2    FROM DUAL
      3  CONNECT BY LEVEL <= 12;
    MNTH
    JANUARY
    FEBRUARY
    MARCH
    APRIL
    MAY
    JUNE
    JULY
    AUGUST
    SEPTEMBER
    OCTOBER
    NOVEMBER
    DECEMBER
    12 rows selected.
    SQL> G.

  • Doubt regarding Date Comparison

    Hello,
    i am facing a problem in date comparison
    SELECT max(l.id)
    FROM irf_bill_details l
    WHERE to_char(l.agreement_id) = '508814'
    AND l.billing_client_id = 'BHPIF'
    AND extract(YEAR FROM l.bill_date) < extract(YEAR FROM to_date('01-Jan-2010', 'dd-Mon-yyyy'))
    So when i am using this Query m getting the result ...BUT ...
    When i use the Below Query .... i am getting NULL ... So the problem surely is in when comparing with months ..?? how to get rid
    SELECT max(l.id)
    FROM irf_bill_details l
    WHERE to_char(l.agreement_id) = '508814'
    AND l.billing_client_id = 'BHPIF'
    AND extract(YEAR FROM l.bill_date) < extract(YEAR FROM to_date('01-Jan-2010', 'dd-Mon-yyyy'))
    AND extract(MONTH FROM l.bill_date)||'-'||extract(YEAR FROM l.bill_date) < extract(MONTH FROM to_date('01-Jan-2010', 'dd-Mon-yyyy'))||'-'||extract(YEAR FROM to_date('01-Jan-2010', 'dd-Mon-yyyy'))
    --------------------------------------------------------------------------------------

    Aijaz Mallick wrote:
    Hello,
    i am facing a problem in date comparison
    SELECT max(l.id)
    FROM irf_bill_details l
    WHERE to_char(l.agreement_id) = '508814'
    AND l.billing_client_id = 'BHPIF'
    AND extract(YEAR FROM l.bill_date) < extract(YEAR FROM to_date('01-Jan-2010', 'dd-Mon-yyyy'))
    So when i am using this Query m getting the result ...BUT ...
    When i use the Below Query .... i am getting NULL ... So the problem surely is in when comparing with months ..?? how to get ridAre you saying that you're still getting one row of output, but the id on the row is NULL?
    SELECT max(l.id)
    FROM irf_bill_details l
    WHERE to_char(l.agreement_id) = '508814'
    AND l.billing_client_id = 'BHPIF'
    AND extract(YEAR FROM l.bill_date) < extract(YEAR FROM to_date('01-Jan-2010', 'dd-Mon-yyyy'))
    AND extract(MONTH FROM l.bill_date)||'-'||extract(YEAR FROM l.bill_date) < extract(MONTH FROM to_date('01-Jan-2010', 'dd-Mon-yyyy'))||'-'||extract(YEAR FROM to_date('01-Jan-2010', 'dd-Mon-yyyy'))
    --------------------------------------------------------------------------------------Whenever you have a problem, post some sampel data (CREATE TABLE and INSERT statements) and the results you want from that data. Explain how you get those results from that data.
    As long as I don't know where you're starting from (sample data) or where you want to go (results) it's hard for me to give you good diorections.
    I suspect you want to be using TRUNC rather than EXTRACT, if not a plain DATE comparison.
    For example, if you have a string p_cutoff_date (such as '01-Jan-2010', but not necessaily the 1st of the month) and you want to see if l.bill_date is earlier than the beginning of the month that contains p_cutoff_date, then:
    WHERE   l.bill_date < TRUNC ( TO_DATE ( p_cutoff_date
                                          , 'dd-Mon-yyyy'
                       , 'MONTH'
                       )As you said in the subject line, you're trying to compare DATEs. So compare DATEs: don't convert them to NUMBERS (using EXTRACT) and then to strings (using ||); keep the DATEs as DATEs.

  • Data declaration error in adobe form

    hi,
    i m just remake a smartform into adobeform.but while doing so it's giving me error regarding data declaration.
    I had declare some of internal table as type of defiened type but at code initialzation it giving it's not a internal table.
    global data
    it_abc type ty_abc,
    types :
    types: begin of ty_abc,
               ab(8) type c,
               bc(4) type c,
              end of abc.
    when i m creating a internal table in code initialization it's giving me that already declared.
    code initialization.
    data : it_abc type table of ty_abc.
    Plz help me out.
    Regards
    Ricky

    Hi Maheshwari,
    After the declaration of the TYPES Structure, you need to declare the Internal Table. As follows
    TYPES
    types: begin of ty_abc,
              ab(8) type c,
              bc(4) type c,
              end of abc,
              tt_abc type standard table of ty_abc initial size 0.
    And in Global Declaration you use the newly created Internal Table (which is created using the Types Statement). And in Code Initialization you can use the Global Declaration internal table.
    Regards
    Pradeep Goli

  • Regarding dates.

    hi gurus, i have some doubt regarding dates function.
    if i enter any date of present month i wand the first date of next month.
    for example  if i enter any date in january from 01/01/2007  to 31/01/2007 i want
    first date of february. ie 01/02/2007. plz help me.
    regards
    vamsi.

    Hi
    use this coding
    data : d1 type sy-datum,
            d2 type sy-datum,
            d3 type sy-datum,
            d4(8),
            m(2),
            y(4).
    d1 = sy-datum.
    CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'
      EXPORTING
        I_DATE        = d1
    IMPORTING
       E_DATE        =  d2 .
    write :   d1.
    skip 3.
    m = d2+4(2).
    y = d2+0(4).
    concatenate  y m '01' into d4  .
    d3 = d4.
    write : / d3.
    write : / d2.
    write / '***********2 month****************************'.
    d3 = d2 + 1.
    CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'
      EXPORTING
        I_DATE        = d3
    IMPORTING
       E_DATE        =  d2 .
    write :/ d3,
            / d2.
    write / '**************3 month ***************************'.
    d3 = d2 + 1.
    CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'
      EXPORTING
        I_DATE        = d3
    IMPORTING
       E_DATE        =  d2 .
    write :/ d3,
            / d2.

  • 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

  • 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 bringing wrong data in Report

    Hello Experts,
    I have a strange situation on Inventory data. We have update rules from data source 2LIS_03_BF to our inventory cube.There is a characteristic in the cube which was not doing any thing in the past(I mean not mapped),which I am filling it currenlty using a update routine. The cube data looks absolutley fine for that field, I mean its bringing what it supposed to bring from my routine.The cube data looks fine for that field, but when I run the report on this cube,the field data is getting some numbers from some where,which is totally wrong.
    I checked whether there is BADI written on this field (Virtual Characteristic), but seems there is none for this characteristic except for some key figures based on some other characteristics.
    I am confused here as why the report is bringing some wrong numbers when it supposed to get the correct values from cube.
    Please advise,
    Regards,
    JB

    Hi,
    i hope you have checked it for non cumulative objects as there will be a different way of aggregation in that case.
    also, if the inventory is modelled based on cumulative key figures and if you are sure there is no code written for virtual key figures then it could be exception aggregation in the reporting settings or in the key figure general settings.
    Also during checks you are considering the historical data as well from the cube and its effect on the report output.
    just do a check and let us know.
    regards
    Ajeet

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

  • 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

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

  • 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

Maybe you are looking for