Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

URGENT:Problem in extraction of data

Hi,

I am trying to extract data from xRPM to BW using a custom data source (extraction through function module).While trying to load the data ,in the monitor the following message is displayed in amber LED lights:

Extraction (messages): Missing messages

and also:

Missing message: Selection completed

I am not sure what is wrong as I have checked everything in my BW side of things.

I have also checked the datasource in rsa3 transaction in the xRPM side and it is extracting data properly there.

I read in the forum that this might be cause of an error in the code so i am attaching the code of the function module written.Someone kindly help with the same.

FUNCTION ZRPM_FUNC_DS_CLNT_PROPDT.

*"----


""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 OPTIONAL

*" EXCEPTIONS

*" NO_MORE_DATA

*" ERROR_PASSED_TO_MESS_HANDLER

*"----


  • Example: DataSource for table SFLIGHT

type-pools: zrpm1.

TABLES: /RPM/ITEM_D.

DATA: LV_EXTRNLID TYPE /RPM/TV_EXTID.

DATA: LV_PLNDT TYPE ARTTX.

DATA: LV_ACTDT TYPE ARTTX.

DATA: LV_PRJDEC TYPE RPM_TV_PROJ_DESCRIPTION.

*DATA: LV_CREATEDON TYPE DPR_TV_TIMESTAMP.

DATA: BEGIN OF ITAB OCCURS 0,

EXTERNAL_ID TYPE /RPM/TV_EXTID,

END OF ITAB.

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

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

WHEN OTHERS.

IF 1 = 2. MESSAGE E009(R3). ENDIF.

  • this is a typical log call. Please write every error message like this

WRITE 'E'. "message type

WRITE 'R3'. "message class

WRITE '009'. "message number

WRITE I_DSOURCE. "message variable 1

WRITE ' '. "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.

  • 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 EXTERNAL_ID FROM /RPM/ITEM_D

INTO TABLE ITAB.

*CLEAR E_T_DATA.

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

LOOP AT ITAB.

MOVE ITAB-EXTERNAL_ID TO LV_EXTRNLID.

CALL FUNCTION 'ZRPM_FUNC_GET_PROJ_DESC'

EXPORTING

EXTERNAL_ID = LV_EXTRNLID

IMPORTING

PROJ_DESC = LV_PRJDEC.

CALL FUNCTION 'ZRPM_FUNC_GET_CHK_PROP_DAT'

EXPORTING

EXTERNAL_ID = LV_EXTRNLID

IMPORTING

PLANNED_END_DATE = LV_PLNDT

ACTUAL_END_DATE = LV_ACTDT.

data: wa_e_t_data type ZRPM_EXRT_DS_CLNT_PROP_S.

  • MOVE LV_PLNDT TO E_T_DATA-PLANNED_END_DATE.

  • MOVE LV_ACTDT TO E_T_DATA-ACTUAL_END_DATE.

  • APPEND E_T_DATA.

MOVE LV_PLNDT TO wa_e_t_data-PLANNED_END_DATE.

MOVE LV_ACTDT TO wa_e_t_data-ACTUAL_END_DATE.

MOVE LV_EXTRNLID TO wa_e_t_data-EXTERNAL_ID.

  • MOVE LV_CREATEDON TO wa_e_t_data-CREATED_ON.

MOVE LV_PRJDEC TO wa_e_t_data-PROJ_DESC.

APPEND wa_e_t_data to E_T_DATA.

  • CLEAR E_T_DATA.

ENDLOOP.

IF SY-SUBRC <> 0.

CLOSE CURSOR S_CURSOR.

RAISE NO_MORE_DATA.

ENDIF.

S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.

ENDIF.

  • "Initialization mode or data extraction ?

ENDIF.

ENDFUNCTION.

Any help will be greatly appreciated.

Thanks in advance,

Sahana

Former Member
Not what you were looking for? View more on this topic or Ask a question