cancel
Showing results for 
Search instead for 
Did you mean: 

Recrods not extracted into BW

Former Member
0 Kudos

Hi,

I'm using a Function Module for extracting data from R/3. I tested the DataSource using RSA3, its working fine and pulling records for the specified criteria. Now, I'm trying to pull data into BW by specifying the same selection criteria as in RSA3. The load is successful but its not pulling any records and I get the below message in Status Tab

No data available

Diagnosis

The data request was a full update.

In this case, the corresponding table in the source system does not

contain any data.

System Response

Info IDoc received with status 8.

Procedure

Check the data basis in the source system.

Message in "Step By Step" Analysis

Diagnosis

The data request was a full update.

o In this case, the corresponding tab

contain any data.

o System Response

Info IDoc received with status

Procedure

Check the data basis in the source system.

Can anyone please tell me why the records are not pulled into BW even though I have the records in the source system and I'm able to extract those records in RSA3

Thank you!

AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

There migh be a prblem in the functionmodule code, In the status message it is clearly showing that data was missed in the corresponding tables.

And also there was some problem in maintaining Joins and loops. Do the necessary changes in the code.

Bye,

Chandu.

Edited by: chandu guduru on Sep 4, 2008 7:09 AM

Former Member
0 Kudos

But i'm able to extract records in RSA3 using the same FM in the DataSource. Since there is no issue while extracting using RSA3 do you still think its a problem with the code.

Thanks,

AM

Former Member
0 Kudos

Hi,

Please check the selection condition in your BW side. Also please check the R/3 Job that has run for this particular request. Usually the R/3 Job gives the number of records pulled to BW. You can check the job log and the variant of the Bw job in R/3.

Regards,

Pramod

Former Member
0 Kudos

Hi,

In the case of RSA3 the parameters are taken automatically for the record numbers and number of fetches..

also there is a separate code in function module which takes care of the selection part in the function module.

L_S_RANGE I think...have you paseed them properly...and also have you used them properly in the code when you are trying to select the records from the table....have you properly maintained the counter for data packages...

You must verify all this as RSA3 may not give you true picture since it has inbuilt capabitly for all this scenario...but for BW you have to specifically create the packages etc.

Thanks

Ajeet

Former Member
0 Kudos

Hi Jet,

I compared my Function Module with the standard SAP FM. Its almost the same except few statements missing. The part pasted below is missing in my FM, Please let me if this could be the reason for the FM to fail during selecting the data based on the selection criteria in the InfoPackage .

  • 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 (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.

The issue with my funciton module is when i trigger the infopackage its not fetching me any records specified in the selection criteria of the infopackage, the following process in Step by Step analysis are failing:

Does selectable data exist in the source system?

Data selection successfully started ?

Data selection successfully finished ?

Can anyone please let me know the significance of the above statements realted to Open Cursor. Also, how is the selection criteria specified in infopackage passed on to the function module when the infopackage is triggered, do we need to do any settings in the infopackage or in the datasource tabs (General Info, Extraction, Fields tab, i'm using a 7.0 datasource) while extracting using a FM.

Thanks,

AM

Former Member
0 Kudos

Please help me, give me some inputs on the above posting.

Thanks,

AM

Former Member
0 Kudos

Hi,

Does your part of the code contains

This part of the code just after delcarations and out of the loop used to increment the data pakid.

this part takes value from your infopackage and passe it to the function module.

loop at g_t_select into l_s_select where fieldnm = 'FIELD NAME.

clear rvbeln.

move-corresponding l_s_select to rvbeln.

append rvbeln.

and then you will have to use these field name in the selections to fetch the data from the table which you are trying to use.Then only your selection will work.

if this is not used then the selection given used in the infopackage will not pass to your function module.

Also are you trying to do a full load´or initialization as well because do the intiallization you will have to write a separate piece of code and will not work with the example logic given in the R/3.

Thanks

Ajeet

Former Member
0 Kudos

Hi Ajeet,

I'm pasting the code below can you please check if its missing something.

  • 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 'XXXXXX'.

WHEN OTHERS.

  • 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.

************************************************************************

  • Data transfer: First Call OPEN CURSOR + FETCH

  • Following Calls FETCH only

************************************************************************

  • First data package -> OPEN CURSOR

IF s_counter_datapakid = 0.

g_first = 'X'.

  • 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 = 'fieldname'.

IF l_s_select-low <> '111' AND

l_s_select-low <> '222'.

RAISE invalid_movement_type.

ELSE.

MOVE-CORRESPONDING l_s_select TO r_im_bwlvs.

APPEND r_im_bwlvs.

ENDIF.

ENDLOOP.

LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'BEG'.

MOVE-CORRESPONDING l_s_select TO r_im_begda.

r_im_begda-low0(4) = l_s_select-low6(4).

r_im_begda-low4(2) = l_s_select-low0(2).

r_im_begda-low6(2) = l_s_select-low3(2).

APPEND r_im_begda.

ENDLOOP.

LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'END'.

MOVE-CORRESPONDING l_s_select TO r_im_endda.

r_im_endda-low0(4) = l_s_select-low6(4).

r_im_endda-low4(2) = l_s_select-low0(2).

r_im_endda-low6(2) = l_s_select-low3(2).

APPEND r_im_endda.

ENDLOOP.

*Select from table ltak into internal table i_ltak the following fields.

*Condition: where bwlvs = import bwlvs & endat is >= import begda and

  • <= import endda.

READ TABLE r_im_begda INDEX 1.

IF sy-subrc NE 0.

RAISE blank_date_invalid.

ELSE.

IF r_im_begda-low IS INITIAL.

RAISE blank_date_invalid.

ENDIF.

ENDIF.

READ TABLE r_im_endda INDEX 1.

IF sy-subrc NE 0.

RAISE blank_date_invalid.

ELSE.

IF r_im_endda-low IS INITIAL.

RAISE blank_date_invalid.

ENDIF.

ENDIF.

IF NOT r_im_endda-low IS INITIAL

AND r_im_begda-low > r_im_endda-low.

RAISE invalid_date.

ENDIF.

r_endat-sign = 'I'.

r_endat-option = 'BT'.

r_endat-low = r_im_begda-low.

r_endat-high = r_im_endda-low.

APPEND r_endat.

*-- Get data from the tables

PERFORM get_data.

*-- Populate the extract structure with data

PERFORM write_data.

*-- Fill Export able with the extracted data

e_t_data[] = i_zbipicprd2[].

ENDIF. "First data package ?

IF g_first EQ 'X'.

CLEAR g_first.

ELSE.

*-- This is important to prevent endless loop.

RAISE no_more_data.

ENDIF.

describe table e_t_data lines s_counter_datapakid.

  • s_counter_datapakid = s_counter_datapakid + 1.

ENDIF. "Initialization mode or data extraction ?

ENDFUNCTION.

Thanks,

AM

Former Member
0 Kudos

Hi,

Thank You all for your help. I figured out the issue, its due to error in code.

Thanks,

AM

Former Member
0 Kudos

What is the error in the code as others may find usefull ?

Answers (2)

Answers (2)

mathew_muthalaly
Contributor
0 Kudos

Hi,

If the data is not large, try loading with no selections.

BR/

Mathew.

Former Member
0 Kudos

Hello AM,

This issue happened to me once....... The proplem is definately with the Function Module....

Please check the code of the Function Module........ Please check whether all the loops are closed properly......

Check how many records get populated in RSA3 (by giving some value for number of records/ per call)........ and then change the number for the NUmber of records per call in the RSA3 and run again...... Check whether you are getting the same amount of data

If possible please send your existing function module code........ We can try checking it...........