Pushing data in packets from Function Module to BW

Hi All,
I have been struggling with a problem for about a week and a half and I find myself at an in-pass. I firstly created a function module to pull data from SAP and join multiple tables so I could use it to report in Crystal. The problem was that it was so much data that I received errors due to processing time.
Thus to solve this problem I now use the function module to push data into a datasource so that it executes in the background.
The main problem I am experiencing is how to code a function module so that it will retrieve the data in segments then commit then retrieve next segment. At the moment the program works but if the data increases like it should I will run into the no more space in the internal table error.
Example of my code below. (much simplified to just demonstrate functionality). Sorry that it is still long but didn't  want to leave out parts that might be important.
So how would one get the data to retrieve from the SAP tables and commit to BW in segments instead of like I do to retrieve all the data then pump into BW in segments.
FUNCTION ZBOBJ_COMMISSION.
*"  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  ZDGB_COMMISION_REPORT OPTIONAL
*"  EXCEPTIONS
*"      NO_MORE_DATA
*"      ERROR_PASSED_TO_MESS_HANDLER
  STATICS : counter type i.
** Example: DataSource for table SFLIGHT
  TABLES: ZDGB_COMMISION_REPORT.
** 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.
** Initialization mode (first call by SAPI) or data transfer mode
** (following calls) ?
  IF I_INITFLAG = SBIWA_C_FLAG_ON.
** Check DataSource validity
    CASE I_DSOURCE.
      WHEN 'ZBOBJ_COMMISSION'.
      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.
    APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.
  ELSE.                 "Initialization mode or data extraction ?
    STATICS: st_itab TYPE ZDGB_COMMISION_REPORT OCCURS 0 WITH HEADER LINE.
    IF S_COUNTER_DATAPAKID = 0.
ORIGINAL - DIRECT CUSTOMER**********************************************************
      Select
             VBPA~KUNNR
            VBRK~VBTYP
            INTO CORRESPONDING FIELDS OF TABLE itab1
              FROM
                VBRK
                INNER JOIN VBRP ON VBRK~VBELN = VBRP~VBELN
                INNER JOIN MARA ON VBRP~MATNR = MARA~MATNR
                INNER JOIN ZCUWE ON ZCUWE~BOT_MAN = MARA~ZZBOTTMANU
                INNER JOIN VBPA ON VBPA~VBELN = VBRP~AUBEL
              WHERE              VBPA~PARVW in s_parvw.
      SORT ITAB1 BY KUNNR.     
      LOOP AT itab2.
        st_itab-BUKRS = itab2-BUKRS.
      ENDLOOP.
    endif.
    INSERT LINES OF st_itab TO S_S_IF-MAXSIZE INTO TABLE e_t_data.
    DELETE st_itab TO S_S_IF-MAXSIZE.
      IF lines( st_itab ) IS INITIAL.
        counter = counter + 1.
        if counter = 2.
          RAISE NO_MORE_DATA.
        endif.
      ENDIF.
          S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
  ENDIF.       
ENDFUNCTION.

I'm not sure, but I think there's something wrong with your select instruction
      Select
             VBPA~KUNNR
            VBRK~VBTYP
            INTO CORRESPONDING FIELDS OF TABLE itab1
              FROM
                VBRK
                INNER JOIN VBRP ON VBRKVBELN = VBRPVBELN
                INNER JOIN MARA ON VBRPMATNR = MARAMATNR
                INNER JOIN ZCUWE ON ZCUWEBOT_MAN = MARAZZBOTTMANU
                INNER JOIN VBPA ON VBPAVBELN = VBRPAUBEL
              WHERE              VBPA~PARVW in s_parvw.
You're making a join within vbrk vbrp mara zcuwe and vbpa using a non-key field such vbpa-parvw. Are you sure we're talking about an over-size problem?
You should separate INNER JOIN, using FOR ALL ENTRIES instruction, with range datas.

Similar Messages

  • How to get data from function module in crystal report

    Hi,
    I installed Crystal Reports 2008 and BO SAP Integration kit for CR.
    I connected successfully to SAP system from CR but unable to get the data into Report ...
    But data is present in function module.
    Could you please tell me what may be the reason ...!!
    Thanks
    Raghavendra

    Hi,
    I connected successfully to SAP system from CR but unable to get the data into Report with all the Input parameters and data is present in function module.
    Note: - If we take Start date as input parameter in Crystal report data is coming for single parameter, whereas we take input parameters like Partner function, Region and Customer - we are not getting data. (These fields we created parameters in Crystal report)
    In Function Module IMPORT Parameters are below mentioned and Export parameter is Blank
                                                                                    Start Date (Mandatory field)
                                                                                    Partner Function (Mandatory)
                                                                                    Region
                                                                                    Customer
    Please let us know if required any information.
    Regards,
    Raghavendra

  • R/3 Master Data Extraction from Function Module

    Hi Experts,
       I need to extract R/3 Master Data (Attr & Text) using function Module.
      It is already developed and in Live system,I need to extract Master Data for 3 more attributes.
      Could you please specify detailed steps on how to proceed wit this once i made changes to Function Module (ABAP Code),Extract Structure...how shall i proceed once this is done.
    Thanks

    Hi,
    Check the following,
    http://help.sap.com/bp_biv235/BI_EN/html/bw.htm
    business content
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/g-i/how%20to%20co-pa%20extraction%203.0x
    https://websmp203.sap-ag.de/co
    http://help.sap.com/saphelp_nw04/helpdata/en/37/5fb13cd0500255e10000000a114084/frameset.htm
    (navigate with expand left nodes)
    also co-pa
    http://help.sap.com/saphelp_nw04/helpdata/en/53/c1143c26b8bc00e10000000a114084/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/fb07ab90-0201-0010-c489-d527d39cc0c6
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1910ab90-0201-0010-eea3-c4ac84080806
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ff61152b-0301-0010-849f-839fec3771f3
    FI-CO 'Data Extraction -Line Item Level-FI-CO'
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a7f2f294-0501-0010-11bb-80e0d67c3e4a
    FI-GL
    http://help.sap.com/saphelp_nw04/helpdata/en/c9/fe943b2bcbd11ee10000000a114084/frameset.htm
    http://help.sap.com/saphelp_470/helpdata/en/e1/8e51341a06084de10000009b38f83b/frameset.htm
    http://www.sapgenie.com/sapfunc/fi.htm
    FI-SL
    http://help.sap.com/saphelp_nw2004s/helpdata/en/28/5ccfbb45b01140a3b59298c267604f/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/41/65be27836d300ae10000000a114b54/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ee/cd143c5db89b00e10000000a114084/frameset.htm
    Please reward for the same.

  • How to create webservice from function module

    Hello,
    I'm trying to create webservice from function module from. I choose Utilities/More Utilities/Create Webservice/..From function Module. What data should I enter in section "Enter Package/Request" ?
    When I check "Local object" checkbox I get a message "Test objects cannot be created in foreign namespaces"
    Is there any doc about this procedure (web service creation) with description of all sections ?
    thanks for any reply,
    Lukasz Ferenc

    Hi,
    Which SAP product of wich release of which SP are you using ?
    The procedure is documented in help.sap.com and in blogs and SDN forum messages.
    It means that the use of the SEARCH button should give plenty of answers...
    >When I check "Local object" checkbox I get a message "Test objects cannot be created in foreign >namespaces"
    As usual, begin your choosen name with an "Z".
    Regards,
    Olivier

  • Calling a report from function module

    Hi Friends,
    I have requirement for Function Module i.e. we will add the button to the standard T-code and ( Function added in config ) then
    Function to be called from Customizing
    Program A called from customizing function
    CalculationPDFFunction  is called from program A.
    So can any one help me the logic for "calling a report from function module  ".
    Thanks in Advance.
    Regards,
    OSReddy.
    Edited by: OSReddy on Sep 23, 2011 7:31 AM

    Hi Jaya,
    Yes. It is possible to call ur custom program using SUBMIT statement.
    1. If u have data to pass then build table type RSPARAMS and use below statement.
    data:
          rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab,
    SUBMIT report1 WITH SELECTION-TABLE rspar_tab
                   AND RETURN.
    1. If u want to create variant to the program and use that. use the below statement .
    SUBMIT report1 USING SELECTION-SET 'VAR1' "variant
                   AND RETURN.
    Regards,
    Venkat.O

  • How to create a generic datasource from function module?

    Dear experts,
    I have created a generic datasource from function module. For this extrator, I created a function module and a structure.
    I have now some difficulties to continue:
    In this function module, i get data from different transparent tables. Then i put these data into an internal table.
    I just don't know what is the relatioin between the structure i defined and this internal table.
    I should make "iTab structure AA" in the source code?
    Thanks

    Hi..
    check this
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
    Generic Extraction via Function Module
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    1. Create s structure with the fields that you need from the 4 tables . Activate.
    2. Goto SE 80 Select The Function Group , Copy , Select the Function module
    " RSAX_BIW_GET_DATA_SIMPLE " and Give a New name starting With
    Y or Z .
    3. SE37 ->Your Function module name -> Change , In table tab give your structure
    name by deleting the associated type given in " XXXX " .
    4. Now select source code and Do the coding . Give Data source name in Coding .
    In your case you have to take data from more that 1 table .
    5. Activate the Function Group .
    6. In RSO2 Create the Data source , Give the Function Module Name , And Save.
    7. RSA3 -> Give data source name and Check for the Records .
    Creation of custom datasource. (Using function module)
    .Create a function group .
    . Structure ZTXXXX
    Create function module (i.e. ZTESTXXX) .
    . Create the data source using transaction (RSO2).
    . If structure exists for the table parameter of your function module then ok else create a structure for the table parameter ‘        ’.
    Test the datasource in R/3 using transaction RSA3.
    Transfer the data source to BW –System and replicate it in the BW-System.
    Message was edited by:
            shiv

  • Problem with R/3 Data Source based on Function module in SAP BI

    Hi,
    We have a data source based on functional module. When we load data from R/3 to BI we face the following error.
    " No end-confirmation arrived in the Warehouse from the source system."
    We are getting data but due to no end confirmation from the source system, the load become timed-out and status becomes "RED". When we change the status to be "GREEN" and proceed tha load further, load is fine.
    Please suggest us a suitable solution.
    Thanks in Advance,
    Geetha

    Hi Geetha Devi Ramalingam.
    I faced the same problem since yesterday. I just resolve the issue.
    So here is my solution :
    try this code :
        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.
    if you add your
    bold
    IF sy-subrc <> 0.
          CLOSE CURSOR s_cursor.
          RAISE no_more_data.
        ENDIF.
    bold
    than the sy-subrc may be equal and than your CLOSE CURSOR s_cursor. will have no effect
    it work for me hope it will for u
    Hard luck!
    Salah
    Edited by: idrissi salaheddine on Jan 19, 2012 12:24 PM

  • Urgent: Web Service from Function Module

    Hi guys, I am new to this area so please help to achieve following:
    I want to show a demo to load data from a web service to BI. I have performed the following steps and don’t know how to process further. Please help me in the sense where do I put the logic to show fields on the web service and ….
    1. I have created a web service data source in BI with four fields (Cal dat, material, amount and currency)
    2. This created a Web Service /RFC FM automatically.
    3. From this FM I created a web service (Utilities – create web service – from function module)
    4. I followed the web service creation wizard.
    Thanks,
    sam

    releasing and related steps are fine,
    what i want to know is, BW/BI datasource will create a FM, from this FM inturn I will create a webservice.
    Lets say BW/BI datasource has 4 fields account, company, amount & currency.
    I want to enter these 4 values from the webservice which will bring these values to BW delta queue and eventually get loaded in BW.
    For this process do I need to code anything in the FM or any other part of the system

  • Provide Asynchornous Webservice from Function Module

    Hi!
    I need to create a webservice to provide master data. My scenario do not use Process Integration, so I create the webservice from function module (Remote-Enable Module) through SE80.
    When service is created I can see in the configuration tag that is not possible to change to asynchronous mode.
    I want to create asynchronous webservice because I need to return master data. Selecting this data consume a lot of time, so in order to avoid timeouts I think is better to create asynchronous webservice.
    May be I am wrong but I think is not possible to create async webservice without PI.
    All documents I have read until now show async comunication through PI and using proxy clients but I have not found the case I am talking.
    Thanks
    Reagards
    Edited by: jordis on Mar 17, 2011 4:45 PM

    Thanks Raja,
    I think I'm confusing about synchronous / asynchronous concept in webservices. I need an example or an explanation where I can understand it. Taking account that I do not have PI, where scenario I'm moving in?
    I mean, is it possible that an external client calls my webservice created through FM in async mode? Maybe is the client who has to create the corresponding call to the webservice in async mode and I have to do anything.
    Another question related, what does it means the propierty sync/async in a proxy?
    I do not understand your sugestion since I think that proxy creaton is relevant in case of the connecting SAP with an external system (I tried it and I have to inform an URL o WSDL).
    All documents I have readed have been in the context of PI and I think my case is more simply.
    Any more suggestions, links or ideas?
    Thanks
    Regards
    Edited by: jordis on Mar 18, 2011 12:41 PM

  • Date of creation of function module

    Hi Guys,
    is there any possibility to find out the date of creation of a function module.
    For programs, it can be found in the table TRDIR. But I cant find any table for function modules.
    Erik

    TFDIR will give you the name of the function group program and the include number.
    E.g. SAPLZFUNCGROUP Include 01.
    From this you can construct the include name: LZFUNCGROUPU01.
    You can look this up in TRDIR to find the creation date (CDAT) of the function module.
    matt

  • Who worked with ICS' Model 4896 GPIB? I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.

    I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.

    Hello. Most of the engineers in developer exchange are more familiar
    with NI products. Contacting ICS for technical support is a better
    course of action.

  • Proxy creation/ access key in the how to guide "push data into BW from XI"

    Hi !
    I'm experiencing troubles with a step of the how to guide "push Data into BW from XI".
    When i want to create the proxy in the BW system (step 10), i'm asked for an access key for the object R3TR CLAS CL_<name of the prefix>_<name of message interface>
    I think that access keys are needed when an object has to be modified. Do I really have to modify this SAP object ? I don't really feel like destroying the whole system...
    Thanks in advance !

    Hi Benjamin,
    you are not destroying anything in the system. Since you generating a class for the implementation of the proxy within the SAP name space, you are asked for the access key (you can register developers and objects via the OSS).
    The system behavior depends on the setting of the system, whether changes are are recorded, etc..
    Ask your basis administrator, who should be able to assist you.
       Cheers
          Andreas

  • Can we change WSDL file created from Function Module wizard??

    Hi everybody!
    I have created a web service from function module using SAP wizard.
    Now the consumer side want me to change <wsp:UsingPolicy wsdl:required="true"/>
    Is this possible???
    If so how?????
    Thank u in advance!!

    Hi Muhammad!
    As soon as you open WSDL for selected binding in the URL are of you explorer change the ws_policy with "standard" . Then simply save the wsdl and send it to the other party.
    Hope this helps!

  • Generic data extractor using a function module

    Hi All,
    I want to create a generic data extractor using a function module within the BW system. i.e. the extractor will run in BW and and store the data in a cube( in BW). No R/3 is invloved. I proceeded as follows:
    1. Created a structure through se11.
    2. Created a function module. But while defining "E_T_DATA" in the "Tables" section of the function module, I am getting the error "TABLES parameters are obsolete". I defined as follows:
    E_T_DATA TYPE ZBW_EXTRACT 
    ZBW_EXTRACT is the name of the structure.
    What should i do in this case ?
    Thanks,
    Satya

    Hello Satya,
    The message "TABLES parameters are obsolete" is just a warning and not an error. The structure of the interface is strict (defined by SAP). You should opt to proceed even if you receive the warning.
    Hope this clarifies.

  • Creating Spool from function module

    Hi friends,
    I want to create a spool from my function module. I dont knw it is possible or not. Currently I am creating spool by submitting another report from my function module and exporting the values calculated in memory ID and importing in report which is not  a good practise, kindly suggest some other way.
    Thanks,
    Brijesh

    No. Spool is not possible from Function Module. You have to use that FM from one report/program.
    Thanks
    Subhankar

Maybe you are looking for

  • Setting attributes of declarative components in an application

    As far as I understand, the attributes of declarative component (DC) can be set in such way: UIXDeclarativeComponent  component = ... /* obtain component instance, no matter how */ component.getAttributes().put("<attribute name>", <attribute value>);

  • Custom Pipeline Component stopped changing input filename

    Hi In my project, I have a custom pipeline component to change the input file name. I use it in the receive pipeline decode stage. It was working initially when I had only a receive pipeline and custom pipeline component in my solution. later I intro

  • Reporting transactions

    Hi, Are there any standard transactions for the following avbl? 1. Functionality to generate a report which has Order submission date, order received date, item #, NDC#, UPC#, cost price, retail price, qty received, short qty, over qty, damage qty an

  • Custom Function in a Sequence Not Working

    Hi All, We have defined a Custom Function and it has got a class (ZCL_IP_DERIVE_XXX_XXXX). Further, in the IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~EXECUTE method of this class, we have defined a logic of appying a new Index (Sales Curve) and the forecast valu

  • Using CS2 and ACR simultaneously

    I am running Windows XP with Photoshop CS2 with ACR 3.7. I am saving multiple RAW files as a batch process with the ACR window. I've seen that others are able to run batches in the ACR window and still be able to do other things in Photoshop. Yes, I'