Function Module Extractor with Internal Table

Hi All,
I have a need to extract records from a complex SQL Statements, so I will be using different SQL Statements and merging the results in to a single internal table. In the function modules what will happen if I do not use cursor WITH HOLD option, (I know it maintains the cursor position) and what if I directly load into E_T_DATA  from my internal table. How this will affect the datapackage size?
In the future I will have records beyond 1 million and I am concerned to send all the 1 million record in one package rather than multiple packages during extraction.
Please give a solution if you have come acroos this kind of situation with your development.
Thanks,
Alex.

Alex,
I do not see why the complexity of ABAP statements should make you change the data processing logic proposed by SAP by way of the sample Function module.  
It appears to me that you are changing something knowing fully well its implications and then trying to find a solution for it.
Good Luck!
Mathew.

Similar Messages

  • Function Module to Download Internal table in EXCEL

    Hi All,
    I need a Function Module to download the Internal table to Excel File.
    I Have used SAP_CONVERT_TO_XLS_FORMAT,
    but this function modules are using GUI_Download indirectly.
    I dont want to use GUI_DOWNLOAD as i am going to call this Function Module in Portal.
    So pls anybody has this type of function module.
    Thanks & Regards,
    Dhruv Shah

    Hello Dhruv.
    In Agreement with Deniz.
    It is required to Export the query as an excel file.
    [SAP HELP Library - Standard Reference - Exporting as a CSV File / MS Excel 2000 File|http://help.sap.com/saphelp_nw04/helpdata/en/d2/11a28fc26d4042a6d230a9783152f2/content.htm]
    [SDN - Reference - Error in "Export to Microsoft Excel" from Portal|Error in "Export to Microsoft Excel" from Portal;
    Hope this works out well.
    Good Luck & Regards.
    Harsh Dave

  • Function Module Extractor with Delta

    I'm very new to working with the BW, so I hope I'm explaining my question in a way that makes sense.
    I need to make a BW extractor that pulls data from at least one table, possibly more, and which also calculates some data.
    I think the only way I can do that is by using an extractor with a function module.
    I've been looking at the examples in function group RSAX, and I think I sort of get it, except for one part.
    I'm really confused about how the delta works.
    I'm looking at the example: RSAX_BIW_GET_DATA_SIMPLE
    Does it even use a delta?
    I'm trying to understand how the delta gets passed, and how it gets used to filter the data in the function module.  I'm not sure if it's something I need to code in myself, or if it's something that BW does by itself, or what.
    I'm not sure if I'm making sense, but if anyone could help me, I'd appreciate it.

    Thanks guys, you've been super helpful so far, so I'm just going to keep asking questions.  I promise to award points at the end
    I'm looking at it now, and I think if I change it to read from a table, instead of read from a function module I can use the 'numeric pointer' option for the delta.  (Does that just mean a number?  For example, payroll runid is a number, so I could use that and only get new payroll runs?)
    However, there still are some calculated fields they want.  Someone mentioned doing that on the BW side.  How would that work?
    Sorry for such vague questions, but any help is really appreciated.

  • Function module for move internal table records into MSexcel file

    Hi all,
    Tell me the function module which is used to
    move internal table records in to MSexcel file.
    Give the sample program...

    Please search the forum for FM  "GUI_DOWNLOAD" You will get tons of threads with sample code.
    Also take a look into SAP_CONVERT_TO_XLS_FORMAT
    Thanks

  • Function Module Extractor with Delta Functionality

    Hi Friends,
         I have to extract the entire data of CDPOS table in R/3 , as its a cluster table I am unable to build a view, I am planning to go for FM extraction, Could someone help me as how to build it with Delta Functionality.
    I think I need to develop the Datasource, with Extract Structure,( Do I need to create a Structure in SE11)  Please help me out .
    Thanks,
    Krish

    Hi,
    you can either use an existing structure or else create one on your own. (SE11).
    The DeltaHandlig fairly easy.
    When having finished the extractor (FunctionModule, Structur and DatasSource), go to the "generic Delta" button and select the relevant field.
    The Generic Delta and its DeltaPointer is managed within the DeltaQueue (RSA7) and works more or less like a selection. Don't think too hard about it in your function module except taht you need to select by this field in your FM.
    Did that come clear?
    hth
    Cheers
    Sven

  • Table or Function module to get Internal order planning and Cost element pl

    Dear All,
    Table or Function module to get Internal order planning and Cost element planning.
    Internal order planning from T-code KO13.
    Thanks in advance.
    Regards,
    Ravi
    Edited by: Ravi Chandra on Sep 13, 2011 8:08 AM

    BPEJ, BPEG, BPEP

  • Function Module extractor extracting as a Single Package?

    Hi All,
    I have created a generic function module extractor, which works fine, but extracts all the records in a single package. The default is set in SBIW as 50000 records. But right now I have only 2500 records. But I changed the packet size to 100 in my info package setting and also specified as 100 with in the function module.
    But still I get all the data come as a single package of 2500. I want to make sure that this extractor will not create any problem in production, so I want to test the data packet size. Any suggestion. I have used he standard function module DATASIMPLE and I do setup I_MAXSIZE as 100 in the IMPORT parameter in the function and hav ethe following code in the function module...
             APPEND mgremp_stru to E_T_DATA.
              mseq = mseq + 1.
              if mseq = 100.
                 G_COUNTER_DATAPAKID = G_COUNTER_DATAPAKID + 1.
                 mseq = 0.
              endif.
        endloop.
        IF SY-SUBRC <> 0.
           RAISE NO_MORE_DATA.
        ENDIF.
        S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
    Any Suggestions?
    Thx,
    Alex.

    Ramesh,
    The simple truth is that what ever you define as a data structure for E_T_DATA should be exactly matching to your selections in the CUSOR. My scenario is way too trichy not just because too many sqls, but because of the nature of HR Tables. Same field will have two different values such as in one record SOBID refers to Org Unit, in the next record the same is Person and in the next record it is Position. So I should have the same field 3 times in a single record. But it is not possible. SO what I did was found 3 different fields whose length and type are same as what I need and selected them but inside my function module I manipulated with internal tables. So the extractor thinks I declare cursor for the same fields I defined in the data source (the value you use in E_T_DATA) and extract them in the FETCH. In the fetch all it checks internally is that whether the only the CURSOR selected fields are extracted , because you will update the E_T_DATA. I know this is little more than what I explained here, but this is the concept.
    I am planning to have a weblog or a white paper published on this in a week or two.
    If this idea helps assign points.
    Goodluck,
    Alex.

  • Function Module: how to setting table import parameter

    hi, i'm developing a function module. i create a TABLES where it will allow multiple variables  IMPORT from user input to this function module. the tables i set as OPTIONAL and decribed as below.
    PSPID     PS_PSPID     CHAR     24
    POSID     PS_POSID     CHAR     24
    AUFNR     AUFNR     CHAR     12
    PSY     J_STATUS     CHAR     5
    PUS     J_STATUS     CHAR     5
    in my source code, i done a select statement to process the IMPORT input . the problems i face,for the PSY and PUS  input,  if the one or both input is BLANK, NO RESULT will display. What i'm try to do , if input one or both  is BLANK, it wil neglect the input and return as ALL RESULT (return result oir all status for input pspis / posid / aufnr)  . attached the select statement. thank you
    itparm[] = objparm[].
    select
        a~pspnr a~stspr a~objnr a~pspid
        b~psphi b~objnr as wobjnr b~posid
        c~aufnr c~objnr as nobjnr c~pspel
        d~objnr as jeobjnr d~inact d~stat
        e~objnr as jcobjnr e~udate e~usnam e~utime e~stat as jcstat e~inact as jcinact
        f~istat as syistat
        f~txt04 as sytxt04
        f~spras
        g~estat as usestat
        g~txt04 as ustxt04
        into corresponding fields of table itobj
        from proj as a
        inner join prps as b on a~pspnr = b~psphi
        inner join aufk as c on b~pspnr = c~pspel
        inner join jest as d on c~objnr = d~objnr
        inner join jcds as e on d~objnr = e~objnr
                             and d~stat = e~stat
        inner join tj02t as f on e~stat = f~istat
        inner join tj30t as g on a~stspr = g~stsma
        for all entries in itparm
        where ( a~pspid = itparm-pspid
        or b~posid = itparm-posid
        or c~aufnr = itparm-aufnr )
       and ( f~istat = itparm-PSY and g~estat = itparm-PUS ).

    Thanks for your quick reply. actually the data will be somehing like this. since i developed a function module, i keep the import parameter in a table.
    PSPID     PS_PSPID     CHAR     24
    POSID     PS_POSID     CHAR     24
    AUFNR     AUFNR         CHAR     12
    PSY       J_STATUS     CHAR     5
    PUS      J_STATUS     CHAR     5
    the example data will be in OTPARM internal table
    PSPID              POSID          AUFNR     PSY     PUS
    aa-aa-aa         a1                                  I001
    bb-bb-bb                              b1                        E009
    cc-cc-cc
    i'll store  this into an internal table. from the data. it can be seen there a BLANK input. so the blank input should not be included into WHERE connditions. that why in the previous solution, i use SELECT inside LOOP because every line of the IMPORT tables will be generated with different WHERE conditions. i tried to do something like this:
    PSPID         POSID     AUFNR     PSY     PUS        cond_syx
    aa-aa-aa     a1                           I001                  if proj~pspid = itparm-pspid and prps~posid = itparm~posid and ....
    bb-bb-bb                   b1                         E009     if proj~pspid = itparm-pspid and aufk~aufnr = itparm~paufnr and ....
    cc-cc-cc                                                             if proj~pspid = itparm-pspid
    and implement with FOR ALL ENTERIES, but at the WHERE conditions i failed to put the CONF_SYX. please comment and give opinions. Thanks you very much.

  • How to Function module extractor

    Can anybody give me a step by step procedure to do a function module extractor ?
    Like the steps that I need to perform even before i start writing my code
    Thanks
    Shruti

    Dear Shruthi,
    Do a Search in SDN .you get lot of threads for FM Extraction ...
    The easiest way to work out with Function Module is to copy the standard one and modify according to your reqirement.
    The standard one is RSAX_BIW_GET_DATA_SIMPLE .
    Dont forget to copy the Function grp RSAX into a custom defined Grp and Modify the Ranges options as per ur req.
    and in Function module, in Sourcecode and Tables, Do modify the E_T_data with ur Generic datasource ,make sure u also modify the select statements within the sourcecode. If you have an idea on ABAP its really easy to work out.
    And regarding the creation of Datasource.
    Its really Simple.
    Goto RSo2.
    Give the name of Datasource.
    Give the Fm name and Extract Struc ( name of D.S only).
    Save and Generate.
    thats it.
    Dont forget to assign points.Its a way of saying thanks.
    Thanks,
    Krishna

  • Function Module in a Generic Function Module Extractor

    I want to use a generic function module (ZFM_CONNECTION_DETAIL) in a Generic Function Module based Extractor.
    After Creating, I have checked it in RSA3... Data is showing properly on the Extractor Check.
    And replicated on BW side, after triggering the extractor using infopackageu2026 only one record is coming on the target side (BW).
    And one job is running endless on the source system.
    Generic extractor on the normal code is working properly on both sides.
    But problem occurs while I was using Function Module in the Generic function Module extractor.
    Waiting for a Reply with solution...........
    Hi Siegfried Szameitat,
    I have searched a lot to find out the solution of my Question (Problem). But there is no solution for the problem I have.
    Please let me to find out a proper solution of my issue....
    Thanks

    FUNCTION zcrm_questionnaire.
    Its a full Load...
    Codes are as followed..........
      DATA:lv_times     TYPE i.
      DATA:lv_datapakid TYPE numc4.
      CLEAR:lv_datapakid,lv_times .
      STATICS: s_s_if TYPE srsc_s_if_simple,
               sd_no_more_data  TYPE flag.
      DATA: l_s_select TYPE srsc_s_select.
      DATA :  s_counter_datapakid LIKE sy-tabix,
              s_cursor TYPE cursor.
      RANGES :  date  FOR  zresult_lt-date.
      DATA: lv_count TYPE i VALUE 1.
      IF i_initflag = sbiwa_c_flag_on.
    Initialization: check input parameters
                    buffer input parameters
                    prepare data selection
    Check InfoSource validity
        CASE i_dsource.
          WHEN 'ZCRM_QUESTIONNAIRE'.
          WHEN OTHERS.
            IF 1 = 2. MESSAGE e009(r3). ENDIF.
            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.
        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
        IF NOT sd_no_more_data IS INITIAL.
          RAISE no_more_data.
        ENDIF.
        LOOP AT s_s_if-t_select INTO l_s_select .
          MOVE-CORRESPONDING l_s_select TO date.
        ENDLOOP.
        DATA : v_questionire  TYPE  crm_svy_db_sid.
        DATA : itab_questionire TYPE zsurveyid.
        DATA : e_tt_data_get TYPE  zresult_lt OCCURS 10.
        v_questionire = 'CALL CENTER'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'METER INSTALLATION TEAM'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'METER READING & BILLING'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'NO SUPPLY'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'CASH COLLECTION CENTER'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'STREET LIGHT'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'CONSUMER CARE CENTER'.
        APPEND v_questionire TO itab_questionire.
        v_questionire = 'WEBSITE'.
        APPEND v_questionire TO itab_questionire.
        DATA : counter TYPE i,
              high  LIKE sy-datum,
               low LIKE sy-datum.
        CONCATENATE
        l_s_select-high+6(4)
        l_s_select-high+3(2)
        l_s_select-high+0(2)
        INTO
        high.
        CONCATENATE
        l_s_select-low+6(4)
        l_s_select-low+3(2)
        l_s_select-low+0(2)
        INTO
        low.
        BREAK-POINT.
       do i_maxsize times.
        CALL FUNCTION 'ZCRM_SURVEY_REPORTING'
          EXPORTING
            e_date_frm    = low
            e_date_to     = high
            e_questionire = itab_questionire
          CHANGING
            it_result     = e_tt_data_get.
        IF sy-subrc IS INITIAL.
          e_t_data[] = e_tt_data_get[].
          APPEND e_t_data.
        ELSE.
          EXIT.
        ENDIF.
         sd_no_more_data = 'X'.
      ENDIF.              "Initialization mode or data extraction ?
    ENDFUNCTION.
    lk

  • Error while using Function module SPELL_AMOUNT with arabic language AR

    Hi ,
    When i am trying to convert the number to words, using function module SPELL_AMOUNT with arabic language(AR),following abend message is coming and FM is getting abended.
    Entry AR 0 1 in table T015Z does not have a delimiter (
    Can you please provide me how to overcome this error?
    Thanks & Regards
    Seshagiri.

    Hi Santosh,
    Thanks for quick inputs.
    And amount is not having any delimitors.
    I have checked in table T015Z and it has entries with AR as SPRAS.
    All entries are having ':' at the beginning of the arabic words,and there is no single entry with ';'.
    All entries with EN as SPRAS are having delimiters ';' at the end of the words.
    Numbers are correctly converted to words in english,but abending in arabic.
    Any idea please.
    Thanks & Regards
    Seshagiri.

  • Function Module to modify MARC table

    Hi all,
    Is There any Function Module which modifys the table MARC.
    please suggest.
    regards,
    chandra.

    Hello Reddy,
    Check this sample code:
    *& Report  ZYTEST02                                                    *
    report  zytest02                      .
    parameters:matnr like bapimathead-material,
               maktx like bapi_makt-matl_desc     default 'Mat. autm. AE',
               werks like bapi_marc-plant,
               vkorg like bapi_mvke-sales_org,
               vtweg like bapi_mvke-distr_chan.
    start-of-selection.
      perform material_create using matnr
                                    maktx
                                    werks
                                    vkorg
                                    vtweg.
    *&      Form  material_create
    *       text
    *      -->P_MATERIAL  text
    form material_create using    value(p_matnr)
                                  value(p_maktx)
                                  value(p_werks)
                                  value(p_vkorg)
                                  value(p_vtweg).
      tables: mara.
    * shift p_matnr right deleting trailing space.
    * translate p_matnr using ' 0'.
      data: headdata    like bapimathead occurs 0 with header line.
      data: clientdata  like bapi_mara.
      data: clientdatax like bapi_marax.
      data: salesdata   like bapi_mvke.
      data: salesdatax  like bapi_mvkex.
      data: plantdata   like bapi_marc.
      data: plantdatax  like bapi_marcx.
      data: return         like bapiret2.
      data: taxclassifications like bapi_mlan   occurs 0 with header line.
      data: commitmessages like bapi_matreturn2 occurs 0 with header line.
      data: returnmessages like bapiret2        occurs 0 with header line.
      data: materialdescription like bapi_makt  occurs 0 with header line.
      data: charx value 'X'.
    * Kopfdaten
      headdata-material   = p_matnr.
      headdata-matl_type  = 'FERT'.
      headdata-ind_sector = 'M'.
    * Sichten die gepflegt werden sollen
      headdata-basic_view = charx.  "Sicht auf Grunddaten
      headdata-sales_view = charx.  "Sicht auf Vertriebsdaten
    * Daten für die Sicht GRUNDDATEN 1
      materialdescription-langu = sy-langu.
      materialdescription-matl_desc = p_maktx.
      append materialdescription.
    * Mandantenspezifische Materialdaten
      clientdata-base_uom  = 'ST'.
      clientdatax-base_uom = charx.
      clientdata-trans_grp  = '0001'.
      clientdatax-trans_grp  = charx.
    * Materialdaten auf Werksebene
      plantdata-plant = p_werks.
      plantdatax-plant = p_werks.
      plantdata-loadinggrp = '0001'.
      plantdatax-loadinggrp = charx.
    * Verkaufsdaten
      salesdata-sales_org = p_vkorg.
      salesdatax-sales_org = p_vkorg.
      salesdata-distr_chan = p_vtweg.
      salesdatax-distr_chan = p_vtweg.
    * Steuerklassifikation
      taxclassifications-depcountry = 'DE'.
      taxclassifications-tax_type_1 = 'MWST'.
      taxclassifications-taxclass_1 = '1'.
      append taxclassifications.
      call function 'BAPI_MATERIAL_SAVEDATA'
        exporting
          headdata                   = headdata
          clientdata                 = clientdata
          clientdatax                = clientdatax
          plantdata                  = plantdata
          plantdatax                 = plantdatax
    *   FORECASTPARAMETERS         =
    *   FORECASTPARAMETERSX        =
    *   PLANNINGDATA               =
    *   PLANNINGDATAX              =
    *   STORAGELOCATIONDATA        =
    *   STORAGELOCATIONDATAX       =
    *   VALUATIONDATA              =
    *   VALUATIONDATAX             =
    *   WAREHOUSENUMBERDATA        =
    *   WAREHOUSENUMBERDATAX       =
           salesdata                  = salesdata
           salesdatax                 = salesdatax
    *   STORAGETYPEDATA            =
    *   STORAGETYPEDATAX           =
        importing
          return                     = return
        tables
          materialdescription        = materialdescription
    *   UNITSOFMEASURE             =
    *   UNITSOFMEASUREX            =
    *   INTERNATIONALARTNOS        =
    *   MATERIALLONGTEXT           =
          taxclassifications         = taxclassifications
          returnmessages             = returnmessages
    *   PRTDATA                    =
    *   PRTDATAX                   =
    *   EXTENSIONIN                =
    *   EXTENSIONINX               =
      call function 'BAPI_TRANSACTION_COMMIT'
           exporting
                wait   = charx
           importing
                return = commitmessages.
    *  commit work and wait.
    * Für den Fall das es notwendig wird die Exclusive Sperre wegräumen
           CALL FUNCTION 'DEQUEUE_EMMARAE'
                EXPORTING
                    matnr = p_matnr.
    * if return-type ne 'S'.
        format color col_negative.
        loop at returnmessages.
          write: / returnmessages-message.
        endloop.
    * endif.
      loop at commitmessages.
        write: / commitmessages-message.
      endloop.
    endform.                    " material_create
    If useful reward.
    Vasanth

  • Storing the output of a function module into a custom table

    Hi Gurus,
    Is it possible to store the output of a function module into a custom table.How can this be done?Is it complex?

    hi,
    After u execute the FM and get values in the internal table ITAB_RESULT. Create a custom table having structure same as ITAB_RESULT call it ZRESULT.
    data :wa type ITAB_RESULT.
    call FM and get result it ITAB_RESULT
    loop at itab_result.
    move-corresponding itab_result to wa.
    insert wa to ZRESULT.
    endloop.
    Regards,
    Mansi.

  • SE37, Function module test, copy & paste table values ?!?!

    Hi all,
    if i run a function module test with se37 and want to fill the table values from the clipboard, nothing happens.
    There is a button in the Status line called "Insert Data" with the clipboard symbol but it seems not to work...
    Anyone here who knows how to solve this ? By the way are there any new transactions for testing function modules, where ALV Grid is used for parameter transfer for the tables ?
    Thx....

    Hi,
    If you check that properly it is for INSERT DATE not data so it may be used to insert Dates in date fields i guess.
    As it is only for testing FM's, you cannot expect all functionalities there, otherwise you have to write a sample program to check the FM using CALL Function.
    Regards
    Karthik D

  • Function module call with destination

    Hi,
    how can check if a function module call with destination works or not ?
    How can I debug.
    What can be the reason if it is not calles
    regards
    ertas

    * to chcek the rfc Destination By pass RFC destination name and Connection Type..
    RFC_CHECK_DESTINATION
    or
    RFC_CHECK_DESTINATION_ID
    or
    You can use this FM RFC_VERIFY_DESTINATION if your release is greater than 4.6C.
    Check this sample code from Craig Cmehil's weblog.
    CALL FUNCTION 'RFC_VERIFY_DESTINATION'
      EXPORTING
        DESTINATION = TMP
            TIMEOUT = 10
      EXCEPTIONS
        INTERNAL_FAILURE           = 1
        TIMEOUT                    = 2
        DEST_COMMUNICATION_FAILURE = 3
        DEST_SYSTEM_FAILURE        = 4
        UPDATE_FAILURE             = 5
        NO_UPDATE_AUTHORITY        = 6
        OTHERS                     = 7.
      IF SY-SUBRC EQ '0'.
        "* Do code here
      ENDIF.
    Prabhu

Maybe you are looking for

  • What do I need to do to get the $200 I was supposed to get for my iPhone 4?

    I ordered an iPhone 6 on September 28th. I talked to someone using live chat as I completed the order and the person told me I could receive a $200 gift card for trading my old iPhone 4. I am currently using a prepaid phone since I had just gotten ou

  • Error code -50

    I've recently created a music video on imovie '09. The problem is, I can't share or export the movie. Every time I try to, it says "Unable to prepare project for publishing.The project could not be prepared for publishing because an error occurred. (

  • Iconia tab 8 A1-840 won't connect to Wi-Fi

    Just opened a refurb Iconia Tab 8 A1-840.Wi-Fi is on.  I select my home Wi-Fi network.  Signal strength - excellent.  Security - WPA2 PSK.I enter my password...  Saved, secured with WPA2.I select my network again and hit connect.  Authenticating...  

  • Can't drag-and-drop from CD to Desktop

    I can't drag-and-drop a photo from an Iphoto CD to the Desktop. I was able to do this on my old 17"IMAC. But the new 20" won't allow me to this anymore. Once I drag it past the Iphoto window the cursor has a circle with a bar across. The MAC person a

  • Update..improve performance

    Hell friends, In a procedure UPDATE statement took more than 20-30 min to update 200,000 records. Tables contains almost 2,000,000 records. As per functionality we need to set 0 value to almost 200,000 records. Is there any way round to increase perf