Code for Routine in Transformation

Hi Gurus,
Can you please tell me if following formula in routine will work?
((SOURCE_FIELDS-G_AERLOS-SOURCE_FIELDS-G_VVRF1) - SOURCE_FIELDS-G_AVVS03) -  SOURCE_FIELDS-PRICE_STD.
Thanks

SOLVED

Similar Messages

  • Need ABAP code for Routine

    Hi Gurus My requirement goes like this.
                                  I need to write the routine in Transformation from DSO to DSO
    Source table
    Doc         Amt         Netduedate      Reference Doc
    1000      10000     01.01.2010        
    1500       5000      30.01.2010        1000
    1700       3000      02.02.2010        1000  
    In the Above table 1st document is Invoice Document, 2nd and 3rd are Partial Payment Document.
    My requirement is 2nd and 3rd record Netduedate value should have 01.01.2010 by referring reference Doc field, for the above Ex We should have the output like this
    Target table
    Doc         Amt         Netduedate      Reference Doc
    1000      10000     01.01.2010        
    1500       5000      01.01.2010        1000
    1700       3000      01.01.2010        1000  
    Please give me the syntax code and where to write the code ie in the start routine or in the field routine. the dataflow is between one DSO to Another DSO
    Please Provide me the solution ASAP as this is very Urgency.
    Thanks in Advance

    If suppose your documents are being loaded in same load,
    1. start routine - create internal table like SOURCE_PACKAGE
    DATA IT_SOURCE_PACKAGE TYPE TABLE OF SOURCE_PACKAGE.
    DATA WA_SOURCE_PACKAGE LIKE LINE OF SOURCE_PACKAGE.
    2. copy all records to new internal table, IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[]
    3. delete partial docs, DELETE IT_SOURCE_PACKAGE WHERE REF_DOC IS NOT INITIAL.
    4. Sort internal table SORT IT_SOURCE_PACKAGE BY DOC
    5. Look for original doc inside loop.
    LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS> WHERE REF_DOC IS NOT INITIAL.
    READ TABLE IT_SOURCE_PACKAGE 
          INTO WA_SOURCE_PACKAGE
          WITH KEY DOC = <SOURCE_FIELDS>-REF_DOC  BINARY SEARCH.
    IF SYSUBRC EQ 0.
      <SOURCE_FIELDS>-NDUEDATE = WA_SOURCE_PACKAGE -NDUEDATE.
    ENDIF.
    ENDLOOP.
    If the original documents are found in different loads in the source DSO, we need to pull the records from active table of the target DSO after step 2.
    -Jijo

  • Example Code for Routine at Data Target in Info Package.

    Hi,
    Can any one send the example code for writing the routines at Data Target of Info Package for Deleting the Request from Info Cube after Update.
    Thanks in Advance,
    Regards,
    srinivas

    Hi All,
    I want to know some examples for guidance in writing the Abap Routine at Data Target of Info Package for Deleting the Request from Info Cube after Update.
    In the Data Targets of Info Package for Info Cubes we can delete the previous request based on the Conditions, exceptions and also based on the Abap Routine. I just want to know how do we write the Routine.
    This option is adjacent to the Maintain to Data Target in Data Targets of Info Package and will available for Info cube only.
    Thanks in Advance,
    Regards,
    srinivas

  • Sample code for routine

    Hi all,
    This is what I want to achieve. I have an attribute for an IO, but the values for that has to be decided at the transfer structure level. I want to write a routine in the transfer rules to populate the field.
    I have another field that gets populated from R/3. I need to write a routine which would take this value and see if it falls in the range and have to decide the value and populate.
    I have gl_account coming in, and in the routine I need to take that value of the gl_account and see if it falls in the range of 1 – 5000 or 6700 - 8130 if so assign a + sign and if not assign a – sign to the new field.
    Any sample code would be appreciated and rewarded.
    Thanks,
    Sri

    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    $$ end of global - insert your declaration only before this line   -
    $$ begin of routine - insert your code only below this line        -
    DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
       Data:  temp1 TYPE RANGE OF TRAN_STRUCTURE-ZDEBITCREDIT,
       Data:  temp1_line LIKE LINE OF temp1.
       temp1_line-sign = 'I'.
       temp1_line-option = 'BT'.
       temp1_line-low = '001'.
       temp1_line-high = '5000'.
       APPEND temp1_line TO temp1
      Data:  temp2 TYPE RANGE OF TRAN_STRUCTURE-ZDEBITCREDIT,
       Data:  temp2_line LIKE LINE OF temp2.
       temp2_line-sign = 'I'.
       temp2_line-option = 'BT'.
       temp2_line-low = '5001'.
       temp2_line-high = '8000'.
       APPEND temp2_line TO temp2
    Data: temp(1) char.
    if TRAN_STRUCTURE-0glaccnt  IN temp1.
       temp3  = '+'.
    elseif TRAN_STRUCTURE-0glaccnt  IN temp2.
      temp 3= '-'.
    endif
      RESULT = temp3 .
    returncode <> 0 means skip this record
      RETURNCODE = 0.
    abort <> 0 means skip whole data package !!!
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -

  • ABAP code for BI 7.0 transformations start routine

    Hi all,
    I am trying to update data from DSO1 (Source1: transaction data) to Infocube(TARGET)
    In the transformations Start routine, I have to read DSO2(Source2: Master data) for some fields.
    DSO1 has CUSTOMER as part of key
    DSO2 has CUSTOMER (key) and other fields....FIELD1, FILED2, FIELD3
    Infocube to be updated with FIELDS1,2 & 3 WHILE READING DSO2.
    WHERE DSO1 CUSTOMER matches with DSO2 CUSTOMER.
    Also, data NOT TO BE UPLOADED into Infocube if FIELD1 in DSO2= NULL
    Please give me the abap code for the above logic.
    Appreciate any help in this regard.
    Thanks.

    This is a doc from this site:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19
    Ravi Thothadri

  • Sample source code for fields mapping in expert routine

    Hi All
    Iam writing the expert routine from dso to cube for example I have two fields in dso FLD1,FLD2
    same fields in infocube also ,can any body provide me sample abap code to map source fields to target fields in expert routine,your help will be heighly appreciatble,it's an argent.
    regards
    eliaz

    Basic would be ;
    RESULT_FIELDS -xxx = <SOURCE_FIELDS> -xxx
    you have the source fields as source, and result fields for as the target. In between you can check some conditions as in other routines of transformation.
    BEGIN OF tys_SC_1, shows your source fields ( in your case DSO chars and key figures)
    BEGIN OF tys_TG_1, , shows your result fields ( in your case Cube characteristics)
    Hope this helps
    Derya

  • Needs sample ABAP code for field routine

    Dear Expert,
    There is a field "Pay Scale Group" in my DSO which stores the data in the format
    AA1/B1/CCC2/DD2/EEE1, A1/BB2/CC2/DDD3/EE2 etc. These data has to be transferred to
    InfoCube where "pay Scale Group" in the InfoCube will store the data like EEE1,EE2 etc.
    I need to write a field routine on the transformation between DSO and Cube.
    Can any one please help me with the sample ABAP code for this scenario.
    Some more examples for better understanding of the requirement:-
    Data in DSO(Source)            Data in Cube(Target)
    ===================            ===================
    AA1/B1/CCC2/DD2/EEE1            EEE1
    AAA1/BB2/CC1/DDD3/EE2           EE2
    A2/BBB2/CC2/DDD3/EEE5           EEE5
    AA2/BB1/C1/DDD3/EE3             EE3
    A3/B1/CC2/DDD1/EE4              EE4
    Many thanks in advance.
    Regards,
    Prakash
    Please do not dump your code requirements in SDN
    Edited by: Pravender on May 18, 2011 11:37 AM

    Hi,
    You can use the following code :
    Suppose the technical name of the field coming from DSO is ZPAY_SGRP.
    And also for example let me take one record, that is ZPAY_SGRP = AA1/B1/CCC2/DD2/EEE1 .
    My assumption is that there will always be 4 '/'.
    In the field routine write the below code
    data: V1(5) type c,
              V2(5) type c,
             V3(5) type c,
              V4(5) type c,
             V5(5) type c.
    data : VAR1 TYPE /BIC/OIZPAY_SGRP.
    split VAR 1  at '/' into V1 V2 V3 V4 V5.
    result = V5.
    V5 will be having the characters after the last '/' .That is V5 = EEE1.
    Hope the above reply was helpful.
    Kind Regards,
    Ashutosh Singh
    Edited by: Ashutosh Singh on May 17, 2011 3:53 PM
    Edited by: Ashutosh Singh on May 17, 2011 4:17 PM

  • Getting Error In the Routine - While writing Code for the Cross Reference.

    Hi,
    Getting Error In the Start Routine - While writing Code for the Cross Reference from the Text table ( /BIC/TZMDES with Fields /BIC/ZMDES(Key),TXTSH ) Getting Error as [ E:Field "ZMDES" unknown ].
    Transformation : IOBJ ZPRJ3(Source) -> IOBJ ZPRJC ( Target ).
    The Source  Fields are: 0logsys(Key),zprj3(Key),ZDOM3.
    The Target Fields are : 0logsys(Key),zprjc(Key),ZDOM3, UID.
    Here i am trying to Update the target Field UID by Comparing the Source Field [ zprj3(Key)] with the Text table ( /BIC/TZMDES ) and update the UID.
    The Code is as below:
    Global Declarations in the Start Routine:
    Types: begin of itabtype,
            ZMDES type /BIC/TZMDES-/BIC/ZMDES,
            TXT type /BIC/TZMDES-TXTSH,
             end of itabtype.
    data : itab type standard table of itabtype
    with key ZMDES,
    wa_itab like line of itab.
    Routine Code :
    select * from /BIC/TZMDES into corresponding fields of table itab for
    all entries in SOURCE_PACKAGE
    where ZMDES = SOURCE_PACKAGE-/BIC/ZPRJ3.
    READ TABLE itab INTO wa_itab
    WITH KEY ZMDES = SOURCE_PACKAGE-/BIC/ZPRJ3
    BINARY SEARCH.
    IF SY-SUBRC = 0.
    RESULT = wa_itab.
    CLEAR wa_itab.
    The tys_SC_1 structure is :
    BEGIN OF tys_SC_1,
         InfoObject: 0LOGSYS.
            LOGSYS           TYPE RSDLOGSYS,
         InfoObject: ZPRJ3.
            /BIC/ZPRJ3           TYPE /BIC/OIZPRJ3,
         InfoObject: ZDOM3.
            /BIC/ZDOM3           TYPE /BIC/OIZDOM3,
         Field: RECORD.
            RECORD           TYPE RSARECORD,
          END   OF tys_SC_1.
        TYPES:
          tyt_SC_1        TYPE STANDARD TABLE OF tys_SC_1
                            WITH NON-UNIQUE DEFAULT KEY.
    Please suggest with your valuable inputs.
    Thanks in Advance

    I have split the code in two.. one for start routine.. other for field routine.. hope this helps
    Types: begin of itabtype,
    ZMDES type /BIC/TZMDES-/BIC/ZMDES,
    TXT type /BIC/TZMDES-TXTSH,
    end of itabtype.
    data : itab type standard table of itabtype
    with key ZMDES,
    wa_itab like line of itab.
    Start routine
    select * from /BIC/TZMDES into corresponding fields of table itab for
    all entries in SOURCE_PACKAGE
    where ZMDES = SOURCE_PACKAGE-/BIC/ZPRJ3.
    Sort itab.
    field routine
    CLEAR wa_itab.
    READ TABLE itab INTO wa_itab
    WITH KEY ZMDES = SOURCE_FIELD-/BIC/ZPRJ3
    BINARY SEARCH.
    IF SY-SUBRC = 0.
    RESULT = wa_itab-<field name>

  • ABAP Routine code for the below logic

    Hello BW Experts ,
    I need to write a complex ABAP routine in BW .
    Following is the detail explaination .
    Can anyone tell me the ABAP code for the below logic?
    It would be a greate help as I am unable to do this
    since last two days.
    WBS Elements are maintained at  IOS and  Warranty levels in R/3 side.
    The IOS WBS is a top level of WBS element and below that the Warranty WBS level.
    The IOS and Warranty WBS elements can be differentiated by means of priority field.
    When priority = i   , WBS Element is known as  IOS Level WBS Element and
    When  priority = Y the WBS element is known as Warranty WBS element.
    The Equipment Number is maintained compulsorily at IOS Level WBS elements only.
    It is not maintained at  Warranty WBS Element.
    But the Cost is maintained at Warranty WBS Elements.
    In BW I need all Warranty WBS ( priority = Y) along with their cost figures and Equipment Numbers.
    But as the Equipment Number is not maintained compulsorily at Warranty WBS level we have asked to
    Copy it from  IOS WBS ( priority = i ) and assign it to Warranty WBS level ( priority = Y ).
    So I have included the Equipment Number in the ODS and in update rules I need to write the routine for it as
    per the above logic.
    The Equipment Number is coming from Master data of  WBS Element.
    The WBS element master data we are loading in BW .
    Also the same WBS Element transaction data is coming from the transaction data data source in BW.
    Following fields / infoobjects and the table names in BW :
    1. Equipment Number : /BIC/ZEQUIPMNT  and table name /BIC/MZWBS_ELEM.
    2. WBS Element       : ZWBS_ELEM  is coming from transaction data data source as well as master data.
                                     In ODS update rules it is coming from  transaction data data source Comm_structure-ZWBS_ELEM.
                                     Also we are loading separetly the master data for ZWBS_ELEM.
                                     The  ZEQUIPMNT is an attribute of ZWBS_ELEM.
    3. Priority                :  PRIORITY     and table name /BIC/MZWBS_ELEM.
                                      The info object name for Priority is 0Priority but in master data table /BIC/MZWBS_ELEM
                                      the field name is    PRIORITY.
                                     When PRIORITY = ' i ' then    ZWBS_ELEM is at IOS Level
                                     When PRIORITY = ' y ' then  ZWBS_ELEM is at Warranty Level.
    4. ODS name :  /BIC/AZCOST00 and same is table name active data table .
    So please tell me the routine Code .
    Best Regards ,
    Amol.

    Hi Dinaker,
    Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
    Thanks,
    SAPBWI

  • Routine sample code for reading 2 fields from existing DSO

    Hi Gurus,
                 I am a monkey when it comes to write ABAP code. I have one DSO-A where we store accounting info of purchading (from DS 2lis_02_acc) and one DSO-B getting data from 2lis_02_scl data source.
    We need to write a rountine to read DSO-A for G/L account and populate DSO-B G/L account field.
    Please provide me the sample code for this.
    Warm Regards,
    Anil

    Hi anil,
    Create a local table this is type of you source,
    Data : LV_table  TYPE  XXXX
    use the select statement to read the table of DSO .You have to use th active table for the dso that you want to read data from.
    Select xxxfieldxxx FROM  /BIC/A..........50
    into lv_table where
    filed name of of scheule line probably order no and item no .
    <soruce-fields>-IOBELN = IOBELN
    and <source-fields>-IOBELP = IOBELP.
    Checke the techinal name i am not sure about it. It will be something like that.
    Cheers mate

  • Wanted: Sample source code for voice recorder

    I've been google searching for some sample source code to implement a voice recorder on my AudioVox 5600. I would like to learn how to read from the microphone and write to my SD card in a standard file format like wav, wma or mp3.
    Can anyone help me understand how to do this?
    Thanks,
    Siegfried

    Basic would be ;
    RESULT_FIELDS -xxx = <SOURCE_FIELDS> -xxx
    you have the source fields as source, and result fields for as the target. In between you can check some conditions as in other routines of transformation.
    BEGIN OF tys_SC_1, shows your source fields ( in your case DSO chars and key figures)
    BEGIN OF tys_TG_1, , shows your result fields ( in your case Cube characteristics)
    Hope this helps
    Derya

  • Start Routine on Transformations

    Hi Friends
    I've Start routine on transfer rules with internal table and it was working fine.
    Now I'm trying to define the internal table with occurs 0 but it's throwing error saying occurs not support in new version.
    How can we define an internal table in start routine of transformations in BI7?
    The code as follows for internal table.
    data: begin of it_ord occurs 0,
    AUFNR(000012) TYPE C,
    ZZARBPL(000008) TYPE C,
    WERKS(000004) TYPE C,
    end of it_ord.
    Regards,
    Chandu.

    Hi
    I've defined as follows
        types: begin of it_ord ,
                AUFNR(000012) TYPE C,
                ARBPL(000008) TYPE C,
                WERKS(000004) TYPE C,
              end of it_ord.
        data: temp_tabix like sy-tabix,
              is_datapak type tys_SC_1.
        data it_ordt type table of it_ord .
    It's throwing error saying it_ort is a table with no header line and therefore has no component called aufnr.
    If I define with header line then header line not supported.
    What could be the problem?
    I've changed like you said but it's giving the following error.
    E:"IT_WA" is not a table with header line.
    Regards,
    Chandu.
    Edited by: Chandu on Feb 18, 2009 8:44 AM

  • Problem with Routine in Transformation

    I have a routine that uses TIMECALC_DIFF to determine the difference between to date/times held in timestamp format.
    All it generates is a duration of zero, no matter what the inputs are.
    Value for YDATTIM is 20050812121821 and for YDATTIMF  is 20050813121821 and the answer given is zero, when it should be 86400.
    CONSTANTS:   gc_timezone_system      TYPE timezone    VALUE 'MSTNO'.
    DATA:  t_first(14) TYPE c,
             t_last(14)  TYPE c,
             /BIC/YDATTIM TYPE timestamp,
             /BIC/YDATTIMF  TYPE timestamp,
             /BIC/YDATDUR TYPE i.
    CALL FUNCTION 'TIMECALC_DIFF'
              EXPORTING
                timestamp1 = /BIC/YDATTIM
                timestamp2 = /BIC/YDATTIMF
                timezone   = gc_timezone_system
              IMPORTING
                difference = /BIC/YDATDUR.
         RESULT = /BIC/YDATDUR.
    Thanks
    Steve

    In the transformation it generates the following code, and this doesn't seem to be editable;
      IMPORTING
        request     type rsrequest
        datapackid  type rsdatapid
        SOURCE_FIELDS-/BIC/YDATTIMF TYPE /BIC/OIYDATTIMF
        SOURCE_FIELDS-/BIC/YDATTIM TYPE /BIC/OIYDATTIM
       EXPORTING
         RESULT type tys_TG_1-/BIC/YDATDUR**
        DATA:
          MONITOR_REC    TYPE rsmonitor.
    I have put all the code generated below
    PROGRAM trans_routine.
          CLASS routine DEFINITION
    CLASS lcl_transform DEFINITION.
      PUBLIC SECTION.
    Attributs
        DATA:
          p_check_master_data_exist
                TYPE RSODSOCHECKONLY READ-ONLY,
    *-    Instance for getting request runtime attributs;
        Available information: Refer to methods of
        interface 'if_rsbk_request_admintab_view'
          p_r_request
                TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
      PRIVATE SECTION.
        TYPE-POOLS: rsd, rstr.
      Rule specific types
        TYPES:
          BEGIN OF tys_SC_1,
         InfoObject: YDATTIMF Finish date/time.
            /BIC/YDATTIMF           TYPE /BIC/OIYDATTIMF,
         InfoObject: YDATTIM Start date/time.
            /BIC/YDATTIM           TYPE /BIC/OIYDATTIM,
         Field: RECORD.
            RECORD           TYPE RSARECORD,
          END   OF tys_SC_1.
        TYPES:
          BEGIN OF tys_TG_1,
         InfoObject: YDATDUR Duration.
            /BIC/YDATDUR           TYPE /BIC/OIYDATDUR,
          END   OF tys_TG_1.
    $$ begin of global - insert your declaration only below this line  -
    $$ end of global - insert your declaration only before this line   -
        METHODS
          compute_YDATDUR
            IMPORTING
              request                  type rsrequest
              datapackid               type rsdatapid
              SOURCE_FIELDS              type tys_SC_1
            EXPORTING
              RESULT                   type tys_TG_1-/BIC/YDATDUR
              monitor                  type rstr_ty_t_monitor
            RAISING
              cx_rsrout_abort
              cx_rsrout_skip_record
              cx_rsrout_skip_val.
        METHODS
          invert_YDATDUR
            IMPORTING
              i_th_fields_outbound         TYPE rstran_t_field_inv
              i_r_selset_outbound          TYPE REF TO cl_rsmds_set
              i_is_main_selection          TYPE rs_bool
              i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
              i_r_universe_inbound         TYPE REF TO cl_rsmds_universe
            CHANGING
              c_th_fields_inbound          TYPE rstran_t_field_inv
              c_r_selset_inbound           TYPE REF TO cl_rsmds_set
              c_exact                      TYPE rs_bool.
    ENDCLASS.                    "routine DEFINITION
    $$ begin of 2nd part global - insert your code only below this line  *
    $$ end of 2nd part global - insert your code only before this line   *
          CLASS routine IMPLEMENTATION
    CLASS lcl_transform IMPLEMENTATION.
      METHOD compute_YDATDUR.
      IMPORTING
        request     type rsrequest
        datapackid  type rsdatapid
        SOURCE_FIELDS-/BIC/YDATTIMF TYPE /BIC/OIYDATTIMF
        SOURCE_FIELDS-/BIC/YDATTIM TYPE /BIC/OIYDATTIM
       EXPORTING
         RESULT type tys_TG_1-/BIC/YDATDUR
        DATA:
          MONITOR_REC    TYPE rsmonitor.
    $$ begin of routine - insert your code only below this line        -
    CONSTANTS:   gc_timezone_system      TYPE timezone    VALUE 'GMTUK'.
    DATA:  t_first(14) TYPE c,
             t_last(14)  TYPE c,
             /BIC/YDATTIM TYPE timestamp,
             /BIC/YDATTIMF  TYPE timestamp,
             /BIC/YDATDUR TYPE i.
    CALL FUNCTION 'ZZTIMEDIFF'
              EXPORTING
                /BIC/YDATTIM = /BIC/YDATTIM
                /BIC/YDATTIMF = /BIC/YDATTIMF
                timezone   = gc_timezone_system
              IMPORTING
                difference = /BIC/YDATDUR.
         RESULT = /BIC/YDATDUR.
    $$ end of routine - insert your code only before this line         -
      ENDMETHOD.                    "compute_YDATDUR
          Method invert_YDATDUR
          This subroutine needs to be implemented only for direct access
          (for better performance) and for the Report/Report Interface
          (drill through).
          The inverse routine should transform a projection and
          a selection for the target to a projection and a selection
          for the source, respectively.
          If the implementation remains empty all fields are filled and
          all values are selected.
      METHOD invert_YDATDUR.
    $$ begin of inverse routine - insert your code only below this line-
    ... "insert your code here
    $$ end of inverse routine - insert your code only before this line -
      ENDMETHOD.                    "invert_YDATDUR
    ENDCLASS.                    "routine IMPLEMENTATION
    Thanks
    Steve

  • Cmod code for data extractor enhancement

    hi guys  i need some help writing some abap code
    the requirement is to enhance the datasource to show data..i have data like
    1  b  john   etc...
    1  c  john   etc..
    1  d john   etc...
    the data belongs in the same structure. .. the structure has 15 fields and i could append the structure with a new filed to hold the concatenated value of b, c, d.
    i need it to written out in the data source as
    1 line showing
    1  b c d  john   etc.......
    delete the rest of the extra lines..
    any ideas.?

    Hi Amar,
    You can do this in start routine of transformation.
    Create one internal table to hold the target value ie. combination of a b c and d in one field.
    Now you can keep  looping on source package and collect all the similar values as given below.
    create a temporary variable for storing the value of field1 which is holding all 1 values.
    Loop at source_package into wa_package.
    if sy-tabix = 1.
    temp_field1 = wa_package-field1.
    concatenate wa_table-field2 wa_package-field2 into wa_table-field2.
    endif.
    if temp_field1 = wa_package-field1.
    concatenate wa_table-field2 wa_package-field2 into wa_table-field2.
    else.
    append wa_table into it_table.
    clear wa_table.
    wa_table-field2 = wa_package.
    endif.
    endloop.
    Regards,
    Durgesh.
    endloop.

  • Thread for routines scenarios-

    Hello guys,
    We are a couple of BI starters without project experience. We read some documents about where to use ABAP in BI  and how to use.We want to implement them in our sandbox but donot know anything about how the requirement will be.
    So we thought of starting a thread here so that people who have got project experience will post in this thread ,where they have used ABAP in their projects or which client requirement made you use ABAP.
    I am sure many of BI starters will like to learn from this thread.
    Thanks,
    Rgds,
    S

    Hi,
    Scenario 1: Reporting Level
    There is Material which is having Manufature Date and Expiry Date.My client wants the no.of Daya between Manufature Date and Expiry Date.So for this we have created customer exit variable and written a code to clacute the no.of.Days.Code written in CMOD ( ABAP Code) in BI.
    Scenario 2:  Start Routine
    Trnaformation Level
    Program Name:      Start Routine of Update Rule 2LIS_04_P_MATNR                    
    Data Declaration
      DATA:i_ZPPLANT_ATT
             like /BI0/PPLANT occurs 0
               with header line,
           i_ZPSALESORG_ATT
             like /BI0/PSALESORG occurs 0
               with header line.
    Remove content of DataSet
      refresh: i_ZPPLANT_ATT,
               i_ZPSALESORG_ATT.
    Selection of Data Package Attributes
      SELECT PLANT SALESORG OBJVERS
        FROM /BI0/PPLANT
      INTO CORRESPONDING FIELDS OF
        TABLE i_ZPPLANT_ATT.
      SELECT SALESORG COMP_CODE OBJVERS
        FROM /BI0/PSALESORG
      INTO CORRESPONDING FIELDS OF
        TABLE i_ZPSALESORG_ATT.
      LOOP AT DATA_PACKAGE.
        CLEAR i_ZPPLANT_ATT.
        CLEAR i_ZPSALESORG_ATT.
      Retrieval of Company Code using Plant Attributes
        READ TABLE i_ZPPLANT_ATT WITH KEY
                   PLANT = DATA_PACKAGE-PLANT
                   OBJVERS = 'A'.
        READ TABLE i_ZPSALESORG_ATT WITH KEY
                   SALESORG = i_ZPPLANT_ATT-SALESORG
                   OBJVERS = 'A'.
        DATA_PACKAGE-COMP_CODE = i_ZPSALESORG_ATT-COMP_CODE.
        DATA_PACKAGE-/BIC/ZCMPSCRAP = DATA_PACKAGE-/BIC/ZCMPSCRAP / 100.
        Modify DATA_PACKAGE TRANSPORTING
            /BIC/ZCMPSCRAP
            COMP_CODE.
      ENDLOOP.
    if abort is not equal zero, the update process will be canceled
    ABORT = 0.
    Threads for Routines:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/609eea32-455e-2c10-c08a-c23adf8c934e?QuickLink=index&overridelayout=true
    Transformation in SAP BI 7.0 routine
    Regards
    Ram.
    Edited by: Ramakanth Deepak Gandepalli on Dec 28, 2009 6:20 AM

Maybe you are looking for