BI end routine at transformation to populate info object by vlookup attribu

Hi ,
I am APO consultant working in Bi routines and I have the follwoing situation and need some guidance in ABAP code (routine) .
We sales info from markets as flat filea snd lod them into cubes. One of the filed is file is External sales Group: ZEXSGRP. This is an attribute or Sales Group info object ZSLSGRP.
We get external sales group populated in file when we upload the file into cube -  I  want to use end routine to vlook up the  info infoobject table ZSLSGRP - all the external sales groups and use the matching value to write Sales Group (ZSLSGRP).Example  if ZSLSGRP  is NAM and it attribute is  ZEXSGRP  and has value N0000032. The file gets value N0000032 so the end routine should look all attribute of all infoobject ZSLSGRP and match the value and populate in example above it populates NAM.
Hope i am clear - can any help with this.
thaks
Varma

Replace your select statement ,
SELECT *
FROM /BIC/PZF31SALOFF
INTO CORRESPONDING FIELDS OF TABLE it_tab4.
instead of selecting all the fields , pick only the fields which are required.(one good performance improvement)
SELECT    /BIC/PZF31SALOFF  comp_code
FROM /BIC/PZF31SALOFF
INTO CORRESPONDING FIELDS OF TABLE it_tab4.
Remove the line below , this is not required
MODIFY it_tab4 FROM wa_tab4.

Similar Messages

  • Difference between Start Routine  and End Routine in Transformations

    Hi  Friends,
      I'm using BI 7.0... here in Transformations step  we have two options..that is START ROUTINE... and END ROUTINE... What is the Difference between Start Routine  and End Routine in Transformations..
       When  we go for Start Routine.. and when we go for End Routine..
    Plz clarrify... points will be rearded..
    thanks
    babu

    Hi,
    One real time scenario for End Routine.
    We have a scenario where in a datasource field is mapped to three infoobjects on the datatarget side. There are 2 key figures which need to get data after these these Infoobjects are filled. The best place for this to happen would be in a End Routine, where in we would loop through the results package and using the values of the infoobjects from the data target ( Cube in this case).
    Hope this helps,
    HD

  • End Routine in Transformation

    Hi Experts,
    We have a scenario wherein we need to write END Routine in the transfromation between  two cubes. While doing so we need to Look up at a DSO to fetch Financial Document Number.
    Details:
    We will be loading the Invoice data from 0LIV_DS01 ODS to the target cube ZLIV_DS01. We have a field called Invoice Clearing Date(0clear_date) in the target cube which is not present in this  0LIV_DS01 ODS. We have Invoice clearing date in the second cube(ZCSOINV). We need to write an END routine in the transformation between ZCSOINV and the target cube.
    We need to select Financial Document Number from Active table of 0liv_ds01 ods and store it in an internal table.
    Then compare this Financial Document Number with the Financial Document Number in the ZCSOINV cube. If there a match we need to select 0clear_date from ZCSOINV cube and assign it to result package.
    Please let me know what code needs to be written to achieve the above requirement in End Routine. Thanks
    Regards,
    Kavitha Jagannath

    In order to read the info cube you can use this function module: RSDRI_INFOPROV_READ
    This is the link in order to help you to use that function :
    /people/dinesh.lalchand/blog/2006/06/07/reading-infocube-data-in-updatetransfer-rules
    SAP also have the demo about it:
    You can open it in this program : RSDRI_INFOPROV_READ_DEMO
    1. go to tcode : se38
    2. type : RSDRI_INFOPROV_READ_DEMO then execute it.
    Edited by: Ananda Theerthan on Apr 12, 2010 6:20 PM

  • Primitive APAB editor in start/end routines in transformations

    When editing or viewing ABAP code in BI transformations, for example in a start routine, the editor that opens is very primitive compared to the normal SE38 editor. Some of the limitations include:
    The editor window doesn't cover the whole screen with seemingly no way to increase its size.
    The syntax check doesn't show on which line syntax errors are located.
    There is no option to perform a extended program check.
    There is no way to insert break-points (other than with the ABAP keyword of course)
    These limitations are present regardless of whether i choose the new front-end editor, the old front-end editor or the back-end editor. We're running SAP Netweaver 2004s.
    It is of course possible to create a program in SE38 and copy-paste your start routine code to see the code using the "real" editor, but this is very tiresome and time consuming. Is there a way to make this editor look and behave like the normal editor? I have looked through the setting options an searched SDN without finding a way.

    Hi,
    This is just the settings you need to change to open the start,end, and characteristics routine using the old editor you are comfortable with. No need to go to se38 and check copy the program.
    Go to se38->Utilities->settings->abap editor->editor tab->select the old abap editor.
    To specifically put break point in transformations (start routine..end routine..)..goto transformation (RSA1) and then display the transformation.
    Then goto extra (menu)->generated program. search for start_routine (method now) and put break point in the desired place.
    Then from the DTP enable all 4 break points..in tranformation (this will come when u cange it to debug mode simulation). And u can debug the transformation.
    The new editor is a good handy one. But take some time to get acquented to it. After you may start liking it :).
    Cheers,
    -J

  • Using the end routine to populate the Cubes

    Hi BI Gurus,
    I am having following requirement:
    DSO: ZODS1  -
    > This DSO gets all the raw data from Source system.
    DSO:ZODS4   -
    >  Updates ZCUBE4
           ,ZODS5    -
    > Updates ZCUBE5
    there is no data flow between ZODS1 and  ZODS4
                                                     ZODS1  and  ZODS5
    I have added same new fields to ZODS1,ZCUBE4,ZCUBE5.
    So i want to populate fields of ZCUBE4,ZCUBE5.What is best possible way to do that without chaning ZODS4,ZODS5 structure?
    I am thinking to write an end routine ?Any idea if its possible?
    Also if possible can somebody sample code .
    Please help.

    Hi,
      U can populate ur new fields easily thorugh end routine in transformation ds04 to cube 4 ....
    Provided u can sufficient key in ds04 and which is the same key in ds01 to get the information of newly added fields in cube....
    please give ur fields and some sample data then it will be more clear ....
    but it can be achieved if u have necessary key fields in both dso's.
    Regards
    vamsi

  • To populate data using end routine

    Hello,
    In the end routine I need to populate the org unit with data from 0hrposition object which gets populated from the source field assigment.
    Could anyone help me in writing the code in BW 7 END Routine
    InfoObject: 0ORGUNIT Organizational Unit.
            ORGUNIT           TYPE /BI0/OIORGUNIT,
    InfoObject: 0HRPOSITION Position.
            HRPOSITION           TYPE /BI0/OIHRPOSITION,
    Thank you
    Anima

    HI Anima,
                            Check here.....
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e73bfc19-0e01-0010-23bc-ef0ad53f2fab
    Regards,
    Vijay.

  • End Routine Implementation Issue

    Hi Colleagues,
    I want to implemente an end routine in order to populate the material type from the material master data.
    The source structure of my transformation contain the material.
    The target structure of my transformation contain the material and material type infoobject.
    I have implemented the following source code in the end routine based on the sdn doc below :
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e73bfc19-0e01-0010-23bc-ef0ad53f2fab
    My source code is :
    Global data declaration
    List of all Employees and corresponding sales organisation
        DATA: BEGIN OF I_S_MATERIAL_TYPE,
          MATERIAL TYPE /BI0/PMATERIAL-MATERIAL,
          MATERIAL_TYPE TYPE /BI0/PMATERIAL-MATL_TYPE,
        END OF I_S_MATERIAL_TYPE.
        DATA: i_t_material_type like table of I_S_material_type.
      METHOD end_routine.
    *=== Segments ===
        FIELD-SYMBOLS:
          <RESULT_FIELDS>    TYPE tys_TG_1.
        DATA:
          MONITOR_REC     TYPE rstmonitor.
    $$ begin of routine - insert your code only below this line        -
    local data declaration
        data: e_s_result type tys_TG_1.
        data: e_t_result type tyt_TG_1.
        data: material_type like e_s_result-matl_type.
    read master data in local table once
          SELECT MATERIAL MATL_TYPE FROM /BI0/PMATERIAL
            into corresponding fields of table i_t_material_type
            WHERE  MATERIAL  = <RESULT_FIELDS>-material
            AND    objvers  = 'A'.
    Do the calculation and add the new rows
    *>>
    loop over the input result data package
        loop at RESULT_PACKAGE into e_s_result.
    get Counter
          read table i_t_material_type into e_t_result with key
          material = e_s_result-material.
             move material_type to e_s_result-matl_type.
             append e_s_result to e_t_result.
        endloop.
    add the lines to the output package
        refresh RESULT_PACKAGE.
        move e_t_result[] to RESULT_PACKAGE[].
    $$ end of routine - insert your code only before this line -
      ENDMETHOD. "end_routine
    $$ end of routine - insert your code only before this line         -
    ENDMETHOD.                    "end_routine
    I have the following error message :
    E:"E_T_RESULT" cannot e converted to the line type of
    "ME->I_T_MATERIAL_TYPE"
    Question :
    Can someone explain me what is the issue in my source code ?
    Cheers,

    Hi Vijay,
    Thanks for your precious answer !
    I have modified the matl_type - but I still have the same error message on the read table coding part.
    Error message: E:"E_T_RESULT" cannot be converted to the line type of
                                  "ME->I_T_MATL_TYPE".
    Global data declaration
    List of all Employees and corresponding sales organisation
        DATA:
        BEGIN OF I_S_MATL_TYPE,
            MATERIAL  TYPE /BI0/PMATERIAL-MATERIAL,
            MATL_TYPE TYPE /BI0/PMATERIAL-MATL_TYPE,
        END OF I_S_MATL_TYPE.
        DATA: i_t_matl_type like table of I_S_matl_type.
    local data declaration
        data: e_s_result type tys_TG_1.
        data: e_t_result type tyt_TG_1.
        data: matl_type like e_s_result-matl_type.
    read master data in local table once
        SELECT MATERIAL MATL_TYPE FROM /BI0/PMATERIAL
        into corresponding fields of table i_t_matl_type
        WHERE MATERIAL = <RESULT_FIELDS>-material
        AND objvers = 'A'.
    Do the calculation and add the new rows
    loop over the input result data package
        loop at RESULT_PACKAGE assigning <result_fields>.
    Error message: E:"E_T_RESULT" cannot be converted to the line type of*
                                 "ME->I_T_MATL_TYPE".*
          read table i_t_matl_type into e_t_result with key
          material = e_s_result-material.
          <RESULT_FIELDS>-matl_type = i_t_matl_type-matl_type
          Modify result_pacakage from <result_fields>
        endloop.

  • BI End Routine MONITOR entry overwrites Start Routine MONITOR entries

    Hi Colleagues,
    I'm using MONITOR TYPE rstr_ty_t_monitors in start routine as well as in end routine of transformations.
    But DTP request monitor shows only my end routine monitor entries under "Start routine" and my start routine monitor entries are not shown.
    msgid = RSM1
    msgty = W or E
    msgno = 799
    Any suggestions?
    Thanks and regards,
    Wolfgang

    Fixed by SAP by means of support package.

  • End routine field not populated

    Hi,
    I have made the following end routine in order to populate the field YNEGOCIO with two characters.
    I´m uploading data from DSO 0FIAR_O03 to customized DSO.  When i activate this DSO i don´t see the field YNEGOCIO populated but the strange thing is that when i make a debbugg to the end routine,  the result package-YNEGOCIO at the end of routine IS POPULATED with the correct values.
    Can anybody help me with this?
    LOOP AT RESULT_PACKAGE INTO e_s_result.
    **Recover characters 14,15 from YNEGOCIO.
    CLEAR lv_negocio.
               SELECT SINGLE
                 /BIC/YYKEY
                FROM /BIC/AYSDLASPV00
                INTO lv_key
                    WHERE
                      /BIC/YYVALUE EQ e_s_result-GL_ACCOUNT.
                IF sy-subrc EQ 0.
                  MOVE lv_key+13(2) TO lv_negocio.
                ENDIF.
          LOOP AT gt_inv_gl9_doc INTO gs_inv_gl8_doc
            WHERE ac_doc_no = e_s_result-ac_doc_no.
    * Calculate Importe Aplicado
            MOVE e_s_result to aux_s_result.
             aux_s_result-record = v_count + 1.
            IF aux_s_result-DEB_CRE_DC IS NOT INITIAL.
              aux_s_result-PROFIT_CTR = gs_inv_gl8_doc-profit_ctr.
              aux_s_result-USERNAME = gs_inv_gl8_doc-USERNAME.
              aux_s_result-deb_cre_dc = gs_inv_gl8_doc-DEB_CRE_DC.
              aux_s_result-/BIC/YI_WRBTR = gs_inv_gl8_doc-DEB_CRE_DC *
                aux_s_result-/BIC/YI_WRBTR / aux_s_result-DEB_CRE_DC.
              aux_s_result-/BIC/YNEGOCIO = lv_negocio.
              APPEND aux_s_result to e_t_result.
            ENDIF.
          endloop.
        endloop.
        REFRESH RESULT_PACKAGE.
        MOVE e_t_result[] TO RESULT_PACKAGE[].
    Regards,
    Diego

    hi,
       check your changelog table and see data over there, i guess this situation generally happens when you do delta laod , itmight happening bcoz of two image are created which might be cancelling each other when request gets actiavted in DSO and also see for 0recordmode value.
    hope it helps
    regards
    laksh

  • End Routine is NOT modifying the DSO with new data after load into that DSO

    Hi all,
      I am creating an End Routine for DSO to populate a field ZFCMP_FLG (to store 'Y' ) with lookup from another DSO ZMDS_D01. This new field shows blank instead of 'Y', after activating the DSO. The RESULT_PACKAGE record is populated with 'Y' for ZFCMP_FLG  while debugging that End Routine and why it is NOT writing the modified records into DSO, please ? It is a Characteristic InfoObject with length 1 to store 'Y'. The following is some part of the code:
    DATA: wa_fcmp_flag   TYPE c VALUE 'Y'.
    LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
        READ TABLE it_zmds_d01 INTO wa_zmds_d01 WITH KEY
                    /BIC/ZAUFNR    = <RESULT_FIELDS>-CS_ORDER
                    NOTIFICATN     = <RESULT_FIELDS>-NOTIFICATN  BINARY SEARCH.
         IF sy-subrc = 0.
           <RESULT_FIELDS>-/BIC/ZFCMP_FLG = wa_fcmp_flg.
        ENDIF.
    ENDLOOP.
    Thanks,
    Venkat.

    hi...
    Since you are using Field symbol to loop the internal Table there is no need to use the MODIFY Statement in the loop.
    So your code is correct only.
    But here you have to check the status of READ TABLE command in the debug mode.
    it may be failing that's why the RESULT_PACKAGE is not getting modified.
    Plz check it.
    Note: You may need to SORT the Int Table since you are using BINARY SEARCH. check below.
    DATA: wa_fcmp_flag   TYPE c VALUE 'Y'.
    Sort it_zmds_d01 by  /BIC/ZAUFNR    NOTIFICATN  .
    LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
        READ TABLE it_zmds_d01 INTO wa_zmds_d01 WITH KEY
                    /BIC/ZAUFNR    = <RESULT_FIELDS>-CS_ORDER
                    NOTIFICATN     = <RESULT_FIELDS>-NOTIFICATN  BINARY SEARCH.
         IF sy-subrc = 0.
           <RESULT_FIELDS>-/BIC/ZFCMP_FLG = wa_fcmp_flg.
        ENDIF.
    ENDLOOP.

  • BW Info Object update problem

    Hi All,
    We are implementing BW. The Vendor and Document date info objects are not mapped directly to SAP R/3. Hence the data is not updating directly fromR/3 for these info objects. So I have written a small transfer routine to update the info object. But it is not getting updated with this routine. I am not sure where the problem is. Any ideas why?
    The following is the code of transfer routine. There are two infosources: communicaoin structure and Transfer structure. I wrote the routine in transfer structure. This routine is written for the info object Vendor. 
    PROGRAM CONVERSION_ROUTINE.
    Type pools used by conversion program
    TYPE-POOLS: RS, RSARC, RSARR, SBIWA, RSSM.
    Declaration of transfer structure (selected fields only)
    TYPES: BEGIN OF TRANSFER_STRUCTURE ,
      InfoObject SL_ACTIV: CHAR - 000004
      ACTIV(000004) TYPE C,
      InfoObject SL_AWORG: CHAR - 000010
      AWORG(000010) TYPE C,
      InfoObject SL_AWTYP: CHAR - 000005
      AWTYP(000005) TYPE C,
      InfoObject 0ACDOC_NO_F: CHAR - 000010
      BELNR(000010) TYPE C,
      InfoObject 0PSTNG_DATE: DATS - 000008
      BUDAT(000008) TYPE D,
      InfoObject 0ITEM_NUM: NUMC - 000003
      BUZEI(000003) TYPE N,
      InfoObject 0CHRT_ACCTS: CHAR - 000004
      CHARTACCTS(000004) TYPE C,
      InfoObject 0CREATEDON: DATS - 000008
      CPUDT(000008) TYPE D,
      InfoObject SL_CPUTM: TIMS - 000006
      CPUTM(000006) TYPE T,
      InfoObject 0CREDIT: CURR - 000017
      CREDIT(000009) TYPE P,
      InfoObject 0CURRENCY: CUKY - 000005
      CURRUNIT(000005) TYPE C,
      InfoObject 0CURTYPE: CHAR - 000002
      CURTYPE(000002) TYPE C,
      InfoObject 0DEBIT: CURR - 000017
      DEBIT(000009) TYPE P,
      InfoObject SL_DOCCT: CHAR - 000001
      DOCCT(000001) TYPE C,
      InfoObject SL_DOCLN: CHAR - 000006
      DOCLN(000006) TYPE C,
      InfoObject SL_DOCNR: CHAR - 000010
      DOCNR(000010) TYPE C,
      InfoObject SL_DOCTY: CHAR - 000002
      DOCTY(000002) TYPE C,
      InfoObject 0FISCPER: NUMC - 000007
      FISCPER(000007) TYPE N,
      InfoObject 0FISCVARNT: CHAR - 000002
      FISCVAR(000002) TYPE C,
      InfoObject SL_LINET: CHAR - 000005
      LINETYPE(000005) TYPE C,
      InfoObject SL_LOGSYS: CHAR - 000010
      LOGSYS(000010) TYPE C,
      InfoObject SL_POPER: NUMC - 000003
      POPER(000003) TYPE N,
      InfoObject 0QUANTITY: QUAN - 000015
      QUANTITY(000008) TYPE P,
      InfoObject 0UNIT: UNIT - 000003
      QUANUNIT(000003) TYPE C,
      InfoObject 0GL_ACCOUNT: CHAR - 000010
      RACCT(000010) TYPE C,
      InfoObject 0COMP_CODE: CHAR - 000004
      RBUKRS(000004) TYPE C,
      InfoObject 0COSTCENTER: CHAR - 000010
      RCNTR(000010) TYPE C,
      InfoObject SL_REFACT: CHAR - 000004
      REFACTIV(000004) TYPE C,
      InfoObject SL_RFDCCT: CHAR - 000001
      REFDOCCT(000001) TYPE C,
      InfoObject SL_RFDCLN: NUMC - 000006
      REFDOCLN(000006) TYPE N,
      InfoObject SL_RFDCNR: CHAR - 000010
        REFDOCNR(000010) TYPE C,
      InfoObject SL_REFRYR: NUMC - 000004
      REFRYEAR(000004) TYPE N,
      InfoObject SPL_CUR1: CUKY - 000005
      RTCUR(000005) TYPE C,
      InfoObject 0VERSION: CHAR - 000003
      RVERS(000003) TYPE C,
      InfoObject SPL_CUR2: CUKY - 000005
      RWCUR(000005) TYPE C,
      InfoObject 0FISCYEAR: NUMC - 000004
      RYEAR(000004) TYPE N,
      InfoObject 0CO_AREA: CHAR - 000004
      RZZKOKRS(000004) TYPE C,
      InfoObject 0PROFIT_CTR: CHAR - 000010
      RZZPRCTR(000010) TYPE C,
      InfoObject 0PACCOUNT: CHAR - 000010
      SACCT(000010) TYPE C,
      InfoObject 0PCOMP_CODE: CHAR - 000004
      SBUKRS(000004) TYPE C,
      InfoObject 0PART_CCTR: CHAR - 000010
      SCNTR(000010) TYPE C,
      InfoObject 0POSTXT: CHAR - 000050
      SGTXT(000050) TYPE C,
      InfoObject SL_PPRCTR: CHAR - 000010
      SZZPRCTR(000010) TYPE C,
      InfoObject SL_TMSTMP: DEC - 000015
      TIMESTAMP(000008) TYPE P,
      InfoObject 0SALES: CURR - 000017
      TURNOVER(000009) TYPE P,
      InfoObject 0RECORDMODE: CHAR - 000001
      UPMOD(000001) TYPE C,
      InfoObject 0USER_NAME: CHAR - 000012
      USNAM(000012) TYPE C,
      InfoObject 0VTYPE: NUMC - 000003
      VALUETYPE(000003) TYPE N,
      InfoObject 0VALUATION: NUMC - 000001
      VALUTYP(000001) TYPE N,
      InfoObject SL_WSDAT: DATS - 000008
      WSDAT(000008) TYPE D,
      InfoObject SL_SPLTMD: CHAR - 000001
      XSPLITMOD(000001) TYPE C,
      InfoObject 0ASSET_MAIN: CHAR - 000012
      ZZANLN1(000012) TYPE C,
      InfoObject 0ASSET: CHAR - 000004
      ZZANLN2(000004) TYPE C,
      InfoObject 0DEBITOR: CHAR - 000010
      ZZKUNNR(000010) TYPE C,
      InfoObject SL_ZZLFNR: CHAR - 000010
      ZZLIFNR(000010) TYPE C,
      InfoObject SL_ZRPRCR: CHAR - 000010
      ZZREPPRCTR(000010) TYPE C,
      InfoObject SL_ZTCDE: CHAR - 000020
      ZZTCODE(000020) TYPE C,
      InfoObject 0REF_DOC_NO: CHAR - 000016
      ZZXBLNR(000016) TYPE C,
    END OF TRANSFER_STRUCTURE .
    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   -
          FORM COMPUTE_CREDITOR
    Compute value of InfoObject 0CREDITOR
    in communication structure /BIC/CSSPL_LINE
    Technical properties:
        field name      = CREDITOR
        data element    = /BI0/OICREDITOR
        data type       = CHAR
        length          = 000010
        decimals        = 000000
        ABAP type       = C
        ABAP length     = 000010
        reference field =
    Parameters:
    -->  RECORD_NO       Record number
    -->  TRAN_STRUCTURE  Transfer structure
    <--  RESULT          Return value of InfoObject
    <->  G_T_ERRORLOG    Error log
    <--  RETURNCODE      Return code (to skip one record)
    <--  ABORT           Abort code (to skip whole data package)
    FORM COMPUTE_CREDITOR
      USING    RECORD_NO LIKE SY-TABIX
               TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
               G_S_MINFO TYPE RSSM_S_MINFO
      CHANGING RESULT TYPE /BI0/OICREDITOR
               G_T_ERRORLOG TYPE rssm_t_errorlog_int
               RETURNCODE LIKE SY-SUBRC
               ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel datapackage
    $$ begin of routine - insert your code only below this line        -
    DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
      SELECT SINGLE CREDITOR FROM /BIC/AAPOSLVEN00
                    INTO RESULT
                    WHERE /BIC/SL_RFDCNR = TRAN_STRUCTURE-REFDOCNR.
       IF SY-SUBRC NE 0.
           CLEAR RESULT.
        ENDIF.
    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         -
    ENDFORM.
          FORM INVERT_CREDITOR
          Inversion of selection criteria for InfoObject 0CREDITOR
          This subroutine needs to be implemented only for SAP RemoteCubes
          (for better performance) and for the Report/Report Interface
          (drill through).
    -->  I_RT_CHAVL_CS       Ranges table for current InfoObject
    -->  I_THX_SELECTION_CS  Selection criteria for all other InfoObjects
    <--  C_T_SELECTION       Selection criteria for fields of
                              transfer structure
    <--  E_EXACT             Flag: Inversion was exact
    FORM INVERT_CREDITOR
      USING    I_RT_CHAVL_CS      TYPE RSARC_RT_CHAVL
               I_THX_SELECTION_CS TYPE RSARC_THX_SELCS
      CHANGING C_T_SELECTION      TYPE SBIWA_T_SELECT
               E_EXACT            TYPE RS_BOOL.
    $$ begin of inverse routine - insert your code only below this line-
      DATA:
        L_S_SELECTION LIKE LINE OF C_T_SELECTION.
    An empty selection means all values
      CLEAR C_T_SELECTION.
      L_S_SELECTION-FIELDNM = 'REFDOCNR'.
    Selection of all values may be not exact
      E_EXACT = RS_C_FALSE.
    $$ end of inverse routine - insert your code only before this line -
    ENDFORM.
    Thanks for the great help,
    Sobhan.

    Hi manoj,
    Welcome to SDN!!
    Check this blog:
    /people/sap.user72/blog/2005/09/05/sap-bw-and-business-content-datasources-in-pursuit-of-the-origins
    Bye
    Dinesh

  • End routine to populate Info-cube.

    Hi ,
    Is it possible to load fileds of a Info-cube using End routines in the following scenairos.
    1.Loading fields of info-cube by referencing/using a master data table in End routine.
    2.Loading fields of info-cube by referencing/using a DSO fields  in End routine.
    3.Loading fields of info-cube by referencing/using a fields of another info-cube in End routine.
    Please advise.

    Hi Stalin,
    Before answering your question you need to understand something about "End routine" and "Expert routine".
    End Routine:
    - Result_fields and Result_package are available
    - End routine contains only those fields available in Data target.
    Start Routine:
    - Source_fields and Source_package are available
    - Start routine contains only those fields coming from source.
    Expert Routine:
    -  Source_fields, Source_package, Result_fields and Result_package are available
    So Now if you want write code to look up into some other cube, in look up you may need to test condition using source fields, in that case " Expert Routine" is only the option.
    For Ex
    my data target contains : x,y and z fields (it becomes result_field)
    source contains : a field ( it becomes source_field)
    now if i want to write look up code like this " select x,y and z fields from other cube where my a field value = other cube a field value. here u r accessing both S_F as well as R_F. So only the option is "EXPERT ROUTINE"
    or else u want to write code only with R_F then "End routine " is enough.
    Thanks,
    Gowd

  • End Routine to populate custom AFS field for Billing Item extractor

    I have the following scenario for Billing 2LIS_13_VDITM datasource
    Doc_No   Item  Material    Item_Categ   AFS_field
    2000        11     XYZ          123
    2000        12     XYZ          123                  US1
    3000        11     PQR          456                 
    3000        12     PQR          456                  CA1
    I need to populate the AFS_field in the first row also for all Doc Nos for certain Item categories (eg 123 & 456). I need to do this on the first transformation from PSA to DSO. I was planning to write a SELECT statement in the Start Routine with the PSA table as the reference as seen below and then write an End Routine calling this reference table. But the PSA table name is different in Dev, QA and Prod so I cannot use this.
    TYPES: BEGIN OF S_AFS,
    VBELN TYPE C LENGTH 10,
    PSTYV TYPE C LENGTH 4,
    MATNR TYPE C LENGTH 18,
    J_4KRCAT TYPE C LENGTH 16,
    J_4KSCAT TYPE C LENGTH 16,
    END OF S_AFS.
    DATA: LT_AFS TYPE STANDARD TABLE OF S_AFS,
          LS_AFS TYPE S_AFS.
    DATA: LT_DATA TYPE tyt_SC_1.
    LT_DATA[] = SOURCE_PACKAGE[].
    SORT LT_DATA DESCENDING BY VBELN MATNR J_4KRCAT.
    DELETE ADJACENT DUPLICATES FROM LT_DATA COMPARING VBELN MATNR.
    SELECT VBELN MATNR J_4KRCAT J_4KSCAT
    INTO CORRESPONDING FIELDS OF TABLE LT_AFS
    FROM /BIC/B0000777001
    FOR ALL ENTRIES IN LT_DATA WHERE VBELN = LT_DATA-VBELN AND MATNR =
    LT_DATA-MATNR.
    SORT LT_AFS BY VBELN MATNR.
    I am not an expert in writing ABAP code. Any suggestions are greatly appreciated and points will be assigned. Thank you.

    Hi
    why do want to select the data from PSA table ?Already your trying to load data from PSA to DSO.
    you want to populate the AFS field value in DSO right?
    1. First you have to add AFS field in ur DSO
    2. Write the Start routine based on ur scenario(select the data based on ur scenario and put into internal table).
    3. wirte AFS field leval  transfer routine(Read the corresponding record based on docu num,item num) pass into RESULT.
    Regards,
    GR

  • Source Field in End Routine of DSO Transformation

    Hi,
    I made a transformation from source DSO to Target DSO.
    There are 7 fields in source & 6 fields in target..All the 6 fields are one to one mapped from the source to Target
    I need to write a simple ABAP Logic in End Routine based on the 7th source field which is not mapped.
    Please let me know the piece of ABAP code or steps where i can get the value of Source table in End routine
    Regards
    Suresh

    Hi Suresh,
                      Check here.........
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e73bfc19-0e01-0010-23bc-ef0ad53f2fab
    http://help.sap.com/saphelp_nw70/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/frameset.htm
    Regards,
    Vijay.

  • Start & End Routines in BI 7  Transformations

    Hi,
    In Transformations from DSO1-->DSO2
    In Start Routine for all entries in Source Package i read some fields from DSO3 and filled an iternal table
    And  in end routine i read the iternal table and filled the result package/fields
    In the mapping i haven't mapped any thing to the fields to which i intended to fill using routines
    When i executed data load those fields are not populated with any value
    But if i debug the transformation...results are updating in all fields in the  result package.......
    Do i need to make any setting or mappings to the fields which i want to update using end routine
    Thanks

    HI,
    For support pack 16 and above you get one more button besides End Routine (once end routine is created).
    This button is to update behaviour of fields in End Routines. You get two options once you select this button. One needs to make selection of proper option as it is mandatory.
    The default setting for the pushbutton is that only the fields with active rules are updated in the transformation. With this selection, fields populated in End routine wont be updated in the data target if no active rule exists for them in Transformation.
    Alternatively, you can define that all the fields should always be updated by selecting 2nd radio button. As a result, fields filled in the end routine are not lost if there is no other active rule.
    So in your case if you are in SP 15 or lower, then you will have to map the fields.
    Go through this article it gives the above explanation along with screenshots.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30d35342-1fe3-2c10-70ba-ad0da83d23bd
    Hope this helps.
    Thanks,
    Rahul

Maybe you are looking for

  • Creation of IBase for Production data or sales order  in R/3

    Hi, My client is a locomotive manufacturing Company, They want to track the failure of parts in the locomotive  and any changes made in the locomotive during service. Kindly explain your thought on the following: 1. Here Each locomotive will have an

  • Express to Pro

    Can I upgrade online from Final Cut Express to Final Cut Pro/Studio (like you can from Pro to Studio) or do I need to buy the Studio 2 set to get everything? Thanks.

  • ITunes keeps opening after I close it, how do I get it to stop?

    I've tried unplugging peripherals, disabling applets, changing msconfig, disabling auto-sync when iPod is plugged in. Nothing works to get it to stop I found and it's annoying.  The only way I can get it to stop is to force the shut down by ending th

  • Binding ActionScript object to webservice

    Hi, Can someone please provide me with simple example as to how to bind an ActionScript object to the webservice. The Scenario is I have an actionscript class. I have the webservice in the mail mxml. I want to create an object of the class and want t

  • Bank Reconciliation Statement-End User Document

    Hi, Does some body have an End User Document for uploading Bank Reconciliation Statement, both Manual and Automatic ? If yes please post a link in this thread. Regards, Swapnil