cancel
Showing results for 
Search instead for 
Did you mean: 

Live Cach Extraction through Function Module Only one Data packet is coming

Former Member
0 Kudos

Hello All,

I am extracting data through Generic Datasource based on Function module into BI system.

This function module intern calls BAPI and extracts data from Live cache of APO system. I am not using select statement so, opening & closing cursor to determine the packet size is not effective.

My problem is that, all the records are coming in single data packet., even I set the packet size and record number fixed in rsa3 or in info package.

Currently it is running very fine. But in future when number of record will increase, processing of single data packet will be a problem.

In this case what needs to do to get the records through various data package.

Appreciate your response.

Regards,

Krunal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi!

You can split selected data into data packets in you fm:


.....
  DATA: from_ind  TYPE i,
          to_ind  TYPE i,
         n_lines  TYPE i.

......
* Auxiliary Selection criteria structure
IF i_initflag = sbiwa_c_flag_on.
...
*call you BAPI .
...
*put selected data into lt_data table.
...
ELSE.
* split into data packets
  from_ind = 1.
    DESCRIBE TABLE lt_data  LINES sy-tfill.
    IF sy-tfill >= i_maxsize.
      to_ind = i_maxsize.
    ELSE.
      to_ind = sy-tfill.
    ENDIF.

    IF to_ind >= from_ind.

      LOOP AT lt_data INTO ls_data FROM from_ind TO to_ind.
        e_t_data = ls_data.
        APPEND e_t_data.
      ENDLOOP.
      DELETE lt_data  FROM from_ind TO to_ind.
    ENDIF.
    DESCRIBE TABLE e_t_data LINES n_lines.
    IF n_lines = 0.
      RAISE no_more_data.
    ENDIF.
    s_counter_datapakid = s_counter_datapakid + 1.
ENDIF.

Former Member
0 Kudos

Hi Andrey,

Your given code is exactly same as what i required.

Thank a ton!!!!!!

I implemented and it is working very much fine.

Regards,

Krunal

Answers (1)

Answers (1)

wilian_segatto
Employee
Employee
0 Kudos

Hi!

Could you please elaborate more on your issue?

Will