Generic Delta extraction by Function module issue

Hello Experts,
Please help !!!
I have problem for delta extraction by Function module.  For the full load, I wrote function module based on RSAX_BIW_GET_DATA_SIMPLE. It works fine.
But I would like to have the delta load enabled. Therefore, I modified the datasource, add a delta specific field u2018ztimestampu2019, which type is calendar day.
Then I create a function module based on template u2018RSAX_BIW_GET_DATAu2019, as this support the upload mode. But when I test this datasource in RSA3, no matter itu2019s full load or initial delta load, it always send me an error, u201CErrors occurred during the extractionu201D.
I had some debug, and found that there is no value  for i_isource when my function module is called. Therefore it raised the exception.
But I do not have the chance to debug my code for the delta logic, can somebody help to check?
I also check the entries in ROOSOURCE,
For my datasource ZTRNREC_FM_DELTA, The DELTA value is u2018AIEu2019, and extraction method is u2018F2u2019, should I change them to DELTA= u2018Du2019 and extraction method to u2018F1u2019? Where to change?
FUNCTION ZRSAX_TRAININGREC_DELTA.
""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 STRUCTURE  ZTRN_REC_TIME 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
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,
          S_S_IF TYPE SRSC_S_IF_SIMPLE,
          S_COUNTER_DATAPAKID LIKE SY-TABIX.
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 'ZTRNREC_FM_DELTA'.
      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 'D'.
      WHEN 'R'.
      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
    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.
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
  LOOP AT G_T_SELECT INTO L_S_SELECT
        WHERE FIELDNM = 'ZTIMESTAMP'.
  ENDLOOP.
      IF G_COUNTER_DATAPAKID = 0.
        IF L_S_SELECT-LOW = '' AND L_S_SELECT-HIGH = ''.
        OPEN CURSOR WITH HOLD G_CURSOR FOR
            SELECT (g_t_fields)
            FROM ZTRN_REC_TIME.
        ELSE.
          OPEN CURSOR WITH HOLD G_CURSOR FOR
            SELECT (g_t_fields)
            FROM ZTRN_REC_TIME
            WHERE ZTIMESTAMP >= L_S_SELECT-LOW
              AND ZTIMESTAMP  <= L_S_SELECT-HIGH.
        ENDIF.
      ENDIF.
  FETCH NEXT CURSOR G_CURSOR
               APPENDING CORRESPONDING FIELDS
               OF TABLE E_T_DATA
               PACKAGE SIZE S_S_IF-MAXSIZE.
    IF SY-SUBRC <> 0.
      CLOSE CURSOR G_CURSOR.
      RAISE NO_MORE_DATA.
    ENDIF.
    S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
  ENDIF.
ENDFUNCTION.
I found some similar issue in this forum by link
Generic Extractor Delta Function Module code, but still I could not get clear answer.
Can you please help me:
1)     why there is no value for i_source , how to fix it?
2)     For the delta logic for ztimestemp, is it correct?
3)     Need I modify the entries in ROOSOURCE ?
Thanks a lot !!!

Hello Andre,
        Thanks a lot for your help. I did some change , but still does not work. Could you please help check.
Now the source code are the following, It's based on the RSAX_BIW_GET_DATA_SIMPLE, as you confirm that this also supply the update mode (full, initial delta, delta).
FUNCTION RSAX_BIW_GET_DATA_TRAININGREC1.
""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  ZTRN_REC_TIME OPTIONAL
*"  EXCEPTIONS
*"      NO_MORE_DATA
*"      ERROR_PASSED_TO_MESS_HANDLER
Auxiliary Selection criteria structure
  DATA: L_S_SELECT TYPE SRSC_S_SELECT.
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.
Select ranges
RANGES:
        L_R_ZTIMESTAMP FOR ZTRN_REC_TIME-ZTIMESTAMP.
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 'ZTRNREC_FM'.
      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.
      LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'ZTIMESTAMP'.
      MOVE-CORRESPONDING L_S_SELECT TO L_R_ZTIMESTAMP.
      APPEND L_R_ZTIMESTAMP.
      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.
     IF L_S_SELECT-LOW = '' AND L_S_SELECT-HIGH = ''.
        OPEN CURSOR WITH HOLD S_CURSOR FOR
        SELECT (S_S_IF-T_FIELDS)
        FROM ZTRN_REC_TIME.
        ELSE.
        OPEN CURSOR WITH HOLD G_CURSOR FOR
        SELECT (S_S_IF-T_FIELDS)
        FROM ZTRN_REC_TIME
        WHERE ZTIMESTAMP >= L_S_SELECT-LOW
        AND ZTIMESTAMP <= L_S_SELECT-HIGH.
     ENDIF.
    ENDIF.                             "First data package ?
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 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.
I think it already includes the important statements you suggested.
I test this FM in RSA3, for the Full load mode, it works fine. Also if I checked the debug mode in execution , it will stop in the code and let me debug.
But when I choose other mode, like 'initializion of the delta transfer'  or simulation of initial delta, I always get error 'error occurs  during the extraction' .. even I choose debug mode, but it could not enter the code for debug..
Till now I did not see any parameter or value for the upload mode..
Another questions is that, in RSO2, I define Ztimestamp as my delta field.. But , can I add other field as selection condition in the datasource definition, and has its range table in this function module ?
Should I change the entries in ROOSOURCE for this datasource ??
Please let me know your feedback, do you have some concret example for generic delta extraction ?
Thanks a lot !

Similar Messages

  • Generic Delta Extraction via Function Module

    Hello,
    i need a help for a generic delta extraction based on a Function Module. As an example i take the function module RSVD_BW_GET_DELTA_DATA.
    My generic delta extractor based on the field AEDAT - Change Date and i will extract purchase service orders and entry sheets.
    In the sample function module the select for the extraction worked with the table ROBWQTSTAT, but this table ist empty after the initialization.
    OPEN CURSOR WITH HOLD G_CURSOR FOR
          SELECT * FROM ROVERCUBE1
                   WHERE COUNTRY IN L_R_COUNTRY AND
                         REGION  IN L_R_REGION AND
                         KUNNR   IN L_R_KUNNR AND
                         TYPE    IN L_R_TYPE AND
                         GJAHR   IN L_R_GJAHR AND
    Here the timerange calculated in form GET_TIME_INTERVAL is evaluated.
                         TSTMP   IN S_R_TSTMP AND
                         OBJVERS = 'A'.
    I found the table ROOSGENDLM. In this table i found the field DELTAID with the last date of the extraction and the field REPEATID with the date for the repead-Update.
    My Questions:
    Is this the right way to build an generic delta extraction with an function module or must i install a coding in my function module for an update of the table ROBWQTSTAT?
    Which settings are needed in the table ROOSOURCE for a generic delta extraction via function module?
    Best regards
    Uwe

    Hi Uwe,
    please have a look at https://weblogs.sdn.sap.com/pub/wlg/2415. [original link is broken] [original link is broken] [original link is broken] It might help
    kind regards
    Siggi
    PS: We already had almost the same question here today.

  • Generic delta extraction using function module

    Hi.
    I have a generic datasource , extraction being performed by a function module. The extraction works fine in full update mode. The extract structure has a timestamp field.
    I have enabled generic delta using this field(i.e., marked this field in RSO2). I understand that with this setting, I should be able to get delta data when I do a delta request. But it does not seem to happen.
    I checked the ROOSPRMSC table for the last(local) timestamp stored there. Now when I do the delta upload I expect to see only those records which are younger than the stored timestamp of last upload.
    But I still get the entire set of records.
    Questions are :
    1. Do I need to explicitly code for fetching the delta in the extractor ?
    2. If not, what could be the reason why generic delta is not working ?
    Thanks and regards,
    Anuradha

    Hi GFV,
    I read-up all the forum entries on this topic but could not find anything specifically dealing with my problem. I have browsed through the how-to paper on generic delta as well.
    I am quite sure that we don't need any special coding in the extrator for generating delta generically. Even the how-to paper does not mention that.
    I have used the FM RSAX_BIW_GET_DATA_SIMPLE as a template
    for my extractor(as suggested by F1 help in RSO2). This FM does not even have the i_updmode flag in its interface. 
    Thus this function module always does full extraction and I expect the system to take care of delta using the timestamp field.
    Are these assumptions incorrect ?
    Regards,
    Anuradha

  • Delta Extraction Using Function Module ( Customization )

    Dear Experts,
    I want a sample code for Delta Extraction using Function Module ( If it is customized already working code very helpful ), I have already created Function Module but Full update is happening. If I give delta update again it is retrieving all records. It is very urgent, if you have please send me to the following mail ID.
    [email protected]
    Best Regards,
    SGK.

    Hi SGK,
    I've done this for a delta based on a timestamp and it's actually pretty easy.  The basic steps are:
    1) Create an extract structure in SE11.  Make sure the structure has a date or timestamp field in it that you can use for delta.  You'll need to include the field twice if you also want to extract it to BW/BI since once it's chosen as the delta field then it will be hidden in the interface.
    2) Create the extractor function module in SE37.  You can use RSAX_BIW_GET_DATA_SIMPLE as a template.  Make sure your logic restricts the data it retrieves according to the selections that are passed in I_T_SELECT, including restrictions on the delta field.
    3) Create a generic DataSource in RSO2.  Click Extraction by FM then fill in your extract structure and function module.  Click Generic Delta and pick your delta field and the appropriate radio button (time stamp or calendar day).  If your delta field is a timestamp field then be sure to set the upper and lower safety limits to -86400 and 86400 respectively.  This might not be necessary on your version of SAPI but on mine there is a bug where it doesn't translate between system time and UTC (GMT) correctly so this was necessary.
    You don't need to program any special delta handling logic in your function module as long as you restrict the data you retrieve based on the delta field (I_T_SELECT).  This is because the SAPI takes care of catching the init, delta and repeat requests, translating them to the appropriate delta field values, and then passing them to your function module as if it was a full extraction for a specific date or timestamp range.
    Hope this helps!
    Jason

  • Code For Delta Extraction Using Function Module

    Dear Experts,
    I want a sample code for Delta Extraction using Function Module ( If it is customized already working code very helpful ), I have already created Function Module but Full update is happening. If I give delta update again it is retrieving all records. It is very urgent, if you have please send me to the following mail ID.
    [email protected]
    Best Regards,
    SGK.

    Dear KJ,
    Thank for your response. I saw the code that you sent, you have used some ztables like ZSC_DELTA_IP, ZSC_SAFETY_DELTA, ZSC_SET_EXT_TIME
    What are the fields that you have created in these tables , what is use of these tables, can you send the fields that you have used in these tables.
    Thanks & Regards,
    SGK

  • How to create delta extraction through function module?

    Hi all,
    So far i have created the data source through full load. But currently i would like to convert the couple of function module generic extraction converted through delta.
    Can anyone let me know how to convert from full load to delta using generic extraction
    thanks

    Hi,
    Try these Links, helps u in getting an idea.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30aefb04-7043-2c10-8e92-941536eebc79?QuickLink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30f1a423-02ae-2e10-bd85-bde64e61fe7b?QuickLink=index&overridelayout=true&51947629650864
    Regards,
    Aravind.

  • Generic Delta Update using Function Module........ problem with CURR  type

    Hi Experts,
    I try to create a generic data source using the transaction RSO2. I got the following error message
    " Das Einheitenfeld CURR des Feldes ZPKZA1 der DataSource ZBWN_DS_POLPOSP ist ausgeblendet"
    "The unit field CURR of the field ZPKZA1 of the DATA SOURCE ZBWN_DS_POLPOSP is not visible/ stopped/ hide".
    How shall i handle this issue..........any suggestions please........
    thanks in advance
    Cheers
    Jaya

    Hi Jaya ,
    The error msg which is coming as...
    "The unit field CURR of the field ZPKZA1 of the DATA SOURCE ZBWN_DS_POLPOSP is not visible/ stopped/ hide" may be due to the currency field made hidden at the data source lavel. Also check weather you have included it in your structure (code).
    So, to check it and make it unhide go to "Display Field List (F7)" in RSO2.
    Hope it helps.

  • What are the disadvantages of generic delta extraction

    Hi all,
    what are the disadvantages of generic delta extraction.
    how function module generic extraction works.
    Thanks,
    Madhu.

    hi madhu,
    Pls refer ths,To learn more about Generic Extraction pls read BW350 book.
    Gereric Extraction can be done in 3 ways.
    If you go to transaction RSO2 in R/3 side, provide tech name for data source and click create.
    you will get the 3 options.
    1)From a DB Table
    2)From a DB View
    3)From Functional module/ Infoset Query
    in first option you can directly give a standard or custom build talbe name. in second option you can select the necessary fields from more than one talbe(eiter standard or custom). In third option you will create a function module or Query to extract data. When creating function modules you can use standard function modules as a template e.g. RSAX_BIW_GET_DATA_SIMPLE.
    see weblog : /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    If you want to enable delta for generic extractor you choose the option delta and provide necessary settings.
    Generic extraction is when your extraction is not satisfied by either BC or LIS/LO. It can be using a view / query/table/FM
    Here the changed records can be isentified by :
    1. Based on the date of creation or last change ( Delta based on 0Calday)
    2. Based on the record number ( Numeric Pointer )
    3. Based on time of change ( Timestamp)
    real time examples would be
    1. Master Record creation like customer ID creation
    2. Timesheets in SAP PS
    3. Invoive details / Sales Order Details.
    Pls check this web logs for clear Idea.
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    Have a look at these threads too.
    Tables
    Transfer Structure
    The steps for creating extractor using Function Module.
    1. Create new Function group (if you have already not done so) in Se80
    2. Copy Function module "RSAX_BIW_GET_DATA_SIMPLE" with suitable name.
    3. Change the code that populate data.
    Following table may give you the guideline for parameters.
    Parameter Description
    I_REQUNR (import) BW provides this request identifier. It is a system-generated identifier in the form REQU_XXXXXX. BW uses this same identifier in all function module calls that relate to a single load.
    I_DSOURCE (import) The name of the generic extractor
    I_MAXSIZE (import) The maximum number of records that BW expects to be in each data packet
    I_INITFLAG (import) A Boolean flag that indicates if this is the initialization (first) call to the function module
    I_READ_ONLY (import) A test flag not needed in most extraction scenarios
    I_T_SELECT (table) This table holds any selections from the BW InfoPackage. The function module should examine these selections and only return data that matches the selections.
    I_T_FIELD (table) This table holds the fields that BW requests
    E_T_DATA (table) The function module fills this table with data records. These records then return to BW as data packets. This table has the same structure as the extract structure defined in the generic DataSource.
    NO_MORE_DATA (exception) The function module raises this exception when no more data is available
    ERROR_PASSED_TO_MESS_HANDLER (exception) The function module raises this exception if an error occurred during the extraction. It alerts BW to check for error logs.
    Change following code to put the selection fields
    Select ranges
    RANGES: L_R_CARRID FOR SFLIGHT-CARRID,
    L_R_CONNID FOR SFLIGHT-CONNID.
    Change following to populate data
    OPEN CURSOR WITH HOLD S_CURSOR FOR
    SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
    WHERE CARRID IN L_R_CARRID AND
    CONNID IN L_R_CONNID.
    ENDIF. "First data package ?
    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.
    Some more links:
    Re: functionmodule
    Re: FM for G. extractor
    with hopes
    Raja Singh

  • Generic Delta Extraction

    Hi,
    In Generic delta extraction for function module which generic delta we can use
    1)Time stamp 2)CAL day 3)Numeric pointer?
    What safety upper limit and safety lower milit in time stamp?
    When we use safety upper limit and lower limit in Time stamp and numeric pointer?
    If possible give 1 scenario for this question
    Thanks,

    Hi,
    Delta with data transfer, you do an init with all the data and marke the requests as delta. The next request will bring the new records and modifications as a normal delta.
    Without data transfer, you're only marking the request as delta, the init don't bring any data. Only next deltas will bring new and modified requests.
    Normally you'll use init with data transfer and deltas after it.
    But imagine you already have an init of a datasource to a Dataprovider, but you'll want to connect that datasource to a new one. Since you already have an init to a first dataprovider, connect it to another new dataprovider, you won't be able to start a new init with data trasnfer to the new dataprovier (without deleting the old one). Therefore, you could bring a full of all the data to the new dataprovider, after that, delete the init flag of the old dataprovider, and create a new init without data. Therefore, the old dataprovider, since already had all the data before, you're only deleting the init flag and create it again, the new dataprovider, you already had sent the data with a full load, so marking the init flag, after that sending deltas will bring new and modified requests to the two dataproviders as what you want.
    Please go through the below links,
    Re: Generic extraction
    Re: Generic Extraction-example
    Re: Numeric Pointer Option on Generic Delta Screen
    Hope it helps you,
    Thanks & Regards,
    Ravi.

  • Urgent: Problems in Generic Extraction by Function Module

    Hi BW Gurus,
    I am new to SDN and also new to generic extraction using function module. My requirement is to extract long text(142 char) from CRM to BW as the text is not stored in database table I used function module read_text with in another ZXXX function module copy of (RSAX_BIW_GET_DATA_SIMPLE). In my extract structure I used GUID(char,32), Langu, long text(142 char) and 2 placeholders. Text can be extracted by passing STXH table fields(Tdname, Tdid, Tdobject, Tdspars) to read_text as parameters and i also need to use CRMD_ORDERADM_H field GUID(32 char) to compare 1st 32 chars of tdname(70 char) with Guid to select Guids and loop thru this Guids and for each Guid i need to append lines of text to e_t_data but as i donot know ABAP i unable to write the code for this. Through my friends help i wrote code when i check in RSA3 it is displaying the text but when i replicate into BW and load into data target in monitor the status is red with records initially but afterwards it will be red status again with 0 from 0 records for initial load again.when i check on job logs the errors i have are:
    The background job has created a job log file of 2Gb size and it is currently on a infinite loop writing entries into the SAP System Log that it cannot write to the Job log file due to “Error 22 for write/read access to a file” this is because of the datasource i have created. Please find my Function module and if anyone would please correct FM and send me that will be really great.I appreciate it in advance.
    MY Function Module is:
    FUNCTION Z_CRMORDERH_STR_TXT.
    ""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  YCRM_TEXT_STR OPTIONAL
    *"  EXCEPTIONS
    *"      NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
    ***"  EXCEPTIONS     NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
      Tables: CRMD_ORDERADM_H, STXH.
    Auxiliary Selection criteria structure
    data: l_s_select type srsc_s_select.
    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.
    data: i_crmtext type standard table of TLINE .
      types: begin of xsreph ,
              GUID type CRMD_ORDERADM_H-guid,
            end of xsreph.
       data: i_guid type standard table of xsreph.
      data: I_TEXT type STXH-TDNAME.
      data: xempl like  YCRM_TEXT_STR occurs 0 with header line.
      data: t_tab like dd03l-tabname.
    Select ranges
      ranges: l_r_guid for CRMD_ORDERADM_H-guid.
             l_r_connid  for sflight-connid.
    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 'yCRM_TEXT'.  " for S_SREPH1
          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.
    we will do our selection based on what is in the p table for the
    infoobject
      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 = 'GUID'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_GUID.
            APPEND L_R_GUID.
          ENDLOOP.
          case i_dsource.
            when 'YCRM_TEXT'.  " for S_SREPH1
              t_tab = 'CRMD_ORDERADM_H'.
          endcase.
          select GUID
          from (t_tab)
          into table i_guid where   PROCESS_TYPE = 'ZACI'  and ( OBJECT_ID < '0000000042').
         select tdname from stxh into i_text where tdobject = 'TEXT'.
         if sy-subrc ne 0.
           message e009(r3).
    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
                     'No master data found'.           "message variable 2
           raise error_passed_to_mess_handler.
         endif.
    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.
         open cursor with hold s_cursor for
         select (s_s_if-t_fields) from CRMD_ORDERADM_H
                                  where GUID in L_R_GUID .
                                   ENDIF.
    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 SY-SUBRC <> 0.
         CLOSE CURSOR S_CURSOR.
         RAISE NO_MORE_DATA.
       ENDIF.
    as we are doing this only once can use the select statement.
    ***data: crmtext like tline occurs 0 with header line.
    **data: i_crmtext type standard table of TLINE.
    **data: i_guid type standard table of xsreph.
    data: l_guid type THEAD-TDNAME.
    data: st_guid type xsreph.
    data: st_crmtext type TLINE.
    data: lan type THEAD-TDSPRAS.
    lan = 'E'.
    loop at i_guid into st_guid.
    l_guid = st_guid-guid.
    CALL FUNCTION 'READ_TEXT'
       EXPORTING
       CLIENT                        = SY-MANDT
         ID                            = 'A002'
         LANGUAGE                      = lan
         NAME                          = l_guid
         OBJECT                        = 'CRM_ORDERH'
       ARCHIVE_HANDLE                = 0
       LOCAL_CAT                     = ' '
    IMPORTING
       HEADER                        =
       TABLES
         LINES                         = i_crmtext.
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
       WRONG_ACCESS_TO_ARCHIVE       = 7
       OTHERS                        = 8
    e_t_data-guid = l_guid.
    loop at i_crmtext into st_crmtext.
    move lan to e_t_data-langu.
    move st_crmtext-tdline to e_t_data-description.
    append e_t_data.
    endif.
    endloop.
    clear: st_guid,l_guid.
    refresh: i_crmtext.
    endloop.
    S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
    endif.
    ENDFUNCTION.
    please Gurus as I donot know ABAP i appreciate if anyone would write a FM based on requirement and send me that will be really great this is my request. I gurantee of award points for good answers.
    Regards
    Kishore

    Hi,
    The statement <b>RAISE NO_MORE_DATA</b> should be active (uncommented) in your code. Otherwise, the infinte loop occurs.
    See also, the Siggi's blog:
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    BTW, was it your thread here:
    Re: Urgent: problems in extracting Long Text
    Best regards,
    Eugene

  • Error in Data selection in R/3 Generic Extraction Using function Modules

    Hi Friends,
    I have created a a generic data source using function module to load data from PA0000 and PA0001 Tables ,Function module is working fine when i execute it indipendently and  the data source is also working fine when i extract data using RSA3. it is showing correct no of records 157.
    When loading data into DSO from BW (using 3.x/7.0 flows) data is comming to PSA  all 157 records but in the RSMO the load status is showing yellow when i look into the step by step analysis it is
    data selection successfully started
    Data selection successfully ended
    All Data packets completed.
    are showing in red.
    after and hour time load getting failed and in the error message it is showing " job terminated in source system---> Request set to red"
    it is giving this message wir no RSM 78.
    Please let me know it

    Hi Jerry,
    Thanks for the immediate replay
    But here in my source system job is getting terminated.
    this is the status of job in Job logs.
    the job is running till this step not going ahead.
    Call customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 157 records 
    Result of customer enhancement: 157 records                             
    Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 301 records     
    Result of customer enhancement: 157 records                             
    Asynchronous send of data package 000001 in task 0002 (1 parallel tasks)
    pl. update me if any idea.

  • Generic Extraction - Using Function Modules

    Hi Friends,
    Can you pl let me know the step by step process for creating generic extraction using function module?
    Thanks in Advance.
    Regards,
    Ari.
    Please search the forum before posting a thread
    Edited by: Pravender on Aug 5, 2010 7:31 PM

    Hi,
    Plz find this doc.
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33.
    And go this link...
    http://www.sdn.sap.com/irj/scn/advancedsearch?query=genericextractionwithfunctionmadule
    Regards.....KP
    Edited by: kundan.sap on Aug 5, 2010 4:35 PM

  • Generic extraction using function module and view

    hi every one ,
    iam new to bw and can anyone plz tell me how to extract the data from R/3 to bw using generic extractor by creating function module and a view
    thank u,
    kishore

    Hi Kishore,
    Check this blog:
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Also Check this doc:
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/548c9ec754ee4d90188a4f108e0121/frameset.htm
    Generic Extractors
    Generic data sources
    Generic DS
    Bye
    Dinesh

  • How to do Delta upload using Generic Extractor built on Function Module?

    Hello Guys,
    I have never created a Generic Extractor using a Function Module. I wanted to know how can we support Delta mechanism if we create Generic extractor using Function Module.
    Regards,
    Abhishek

    Hi Abishek,
    Please check the standard Function Module RSAX_BIW_GET_DATA for your delta mechnism.
    Hope it will help you.
    Thanks,
    Chandra

  • 0CO_OM_CCA_9 - Delta load - after  Function Module Enhancement

    Hi All,
    We are facing issue in 0CO_OM_CCA_9 data source delta load after function module enhancement.
    why we went for enhancement -
    Vendor (LIFNR)field is getting populated only for Invoice and not for GR entries.
    To Solve the issue -
    we written an user exit in CMOD, that will fetch the Vendor field(LIFNR) from the table EKKO using the PO Document Number (EBELN) as key.
    Issue -
    We loaded the data with full load and found after the enhacement data fetched for vendor field.
    But after doing the init and started loading the delta we found data is not fetched for vendor field alone.Hence for the delta load we face the same issue of no entries for vendor field.
    Can anyone suggest the reason, y delta is not fetching the vendor entries.
    I have checked in RSA3, only FULL update option is allowed to check and other update mode is not allowed(greyed).
    Thanks in Advance
    Ramesh

    Hi Ramesh,
    What you can do to debug the extraction is adding an infinite loop in the enhacement (before your code) like this:
    data: a.
    a  = 1.
    while a = 1.
    endwhile.
    **your code**
    Then, from BW run the extraction, and go to ERP, transaction SM50, look for the extraction process, select it, and go to Process/Session -> Program Debugging. A new window with the debugger will be opened, and you'll be in the while. Change the valiue of a, and start debugging.
    Perhaps the problem is that you are trying to modify a value that is not an enhacement, and it doesn't takes your modification when you do a delta.
    Hope this helps.
    Regards,
    Diego

Maybe you are looking for

  • External Editor Doesn't Update Aperture 3 mage

    Relatively new to Mac. Using Aperture 3 with Photoshop Elements 9 selected as the external editor. First time to try external editing. Seleted "edit in external editor" and Aperture makes a new version and Photoshop Elements 9 opens up with the selec

  • Array to bufferedimage

    why doesn't this work? import java.awt.*; import java.awt.event.*; import java.applet.*; import java.awt.image.*; public class Firew extends Applet { public BufferedImage img2 = new BufferedImage (320,240,BufferedImage.TYPE_BYTE_INDEXED); public byte

  • Menu flickers driving me crazy!.... help!

    Hi all, I'm having a big problem using Photoshop and other programs and even the internet, there are a few instances of the problem, one is when I am in Photoshop and I try to 'save as' I cannot scroll down the file types, instead it flickers and the

  • Adding a movie to a blog

    I'm using the 'modern' blog template. When I drag a photo to the image placeholder in the 'entries' section, that photo also becomes the thumbnail on the blog title page. That's nice and easy, but how do I do this with a Quicktime movie? When I drag

  • Screen freezes.

    Hi, I've got a strange problem - or it's more like a frustration. My screen freezes randomly and it's only my screen. Everything else works like a charm. I can stop my music, play next track and so forth. To fix this I have to A+C+F2 and back to F1.