Zero records in generic extractor

Dear all ,
I have created  a generic extrator with function module but there are zero records which are getting extracted.I am able to extract records if I execute only the function module.
Below is the code for the same.*
FUNCTION ZGET_CUST_SALP .
""Local Interface:
*"  IMPORTING
*"     VALUE(I_REQUNR) TYPE  SRSC_S_IF_SIMPLE-REQUNR
*"     VALUE(I_DSOURCE) TYPE  SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
*"     VALUE(I_MAXSIZE) TYPE  SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
*"     VALUE(I_INITFLAG) TYPE  SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
*"     VALUE(I_READ_ONLY) TYPE  SRSC_S_IF_SIMPLE-READONLY OPTIONAL
*"     VALUE(I_REMOTE_CALL) TYPE  SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
*"  TABLES
*"      I_T_SELECT TYPE  SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*"      I_T_FIELDS TYPE  SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*"      E_T_DATA STRUCTURE  ZKN_VP OPTIONAL
*"  EXCEPTIONS
*"      NO_MORE_DATA
*"      ERROR_PASSED_TO_MESS_HANDLER
Example: DataSource for table ZKN_VP
  TABLES: ZKN_VP.
Auxiliary Selection criteria structure
  DATA: L_S_SELECT TYPE SRSC_S_SELECT.
  data : begin of t_tab1 occurs 0,
           kunnr like kna1-kunnr,
           land1 like kna1-land1,
           PERNR like knvp-PERNR,
           end of t_tab1.
  data : begin of t_knvv occurs 0,
         kunnr like knvv-kunnr,
         vkorg like knvv-vkorg,
         VTWEG like knvv-VTWEG,
         spart like knvv-spart,
         end of t_knvv.
  data : begin of t_knvp_kunn2 occurs 0,
          kunnr like knvp-kunnr,
          kunn2 like knvp-kunn2,
          vkorg like knvv-vkorg,
          VTWEG like knvv-VTWEG,
          spart like knvv-spart,
          end of t_knvp_kunn2.
  data : begin of t_knvp_pernr occurs 0,
          kunnr like knvp-kunnr,
          pernr like knvp-pernr,
          vkorg like knvv-vkorg,
          VTWEG like knvv-VTWEG,
          spart like knvv-spart,
          end of t_knvp_pernr.
  data : begin of t_knvp_p_k occurs 0,
       kunnr like knvp-kunnr,
       pernr like knvp-pernr,
       vkorg like knvv-vkorg,
       VTWEG like knvv-VTWEG,
       spart like knvv-spart,
       end of t_knvp_p_k.
  data : IS_BW_CUST1_w like zkn_vp occurs 0 with header line.
Maximum number of lines for DB table
  STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
counter
          S_COUNTER_DATAPAKID LIKE SY-TABIX,
cursor
          S_CURSOR TYPE CURSOR,
          S_CURSOR1 TYPE CURSOR,
          S_CURSOR2 TYPE CURSOR.
Select ranges
  RANGES: L_R_KUNNR  FOR KNA1-KUNNR.
Initialization mode (first call by SAPI) or data transfer mode
(following calls) ?
  IF I_INITFLAG = SBIWA_C_FLAG_ON.
Initialization: check input parameters
                buffer input parameters
                prepare data selection
Check DataSource validity
    CASE I_DSOURCE.
      WHEN 'ZGET_CUST_SALP_ATTR'.
      WHEN OTHERS.
        IF 1 = 2. MESSAGE E009(R3). ENDIF.
this is a typical log call. Please write every error message like this
        LOG_WRITE 'E'                  "message type
                  'R3'                 "message class
                  '009'                "message number
                  I_DSOURCE   "message variable 1
                  ' '.                 "message variable 2
        RAISE ERROR_PASSED_TO_MESS_HANDLER.
    ENDCASE.
    APPEND LINES OF I_T_SELECT TO S_S_IF-T_SELECT.
Fill parameter buffer for data extraction calls
    S_S_IF-REQUNR    = I_REQUNR.
    S_S_IF-DSOURCE = I_DSOURCE.
    S_S_IF-MAXSIZE   = I_MAXSIZE.
Fill field list table for an optimized select statement
(in case that there is no 1:1 relation between InfoSource fields
and database table fields this may be far from beeing trivial)
    APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.
  ELSE.                 "Initialization mode or data extraction ?
Data transfer: First Call      OPEN CURSOR + FETCH
               Following Calls FETCH only
First data package -> OPEN CURSOR
    IF S_COUNTER_DATAPAKID = 0.
Fill range tables BW will only pass down simple selection criteria
of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
      LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'KUNNR'.
        MOVE-CORRESPONDING L_S_SELECT TO L_R_KUNNR.
        APPEND L_R_KUNNR.
      ENDLOOP.
     LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.
       MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.
       APPEND L_R_CONNID.
     ENDLOOP.
Determine number of database records to be read per FETCH statement
from input parameter I_MAXSIZE. If there is a one to one relation
between DataSource table lines and database entries, this is trivial.
In other cases, it may be impossible and some estimated value has to
be determined.
******Get Customer Number from KNA1 Table
      OPEN CURSOR WITH HOLD S_CURSOR FOR
      SELECT kunnr FROM KNA1
                               WHERE KUNNR  IN L_R_KUNNR.
      fetch next cursor s_cursor APPENDING corresponding fields of table t_tab1
      PACKAGE SIZE S_S_IF-MAXSIZE.
      CLOSE CURSOR S_CURSOR.
******Get Customer Details from KNVV Table
      OPEN CURSOR WITH HOLD  S_CURSOR1  FOR
      SELECT kunnr vkorg VTWEG spart  FROM KNVV for all entries in t_tab1
      where
      KUNNR = t_tab1-kunnr.
      fetch next cursor s_cursor1 APPENDING corresponding fields of table t_knvv
      PACKAGE SIZE S_S_IF-MAXSIZE.
      CLOSE CURSOR S_CURSOR1.
******Get Customer Partner Function Details from KNVP Table for ship to party.
      OPEN CURSOR WITH HOLD  S_CURSOR2  FOR
  select kunnr kunn2 vkorg VTWEG spart from knvp for all entries in t_knvv
    where kunnr = t_knvv-kunnr and vkorg = t_knvv-vkorg
   and VTWEG = t_knvv-VTWEG and spart = t_knvv-spart and parvw = 'WE'.
      fetch next cursor s_cursor2 APPENDING corresponding fields of table t_knvp_kunn2
            PACKAGE SIZE S_S_IF-MAXSIZE.
      CLOSE CURSOR S_CURSOR2.
      delete adjacent duplicates from t_knvp_kunn2 comparing kunnr.
******Get Customer Partner Function Details from KNVP Table for Sales Personnel.
      OPEN CURSOR WITH HOLD S_CURSOR2 FOR
      select kunnr pernr vkorg VTWEG spart from knvp for all entries in t_knvv
      where kunnr = t_knvv-kunnr and vkorg = t_knvv-vkorg
      and VTWEG = t_knvv-VTWEG and spart = t_knvv-spart and parvw = 'ZR'.
    ENDIF.                             "First data package ?
    fetch next cursor s_cursor2 APPENDING corresponding fields of table t_knvp_pernr
       PACKAGE SIZE S_S_IF-MAXSIZE.
    CLOSE CURSOR S_CURSOR2.
    Loop at t_knvp_pernr.
      t_knvp_p_k-kunnr = t_knvp_pernr-kunnr.
      t_knvp_p_k-pernr = t_knvp_pernr-pernr.
      t_knvp_p_k-vkorg = t_knvp_pernr-vkorg.
      t_knvp_p_k-VTWEG = t_knvp_pernr-VTWEG.
      t_knvp_p_k-spart = t_knvp_pernr-spart.
      append t_knvp_p_k.
      loop at t_knvp_kunn2 where kunnr = t_knvp_pernr-kunnr and vkorg = t_knvp_pernr-vkorg
      and VTWEG = t_knvp_pernr-VTWEG and spart = t_knvp_pernr-spart.
        t_knvp_p_k-kunnr = t_knvp_kunn2-kunn2.
        t_knvp_p_k-pernr = t_knvp_pernr-pernr.
        t_knvp_p_k-vkorg = t_knvp_pernr-vkorg.
        t_knvp_p_k-VTWEG = t_knvp_pernr-VTWEG.
        t_knvp_p_k-spart = t_knvp_pernr-spart.
        append t_knvp_p_k.
      endloop.
    endloop.
    delete adjacent duplicates from t_knvp_p_k comparing kunnr pernr vkorg vtweg spart.
    loop at t_knvp_p_k.
      IS_BW_CUST1_w-kunnr = t_knvp_p_k-kunnr.
      IS_BW_CUST1_w-pernr = t_knvp_p_k-pernr.
      IS_BW_CUST1_w-vtweg = t_knvp_p_k-vtweg.
      append IS_BW_CUST1_w to  E_T_DATA.
    endloop.
Fetch records into interface table.
  named E_T_'Name of extract structure'.
   FETCH NEXT CURSOR S_CURSOR
              APPENDING CORRESPONDING FIELDS
              OF TABLE E_T_DATA
              PACKAGE SIZE S_S_IF-MAXSIZE.
    if e_t_data[] is initial.
      RAISE NO_MORE_DATA.
    endif.
  IF SY-SUBRC <> 0.
  CLOSE CURSOR S_CURSOR.
    RAISE NO_MORE_DATA.
  ENDIF.
    S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
  ENDIF.              "Initialization mode or data extraction ?
ENDFUNCTION.
Nimisha Gandhi.

Hi,
you can't open several cursors this way....
If you need fields from several tables I suggest to open the cursor on something like
SELECT t1<field> t2<field>
FROM KNA1 AS t1
INNER JOIN KNVV t2 ON t2KUNNR = t1KUNNR
Please try to stick to template as well since it is of paramount importance to FETCH NEXT at the right moment as well as RAISE NO_MORE_DATA at the right place....
otherwise that won't work.
Hope this helps...
Olivier.

Similar Messages

  • Problem with data records with generic extractor

    I have created generic exractor based on function module.
    When i fetch the data with one infopackage it fetches only 104,239 ( which is wrong correct record are 155,120 )
    But when i fetch the data with six different infopackages with different filters it fetches 155,120
    So is extracotr gives wrong values if it exceeds greater than 100 k records ?
    I want to fetch all the records in one ifopackage please suggest.

    Hi Venkatesh,
    Thanks a lot, my Bsource BI settings are like this
    Source System   Max KB   Maximam line Frequency  Max Proc.
    CLNT700           100000        100000        10     10     
    Should i increase the values to more than  100000
    Or should i cahnge the following code ?
    Fetch records into interface table.
      named E_T_'Name of extract structure'.
        FETCH NEXT CURSOR S_CURSOR
                   APPENDING CORRESPONDING FIELDS
                  OF TABLE E_T_DATA
                   of TABLE gt_ebi
                   PACKAGE SIZE S_S_IF-MAXSIZE.
        IF SY-SUBRC <> 0.
          CLOSE CURSOR S_CURSOR.
          RAISE NO_MORE_DATA.
        ENDIF.

  • 0FI_AR_4 extractor bringing zero records

    Hi,
    We are using extractor 0FI_AR_4 as delta. At times it is bringing zero records but the next time it brings data along with the daata missed the previous day.
    For ex
    Monday it brought records until previous week
    Tuesday it brought zero record
    Wednesday it brought more records i.e including records created on Monday and Tuesday
    We could not figure out a situation when can this happen. But our observation is that there is no entry for tuesday in the table BWOM2_TIMEST.
    BWOM_SETTINGS
    BWFILOWLIM     19910101
    BWFINSAF         3600
    BWFISAFETY     1
    BWFITIMBOR      020000
    DELTIMEST         60
    OBJCURTYPE    10
    Regards
    Vijay

    check http://help.sap.com/erp2005_ehp_04/helpdata/EN/af/16533bbb15b762e10000000a114084/content.htm
    it states :
    In delta mode, data requests with InfoSource 0FI_AR_4 and InfoSource 0FI_AP_4 do not provide any data if no new extraction has taken place with InfoSource 0FI_GL_4 since the last data transfer. This ensures that the data in BW for Accounts Receivable and Accounts Payable Accounting is exactly as up to date as the data for General Ledger Accounting.
    you can check this...de link gives details about the delta methods for FI extractors

  • Delta loading through Generic extractor - function module not found

    Hi,
    I'm working on a BW3.5 system and we have some generic delta FM extractors. One of these is called ZBW_CONF_DELTA and the FM is also called ZBW_CONF_DELTA. It is a delta-enabled extractor. Whenever an extraction is done in the init delta mode, the data gets picked up from SAP.
    However, whenever we load subsequent deltas, the extractor brings zero records. When I look in the SM37 logs in R/3, it says "Function module /BIC/QIZBW_CONF_DELTA0001 does not exist"
    I'm not sure where the "/BIC/QIZBW_CONF_DELTA0001" function module name came from, because I haven't given it like that (if I did, the init load would also have failed).
    Due to this problem, I'm unable to perform any delta loads. Is there anything I could be doing to fix this?
    Regards

    Hi,
    First check how extractor works in R/3 side using RSA3
    Make a full load.
    Now check the generic delta field of your generic extractor, lets say changed on date.
    Do the SAP transaction ( take help from some Functional COnsultant ) to update that delta field. Note that record.
    Now if u do the delta load with same extractor, you are suppose to get that record.
    If not then there is some problem with FM or extracor.
    Let me know what happens.
    Thank-You.
    Regards,
    Vinod

  • Delta fo Generic extractor using function module

    Hi,
    I am using the following function module for generic extractor but its always showing me extraction error.Could anyone please suggest to resolve the issue.
    Thanks in advance fo rsuggestion.
    FUNCTION Z_BW_SALESDATA_EXTRACT_CHNG2.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(I_REQUNR) TYPE  SBIWA_S_INTERFACE-REQUNR
    *"     VALUE(I_ISOURCE) TYPE  SBIWA_S_INTERFACE-ISOURCE OPTIONAL
    *"     VALUE(I_MAXSIZE) TYPE  SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
    *"     VALUE(I_INITFLAG) TYPE  SBIWA_S_INTERFACE-INITFLAG OPTIONAL
    *"     VALUE(I_UPDMODE) TYPE  SBIWA_S_INTERFACE-UPDMODE OPTIONAL
    *"     VALUE(I_DATAPAKID) TYPE  SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
    *"     VALUE(I_PRIVATE_MODE) OPTIONAL
    *"     VALUE(I_CALLMODE) LIKE  ROARCHD200-CALLMODE OPTIONAL
    *"     VALUE(I_REMOTE_CALL) TYPE  SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
    *"  TABLES
    *"      I_T_SELECT TYPE  SBIWA_T_SELECT OPTIONAL
    *"      I_T_FIELDS TYPE  SBIWA_T_FIELDS OPTIONAL
    *"      E_T_DATA OPTIONAL
    *"      E_T_SOURCE_STRUCTURE_NAME OPTIONAL
    *"  EXCEPTIONS
    *"      NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
    The input parameter I_DATAPAKID is not supported yet !
    Example: InfoSource containing TADIR objects
      TABLES: VBFA,VBRK,tadir.
    Auxiliary Selection criteria structure
      DATA: l_s_select TYPE sbiwa_s_select.
    Maximum number of lines for DB table
      STATICS: l_maxsize TYPE sbiwa_s_interface-maxsize.
    user defined variables.
      DATA : X_UPDMODE(1) Type c,        " Update Type
            X_LastUpdate Like Sy-Datum. " Last Update Date
             X_LastUpdate TYPE RODELTAID. " Last Update Date   "TCS_KAP
    Select ranges
      RANGES: L_R_VBELN   FOR VBAK-VBELN,
              L_R_AUDAT   FOR VBAK-AUDAT.
    Parameter I_PRIVATE_MODE:
    Some applications might want to use this function module for other
    purposes as well (e.g. data supply for OLTP reporting tools). If the
    processing logic has to be different in this case, use the optional
    parameter I_PRIVATE_MODE (not supplied by BIW !) to distinguish
    between BIW calls (I_PRIVATE_MODE = SPACE) and other calls
    (I_PRIVATE_MODE = X).
    If the message handling has to be different as well, define Your own
    messaging macro which interprets parameter I_PRIVATE_MODE. When
    called by BIW, it should use the LOG_WRITE macro, otherwise do what
    You want.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
      IF i_initflag = sbiwa_c_flag_on.
    Initialization: check input parameters
                    buffer input parameters
                    prepare data selection
    The input parameter I_DATAPAKID is not supported yet !
    Invalid second initialization call -> error exit
        IF NOT g_flag_interface_initialized IS INITIAL.
          IF 1 = 2. MESSAGE e008(r3). ENDIF.
          log_write 'E'                    "message type
                    'R3'                   "message class
                    '008'                  "message number
                    ' '                    "message variable 1
                    ' '.                   "message variable 2
          RAISE error_passed_to_mess_handler.
          ENDIF.
    Check InfoSource validity
        CASE i_isource.
          WHEN 'Z_BW_SDDATA_CREATEON'.
          WHEN 'Y'.
          WHEN 'Z'.
          WHEN OTHERS.
            IF 1 = 2. MESSAGE e009(r3). ENDIF.
            log_write 'E'                  "message type
                      'R3'                 "message class
                      '009'                "message number
                      i_isource            "message variable 1
                      ' '.                 "message variable 2
            RAISE error_passed_to_mess_handler.
        ENDCASE.
    Check for supported update mode
       CASE i_updmode.
         WHEN 'F'.
         WHEN OTHERS.
           IF 1 = 2. MESSAGE e011(r3). ENDIF.
           log_write 'E'                  "message type
                     'R3'                 "message class
                     '011'                "message number
                     i_updmode            "message variable 1
                     ' '.                 "message variable 2
           RAISE error_passed_to_mess_handler.
       ENDCASE.
    Check for obligatory selection criteria
       READ TABLE i_t_select INTO l_s_select WITH KEY fieldnm = 'VBELN'.
       IF sy-subrc <> 0.
         IF 1 = 2. MESSAGE e010(r3). ENDIF.
         log_write 'E'                    "message type
                   'R3'                   "message class
                   '010'                  "message number
                   'PGMID'                "message variable 1
                   ' '.                   "message variable 2
         RAISE error_passed_to_mess_handler.
       ENDIF.
       APPEND LINES OF i_t_select TO g_t_select.
    Fill parameter buffer for data extraction calls
        g_s_interface-requnr    = i_requnr.
        g_s_interface-isource   = i_isource.
        g_s_interface-maxsize   = i_maxsize.
        g_s_interface-initflag  = i_initflag.
        g_s_interface-updmode   = i_updmode.
        g_s_interface-datapakid = i_datapakid.
        g_flag_interface_initialized = sbiwa_c_flag_on.
    Store Update mode in static variable...
       X_UPDMODE = I_UPDMODE.
        Select Single DELTAID
               Into   X_LastUpdate
               From   ROOSGENDLM
               Where  OLTPSOURCE = 'Z_BW_SDDATA_CREATEON'.
        If X_LastUpdate Is Initial.
          X_LastUpdate = '19800101'. " The oldest..., this should not happen
        Endif.
    Fill field list table for an optimized select statement
    (in case that there is no 1:1 relation between InfoSource fields
    and database table fields this may be far from beeing trivial)
        APPEND LINES OF i_t_fields TO g_t_segfields.
      ELSE.                 "Initialization mode or data extraction ?
    Data transfer: First Call      OPEN CURSOR + FETCH
                   Following Calls FETCH only
    X_UPDMODE = I_UPDMODE.
    First data package -> OPEN CURSOR
        IF g_counter_datapakid = 0.
    Fill range tables for fixed InfoSources. In the case of generated
    InfoSources, the usage of a dynamical SELECT statement might be
    more reasonable. BIW will only pass down simple selection criteria
    of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
          LOOP AT g_t_select INTO l_s_select WHERE fieldnm = 'VBELN'.
            MOVE-CORRESPONDING l_s_select TO L_R_VBELN.
            APPEND L_R_VBELN.
          ENDLOOP.
          LOOP AT g_t_select INTO l_s_select WHERE fieldnm = 'AUDAT'.
            MOVE-CORRESPONDING l_s_select TO L_R_AUDAT.
            APPEND L_R_AUDAT.
          ENDLOOP.
    Determine number of database records to be read per FETCH statement
    from input parameter I_MAXSIZE. If there is a one to one relation
    between InfoSource table lines and database entries, this is trivial.
    In other cases, it may be impossible and some estimated value has to
    be determined.
    *added by Yogesh
          DELETE FROM ZBWSALEDATA.
    *ended by Yogesh
          l_maxsize = g_s_interface-maxsize.
    Check for supported update mode
          CASE X_UPDMODE.
            WHEN 'F' Or 'I'. " Full or Init
    **get sales orders
              SELECT *
                           INTO CORRESPONDING FIELDS OF TABLE I_SALESDATA
                           FROM VBAK AS K
                           INNER JOIN VBAP AS P
                                 ON  PVBELN = KVBELN
                           WHERE K~VBELN IN L_R_VBELN
                           AND   K~AUDAT IN L_R_AUDAT
                           AND   K~VBTYP = 'C'.
              IF I_SALESDATA[] IS NOT INITIAL.
                PERFORM F_GET_DATA.                   "get data
                PERFORM F_DEL_VATCOND.                "delete vat conditions
                PERFORM F_GET_TAR_COSTUNIT.           "get tariff cost unit
                PERFORM F_GET_NETVAL TABLES IT_VBDPA1. "get net val of the item
                PERFORM F_GET_SALESDATA.
    *write perform with name F_INSERT_DB_ZBWSALEDATA.
                PERFORM F_INSERT_DB_ZBWSALEDATA.      "insert into table ZBWSALESDATA
               LOOP AT I_SALESDATA WHERE NETPR = 0.
                 MOVE-CORRESPONDING I_SALESDATA TO I_SALESDATA_FIN.
                 APPEND I_SALESDATA_FIN.
               ENDLOOP.
               SORT I_SALESDATA_FIN BY VBELN POSNR KSCHL.
               DELETE ADJACENT DUPLICATES FROM I_SALESDATA_FIN
                                               COMPARING VBELN POSNR
                                                         KSCHL.
               INSERT ZBWSALEDATA FROM TABLE I_SALESDATA_FIN.
              ENDIF.
            WHEN 'D'. " Delta
              SELECT *
                             INTO CORRESPONDING FIELDS OF TABLE I_SALESDATA
                             FROM VBAK AS K
                             INNER JOIN VBAP AS P
                                   ON  PVBELN = KVBELN
                            WHERE K~ERDAT >= X_LastUpdate
                             WHERE K~ERDAT >= X_LastUpdate+0(8)          "TCS_KAP
                             AND   K~VBTYP = 'C'.
              IF I_SALESDATA[] IS NOT INITIAL.
                PERFORM F_GET_DATA.                   "get data
                PERFORM F_DEL_VATCOND.                "delete vat conditions
                PERFORM F_GET_TAR_COSTUNIT.           "get tariff cost unit
                PERFORM F_GET_NETVAL TABLES IT_VBDPA1. "get net val of the item
                PERFORM F_GET_SALESDATA.
    *write perform with name F_INSERT_DB_ZBWSALEDATA.
                PERFORM F_INSERT_DB_ZBWSALEDATA.      "insert into table ZBWSALESDATA
               LOOP AT I_SALESDATA WHERE NETPR = 0.
                 MOVE-CORRESPONDING I_SALESDATA TO I_SALESDATA_FIN.
                 APPEND I_SALESDATA_FIN.
               ENDLOOP.
               SORT I_SALESDATA_FIN BY VBELN POSNR KSCHL.
               DELETE ADJACENT DUPLICATES FROM I_SALESDATA_FIN
                                               COMPARING VBELN POSNR
                                                         KSCHL.
               INSERT ZBWSALEDATA FROM TABLE I_SALESDATA_FIN.
              ENDIF.
            WHEN OTHERS.
              IF 1 = 2. MESSAGE E011(R3). ENDIF.
              LOG_WRITE 'E' "message type
              'R3' "message class
              '011' "message number
              I_UPDMODE "message variable 1
              ' '. "message variable 2
              RAISE ERROR_PASSED_TO_MESS_HANDLER.
          ENDCASE.
    **end get sales orders
          OPEN CURSOR WITH HOLD g_cursor FOR
          SELECT (g_t_fields) FROM ZBWSALEDATA.
         WHERE pgmid  IN l_r_pgmid AND
                                        object IN l_r_object.
        ENDIF.                             "First data package ?
    Fetch records into interface table. There are two different options:
    - fixed interface table structure for fixed InfoSources have to be
      named E_T_'Name of assigned source structure in table ROIS'.
    - for generating applications like LIS and CO-PA, the generic table
      E_T_DATA has to be used.
    Only one of these interface types should be implemented in one API !
        FETCH NEXT CURSOR g_cursor
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE E_T_DATA
                   PACKAGE SIZE l_maxsize.
        IF sy-subrc <> 0.
          CLOSE CURSOR g_cursor.
          RAISE no_more_data.
        ENDIF.
        g_counter_datapakid = g_counter_datapakid + 1.
      ENDIF.              "Initialization mode or data extraction ?
    Best regards,
    Yogesh

    Dear Yogesh,
    Try to debug the code by putting a break point at select statement...is the FM Syntactically correct ??
    Check the Select statements..if all fields are not required avoid using Select * , and use always for all entries rather than JOINS..
    Note : For Joins you have to specify the Fields in the Select...Dont use Select * ....
    Hope it helps..
    Thanks,
    Krish

  • Error while creating Generic Extractor via Function Module

    Hello Guys
    I have created a Generic Extractor through a Function Module. I took the Standard FM: RSAX_BIW_GET_DATA_SIMPLE, gave it a new name and activated it. I made a few changes in it, like giving my structure name for E_T_DATA and giving the list of tables, from where I need to get the data. Then I created the datasource in RSO2 by giving this function module and the extract structure.
    The DS was created properly, but when I check in RSA3 for records, its giving me an error: ---> <b>The extraction program does not support object YCNA_INVY_TRNS</b>
    What do i do now? Can someone please tell me, what changes I need to make in the standard FM to suit my requirements??
    Thanks.

    Hi,
            Just try to reactivate the structure once again. And when you open the function module, if the problem still persists just try to press Return key several times. The message you are getting is just a warning message.
    PS: I am not sure whether this is the correct way, but i personally resolved this by pressing the ENTER key 4 or 5 times. So just give a try.
    Regards
    Sunil

  • How to reduce long extraction time - Generic extractor based on view

    Hello. The previous thread about this error was closed without any answer.
    I'm in the same configuration.
    "Using a generic extractor (Delta enabled on confirmation date) based on view to load data from ECC6 to BI.
    Now my issue is that the delta extraction is running for a long time (around 1 hr) even if the data volume is very small
    While checking the job overview in source system i saw that the job is hanging at the below step for almost 1 hr."
    1 LUWs confirmed and 1 LUWs to be deleted with function module MF RSC2_QOUT_CONFIRM_DATA.
    I am not understanding why this is happening.
    Here is the log of the job:
    30.05.2011 03:58:11 Job started
    30.05.2011 03:58:11 Step 001 started (program SBIE0001, variant &0000000166864, user ID ALEREMOTE)
    30.05.2011 03:58:11 Asynchronous transmission of info IDoc 2 in task 0001 (0 parallel tasks)
    30.05.2011 03:58:11 DATASOURCE = 0CO_OM_WBS_6
    30.05.2011 03:58:11 *************************************************************************
    30.05.2011 03:58:11 *          Current Values for Selected Profile Parameters               *
    30.05.2011 03:58:11 *************************************************************************
    30.05.2011 03:58:11 * abap/heap_area_nondia......... 4000000000                              *
    30.05.2011 03:58:11 * abap/heap_area_total.......... 8000000000                              *
    30.05.2011 03:58:11 * abap/heaplimit................ 100000000                               *
    30.05.2011 03:58:11 * zcsa/installed_languages...... DEFS                                    *
    30.05.2011 03:58:11 * zcsa/system_language.......... E                                       *
    30.05.2011 03:58:11 * ztta/max_memreq_MB............ 2047                                    *
    30.05.2011 03:58:11 * ztta/roll_area................ 6500000                                 *
    30.05.2011 03:58:11 * ztta/roll_extension........... 2000000000                              *
    30.05.2011 03:58:11 *************************************************************************
    30.05.2011 03:58:11 1 LUWs confirmed and 1 LUWs to be deleted with function module RSC2_QOUT_CONFIRM_DATA
    30.05.2011 05:02:53 Call customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 171 records
    30.05.2011 05:02:53 Result of customer enhancement: 171 records
    30.05.2011 05:02:53 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 171 records
    30.05.2011 05:02:53 Result of customer enhancement: 171 records
    30.05.2011 05:02:53 Asynchronous send of data package 1 in task 0002 (1 parallel tasks)
    30.05.2011 05:02:53 IDOC: Info IDoc 2, IDoc No. 4667050, Duration 00:00:00
    30.05.2011 05:02:53 IDoc: Start = 30.05.2011 03:58:11, End = 30.05.2011 03:58:11
    30.05.2011 05:02:53 tRFC: Data Package = 1, TID = AC11082D38B44DE308DD028A, Duration = 00:00:00, ARFCSTATE = RECORDED
    30.05.2011 05:02:53 tRFC: Start = 30.05.2011 05:02:53, End = 30.05.2011 05:02:53
    30.05.2011 05:02:53 Altogether, 0 records were filtered out through selection conditions
    30.05.2011 05:02:53 Asynchronous transmission of info IDoc 3 in task 0003 (0 parallel tasks)
    30.05.2011 05:02:53 IDOC: Info IDoc 3, IDoc No. 4667051, Duration 00:00:00
    30.05.2011 05:02:53 IDoc: Start = 30.05.2011 05:02:53, End = 30.05.2011 05:02:53
    30.05.2011 05:02:53 Synchronized transmission of info IDoc 4 (0 parallel tasks)
    30.05.2011 05:02:53 IDOC: Info IDoc 4, IDoc No. 4667052, Duration 00:00:00
    30.05.2011 05:02:53 IDoc: Start = 30.05.2011 05:02:53, End = 30.05.2011 05:02:53
    30.05.2011 05:02:53 Job finished
    Thanks for your help.
    Yann

    Parth Kulkarni,
    following the note and the other thread, I've check the index 4 of the table COEP.
    Here is what I got:
    Index ID           COEP             - 4
    Short text         MANDT/TIMESTMP/OBJNR, Index for Delta read method (CO-PA)
    Last changed       SAP             04.01.2010
    Status             Active          Saved
                       Does not exist in the database
    DB index nme
        Not defined as DB index in the ABAP Dictionary
    Is the fact that it doesn't exist in the database a problem ?
    Is the fact that it is active is good enough ?
    By the way thanks for your speedy reply !
    Yann
    Edited by: Yann GOFFIN on May 30, 2011 1:35 PM

  • How to deal with delete record in generic delta of generic datasource

    Hi,
       Anyone can give me suggestion about the delete record in generic delta  of generic data. I need extract data with a generic datasource and hope deleted record in datasource also can be "delete" in next delta extraction. I do a test with generic delta. It seem that the delete record can not be updated in ODS. but updated record can be updated in next delta extraction.
    How dose BW generic delta deal with the deleted record with generic delta mechanisim? Or how can I use generic delta mechanisim to realize that BW "delete" the deleted record of source system in ODS with delta extraction?
    Thanks in advance!
    Billy

    Delete is not supported in delta mechanism of generic delta extractor. You will need to add a workaround for that.
    - Capture the deleted records somewhere (maybe enhance the txn deleting the record so the key is written to a Z table). Take these records to BW and manipulate the recordmode to affect deletion of corresponding record from ODS.
    - If your generic delta is based on FM, and if the 'delete' is captured in change document tables, add the logic to check change document tables whether any records are deleted, and if yes, send those to BW with appropriate recordmode to achieve deletion.

  • 0RecordMode implementation in Generic Extractor & ODS

    Hi All,
    We have scenario of generic extractor supplying data to ODS . Now we want to implement deletion functionality using record mode .
    We have added 0recordmode to ODS and infosource . What additional thing we need to do in case of achieving deletion of data from ODS . ( Tried supplying record mode D to ODS  but system doesnt delete the record).
    One more thing is in ods we have 4 keyfields out of which we are able to supply only 3 fields in the infosource which supplies data deletion records.
    Could any body please explain as how to achieve this ...
    Thanks !
    Regards
    Mr Kapadia

    Hi Kapadia,
        In transfer rules level change the record mode to R rather than D. Let me know if you have any questions.
    Assign points if it helps.
    Regards
    Satish Arra

  • Modifying the record in the extractor.

    Hi gurus,
    i am a BW developer. i have one requirement, i have to enhance some fields from table MSEG to my generic extractor.
    In my extractor structure, Material, Plant and Order number is the key fields. i am selecting some fields from MSEG table into internal tables and doing some calculation on that fields and finally i have to enhance those records into my extractor.
    material, plant and ordernumber are the key fields. in my internal table i have 2 records and in my extractor i have only one record for particular combination of keys.
    example:
    in my internal table:
    material plant odernumber quantity week
    0980009 1800 2000125    500   200702
    0980009 1800 2000125    453   200704
    in my extractor:
    ( quantity and week are the enhanced fields)
    material plant ordernumber quantity week
    0980009 1800 2000125   
    in my code: while enhancing the fields to extractor, i have modifying the existing record.  so that i am getting only the second record in my extractor.
    like 0980009 1800 2000125 453 200704
    and i cannot append the record into my extractor, because for example for this combination of key if have 100 records in my extractor it is adding all the 100 records instead of one record.
    Can any one suggest me how can enhance these records into my extractor.
    Any help is greatly appriciatable. Thanks in advance.

    This question has been answered

  • Text load af vendor sub range - generic extractor

    Hello BW experts,
    I have created a generic extractor for transfering vendor sub range texts into the text table of an info object. However the text doen't end up in the table..
    It transfers all included lines in the source table to BW, but I get the error message that some posts are duplicate in the PSA. Nothing ends up in the destination table... Can certain lines be erased in the PSA? Could this really be the reason for the difficulties to load?
    Please help!!!
    BR,
    Fredrik

    Hi Fredrik,
    In your InfoPackage > Processing tab > choose Only PSA and Update Subsequently into Data Targets and also Ignore Double Data Records. This way you will not get the duplicate entries error message and the data should load.
    Hope this helps...

  • Generic Extractor Issue

    Hello Experts,
    I have one small doubt on the Generic Extractor. My Generic Extractor is based on the Delta with the changed on Field(AEDAT) and I wanted to know is it possible to extract the data if changed on is not updated to the document but other fields are getting updated.
    Like if the Sales Document status is changing from One status to other. In this case the AEDAT for that sales order wont get updated. in this case is it possible to extract that record as Delta thru the Generic Extractor if the Extractor is based on AEDAT.
    Suggestions will be appreciated..
    thanks
    Bulli

    Hello Bulli
    Its very muc possible to define delta on 2 fields in generic data source , you need to use created on and changed on field to define delta by modifying standard extractor program
    follo below threads
    generic delta   using function module with two fields  AEDAT AND ERDAT
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Thanks
    Tripple k

  • Customer exits for currency field in generic extractor

    Hi,
    I had a requirement to create a generic extractor. I've created a generic extractor by name 'ZXXZ_XXX_TAX_ATTR'. This extractor was created based on a table T007V in turn view. It has a currency and a quantity type field. Those two fields were not refering to a table fields but were refering a structure. So as per the note 335342, if we have fields of curr/quan type and are having reference fields as a structure field, we need to populate those fields throught a customer exit.
    As I have read that the same problem has been solved by you with customer exit. So can you mail me the exit code as I am not a good in  ABAP.
    Regards,
    Amol Gaurkar

    Hi Amol,
    Here is the code below,
    TYPES: BEGIN OF TY_T007V,
                     TRKORR TYPE TRKORR,
                     ALAND  TYPE ALAND,
                     MWSKZ TYPE MWSKZ,
                     TXJCD  TYPE TXJCD,
                     DATAM  TYPE DATAM,
                     KSCHL  TYPE KSCHL,
                     KBETR  TYPE KBETR,
                  END OF TY_T007V.
    DATA:  T_T007V TYPE STANDARD TABLE OF TY_T007V,
                T_EXTRSTRU TYPE STANDARD TABLE OF <b><Extract Structure></b>,
    **--    Work Area
               W_T007V TYPE TY_T007V,
               L_TABIX   TYPE SY-TABIX.
    CASE I_DATASOURCE.
       WHEN 'ZXXZ_XXX_TAX_ATTR'.
         REFRESH: T_T007V.
         CLEAR:     W_T007V,
                          L_TABIX.
         T_EXTRSTRU[] = C_T_DATA[].
         IF NOT T_EXTRSTRU IS INITIAL.
    Fetching all the records into internal table T_T007V from the transparent table T007V
           SELECT TRKORR
                         ALAND
                         MWSKZ
                         TXJCD
                         DATAM
                         KSCHL
                         KBETR
               INTO TABLE T_T007V
               FROM T007V
                FOR ALL ENTRIES IN T_EXTRSTRU
              WHERE TRKORR = T_EXTRSTRU-KOKRS
                AND ALAND = T_EXTRSTRU-ALAND
                AND MWSKZ = T_EXTRSTRU-MWSKZ
                AND TXJCD  = T_EXTRSTRU-TXJCD
                AND DATAM = T_EXTRSTRU-DATAM
                AND KSCHL = T_EXTRSTRU-KSCHL.
           IF NOT T_T007V IS INITIAL.
             SORT T_T007V BY TRKORR ALAND MWSKZ TXJCD DATAM KSCHL.
             LOOP AT T_EXTRSTRU INTO W_EXTRSTRU.
               L_TABIX = SY-TABIX.
               READ TABLE T_T007V INTO W_T007V
                                 WITH KEY TRKORR = T_EXTRSTRU-KOKRS
                                                  ALAND   = T_EXTRSTRU-ALAND
                                                  MWSKZ  = T_EXTRSTRU-MWSKZ
                                                  TXJCD    = T_EXTRSTRU-TXJCD
                                                  DATAM   = T_EXTRSTRU-DATAM
                                                  KSCHL   = T_EXTRSTRU-KSCHL
                                 BINARY SEARCH.
               IF SY-SUBRC = 0.
                 W_EXTRSTRU-KBETR = W_T007V-KBETR.
                 MODIFY T_EXTRSTRU FROM W_EXTRSTRU INDEX L_TABIX.
                 CLEAR W_EXTRSTRU.
               ENDIF.
               CLEAR: W_T007V,
                      L_TABIX,
                      W_EXTRSTRU.
             ENDLOOP.
           ENDIF.
           REFRESH C_T_DATA.
           C_T_DATA[] = T_EXTRSTRU[].
           REFRESH: T_T007V,
                    T_EXTRSTRU.
         ENDIF.
    ENDCASE.                           "ENDCASE FOR RETREVING THE EXTRACTOR
    <b>Reward points if this helps,</b>
    Kiran

  • Generic Extractor Question

    Hi
    I would like to create a Generic Extractor on table QMFE which has Created Date and Changed Date fields.
    If I have to get deltas, I can use only one field in Extractor for Delta option: Either Created Date or Change Date.
    If I use Create Date, I'll miss Changes and vice versa.
    I felt Function Module Extractor will be 2much complex.
    Can any one suggest what is the best approach to get deltas in this scenario?
    Thanks
    Sree
    Please search the forum before posting a thread
    Edited by: Pravender on Aug 12, 2011 3:59 PM

    Hi Sree,
    1) The simplest approach will be to create a single extractor and set the delta pointer to Changed Date, but this is only possible if you populate changed date = Created date for the very first time you create records. So that by using changed date you will not miss any newly created delta records, check with your functional team whether this is possible or not?
    2) Otherwise you can create two generic extractors and use two different delta pointers one with Created Date and other with changed date. In the generic extractor you simply need to set your delta pointer and modify the OPEN CURSOR statment to include the proper delta field in selection of data. Rest of your code will be same for both the extractors.
    Now if you go for 1st approach then you will have to create only one IP in BW and include it in process chain but in 2nd approach you will have to create two IP (one for each DS) and include both in process chain. It will only increase your data loading time.
    Regards,
    Durgesh.

  • Building a Generic Extractor on the Material (MBEW) Valuation table

    When I build an extractor based off the MBEW table does it matter whether the generic extractor is transactional i.e. any performance, conflict type issues?  My thought is to build it as a Master data generic extractor? Thanks

    Hi,
    I hope, It Does not matter. We can created Master data source on MBEW.
    If you want to define this DS as Transaction datasource and  If MBEW has More than material and plant as primary key, then it is better to upload the data to ODS first to avoid duplicate records problems while uploading to master data infoobject.
    With rgds,
    Anil Kumar Sharma .P

Maybe you are looking for

  • Itunes Problems Recent (error 50 with Sync/Itunes Store)

    Just recently I have been experiencing issues with iTunes. The last 3 albums I have purchased from the store have not worked. Only 1-2 songs per album have worked. Songs work fine when I purchase singles. I am now getting the "Can not sync song/album

  • Connecting Windows-based XP note book to printer

    I have a an Airport Extreme and configured network through my iMac. I can connect wirelessly to the internet with Dell Latitude note book no problem, but I want to be able to connect to the printer that's connected to the Airport Extreme. Can anyone

  • New to Iphone ...purchased Music but don't see the charges in my bank account

    I am a brand new iPhone 5 user; actually a brand new apple user. I purchased some music last night and this morning, but I don't see the charges showing as pending in my bank account. Do they not show up as pending? or do they accumulate for a few da

  • Upgrade OAS from 10.1.2.0.2 to 10.1.2.3.0

    The client application worked fine before the update but now I receive some strange results. Everything still works fine if I use a test OC4J 10.1.2.0.2 I want to do a test with the real 10.1.2.3.0 client jar files. Can I download them somewhere? I c

  • File protection

    Hello I used the iPhoto library shared for all family members using different accounts on the same mac. This used to work as I did set the unix umask and all files got a 664 protection. Now with iPhoto 9.3 it seems that the default protection has cha