Delta extraction for a generic datasource

Hi BWers,
I want put in Delta the extraction of a generic datasource.
Currently this generic datasource is based on the table VBPA (Sales Document: Partner). Any time field exists.
We need a time field in order to converse to a Delta extraction. This time field exists in the table VBAP (Sales Document: Item data). In fact two time fields exist: one which is filled at the creation of the sales order (ERDAT), another at the change of the sales order (AEDAT).
The fields VBELN, POSNR and MANDT are keys in the tables VBAP and VBPA.
The table VBAP changes when partner functions is created or changed in a sales order (VBELN) :
- When it is a creation of a new sales order (with new partner functions), a new record is created in VBAP and the field ERDAT (Created on) is filled. The field AEDAT (Changed on) is empty.
- When is a change of an existing sales order, the corresponding record in VBAP changed, and the field AEDAT is filled. ERDAT stays unchanged.
In order to converse to the Delta extraction, i need a only one time-field (calendar day) in RSO2 / Generic Delta.
But there is 2 time-fields ERDAT and AEDAT. So i just need to get AEDAT if it is filled, else if AEDAT is empty I will get ERDAT.
I would base my datasource on a view between VBPA and VBAP with one field which will be filled by AEDAT or ERDAT (with the conditions below). But it seems it is not possible.
Can you give me other ideas ?
Thanks a lot.
Cheers,
Vince.

In order to create a generic delta from two source fields, ERDAT and AEDAT in this case, you're going to have to create your generic extractor from a Function Module. Otherwise you'll only have the standard functionality available to you for creating the generic delta, which allows you to base it on only one column.
Here's a sample you can use, that was created for VBFA, and change for your DataSource.
FUNCTION y_docu_flow.
*"*"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  YSDS_DOCU_FLOW OPTIONAL
*"  EXCEPTIONS
*"      NO_MORE_DATA
*"      ERROR_PASSED_TO_MESS_HANDLER
*& Global Data Declarations
* Type for VBFA Data
  TYPES : BEGIN OF ty_vbfa            ,
            mandt   TYPE vbfa-mandt   ,
            vbelv   TYPE vbfa-vbelv   ,
            posnv   TYPE vbfa-posnv   ,
            vbeln   TYPE vbfa-vbeln   ,
            posnn   TYPE vbfa-posnn   ,
            vbtyp_n TYPE vbfa-vbtyp_n ,
            rfmng   TYPE vbfa-rfmng   ,
            meins   TYPE vbfa-meins   ,
            rfwrt   TYPE vbfa-rfwrt   ,
            waers   TYPE vbfa-waers   ,
            vbtyp_v TYPE vbfa-vbtyp_v ,
            plmin   TYPE vbfa-plmin   ,
            erdat   TYPE vbfa-erdat   ,
            aedat   TYPE vbfa-aedat   ,
          END   OF ty_vbfa            .
* Internal Tables and Selection Criteria Structure
  DATA : t_vbfa     TYPE STANDARD TABLE OF ty_vbfa ,
         l_s_select TYPE srsc_s_select             .
* Field Symbols
  FIELD-SYMBOLS : <fs_fields> TYPE rsfieldsel.
* Constants
  CONSTANTS : c_error_msgty TYPE rslogparms-msgty VALUE 'E'            ,
              c_error_msgid TYPE rslogparms-msgid VALUE 'YAERO_WTY_VSR',
              c_error_msgv1 TYPE rslogparms-msgv1 VALUE ' MESSAGE_V1 ' ,
              c_error_msgv2 TYPE rslogparms-msgv1 VALUE ' MESSAGE_V2 ' ,
              c_error_msgv3 TYPE rslogparms-msgv1 VALUE ' MESSAGE_V3 ' ,
              c_error_msgv4 TYPE rslogparms-msgv1 VALUE ' MESSAGE_V4 ' ,
              c_error_msgno TYPE rslogparms-msgno VALUE 999            ,
              c_alias(2)    TYPE c                VALUE 'A~'           ,
              c_vbfa        TYPE dntab-tabname    VALUE 'VBFA'         .
* Maximum Database Lines, Data Package Counter and Cursor
  STATICS : s_s_if              TYPE srsc_s_if_simple ,
            s_counter_datapakid TYPE sy-tabix         ,
            s_cursor            TYPE cursor           .
* Select Ranges
  RANGES : r_erdat FOR vbfa-erdat ,
           r_aedat FOR vbfa-aedat ,
           r_vbelv FOR vbfa-vbelv ,
           r_posnv FOR vbfa-posnv ,
           r_vbeln FOR vbfa-vbeln ,
           r_posnn FOR vbfa-posnn .
*& Processing Logic
* Refresh Internal Table and Clear work area
  REFRESH: t_vbfa   ,
           e_t_data .
* Check the Extraction Mode (Delta Initialization Or Delta)
  IF i_initflag EQ sbiwa_c_flag_on.
*   Determine DataSource Validity
    IF i_dsource NE 'YSDDS_DOCU_FLOW'.
*     Call Function to Write Log
      CALL FUNCTION 'RSAL_LOG_WRITE'
        EXPORTING
          i_msgty = c_error_msgty
          i_msgid = c_error_msgid
          i_msgno = c_error_msgno
          i_msgv1 = c_error_msgv1
          i_msgv2 = c_error_msgv2
          i_msgv3 = c_error_msgv3
          i_msgv4 = c_error_msgv4.
*     Raise Exception
      RAISE error_passed_to_mess_handler.
    ENDIF.                  " IF i_dsource NE 'YSDDS_DOCU_FLOW'.
*   Append the Selection Criteria
    APPEND LINES OF i_t_select TO s_s_if-t_select.
*   Fill parameter buffer for data extraction calls
    MOVE : i_requnr  TO s_s_if-requnr  ,
           i_dsource TO s_s_if-dsource ,
           i_maxsize TO s_s_if-maxsize .
*   Append Fields to be Selected
    APPEND LINES OF i_t_fields TO s_s_if-t_fields.
*   Add the Alias to Fields
    LOOP AT s_s_if-t_fields
      ASSIGNING <fs_fields>.
      CONCATENATE c_alias
                  <fs_fields>-fieldnm
             INTO <fs_fields>-fieldnm.
      CONDENSE <fs_fields>-fieldnm NO-GAPS.
    ENDLOOP.                " LOOP AT s_s_if-t_fields..
  ELSE.                     " IF i_initflag EQ sbiwa_c_flag_on
*   For First Data Package, Open Cursor
    IF s_counter_datapakid EQ 0.
*     Clear Ranges
      CLEAR : r_erdat ,
              r_aedat ,
              r_vbelv ,
              r_posnv ,
              r_vbeln ,
              r_posnn .
*     Fill Selection Ranges
      LOOP AT s_s_if-t_select
        INTO l_s_select.
*       Determine Selection Range Field Name
        CASE l_s_select-fieldnm.
*         Created On Date
          WHEN 'ERDAT'.
            MOVE : l_s_select-sign   TO r_erdat-sign   ,
                   l_s_select-option TO r_erdat-option ,
                   l_s_select-low    TO r_erdat-low    ,
                   l_s_select-high   TO r_erdat-high   .
            APPEND r_erdat.
*           Fill the change date too
            MOVE r_erdat[] TO r_aedat[].
*         Predecessor Document Number
          WHEN 'VBELV'.
            MOVE : l_s_select-sign   TO r_vbelv-sign   ,
                   l_s_select-option TO r_vbelv-option ,
                   l_s_select-low    TO r_vbelv-low    ,
                   l_s_select-high   TO r_vbelv-high   .
            APPEND r_vbelv.
*         Predecessor Document Line Item
          WHEN 'POSNV'.
            MOVE : l_s_select-sign   TO r_posnv-sign   ,
                   l_s_select-option TO r_posnv-option ,
                   l_s_select-low    TO r_posnv-low    ,
                   l_s_select-high   TO r_posnv-high   .
            APPEND r_posnv.
*         Successor Document Number
          WHEN 'VBELN'.
            MOVE : l_s_select-sign   TO r_vbeln-sign   ,
                   l_s_select-option TO r_vbeln-option ,
                   l_s_select-low    TO r_vbeln-low    ,
                   l_s_select-high   TO r_vbeln-high   .
            APPEND r_vbeln.
*         Successor Document Line Item
          WHEN 'POSNN'.
            MOVE : l_s_select-sign   TO r_posnn-sign   ,
                   l_s_select-option TO r_posnn-option ,
                   l_s_select-low    TO r_posnn-low    ,
                   l_s_select-high   TO r_posnn-high   .
            APPEND r_posnn.
        ENDCASE.            " CASE l_s_select-fieldnm.
      ENDLOOP.              " LOOP AT s_s_if-t_select..
*     Open Cursor on View to Fetch data
*     If full load with Selection on Fiscal Year
      IF r_aedat[] IS INITIAL.
*       Full Extraction
        OPEN CURSOR
        WITH HOLD s_cursor FOR
      SELECT (s_s_if-t_fields)
        FROM vbfa      AS a
        JOIN pnwtyv    AS b
          ON a~vbelv   EQ b~sdvbeln
       WHERE a~vbelv   IN r_vbelv
         AND a~posnv   IN r_posnv
         AND a~vbeln   IN r_vbeln
         AND a~posnn   IN r_posnn
         AND a~rfmng   NE 0
         AND a~erdat   IN r_erdat
         AND b~sdvbeln NE space.
      ELSE.
*       Delta Extraction Using ERDAT and AEDAT
        OPEN   CURSOR
        WITH   HOLD s_cursor FOR
      SELECT   (s_s_if-t_fields)
        FROM   vbfa      AS a
        JOIN   pnwtyv    AS b
          ON   a~vbelv   EQ b~sdvbeln
       WHERE   a~vbelv   IN r_vbelv
         AND   a~posnv   IN r_posnv
         AND   a~vbeln   IN r_vbeln
         AND   a~posnn   IN r_posnn
         AND   a~rfmng   NE 0
         AND ( a~erdat   IN r_erdat
          OR   a~aedat   IN r_aedat )
         AND   b~sdvbeln NE space.
      ENDIF.                " IF r_aedat[] IS INITIAL
    ENDIF.                  " IF s_counter_datapakid..
*   Fetch Records into Interface Table
    FETCH NEXT CURSOR s_cursor
         APPENDING CORRESPONDING FIELDS
          OF TABLE t_vbfa
      PACKAGE SIZE s_s_if-maxsize.
*   No More Data, Raise Exception
    IF sy-subrc NE 0.
*     Close the Cursor
      CLOSE CURSOR s_cursor.
*     Raise Exception
      RAISE no_more_data.
    ELSE.
*     Move Extracted Data to Output Structure
      MOVE t_vbfa[] TO e_t_data[].
*     Release Memory
      FREE t_vbfa.
*     Sort Output Structure
      SORT e_t_data BY vbelv
                       posnv
                       vbeln
                       posnn
                       vbtyp_n.
*     Delete Duplicate Records from Output Structure
      DELETE ADJACENT DUPLICATES
        FROM e_t_data
   COMPARING vbelv
             posnv
             vbeln
             posnn
             vbtyp_n.
*     Increment Data Package Number
      s_counter_datapakid = s_counter_datapakid + 1.
    ENDIF.                  " IF sy-subrc NE 0
  ENDIF.                    " IF i_initflag EQ sbiwa_c_flag_on
ENDFUNCTION.              
Edited by: Dennis Scoville on Jul 16, 2009 8:29 AM
Edited by: Dennis Scoville on Jul 16, 2009 8:29 AM

Similar Messages

  • Delta extraction for COPA generic datasource

    Hi,
    I have created generic datasource for COPA with timestamp as delta.I have initialized the delta in BW and was able to extract the same number of records which I had in RSA3.To test the delta created couple of records and when tried to extract it was giving me 0 records with Info doc status 8 in the status tab.The processing is red and it does not drop down. I checked in the the roosource table in R3 and it shows delta process as AIE and safety interval is 120 for the timestamp(will change it later).

    The safety interval is just 120 seconds. One more thing is when I initialized the delta on the R3 side in RSA7 I can find my datasource but under the status tab it shows some other datasource and also the delta field and current status are empty. So do u think I have to add the UPMOD field to my generic datasource or any of your suggestions for creating delta are welcome.
    Regards,
    Kal

  • Error while extracting data from Generic datasource

    Hello Gurus,
    I have encountered an error "Errors in source system" with status red while extracting data from generic datasource into DSO.
    I have done below things:-
    1. Checked the jobs in source system, the job is successfully completed
    2. The generic datasource is active and supporting delta with calender day  in source system.
    3. No TRfc error and no idocs stucked.
    4. No short dumps in source system.
    5. The delta queue(RSA7) is showing 0 with status as green.
    6. Replicated the datasource On BW side and also activated the transfer rules by RS_TRANSU_ACTIVATE_ALL
    The problem has not yet solved. Could you guys please suggest me what might be the reason for this error......
    Thanks,
    Sonu

    Hello,
    I have used the generic delta using calender day.
    Safety upper limit : - 1
    Safety lowerr limit : - 0
    I have made the entries in va01 transaction, but the delta queus is not getting updated which should show 1.
    Do Generic extraction require any job to transfer data from Database table to delta queue.
    We are not able to get the delta records on BW side. Please suggest.
    Please suggest.
    Thanks,
    Sonu

  • * Delta Extraction for 0ASSET_ATTR_TEXT

    Hi All,
    Can someone help me for the delta extraction for 0ASSET_ATTR_TEXT datasource.
    Steps performed as per SAP Help
    1. Activated the BADI
    2. Ran the initialization without datatransfer infopackage.
    3. Created new records in R/3 side
    4. I can see the newly created records in the Table : BWFIAA_AEDAT_AS
    5. Ran the delta infopackage ( no records are getting updated)
    When i check in RSA3 with the delta update, its giving an error.
    Please guide me if i am missing any steps
    Regards
    Ram

    Hi Ram,
    Check this note,
    Note 816560 - DeltaInit w/o data transfer does not createe time stamp
    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=816560
    Hope this helps....

  • Delta extraction  for masterdata object

    hi,
        can  anybody  tell me the procedure for delta extraction for master data object.
    is it possible!

    Master Data Datasources do allow for delta extraction. You can display datasource in RSA6 and check if it is delta enabled. You will have to initialize with delta to perform delta extraction. RSA7 will give you delta queues in R/3

  • ALE delta extract for HR master data

    We want to create some R/3 delta extracts based on the HR PA* tables using the ALE delta extract function of generic extractor. Has anyone done this before?  Are there any OSS notes or documents that I should look at?  Thanks!

    Hi Bill Faison,
    This is very old message. I think your problem must be solved. If it is not then: yes we can extract Data from R/3 with ALE Delta .
    You have to perform below steps.
    1.     In your Table you need to activate ALE change   pointer.
    2.     Create change documents for required table.
    3.     Created Generic Extractor with ALE Delta.
    Hope this will help.
    Let me know if you have any concern or issue in this regards
    Best Regards
    Sharad Verma

  • Delta extraction for dunning history is not active

    Hi all,
    I am loading data to the FI Cube (Financial A/c -> Contract a/c receivables ) Dunning header .
    This is a Standard infocube.  This cube contains two DSOu2019S  0FC_DS08 , 0FC_DS11.  When I starting the data loading from the DSO ( 0FC_DS08 ), I create the INIT package .  When creating itself it throwing the error  u201C Delta extraction for dunning history is not active u201D
       When I check on SDN SAP , ( Use Tcode sbiw. Select 'Settings for apllication-specific datasources (PI) ->Contract Aacounts Receivable -> Make Central Settings'. Then tick 'Delta Extraction for Dunning Items Active'.) I got this link.  But I could not proceed this link.  Can you explain detailed step by step how to proceed to solve this issue.
    Regards,
    Baskaran.

    Hello Baskaran,
    Did you ever solve this issue?
    We do not have the link in SBIW (ERP 6.0 EHP6).
    Thanks,
    Andreas

  • How can I know the delta field for CO-PA datasource?

    Hi,folks:
        How can I know which is the field assigned as the delta field for CO-PA datasource,as is noticed in the note that after PI2004 the logic has been turned to general datasource,but I can't find the datasource through RSO2.
        Full points will be given to u.
    Martin Xie

    Dear Martin,
    The CO-PA DataSources generated use a separate time stamp method for the delta procedure. This procedure means that client-independent DataSources in CO-PA are normally restricted to the clients in which they were generated.
    See this link...
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/97/6f4d40cef71059e10000000a155106/frameset.htm
    Also check ROOSOURCE in R3, asmentioned by Dinesh.
    Hope it helps.

  • HI,How can i set delta option for costumised Generic data source

    Hi Sir/Madam,
          How can i set delta option for costumised Generic data source.
    Regards,
    Vishali.R
    Please search the forum before posting a thread
    Edited by: Pravender on Aug 15, 2011 1:26 PM

    Hi,
    Go to RSO2 transaction and click on change then on the tool bar click on Generic Delta button. In the next popup you can set your delta.
    Regards,
    Durgesh.

  • Delta Extraction for 0FI_GL_6

    Hi,
    We are facing a problem in the delta extraction for the data source <b>0FI_GL_6</b>.  0 Records are populated into BW whereas in the Extract checker (RSA3) of the source system shows 1000 records. Moreover the delta queue (RSA7) has an entry for 0FI_GL_6 but no data is displayed inside it.
    Kindly advice.
    Reagards,
    Vidhya

    Hi,
    This extractor works based on time stamps so wait for a day to get the data.
    have a look of the thread :
    Re: delta not working for 0FI_GL_6 & 0EC_PCA_1
    Regards
    Happy Tony

  • Delta support for the Generic extracter

    Hello Roberto,
    I have created the generic extractor (view-VBRK,VBRP) and it is working fine now i want to create the delta support for the extractor at R/3 side , please guide for the same .
    Regards,
    Milind

    Hi Milind,
    Under R/3, go to TCODE <b>RSO2</b>, you are presented with 3 options "Transaction Data", "Master Data", "Text". You choose which is the type of Generic Extractor you want.
    There is a button labeled "<b>DELTA</b>" on the upper left corner of the screen. You indicate there which of the fields in your Extract Structure will be used as DELTA indicator or reference point.
    You can choose either via Numeric Pointer, Timestamp, Calendar Day.
    Hope that helps...
    Do award some points if helpful...
    --Jkyle

  • Identifying the target system using FM extraction in a Generic Datasource

    Hi all,
    We are using a Generic datasource using FM for extraction from R/3 system to BW system. This Function module picks data from a Z table! After each successful delta extraction from the table, a flag field is set to identify whether the data is pulled or not.
    We are about to use BO data services which is connected to the R/3 system to fetch data. For capturing delta records after the BW run has happened, the table can be added a new flag field to pull delta for Data services.
    Is there any way to identify which target system's extraction is running particularly in the function module (for e.g., if BW extraction is triggered or BODS extraction is triggered) so as to set the respective target flag in the Z table?
    Regards,
    vivek

    Leandro,
    The calling program of your FM should have a local variable I_RLOGSYS which is populated with the BW server ID.
    If you don't know how to access a variable in a program that is in call stack using field symbols, search SDN.
    I haven't tested this, so you may have to explore a little.
    Good luck.

  • Delta on Sales Data (Generic Datasource)

    Hi,
    I have created a generic datasoucrce which is taking data from VBRK & VBRP. Now i have to set delta on it, for which i was looking for change date field but didnt found anyone.
    Does anyone have any idea on which field for sales data i can set my delta ??

    Hi,
    generic extractor is an extractor that you create yourself for a special requirement which is not solved by the standard available business content.
    Before creating your own datasource take a look at the Logistic Cockpit (Transaction LBWE) -> application 13. Here you found BW content datasources like 2LIS_13_VDITM
    to extract the tables for SD billing document (VBRK & VBRP) in delta mode.
    After you have filled the setup table for application 13 you can do an initial run from BW. Now you can extract your delta without building your own datasource. Delta updating is part of the standard Logistics extraction process.
    Additional you can use now standard business content in BW system for this extraction (or take a look on it how it is implemented).
    Check this blogs for Logistics Extraction:
    /people/sap.user72/blog/2004/12/16/logistic-cockpit-delta-mechanism--episode-one-v3-update-the-145serializer146
    /people/sap.user72/blog/2004/12/23/logistic-cockpit-delta-mechanism--episode-two-v3-update-when-some-problems-can-occur
    /people/sap.user72/blog/2005/01/19/logistic-cockpit-delta-mechanism--episode-three-the-new-update-methods
    /people/sap.user72/blog/2005/02/14/logistic-cockpit--when-you-need-more--first-option-enhance-it
    /people/sap.user72/blog/2005/04/19/logistic-cockpit-a-new-deal-overshadowed-by-the-old-fashioned-lis
    I hope this helps.
    Best regards
    Andreas

  • Delta issue on a Generic Datasource

    Hi
       I had a Generic Datasource on a Z table.
       The Z table had a Date field on which Delta is based.The Postings are performed manually.
      How to solve the delta issue in the below scenario.
    Ex; A user made a manual posting with a date 09AUG2010 today and delta is extracted to BW.
        But tommorow a used made another posting with a date 14JULY2010....
    Currently that record is not being extracted....how can i resolve this
    Thanks

    Hi,
    Once the data source is created you will extract the data till that date and as the delta is set it will fetch the newly updated records .But i dont think one can post with the back dates in R/3 side.
    If i'm not wrong if you are asking regarding record got missed out them wht need to be done?
    Then do the repair full request and pull the missed delta records and it wont effect the delta settings.
    Regards
    KP

  • Delta Extraction for PS

    Hi,
    Is delta extraction possible for PS dates datasouces viz. 0PS_DAT_PRJ, 0PS_DAT_NWA, 0PS_DAT_NTW etc. If not, do we have to empty and re-load the cube everytime?
    Regards,
    Anoop Sahu

    HI Anoop,
    The datasources donot support delta extraction, the old data needs to be deleted if you want to load to cube dire tly
    May be you can use the changed on date in the infopackage and choose select yesterdays data , to handle delta
    Regards,
    Sathya

Maybe you are looking for