Skip to Content
author's profile photo Former Member
Former Member

Start Routine


I searhed all the threads could not get a solution . i written start routine with help of ABAPer. i have some syntax error .

i know If it is standard ODS (0fiar_o03)code below like this.

data : i_fiar like /BI0/AFIAR_O0300,

Can any one guide me how to write above code if it customized ODS(ZFIAP_O3).



Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 08, 2010 at 06:45 AM


    It will be same.

    i_fiar like /BI0/aZFIAP_O300.

    Or you may define one table using fields and then type.

    TYPES: BEGIN OF table1,

    field 1 TYPE /bic/aZFIAP_O300-/bic/Info Obgect1,

    field 2 TYPE /bic/aZFIAP_O300-/bic/Info Object 2,

    END OF table1.

    DATA: i_fiar like table1

    I hopw it will work.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      i written code and getting below error.Can you please guide me.

      E:Field "FISCYEAR" unknown

      data : i_tab like DATA_PACKAGE,
               it_tab like TABLE OF i_tab,
               it_tab1 like TABLE OF i_tab.
        data : i_fiar like /BIc/AzFIAp_O300,
               it_fiar LIKE TABLE OF i_fiar.
        data : loopx LIKE sy-tabix.
        refresh : it_tab, it_fiar, it_tab1.
        it_tab[] = DATA_PACKAGE[].
        it_tab1[] = it_tab[].
        DELETE it_tab1 where INV_DOC_NO is INITIAL.
        sort it_tab1 by INV_DOC_NO inv_item comp_code inv_year.
        delete ADJACENT DUPLICATES FROM it_tab1
            COMPARING INV_DOC_NO inv_item comp_code inv_year.
        if not it_tab1[] is INITIAL.
          SELECT *
            from /BIc/AzFIAp_O300
            into TABLE it_fiar
            FOR ALL ENTRIES IN it_tab1
            where AC_DOC_NO = it_tab1-inv_doc_no
            and   item_num  = it_tab1-inv_item
            and   comp_code = it_tab1-comp_code
            and   fiscyear  = it_tab1-inv_year.
          sort it_fiar by AC_DOC_NO item_num comp_code fiscyear.

      loop at it_tab into i_tab where INV_DOC_NO is not INITIAL.

      loopx = sy-tabix.

      clear : i_fiar.

      READ TABLE it_fiar into i_fiar with key ac_doc_no = i_tab-inv_doc_no

      item_num = i_tab-inv_item comp_code = i_tab-comp_code

      fiscyear = i_tab-inv_year BINARY SEARCH.

      if sy-subrc eq 0.

      i_tab-DOC_DATE = i_fiar-DOC_DATE.

      i_tab-netdueDATE = i_fiar-netdueDATE.

      modify it_tab FROM i_tab INDEX loopx TRANSPORTING doc_date




        refresh : DATA_PACKAGE.
        DATA_PACKAGE[] = it_tab[].
      * if abort is not equal zero, the update process will be canceled
        ABORT = 0.
      *$*$ end of routine - insert your code only before this line         *-*

      Edited by: rama krishan on Jul 8, 2010 11:59 AM

  • Posted on Jul 08, 2010 at 10:34 AM


    Start Routine:

    The start routine is run for each data package at the start of the transformation. The start routine has a table in the format of the source structure as input and output parameters. It is used to perform preliminary calculations and store these in a global data structure or in a table. This structure or table can be accessed from other routines. You can modify or delete data in the data package.


    Suppose you are loading some records from an ODS to one Infocube,there are around 1000 Account number,but you want to exclude 5 Account numbers,so you can write a Start routine where you will delete all records related to these account numbers

    Using Lookup Code you can do it. See the below sample code, I have data in another DSO1, but while loading to different DSO2, I'm refering the DSO1 and bringing the Data from DSO1 and loading into DSO2.

    Write the code like below in BW 3.5.

    DATA: BEGIN OF t_batch OCCURS 0,
    	material LIKE /BIC/AZIC_O0600-material,
    	plant LIKE /BIC/AZIC_O0600-plant,
    	stor_loc LIKE /BIC/AZIC_O0600-stor_loc,
    	batch LIKE /BIC/AZIC_O0600-batch.
          END OF t_batch.
     material = DATA_PACKAGE-material  and
     plant    = DATA_PACKAGE-PLANT     and
     stor_loc = DATA_PACKAGE-stor_loc.
     ABORT = 0.
    "This code is at field level routine.
    SORT t_batch by material batch stor_loc.
    Read table t_btach with key material = COMM_STRUCTURE-material
                                plant    = COMM_STRUCTURE-plant    
                                stor_loc = COMM_STRUCTURE-stor_loc.
    If sy-subrc = 0.
      RESULT = t_batch-PLANT.
      RESULT = ''.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.