cancel
Showing results for 
Search instead for 
Did you mean: 

Generic DataSource and data package

0 Kudos


I have created a generic datasource off of RSAX_BIW_GET_DATA_SIMPLE. It is for full load. When I run the datasource in RSA3. It works fine and I can see the data in different packages.  As it is shown in first screen shot. But when I ran the info package, the data doesn't come in packages like that.  In standard datasource, the PSA will also have 10 data packages as it is in RSA3.

Can someone please help me what I am doing wrong. Or is there any setting that I am missing.

Thanks.

 

Accepted Solutions (0)

Answers (1)

Answers (1)

ccc_ccc
Active Contributor
0 Kudos

Hi Sophie,

Do you have below statement in your code? if not please include data will separate in data packages in BW also.

S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1

Thank you,

Nanda

0 Kudos

Hi,

I have it in my code.

Thanks.

ccc_ccc
Active Contributor
0 Kudos

Hi Sophie,

Could you please share the code?

Thank you,

Nanda

ccc_ccc
Active Contributor
0 Kudos

Hi Sophie,

Could you please check how you configured in Infopackage-->Scheduler-->DataS.Default Data Transfer

Please change as like below and check

Maximum size of a data packet in rows 1000

Number of data packets per info-IDoc 10.

Thank you,

Nanda

0 Kudos


FUNCTION ZTEST_DS.
*"----------------------------------------------------------------------
*"*"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  ZHRMS_BW_QUALIFICATION_COMPLI OPTIONAL
*"  EXCEPTIONS
*"      NO_MORE_DATA
*"      ERROR_PASSED_TO_MESS_HANDLER
*"----------------------------------------------------------------------

* Example: DataSource for table SFLIGHT
  "TABLES: SFLIGHT.

* 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: L_R_ZZPernr FOR PA0000-PERNR.
Types: Begin of Pernr_s,
       pernr type PA0000-Pernr,
       End of Pernr_s.

DATA: c_pernr TYPE C LENGTH 45.
* 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
************************************************************************

* Check DataSource validity
    CASE I_DSOURCE.
      WHEN 'ZBW_TEST
      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.

* 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
    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 = 'PERNR'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_ZZPernr.
            APPEND L_R_ZZPernr.
           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 DISTINCT Pernr
             FROM PA0000
             WHERE pernr IN L_R_ZZPernr
             AND ENDDA = '99991231'
             AND STAT2 = '3'
             .
       CLEAR g_records_last.
    ENDIF.                             "First data package ?

FETCH NEXT CURSOR S_CURSOR
               APPENDING CORRESPONDING FIELDS
               OF TABLE it_pernr
               PACKAGE SIZE S_S_IF-MAXSIZE.

    IF SY-SUBRC <> 0.
      CLOSE CURSOR S_CURSOR.
      RAISE NO_MORE_DATA.
    ENDIF.
    " safia changes - begins
     LOOP AT it_Pernr INTO wa_Pernr.
          l_tabix = sy-tabix.
         
         * EXTACTOR LOGIC GOES HERE *

       ENDLOOP.


      E_T_DATA[] = it_ct_data[].
     S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.

  ENDIF.              "Initialization mode or data extraction ?

ENDFUNCTION.

0 Kudos

Yes I have it configured as package size 20000 (by default, i have tried to reduce it to 1000 ) and have info-IDoc as 10. But still getting same result.

RafkeMagic
Active Contributor
0 Kudos

I believe that the following part:

    IF SY-SUBRC <> 0.

      CLOSE CURSOR S_CURSOR.

      RAISE NO_MORE_DATA.

    ENDIF.

should be moved down (before the ENDIF. ENDFUNCTION. statements and àfter filling the E_T_DATA table and the S_COUNTER_DATAPAKID variable).

0 Kudos

I have tried that also but to no avail.

Thnx.

Former Member
0 Kudos

Hi Sophie,

Can you please check in your BW system in tcode SBIW - what is the control parameters for transfer from source system? you should have entry for your source system and max package value.

If possible try to decrease it and then check the datasource extraction.

Thanks

Amit