Generic datasource by function module to fetch data from multiple tables?

I'm writing a function module to fetch price, for generic datasource.
At first, extract test is OK. But InfoPackage never stop  when loading data to PSA in BW.
And I find the example codes:
     OPEN CURSOR WITH HOLD S_CURSOR FOR
      SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
                               WHERE CARRID  IN L_R_CARRID AND
                                     CONNID  IN L_R_CONNID.
    ENDIF.                             "First data package ?
* Fetch records into interface table.
*   named E_T_'Name of extract structure'.
    FETCH NEXT CURSOR S_CURSOR
               APPENDING CORRESPONDING FIELDS
               OF TABLE E_T_DATA
               PACKAGE SIZE S_S_IF-MAXSIZE.
    IF SY-SUBRC <> 0.
      CLOSE CURSOR S_CURSOR.
      RAISE NO_MORE_DATA.
    ENDIF.
    S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
  ENDIF.
There using Cursor to fetch data package by package, and raise exception NO_MORE_DATA to stop the loading process.
Now I fetch data from multiple tables, I don't think I can use Cursor.
Then How can I handle this?  
Thanks a lot.

Thanks
IF IT_999[] IS INITIAL.
    SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
      TABLE TP_DATA
        FROM A999 AS A
          INNER JOIN KONP AS B
              ON A~KNUMH = B~KNUMH
          INNER JOIN MARA AS C
             ON A~MATNR = C~MATNR
*          FOR ALL ENTRIES IN IT_999
                WHERE
*      A~KNUMH = IT_999-KNUMH  AND
       ( ( A~KSCHL = 'ZPRC' AND VKORG = 'Z000' AND VTWEG = 'Z1' ) OR
                      ( A~KSCHL = 'ZPRD' AND VKORG = 'A000' AND VTWEG = 'Y3' ) ) AND
*                      A~DATBI >= SY-DATUM AND
                      LOEVM_KO = ''.
    SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR AS KHETR  KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
      TABLE TP_DATA
        FROM A999 AS A
          INNER JOIN KONP AS B
              ON A~KNUMH = B~KNUMH
          INNER JOIN MARA AS C
             ON A~MATNR = C~MATNR
*          FOR ALL ENTRIES IN IT_999
                WHERE
*      A~KNUMH = IT_999-KNUMH AND
      A~KSCHL = 'ZPR3' AND A~VKORG = 'I000' AND
*                      DATBI >= SY-DATUM AND
                      LOEVM_KO = ''.
  ENDIF.
  IF IT_997[] IS INITIAL.
    SELECT A~KNUMH A~MATNR A~KSCHL VTWEG A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
      TABLE TP_DATA
        FROM A997 AS A
          INNER JOIN KONP AS B
              ON A~KNUMH = B~KNUMH
          INNER JOIN MARA AS C
             ON A~MATNR = C~MATNR
*          FOR ALL ENTRIES IN IT_997
                WHERE
*      A~KNUMH = IT_997-KNUMH      AND
      A~KSCHL = 'ZPRA' AND VTWEG = 'Y1' AND
*                      DATBI >= SY-DATUM AND
                  LOEVM_KO = ''.
  ENDIF.
  IF IT_996[] IS INITIAL.
    SELECT A~KNUMH A~MATNR A~KSCHL A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
       TABLE TP_DATA
         FROM A996 AS A
           INNER JOIN KONP AS B
               ON A~KNUMH = B~KNUMH
           INNER JOIN MARA AS C
              ON A~MATNR = C~MATNR
*          FOR ALL ENTRIES IN IT_996
                WHERE
*      A~KNUMH = IT_996-KNUMH AND
      A~KSCHL = 'ZPRB' AND
*                       DATBI >= SY-DATUM AND
      LOEVM_KO = ''.
  ENDIF.
  SELECT   MATNR     "u7269u6599u53F7u7801
           MEINH     "u4ED3u50A8u5355u4F4Du7684u5907u7528u8BA1u91CFu5355u4F4D
           UMREZ     "u57FAu672Cu8BA1u91CFu5355u4F4Du8F6Cu6362u5206u5B50
           UMREN     "u8F6Cu6362u4E3Au57FAu672Cu8BA1u91CFu5355u4F4Du7684u5206u6BCD
      FROM MARM
      INTO CORRESPONDING FIELDS OF TABLE IT_MARM
       FOR ALL ENTRIES IN TP_DATA
     WHERE MATNR = TP_DATA-MATNR AND  MEINH = TP_DATA-KMEIN.
  LOOP AT TP_DATA.
    IF TP_DATA-KPEIN NE 0.
      TP_DATA-KBETR =  TP_DATA-KBETR / TP_DATA-KPEIN.
      TP_DATA-KHETR =  TP_DATA-KHETR / TP_DATA-KPEIN.
    ENDIF.
    IF TP_DATA-KSCHL = 'ZPRA'.
*       TP_DATA-MEINH = 'ZI'.
*      TP_DATA-KSCHL = 'B4'.
      IF TP_DATA-KMEIN = 'ZI'.
        TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
      ELSE.
        READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
*           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'CT'.
        TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
*           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
        TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
      ENDIF.
    ELSEIF TP_DATA-KSCHL = 'ZPRB'.
*      TP_DATA-KSCHL = 'L0'.
*       TP_DATA-MEINH = 'ZI'.
      IF TP_DATA-KMEIN = 'ZI'.
        TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
      ELSE.
        READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
*           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
        TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
*           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
        TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
      ENDIF.
    ELSEIF TP_DATA-KSCHL = 'ZPRC' OR TP_DATA-KSCHL = 'ZPRD'.
*       TP_DATA-MEINH = 'ZI'.
      IF TP_DATA-KMEIN = 'ZI'.
        TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
      ELSE.
        READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
*           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'WZI'.
        TP_DATA-KBETR = TP_DATA-KBETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
*           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
        TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
      ENDIF.
    ELSEIF TP_DATA-KSCHL = 'ZPR3'.
*      TP_DATA-KSCHL = 'B2'.
      IF TP_DATA-KMEIN = 'ZI'.
        TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
      ELSE.
        READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
*           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
        TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
*           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
        TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
      ENDIF.
    ENDIF.
    TP_DATA-MEINH = '01'.
    MODIFY TP_DATA.
E_T_DATA-MATNR =   TP_DATA-MATNR.
E_T_DATA-KSCHL =   TP_DATA-KSCHL.
E_T_DATA-KHETR =   TP_DATA-KHETR.
E_T_DATA-KBETR =   TP_DATA-KBETR.
E_T_DATA-KMEIN =   TP_DATA-KMEIN.
E_T_DATA-DATAB =   TP_DATA-DATAB.
E_T_DATA-DATBI =   TP_DATA-DATBI.
APPEND E_T_DATA.
    CLEAR WA_MARM1.
    CLEAR WA_MARM2.
  ENDLOOP.
Edited by: Shen Peng on Oct 20, 2010 10:09 AM

Similar Messages

  • Function module to fetch data from table SETLEAVES

    Hi All,
    We have a requirement to fetch the data from table SETLEAVES based on the setclass,subclass and group. As the table holds hierarchical data, Please let me know a FM which fetches all the hierarchical data from the table SETLEAVES.
    Regards
    Shiva

    Try:
        exporting
          e_class                     = '0102'
          e_setid                     = setid
          e_kokrs                     = my_kokrs
          e_mandt                     = sy-mandt
          e_master_data               = 'XXX'
          e_structure                 = 'X  X0200'
          e_replace_class             = space
          e_replace_unit              = space
          e_suffix                    = space
          e_old_line_level            = 1  "l_ol_level
        tables
          t_nodes                     = it_ceg_nodes
          t_values                    = it_ceg_values
        changing
          c_info                      = c_info
          c_overwrite                 = c_overwrite
        exceptions
          no_controlling_area         = 1
          no_chart_of_account         = 2
          different_controlling_areas = 3
          different_chart_of_accounts = 4
          set_not_found               = 5
          illegal_field_replacement   = 6
          illegal_table_replacement   = 7
          fm_raise                    = 8
          convert_error               = 9
          no_overwrite_standard_hier  = 10
          no_bukrs_for_kokrs          = 11
          others                      = 12.
    Rob

  • Problem fetching data from multiple tables

    Hi,
    I am facing a problem in fetching data from 3 different tables. i am able to get the data from 2 tables but when i try accessing data from other table, i am getting redundant data. please help, my query is as under.
    select a.*,b.*, c.BidAmount from carregister a , watchlist b, Bidmaster c where a.CarID= b.CarID and b.UserID = 23 and c.BidAmount=(select max(BidAmount) from BidMaster where carid=a.carid group by c.BidAmount);
    Regards,
    Ujjwal B Soni
    <Software Developer>
    Baroda Gujarat India

    Hi,
    I got the solution. The solved query is as under :
    select a.*,b.*,(select max(BidAmount) from BidMaster where carid=b.carid) as MAX_AMT from carregister a , watchlist b where a.CarID= b.CarID and b.UserID=23;
    Thank you all for replying me.
    Warm Regards,
    Ujjwal B Soni
    <Software Developer>
    <Baroda Gujarat India>

  • Function module to fetch data from table

    Hi All,
    I want to get the entries from the table 'arfcsstate'  for a particular date. Is there a function module to get the same.
    Thanks in advance.
    Regards,
    Anju

    Hi,
    You can use select query
    Select * from arfcsstate into <Internal table name>
    where date <give ur condition.>
    if date is in selection screen than write
    date in s_date.
    Thanx
    Ankur Sharma

  • Function module to get data from VARI table

    Hi All,
    thank you for viewing this thread. can anyone help me out in finding a function module which can get data from the VARI table?
    thank you

    Hi,
    FMs you will require are:
    RS_VARIANT_CONTENTS - Values of a variant returned in a table
    RS_VARIANT_EXISTS - Checks whether a variant exists for a report
    RS_VARIANT_TEXT - Returns short description of variant
    RS_VARIANT_VALUES_TECH_DATA - Reads variant parameters of a report
    Do search on them for complete details.
    Cheers.

  • Fetch data from multiple tables

    Helo all,
    I am having four tables in database which are independent having no relations and all columns are different in each table.
    I wants to create Sp where all data can be fetched at once where there is something to differntiate that Ok this data is of this table and so on...
    so that from server side code i have to hit database only once and from output i will assign tables to their array.
    Is there any way to do so ??
    Niki

    Hi Nikijain,
    Since your requirement is not precise so I have to guess you may be looking for a sample as below.
    CREATE TABLE T1(ID INT);
    INSERT INTO T1 SELECT 1;
    GO
    CREATE TABLE T2(ID INT);
    INSERT INTO T2 SELECT 2;
    GO
    CREATE TABLE T3(ID INT);
    INSERT INTO T3 SELECT 3;
    GO
    CREATE TABLE T4(ID INT);
    INSERT INTO T4 SELECT 4;
    GO
    CREATE PROC p4test
    AS
    SELECT ID FROM T1;
    SELECT ID FROM T2;
    SELECT ID FROM T3;
    SELECT ID FROM T4;
    GO
    EXEC p4test
    DROP TABLE T1,T2,T3,T4
    DROP PROC p4test
    Regarding how to access the resultset individually, you may reference the below links.
    Access to Result sets from within Stored procedures Transact-SQL SQL Server
    Using Multiple Result Sets
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Generic DataSOurce on Function Module

    Hi Everyone,
    I know how to create a Generic Datasource based on a view. I amfirst time trying to create a Generic DS based on FM. I know the steps. Like we go to SE11..select database type..give the name..select structure..give the name..enter the fields name in component save it..then go to SE80..select function gp..etc...etc.
    My question is This function module should get data from two tables. In which step we need to mention the table names?
    Can anyone please explain?
    Regards

    Hi,
    If you would like to have a DS which'll extract using FM then you've to copy RSAX_BIW_GET_DATA_SIMPLE FM.
    Now once you copy it then in that only you see the line:
    open cursor with hold s_cursor for
    select distinct pernr from pa0000
    where pernr in l_r_pernr
    and stat2 = '3'.
    If you want to have more than one table then create cursors and use them accordingly.
    Best Regards,
    Rachit

  • Move data from multiple Tables to a Single Table & Convert the list to ALV.

    Hi,
    My aim is to get the list of Materials with their descriptions, with MRP Controller, with Unrestriced Qty. & the Reorder Qty. So, I have to fetch the data from different tables. But finally I am not able to copy or move the fetched data from multiple tables into the single final table.
    Also tell me how to convert this list into ALV.
    Below is the program code.
    *& Report  Y_REORDER_REPORT
    REPORT  Y_REORDER_REPORT.
    tables : marc,makt, mard.
    DATA: Begin of i_final occurs 0,
            matnr type marc-matnr,
            maktx type makt-maktx,
            DISPO type marc-DISPO,
            MINBE type marc-MINBE,
            LABST type mard-LABST,
          end of i_final.
    DATA: Begin of i_marc occurs 0,
           matnr type marc-matnr,
           DISPO type marc-DISPO,
           MINBE type marc-MINBE,
          end of i_marc.
    DATA: Begin of i_makt occurs 0,
           matnr type makt-matnr,
           maktx type makt-maktx,
          end of i_makt.
    DATA: Begin of i_mard occurs 0,
           matnr type mard-matnr,
           LABST type mard-LABST,
           LGORT TYPE MARD-LGORT,
          end of i_mard.
    SELECT  matnr
            dispo
            minbe from marc
            into corresponding fields of table i_marc
            where dispo EQ 'STR'.
    SORT I_MARC by MATNR.
    WRITE: /10  'Material',
            75  'MRP',
            80  'Reorder Qty.'.
    LOOP at i_marc.
    Write: /10  i_marc-matnr,
            75  i_marc-dispo,
            80  i_marc-minbe.
    ENDLOOP.
    write: /.
    SELECT  matnr
            MAKTX from makt
            into corresponding fields of table i_makt
            for all entries in i_marc
            where matnr = i_marc-matnr.
    LOOP at i_makt.
    Write: /10 i_makt-matnr,
            30 i_makt-maktx.
    ENDLOOP.
    SELECT  matnr
            LGORT
            LABST from mard
            into corresponding fields of table i_mard
            for all entries in i_marc
            where matnr = i_marc-matnr.
    LOOP at i_mard.
    Write: /10 i_mard-matnr,
            30 I_MARD-LGORT,
            40 i_mard-labst.
    ENDLOOP.
    move  i_mard-matnr to i_final-matnr.
    move  i_marc-dispo to i_final-dispo.
    move  i_marc-minbe to i_final-minbe.
    move  i_makt-maktx to i_final-maktx.
    move  i_mard-labst to i_final-labst.
    WRITE: /10  'Material',
            30  'Material Desc.',
            75  'MRP',
            80  'Reorder Qty.',
            105 'Current Stock'.
    LOOP at i_final.
    Write: /10  i_final-matnr,
            30  i_final-maktx,
            75  i_final-dispo,
            80  i_final-minbe,
            105 i_final-labst.
    ENDLOOP.
    *LOOP at i_mard.
    *Write: /10  i_mard-matnr,
           30  i_makt-maktx,
           75  i_marc-dispo,
           80  i_marc-minbe,
           105 i_mard-labst.
    *ENDLOOP.
    Regards,
    Vishal

    Change like this,
    SELECT matnr
    lgort
    labst FROM mard
    INTO CORRESPONDING FIELDS OF TABLE i_mard
    FOR ALL ENTRIES IN i_marc
    WHERE matnr = i_marc-matnr.
    LOOP AT i_mard.
       WRITE: /10 i_mard-matnr,
       30 i_mard-lgort,
       40 i_mard-labst.
    ENDLOOP.
    LOOP AT i_marc.
       READ TABLE i_mard WITH KEY matnr =  i_marc-matnr.
       READ TABLE i_makt WITH KEY matnr =  i_marc-matnr.
       MOVE i_mard-matnr TO i_final-matnr.
       MOVE i_marc-dispo TO i_final-dispo.
       MOVE i_marc-minbe TO i_final-minbe.
       MOVE i_makt-maktx TO i_final-maktx.
       MOVE i_mard-labst TO i_final-labst.
       APPEND i_final.
    ENDLOOP.
    WRITE: /10 'Material',
    30 'Material Desc.',
    75 'MRP',
    80 'Reorder Qty.',
    105 'Current Stock'.

  • Can anybody explain me creating Generic Datasource using Function module?

    Hi,
    can anybody explain me creating Generic Datasource using Function module?
    Thax in advance,
    Ravi.

    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 " E_T_DATA " .
    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)
    <b>is an example</b>
    1.Create a function group .
    2. Structure ZTEST123
    ZMATNR MATNR CHAR 18 0 Material Number
    ZMTART MTART CHAR 4 0 Material type
    ZMBRSH MBRSH CHAR 1 0 Industry sector
    ZMATKL MATKL CHAR 9 0 Material group
    ZBISMT BISMT CHAR 18 0 Old material number
    ZMAKTX MAKTX CHAR 40 0 Material description
    3. Create function module (i.e. ZTEST….) .
    FM - YMARA_DATA_TRNS
    FUNCTION YMARA_DATA_TRNS.
    ""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
    *" 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 ZTEST123 OPTIONAL
    *" EXCEPTIONS
    *" NO_MORE_DATA
    *" ERROR_PASSED_TO_MESS_HANDLER
    data : ZTEST123 type ZTEST123 occurs 0 with header line.
    Maximum number of lines for DB table
    STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
    S_COUNTER_DATAPAKID LIKE SY-TABIX.
    DATA: begin of t_mara occurs 0,
    ZMATNR type MATNR,
    ZMTART type MTART,
    ZMBRSH type MBRSH,
    ZMATKL type MATKL,
    ZBISMT type BISMT,
    end of t_mara.
    DATA: begin of t_makt occurs 0,
    ZMATNR type MATNR,
    ZMAKTX type MAKTX,
    end of t_makt.
    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 'ZZMARA_DATA'.
    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.
    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.
    ELSE. "Initialization mode or data extraction ?
    Data transfer: First Call OPEN CURSOR + FETCH
    Following Calls FETCH only
    First data package -> OPEN CURSOR
    IF S_COUNTER_DATAPAKID = 0.
    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.
    select MATNR
    MTART
    MBRSH
    MATKL
    BISMT
    from mara up to 10 rows
    into table t_mara.
    if not t_mara[] is initial.
    select MATNR
    maktx
    from makt
    into table t_makt
    for all entries in t_mara
    where matnr = t_mara-zmatnr.
    endif.
    loop at t_mara.
    read table t_makt with key zmatnr = t_mara-zmatnr.
    ZTEST123-zmatnr = t_mara-zmatnr.
    ZTEST123-ZMTART = t_mara-ZMTART.
    ZTEST123-ZBISMT = t_mara-ZBISMT.
    ZTEST123-ZMBRSH = t_mara-ZMBRSH.
    ZTEST123-ZMATKL = t_mara-ZMATKL.
    ZTEST123-zmaktx = t_makt-zmaktx.
    append ZTEST123.
    clear ZTEST123.
    endloop.
    clear E_T_DATA.
    refresh E_T_DATA.
    E_T_DATA[] = ZTEST123[].
    ENDIF.
    S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
    ENDIF. "Initialization mode or data extractio
    ENDFUNCTION.
    3. Create the data source using transaction (RSO2).
    4. If structure exists for the table parameter of your function module then ok else create a structure for the table parameter ‘E_T_DATA’.
    5. Test the datasource in R/3 using transaction RSA3.
    6. Transfer the data source to BW –System and replicate it in the BW-System.

  • Generic DataSource on Function Module - Query

    Hi All,
    We have a requirement wherin we have to pull data from MARM  (Material UOM fields) table. This table has some 1,130,000 records.  Since this table doesn't have a Last Changed on or Created on field we are not able to create a Generic Delta on the table itself.
    We have come to know that in MM02, we can change the Unit of Measure fields for material. When we update in MM02, both MARA and MARM table gets changed. MARA will be updated with  the last changed date.
    So we are thinking of creating a Generic DataSource on Function module so that we can perform the delta on Last changed or Created on field of MARA.
    I have a doubt about creating the function module. How should we achieve the initial load (Getting all the material and it's UOM to BW) and then Delta loads through the function module?
    Does the first load needs to be or should be a full load?
    If someone can tell me the steps that should be followed, it would be very helpful
    Please let me know your suggesstion.
    Regards,
    Vivek Das Gupta

    Hi
    Could u try creating a view based Datasource.
    Also u can do a full load in parallel by creating 4-5 Infopackages. After which a Init without data transfer can be done.
    Hope this helps.
    Reg
    Aparna

  • Creating a Generic Datasource using Function Module

    Hi Guru's
                  We are tryin to create a Generic datasource using function module, we have found few old how to guides for doing the same but it is not effective and need to be altered. Can anyone suggest me the latest step by step procedure to create the above, also if you have the how to guide kindly paste the link as it will be a great help at this point.
    Thanks in advance
    Regards
    Liquid

    Hi,
    Please goto the Following links  :-
                                                                          PDF
    1)         http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c062a3a8-f44c-2c10-ccb8-9b88fbdcb008?quicklink=index&overridelayout=true
    2)        http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33?quicklink=index&overridelayout=true
                                                     SAP Forum
    3)        Re: DataSouce based on FM
    4)       http://forums.sdn.sap.com/post!reply.jspa?messageID=10050614
    5)       https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
    6)       Re: Generic datasource with functional module
    7)       Generic Extractor (FM based) - Delta Enabled
    Regards
    Obaid

  • Creating generic datasource using function module in R/3 4.6c

    Hi,
    I am not able to see the option (in TC RSO2) to create generic datasource using function module in R/3 4.6c. Is there any special plug in or some SAP Note to be applied to get the option ?
    Waiting for a quick response.
    Thanks and Regards,
    Deepak

    Hi Sat,
    Thanks for the reply.
    I know that creating generic datasource from function module is available in R/3 4.7.
    In 4.6c version there are only two options available. They are Extraction from DB View and Extraction from SAP Query.
    The third option i.e. Extraction from Function Module is not available in 4.6c. I wanted to know if there is any plugin that needs to be installed to get this option.
    Thanks and Regards,
    Deepak

  • Program or Function module to delete data from Open Hub Destination Table

    Hi All,
    Can anybody suggest me a Program or Function module to delete data from Open Hub Destination Table.
    Thanks & Regards,
    Vinay Kumar

    You can simply goto t-code SE14 mention the open hub destination table and Delete data by clicking on "Activate and Adjust database" with radio button "Delete Data".
    Regards,
    Arminder

  • How to use for all entires clause while fetching data from archived tables

    How to use for all entires clause while fetching data from archived tables using the FM
    /PBS/SELECT_INTO_TABLE' .
    I need to fetch data from an Archived table for all the entries in an internal table.
    Kindly provide some inputs for the same.
    thanks n Regards
    Ramesh

    Hi Ramesh,
    I have a query regarding accessing archived data through PBS.
    I have archived SAP FI data ( Object FI_DOCUMNT) using SAP standard process through TCODE : SARA.
    Now please tell me can I acees this archived data through the PBS add on FM : '/PBS/SELECT_INTO_TABLE'.
    Do I need to do something else to access data archived through SAP standard process ot not ? If yes, then please tell me as I am not able to get the data using the above FM.
    The call to the above FM is as follows :
    CALL FUNCTION '/PBS/SELECT_INTO_TABLE'
      EXPORTING
        archiv           = 'CFI'
        OPTION           = ''
        tabname          = 'BKPF'
        SCHL1_NAME       = 'BELNR'
        SCHL1_VON        =  belnr-low
        SCHL1_BIS        =  belnr-low
        SCHL2_NAME       = 'GJAHR'
        SCHL2_VON        =  GJAHR-LOW
        SCHL2_BIS        =  GJAHR-LOW
        SCHL3_NAME       =  'BUKRS'
        SCHL3_VON        =  bukrs-low
        SCHL3_BIS        =  bukrs-low
      SCHL4_NAME       =
      SCHL4_VON        =
      SCHL4_BIS        =
        CLR_ITAB         = 'X'
      MAX_ZAHL         =
      tables
        i_tabelle        =  t_bkpf
      SCHL1_IN         =
      SCHL2_IN         =
      SCHL3_IN         =
      SCHL4_IN         =
    EXCEPTIONS
       EOF              = 1
       OTHERS           = 2
       OTHERS           = 3
    It gives me the following error :
    Index for table not supported ! BKPF BELNR.
    Please help ASAP.
    Thnaks and Regards
    Gurpreet Singh

  • How to fetch data from PTREQ tables

    I need to display  data in the customised webdynpro application from PTREQ tables.
    Can anyone help me out how to fetch data from these tables.

    use the standard modules like
    PT_ARQ_REQUEST_CHECK
    PT_ARQ_REQUEST_EXECUTE
    PT_ARQ_REQUEST_PREPARE

Maybe you are looking for

  • HP Officejet Pro 8610 e-all-in-one-printer

    I really need to find an important fax confirmation and my fax log only shows the last 30 transactions.  Same with the call history.  Is there any way I can get more than the last 30 items.

  • Updating iPod from Library--not working?

    How is I have 400 songs in my library and only 275 on my iPod, even after updating? Appreciate any help!

  • Acrobat Review Tracker: Can I export Tracker details?

    Hello, I frequently send out and join a variety of PDF reviews in my day to day activities at work. The Adobe Review Tracker allows me to see the various reviews I'm participating in with details regarding the review names, number of reviewers, and n

  • Understanding database driver loading

    Hi This question is to clarify my understanding When your vendor writes a drivers for a database Is it a requirement that he creates a instance of the driver and register it with the DriverManager like so class MyDriver implements Driver{     static{

  • ThinkPad Hotkey Features Integration 3.89.0000 On Screen Display and Mute Button Fail

    I am installing updates on a T400 system running WIndows 7 Pro 64-bit. The system has been freshly factory restored and all features work properly... After running System Restore to update to the latest drivers and recommended software, I find Thinkp