Writing to FI-GL records to Delta Queue using a Function Module

Has anyone of you tried to write FI-GL transactions to delta queue using BTE by configuring a function module. I am trying to achieve it for a datasource based on a view on FAGLFLEXA table (GL Line Items). For some reason I am not able to see records in Delta Queue. I am doing this to achieve RDA functionality. If you have done it please sends me step sequence and the name of FM.
Your help would be highly appreciable.
Regards,
Ram

Hello Ram,
See this SAP Network Blog: [Generic Extraction via Function Module|/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module]
Have a look at these docs,
[How to Create Generic Data Sources which use the Delta Queue (NW7.0)|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10b68b99-022e-2a10-999d-c4dc9ec24a59]
[How to Create Generic DataSources Which Use the Delta Queue (NW2004)|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d3219af2-0c01-0010-71ac-dbb4356cf4bf]
[How to Create Generic Delta|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33]
Thanks
Chandran

Similar Messages

  • Insert new Master Data Record for an InfoObject using a Function Module

    Hi @ all,
    is there any Function Module for creating a new master data record for an InfoObject? Implementing a FM for inserting a master data record into a master data table is done quickly. I think there will be problems with inconsistency implementing a FM using a simple "Insert" Statement. Isn´t it?
    I know it is possible to maintain an InfoObject in RSA1 (Master data IO> right click>Maintain Master data>execute(F8)> ...) but I have another requirement for using a FM.
    Thanks!
    Regards,
    Johannes

    use this
    RSNDI_MD_ATTRIBUTES_UPDATE

  • Number of records in Delta Queue in table level.

    Hi All,
    I want to know the number of records in Delta Queue for a particular database in Table level. Right now in Production, i dont have access to TCODE RSA7. I just trying to check the Table TRFCQOUT but i am unable to see the exact count of records specific to data source. Can you please provide any other table to see the data and the count of records in delta queue specific to each data source.
    Thanks.

    Hi Jalina,
    Check the follwing tables:
    -ARFCDATA
    -TRFCQOUT
    -ARFCSTATE
    In case you can't find what you need in the above tables. You can always ask a temporary access to RSA7 transcation to your basis team or ask them to give you the required information from RSA7 themseleves (of course provide to them a step by step procedure) .
    Hope it helps.
    Amine

  • Is there any solution to Delete Single Record in Delta Queue 2LIS_08TRFKZ

    Hi,
    Is there any solution to Delete the Single Record in Delta Queue at R/3 -(RSA7) for Datasoure 2LIS_08TRFKZ
    A wrong posting has been posted at R/3, its has been deleted once they came to know its wrong at R/3.
    Now the  Problem is  wrong data has come into Delta Queue RSA7.
    We are unable to extract the data in BW. Its not even coming till PSA also  so that we can delete at PSA itself that particular record.
    Is there any solution to delete the Single Record in Delta Queue at R/3 -RSA
    Thanks & Regards
    Ashfaq

    >
    Ashfaq Shaik wrote:
    >
    > Record 166 :Contents <000000000.00000000 from field ZZVOLUME cannot be converted in type DEC     RSAR     197
    Sorry I didnot see this error before.
    I guess you didnot try error handling hence you get this error BW side.Try error handling first.
    If this doesn't work then you can go with above method.

  • Delta extraction(date) with Function module problem

    Hi All,
    FUNCTION zrsax_biw_get_data_pr_d.
    *"*"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  ZPR_ST 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: tadir.
    *DATA: BEGIN OF zpr_st_copy,
    *        banfn TYPE zpr_st-banfn,
    *        bnfpo TYPE zpr_st-bnfpo,
    *        zebkn TYPE zpr_st-zebkn,
    *        knttp TYPE zpr_st-knttp,
    *        vbeln TYPE zpr_st-vbeln,
    *        ps_psp_pnr TYPE zpr_st-ps_psp_pnr,
    *        gsber TYPE zpr_st-gsber,
    *        werks TYPE zpr_st-werks,
    *        statu TYPE zpr_st-statu,
    *        ekgrp TYPE zpr_st-ekgrp,
    *        menge TYPE zpr_st-menge,
    *        frgdt TYPE zpr_st-frgdt,
    *        meins TYPE zpr_st-meins,
    *         loekz TYPE zpr_st-loekz,
    *      END OF zpr_st_copy.
    * 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.
    * Select ranges
    *  RANGES: l_r_pgmid  FOR tadir-pgmid,
    *          l_r_object FOR tadir-object,
        RANGES: PRNO for zpr_st-banfn,
                DATE1 FOR zpr_st-frgdt.
    * 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 'ZPR_ST_DS_D' OR ''.
          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' OR ''.
          WHEN 'C'.
          WHEN 'R'.
          WHEN 'S'. " DELTA INITIALIZATION
          WHEN 'I'. "DELTA INITIALIZATION FOR NON CUMULATIVE
          WHEN 'D'. "DELTA
          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.
    BREAK-POINT.
    * Check for obligatory selection criteria
    *    READ TABLE i_t_select INTO l_s_select WITH KEY fieldnm = 'ZPR_ST-FRGDT'.
    *    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.
    * 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.
    *   Start tracing of extraction
    *    bice_trace_open g_r_tracer i_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 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 = 'PGMID'.
    *        MOVE-CORRESPONDING l_s_select TO l_r_pgmid.
    *        APPEND l_r_pgmid.
    *      ENDLOOP.
    *      LOOP AT g_t_select INTO l_s_select WHERE fieldnm = 'OBJECT'.
    *        MOVE-CORRESPONDING l_s_select TO l_r_object.
    *        APPEND l_r_object.
    *      ENDLOOP.
    LOOP AT g_t_select INTO l_s_select WHERE fieldnm = 'ZPR_ST-FRGDT'.
                MOVE-CORRESPONDING l_s_select to DATE1.
                DATE1-sign = 'I'.
                DATE1-option = 'GE'.
                clear DATE1-high.
                APPEND DATE1.
          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.
          l_maxsize = g_s_interface-maxsize.
          OPEN CURSOR WITH HOLD g_cursor FOR
    *      SELECT (g_t_fields) FROM tadir
    *                               WHERE pgmid  IN l_r_pgmid AND
    *                                     object IN l_r_object.    "#EC CI_GENBUFF
    *@ CODE FOR THE STRUCTURE TO FILL IN FROM EBAN AND EBKN@*
                SELECT a~banfn a~bnfpo k~zebkn a~knttp k~vbeln k~ps_psp_pnr k~gsber a~werks a~statu a~ekgrp a~menge a~menge a~frgdt a~meins
    * INTO CORRESPONDING FIELDS OF TABLE IT1
                FROM  eban AS a INNER JOIN ebkn AS k ON ( a~banfn = k~banfn AND a~bnfpo = k~bnfpo )
                WHERE a~banfn GE '2000000000' AND a~banfn LE '2999999999' and a~loekz eq ' ' and a~frgdt ge '20130401' and a~FRGKZ eq '2'.
    *BREAK-POINT.
        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.
    *      bice_trace_close g_r_tracer.
          RAISE no_more_data.
        ENDIF.
    *    bice_collect_table g_r_tracer e_t_data.
        g_counter_datapakid = g_counter_datapakid + 1.
      ENDIF.              "Initialization mode or data extraction ?
    ENDFUNCTION.
    in the above I_t_fields and I_T_select structures  are not getting data .....
    can any one pleasee let me know what mistake i hvae done with my code?
    and i m unbale to change data source value to F1 if i am trying to change my function module and extract structure are disappearing....
    i m not getting why it is happening .......
    thank you
    vijay

    Hi yasemin,
       I m bit confused here with the line below
                                     IF i_initflag = sbiwa_c_flag_on.(if we pass 'X' then it will enter loop and checks for F or D and then assigns values to I_T_SELECT and I_T_Fields structure)
          accordfing to my code i feel it will work for any one not both(F or D).
    one more doubt rsax_biw_get_data extraction method is F2 few of them are asking to change to F1.
    so tried running a code then in RSO2 extact structure and FM both dissapeared i did not get why it happened ?
    can you please let me know why it happend
    thanks
    vijay

  • Delta package not fetching all records from Delta queue in r/3

    Hello,
    I have loaded Goods Movement Data using 2LIS_03_BF datasource into my BI system.
    The Delta has been initialized and everyday the delta is being moved from r/3.
    I observed that when I execute my delta package not all delta records are fetched into PSA from r/3.
    For Ex: Before starting my delta package I checked in SMQ1 of my R/3 system and see that there are around 1000 records.On executing the delta package I see that the record count is reduced from 1000 to 400 in SMQ1.On executing the delta package again I get the remaining 400 records into my PSA.
    Shouldn't the delta package get all records from the queue on single execution??
    Is there some setting to define the nr of records to be loaded?
    I'm confused with this behaviour.Please help me understand this behaviour.
    Thank You.

    Hello,
          First thing: the data is not transferred from the SMQ1 queue, rather the data is transfered to BW from the RSA7 Delta queue. You need to check the number of records present in the RSA7 queue.
    Since SMQ1 is involved, i think you are using the unserialized V3 update method. In this method, when data is first written to the application tables, it is first transferred to the SMQ1 update queue,then via a job to the LBWQ extractor queue and then to the RSA7 delta queue. So the number of entries that you see in the SMQ1 queue are not the number of entries that have to be transferred to BW but rather the records that are waiting to be transferred to the extractor queue in LBWQ. Similarly, in LBWQ, the number of entries displayed here are not the no of entries that are going to be transferred to BW, they are the no of entries that will be transferred to the delta queue RSA7 when the next v3 update job runs.
    If you want to check the number of records that will be transferred to BW, select the datasource in rsa7 and then click on the display data entries button.
    Hope this helps.
    Regards.

  • No records in delta queue for 0CRM_SALES_ACT_1 & 0CRM_COMPLAINTS_I

    Hi all,
    we are linking a SAP CRM system 4.0 (patch level 10) with BW 7.0. We have initialized the delta extraction and everything was fine. Data was extracted and we can see the delta queue in RSA7 but no records are added. Users are creating new activities and nothing appears in the delta queue. We have other extractors delta capable which are working fine.
    The main difference is that these two extractors have been enhanced using the Badi CRM_BWA_MFLOW. When we check the extractor using transaction RSA6, records include the information we add in the Badi.
    We think the problem is in CRM because, it does not collect any delta data (queue is always empty). BW is capable to extract when initilitialization. We have tried the early delta initialization and the simple delta initialization.
    Any help will be appreciated.
    Thank you in advance.
    As an extension: we can't see the extractors in the qRFC monitor (trans. SMQ1). We can see there the ones which are working...

    Hi again,
    we finally solved the problem. The thing was that no BDOCS with type BUS_TRANS_MSG were not being generated when creating or modifying CRM activities. Theses datasources need the BDOCS to work. Transaction SMW3_00 had the flag "Do Not Send" set. We unmarked it and everything seems to work now.

  • No records - FM Delta queue

    Hi,
    I did setup all steps for 0PU_IS_PS_44 data extraction from R/3. In doing so I did Initialized Delta process, logged to R/3 RSA7 transaction code to check the queue. At the time of Init I got 300 records. Today I created new Info package to extract the Delta records.
    Here my problem is I could not see any Delta extraction to BW. In R/3 I could not see any records in the queue but where as in the RSA3 (Extract checker) the number of records are 324 meaning (324-300) 24 records were created from I did the Init and expected that records to appear in Delta Queue and also while Delta extraction to BW.
    Appreciate if one could help me any steps I am missing out or any suggestions to see additional records to extract via Delta.
    Thanks in advance.
    Best Regards,
    Murphy.

    Hi Bhanu,
    Thanks for your response at both places.
    I got resolved the FM data source delta extraction. Adam responded to my post stating the IMG setting required for the activating Delta Queue.
    I have the same issues with CO and FI data sources. Even the GL Account master data data source does not show the new/changed records/documents at Delta queue.
    Appreciate if you could help me in resolving the problem.
    Thanks.
    Murphy.

  • Zero records in Delta Queue for Non-LO Datasource

    Hi,
    I have a process chain which loads data daily and last loaded on 5th of this month which is a delta load to DSO, and then I have triggered process chain on 10th  and now the process chain got successful but delta is returning zero records. I have gone through the Delta queue monitor, in that the data source is showing 0. what could be the reason for this? The data source is a Generic data source built on View and it is not a LO data source and delta is on timestamp.
    Thanks,
    Karan.

    Hi lokesh.
    Repair Full delta option it wont distub existing deltas.....
    repair full delta put full update indicate request as repair request.
    Via the Scheduler menu we can indicate a request with full-update mode as Repair Full Request. This request can be updated into every data target even if the data target already contains data from an initialization run or delta for this Data Source/ source system combination, and has overlapping selection criteria.

  • Creating a delta against a custom Function Module datasource

    I currently created a datasource via RSO2 against a function module.  The function module uses the RSAX_BIW_GET_DATA_SIMPLE as a template and I molded this against the data that I need.  Full loads for this extractor work without any problems but I'm having issues with creating a delta load.  Is there someone that can create a list on how to createa delta against a function module.  I believe there is more to do this than just have RSO2 set up against a field.  How do I get the new records into RSA7?  Thanks for your help.
    Tim

    We are trying to create the same delta extract from r/3 against a custom z table to an infocube in BW. Were you able to do this successfully using the f RSVD_BW_GET_DELTA_DATA as a template and did u receive the code? If so, are you able to send your code?
    My function modules works and fetches the data normally but the info package when scheduled gives an error
    <b>Error message from the source system
    Diagnosis
    An error occurred in the source system.
    System response
    Caller 09 contains an error message.
    Further analysis:
    The error occurred in Service API .
    Refer to the error message.
    Procedure
    How you remove the error depends on the error message.
    Note
    If the source system is a Client Workstation, then it is possible that the file that you wanted to load was being edited at the time of the data request. Make sure that the file is in the specified directory, that it is not being processed at the moment, and restart the request.</b>
    You can send the code or procedure to my mail id
    [email protected]
    Thanks in advance,
    Best Regards,
    Vishal

  • Generic Delta enabled datasource with Functional Module

    Hi All,
    We have a requirement to create a Generic Data Source which will be having fields from the tables COEP, COBK & BKPF. Generic datasource should be delta enabled. We are planning to achive it by writing a Functional Module.
    No my question is can i use BWFI_AEDAT & BWOM2_TIMEST tables to make Generic Datasource delta enabled. If i can then please let me know how. If i can't then please let me know what should i do to make it delta enabled.
    Thanks & Kind REgards,
    Harman

    Hi,
    before looking in specifics on your question please have a look at
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30f1a423-02ae-2e10-bd85-bde64e61fe7b?QuickLink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70806d62-1c59-2e10-7597-91c114600d32?QuickLink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c062a3a8-f44c-2c10-ccb8-9b88fbdcb008?QuickLink=index&overridelayout=true
    And finally:
    http://help.sap.com/saphelp_nw70/helpdata/en/d0/4cc138944cfa06e10000000a11405a/content.htm
    Last link is talking about deltas from COEP table and one of the fields you are mentioning (which might mean something else than you expected)
    Hope this helped
    C.

  • Delta error in GE-Function Module

    Hi ,
    my GE-delta is based on UDATE ( chenged date) from CDHDR table.
    i created datasource in RS02 and i defined delta based in UDATE with upper limit 1 day and lower limit is '0'..
    i created FM based on RSAX_BIW_GEDATA_SIMPLE.
    for full load it working fine.
    i put some extra code for delta.
    it is not take any records...
    i dont know much ABAP.
    plz tell me where is wrong in my code for delta..
    code ...
    FUNCTION ZXBWMM_INV_POT_ID.
    ""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  ZVSAIPID OPTIONAL
    *"  EXCEPTIONS
    *"      NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
    Example: DataSource for table SFLIGHT
    TABLES: SFLIGHT.
    TABLES: EBAN , CDPOS , CDHDR , ZVSAPR.
      TYPES : BEGIN OF TY_OBJDATE ,
            OBJECTID TYPE CDHDR-OBJECTID,
            VALUE_NEW TYPE CDPOS-VALUE_NEW,
            VALUE_OLD TYPE CDPOS-VALUE_OLD,
            UDATE TYPE CDHDR-UDATE,
            MINBE TYPE MARC-MINBE,
            BSTMA TYPE MARC-BSTMA,
            WERKS TYPE MARC-WERKS,
            VERPR TYPE MBEW-VERPR,
            STPRS TYPE MBEW-STPRS,
            LBKUM TYPE MBEW-LBKUM,
            BUDAT TYPE MKPF-BUDAT,
            MBLNR TYPE MSEG-MBLNR,
            MENGE TYPE MSEG-MENGE,
            DMBTR TYPE MSEG-DMBTR,
            END OF TY_OBJDATE.
      data : int_cdhdr type table of cdhdr with header line,
           int_cdpos type table of cdpos with HEADER LINE,
           INT_OBJDATE TYPE TABLE OF TY_OBJDATE WITH HEADER LINE.
          int_marc type table of marc with header line.
    *DATA: int_pr1 TYPE TABLE OF ZVSAIPID WITH HEADER LINE.
      DATA : BEGIN OF INT_MATNR OCCURS 10,
             MAtnr like mara-matnr,
             end of int_matnr.
    DATA : BEGIN OF INT_MARC OCCURS 10,
             matnr like marc-matnr,
             MINBE like marC-mINBE,
             BSTMA LIKE Marc-bstma,
             WERKS LIKE MARC-WERKS,
             end of int_marc.
    DATA : BEGIN OF INT_MBEW OCCURS 10,
             MATNR LIKE MBEW-MATNR,
             VERPR LIKE MBEW-VERPR,
             STPRS LIKE MBEW-STPRS,
             LBKUM LIKE MBEW-LBKUM,
             end of int_MBEW.
    DATA : BEGIN OF INT_MKPF OCCURS 10,
             MBLNR LIKE MKPF-MBLNR,
             BUDAT LIKE MKPF-BUDAT,
             END OF INT_MKPF.
    DATA : BEGIN OF INT_MSEG OCCURS 10,
             MATNR LIKE MSEG-MATNR,
             MBLNR LIKE MSEG-MBLNR,
             MENGE LIKE MSEG-MENGE,
             DMBTR LIKE MSEG-DMBTR,
             END OF INT_MSEG.
    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_CARRID  FOR SFLIGHT-CARRID,
             L_R_CONNID  FOR SFLIGHT-CONNID.
      RANGES : ra_OBJECTID FOR E_T_DATA-OBJECTID.
              RA_UDATE FOR E_T_DATA-UDATE.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
      IF I_INITFLAG = SBIWA_C_FLAG_ON.
      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.
    Initialization: check input parameters
                    buffer input parameters
                    prepare data selection
    Check DataSource validity
        CASE I_DSOURCE.
          WHEN 'ZOI_MM_INVENTORY_IPID'.
          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.
      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.
    READ TABLE I_T_SELECT INTO L_S_SELECT
    WITH KEY FIELDNM = 'UDATE'.
        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.
        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 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
      LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT
      WHERE FIELDNM = 'UDATE'.
      ENDLOOP
        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 = 'CARRID'.
           MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.
           APPEND L_R_CARRID.
         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.
         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.
         IF L_S_SELECT-LOW = '' AND L_S_SELECT-HIGH = ''. "FULL or INIT
          OPEN CURSOR WITH HOLD S_CURSOR FOR
          select * from cdhdr where OBJECTCLAS = 'MATERIAL' AND TCODE = 'MM02'.
          ELSE. "DELTA
         OPEN CURSOR WITH HOLD G_CURSOR FOR
         select * from cdhdr where OBJECTCLAS = 'MATERIAL'
         AND TCODE = 'MM02'
         AND UDATE >= L_S_SELECT-LOW
         AND UDATE <= L_S_SELECT-HIGH.
         ENDIF.
         ENDIF.
       ENDIF.
        "First data package ?
        FETCH NEXT CURSOR S_CURSOR
              APPENDING  TABLE int_cdhdr
              PACKAGE SIZE S_S_IF-MAXSIZE.
       into table int_cdhdr
        IF SY-SUBRC <> 0.
          CLOSE CURSOR S_CURSOR.
          RAISE NO_MORE_DATA.
        ENDIF.
        SELECT * FROM CDPOS INTO TABLE INT_CDPOS
             FOR ALL ENTRIES IN INT_CDHDR
             WHERE OBJECTID = INT_CDHDR-OBJECTID
             AND TABNAME = 'MARC'
             AND ( FNAME =  'BSTMA' OR FNAME = 'MINBE' ).
        LOOP AT int_cdpos.
          int_matnr-matnr = int_cdpos-objectid.
          APPEND int_matnr.
        ENDLOOP.
        SELECT  matnr MINBE BSTMA WERKS FROM MARC INTO TABLE INT_marc
                FOR ALL ENTRIES IN int_matnr
               WHERE MATNR = INT_matnr-matnr.
        SELECT  matnr VERPR STPRS LBKUM FROM MBEW INTO TABLE INT_MBEW
                FOR ALL ENTRIES IN int_matnr
               WHERE MATNR = INT_matnr-matnr.
        SELECT  matnr MBLNR MENGE DMBTR FROM MSEG INTO TABLE INT_MSEG
                FOR ALL ENTRIES IN int_matnr
               WHERE MATNR = INT_matnr-matnr.
         LOOP AT int_MSEG.
          int_MKPF-MBLNR = int_MSEG-MBLNR.
          APPEND int_MKPF.
        ENDLOOP.
        SELECT  MBLNR BUDAT FROM MKPF INTO TABLE INT_MKPF
                FOR ALL ENTRIES IN int_MKPF
               WHERE MBLNR = INT_MKPF-MBLNR.
    *BREAK-POINT.
        LOOP AT INT_CDPOS.
          READ TABLE INT_CDHDR WITH KEY OBJECTID = INT_CDPOS-OBJECTID .
          IF SY-SUBRC = 0.
            INT_OBJDATE-OBJECTID = INT_CDPOS-OBJECTID.
            INT_OBJDATE-VALUE_NEW = INT_CDPOS-VALUE_NEW.
            INT_OBJDATE-VALUE_OLD = INT_CDPOS-VALUE_OLD.
            INT_OBJDATE-UDATE = INT_CDHDR-UDATE.
            READ TABLE INT_MARC WITH KEY MATNR = INT_CDPOS-OBJECTID .
            IF SY-SUBRC = 0.
              INT_OBJDATE-MINBE = INT_MARC-MINBE.
              INT_OBJDATE-BSTMA = INT_MARC-BSTMA.
              INT_OBJDATE-WERKS = INT_MARC-WERKS.
              ENDIF.
            READ TABLE INT_MBEW WITH KEY MATNR = INT_CDPOS-OBJECTID .
            IF SY-SUBRC = 0.
              INT_OBJDATE-VERPR = INT_MBEW-VERPR.
              INT_OBJDATE-STPRS = INT_MBEW-STPRS.
              INT_OBJDATE-LBKUM = INT_MBEW-LBKUM.
             ENDIF.
            READ TABLE INT_MSEG WITH KEY MATNR = INT_CDPOS-OBJECTID .
            IF SY-SUBRC = 0.
              INT_OBJDATE-MBLNR = INT_MSEG-MBLNR.
              INT_OBJDATE-MENGE = INT_MSEG-MENGE.
              INT_OBJDATE-DMBTR = INT_MSEG-DMBTR.
             ENDIF.
            READ TABLE INT_MKPF WITH KEY MBLNR = INT_MSEG-MBLNR .
            IF SY-SUBRC = 0.
              INT_OBJDATE-MBLNR = INT_MKPF-MBLNR.
              INT_OBJDATE-BUDAT = INT_MKPF-BUDAT.
             ENDIF.
            APPEND INT_OBJDATE.
          ENDIF.
        ENDLOOP.
    *SELECT * FROM EBAN
        INTO CORRESPONDING FIELDS OF TABLE INT_PR1
        FOR ALL ENTRIES IN INT_OBJDATE
        WHERE BAnfn = int_objdate-objectid.
    *ZZPRREL
        LOOP AT INT_OBJDATE.
          E_T_DATA-OBJECTID = INT_OBJDATE-OBJECTID.
          E_T_DATA-UDATE = INT_OBJDATE-UDATE.
          E_T_DATA-VALUE_NEW = INT_OBJDATE-VALUE_NEW.
          E_T_DATA-VALUE_OLD = INT_OBJDATE-VALUE_OLD.
          E_T_DATA-MINBE = INT_OBJDATE-MINBE.
          E_T_DATA-BSTMA = INT_OBJDATE-BSTMA.
          E_T_DATA-WERKS = INT_OBJDATE-WERKS.
          E_T_DATA-VERPR = INT_OBJDATE-VERPR.
          E_T_DATA-STPRS = INT_OBJDATE-STPRS.
          E_T_DATA-LBKUM = INT_OBJDATE-LBKUM.
          E_T_DATA-MBLNR = INT_OBJDATE-MBLNR.
          E_T_DATA-MENGE = INT_OBJDATE-MENGE.
          E_T_DATA-DMBTR = INT_OBJDATE-DMBTR.
          E_T_DATA-BUDAT = INT_OBJDATE-BUDAT.
          APPEND E_T_DATA.
          CLEAR  E_T_DATA.
        ENDLOOP.
    Fetch records into interface table.
      named E_T_'Name of extract structure'.
        S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
      ENDIF.              "Initialization mode or data extraction ?
    ENDFUNCTION.
    i assign points....
    Regards,
    PSR.

    Hi ,
    i am not find any sollution for this..
    any body help me for this problum...
    i assign points..
    Regards,
    PSR

  • How to catch Delta Initialization and Delta Update in a Function Module

    Hi Experts:
    I'm developing a FM to extract data from R3. I wonder if anybody knows how to catch when i'm making a delta initialization and a delta update in my FM, because i have different parameters and routines from each one.
    Thanks in advanced.
    Points for helpfull answers.

    Hi,
    Keep one dummy date field in the structure. Make this dummy date field as delta enabled field. When you do Init load this date field value will be blank and next time when you do load it will have the last upload (in this case init load) date. You have to write a code before open cursor as below:
          LOOP AT s_s_if-t_select INTO l_s_select.
                                  WHERE fieldnm = '(dummy date field name)'.
             l_date = l_s_select-low.
          ENDLOOP.
    l_date will have the last upload date. This you can use to select the delta records from the table or for the further processing.
    If you want to check the value during Init or delta load, go to RSA3 and debug it(Don't use F - Full load. Use I or D in the update field).
    Hope this helps.
    PB

  • Issue in loading XML data in BW delta queue

    Hello All,
    My requirement is to stage small amount of XML data in SAP BW. For doing so, i have followed below steps...
    1. Create File data source
    2. Define Myself data source using file data source with Function module
    3. Initialize load process without no data transfer
    4. Using SOAP RFC service, Load xml records in delta queue.
    Now in step number 4, i am unable to open the SOAP RFC service using which we can select the xml file.
    Any help in this regard will be highly appriciated.
    Thanks
    Ketan

    SOAP/RFC service is already activated. Only problem i am facing is as below.......
    1. Created HTML page by copying html snipest
    2. On created HTML page, select XML file as an input and URL of SOAP service which is pointing out to the application server
    3. When i press "Send recordset" button, HTML page throws "Java script" error and data is not being pushed to BW delta queue....
    Please share your ideas to resolve this issue.
    Thanks in advance,
    Ketan

  • Error in loading XML data in BW delta queue

    Hi All
    My requirement is to stage small amount of XML data in SAP BW 3.5. For doing so, i have followed the steps specified in How to send XML data to BW
    Link for "How to send XML data to BW"
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/21d8aa90-0201-0010-5e83-a3798b9a5ee0
    1. Created File data source
    2. Defined data source using file data source with Function module
    3. Initialize load process without no data transfer
    4. Using SOAP RFC service, Load xml records in delta queue.
    Now in step number 4, i have created the following
    1. Created the html code
    2. On created HTML page, select .CSV file as an input and URL of SOAP service which is pointing out to the application server
    3. When i press "XML Send recordset" button, HTML page throws "Java script" error and data is not being pushed to BW delta queue
    Any help in this regard will be highly appreciated.
    Thanks
    Yeshwant

    Hi All
    My requirement is to stage small amount of XML data in SAP BW 3.5. For doing so, i have followed the steps specified in How to send XML data to BW
    Link for "How to send XML data to BW"
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/21d8aa90-0201-0010-5e83-a3798b9a5ee0
    1. Created File data source
    2. Defined data source using file data source with Function module
    3. Initialize load process without no data transfer
    4. Using SOAP RFC service, Load xml records in delta queue.
    Now in step number 4, i have created the following
    1. Created the html code
    2. On created HTML page, select .CSV file as an input and URL of SOAP service which is pointing out to the application server
    3. When i press "XML Send recordset" button, HTML page throws "Java script" error and data is not being pushed to BW delta queue
    Any help in this regard will be highly appreciated.
    Thanks
    Yeshwant

Maybe you are looking for

  • Major in Mac rebate denied... why?!?!

    I bought a Mac Pro on the online Apple Store right when it came out. At checkout, I was given the option to buy an iPod, as it said that my purchase qualified me to get $179 rebate on this item. I filled in the information, got the computer, sent in

  • Cluster mgmt of off-network (multihomed) addresses

    I'm currently in the process of configuring an HA cluster to replace a single machine. The original machine had virtual interfaces plumbed for several different networks, which remote sites connect to for FTP and other data. I'd like to know how to d

  • Is my bit rate too high?!

    I'm new to DVDSP but thought I'd figured it out. I'm burning a 30 minute film, with 13 chapters, to HD-DVD. The simulation works fine, and the build and format seems to go through fine, but the resulting dvd works only on my computer (that I burnt it

  • HOW DO I DELETE PROGRAMS RUNNING IN THE BACKGROUND OF MY IPHONE WITH SOFTWARE IOS7

    How do I delete programs running in the background now that I have upgraded my software to IOS7?

  • Saving tunes on my ipod

    I am downloading a great number of CDs to my ipod Classic. When I am about a quarter of the way through recording this pile my computer says its free space is limited How do I keep the tunes recorded on the ipod when I clear the used space and create