Skip to Content
author's profile photo Former Member
Former Member

Regarding: Loading data from R/3 To BI for a Generic Data source

Hi Every,

Need Help Urgent

I had created a Generic data source with function Module as the data source, in Rsa3 it is working fine.

1-> I had replicated the data source to Bi then i had created a info package and then I executed the same. when it is getting the data and it is show in the request monitor (Number of records ) but the status is not changing from Yellow to Green.

Status in Step by step analysis is every step is green Except "Data selection successfully finished ?" (RED)

2-> Then I had seen the Back ground job in Source system which is executing still. I waited for it for a long time but nearly 30 min.

(I had done Steps one and 2 number of time by activating replicating the data source and so on, but still their is no change in it)

3-> Then I had canceled that back ground job with the help of BASIS (as i feel that it is something going wrong).

4-> I feel that their is some thing wrong in the Code of Extractor.

Please Help...............

*"----


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

*"----


*Need to get the data only for two Gl account which are fro material purchase while MIGO

*G/L Account Numbers: 0010502001 0010502002

data: E_T_DATA1 type table of ZBI_MATGRIR.

RANGES: R_BUKRS FOR BSIS-BUKRS,

R_BUDAT FOR BSIS-BUDAT,

R_GJAHR FOR BSIS-GJAHR,

R_HKONT FOR BSIS-HKONT.

DATA: L_S_SELECT TYPE SRSC_S_SELECT.

STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,

S_COUNTER_DATAPAKID LIKE SY-TABIX,

S_CURSOR TYPE CURSOR.

*Declare

TYPES: BEGIN OF TY_FAGL,

RBURS TYPE FAGLFLEXA-RBUKRS,

RYEAR TYPE FAGLFLEXA-RYEAR,

DOCNR TYPE FAGLFLEXA-DOCNR,

BUZEI TYPE FAGLFLEXA-BUZEI,

DOCLN TYPE FAGLFLEXA-DOCLN,

PRCTR TYPE FAGLFLEXA-PRCTR,

SEGMENT TYPE FAGLFLEXA-SEGMENT,

END OF TY_FAGL.

DATA: GT_FAGL TYPE TABLE OF TY_FAGL,

GS_FAGL TYPE TY_FAGL.

IF I_INITFLAG = SBIWA_C_FLAG_ON.

CASE I_DSOURCE.

WHEN 'ZFI_GL_M4'.

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.

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.

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

MOVE-CORRESPONDING L_S_SELECT TO R_BUKRS.

APPEND R_BUKRS.

ENDLOOP.

LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'GJAHR'.

MOVE-CORRESPONDING L_S_SELECT TO R_GJAHR.

APPEND R_GJAHR.

ENDLOOP.

LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'BUDAT'.

MOVE-CORRESPONDING L_S_SELECT TO R_BUDAT.

APPEND R_BUDAT.

ENDLOOP.

*

*GRIR Inventory (RM/Stores/Spares/FG) 10502001

*GRIR Services & Others Payable 10502002

R_HKONT-SIGN = 'I'. "i_t_select-sign.

R_HKONT-OPTION = 'BT'." i_t_select-option.

R_HKONT-LOW = '0010502001'.

R_HKONT-HIGH = '0010502002'. "i_t_select-high.

APPEND R_HKONT.

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

AUGBL

ZUONR

BELNR

GJAHR

BUZEI

BUDAT

HKONT

BLART

MONAT

BSCHL

SHKZG

DMBTR

WAERS

FROM BSIS

  • INTO TABLE E_T_DATA

WHERE BUKRS IN R_BUKRS

AND GJAHR IN R_GJAHR

AND BUDAT IN R_BUDAT

AND HKONT IN R_HKONT.

  • Fetch records into interface table.

  • named E_T_'Name of extract structure'.

FETCH NEXT CURSOR S_CURSOR

APPENDING CORRESPONDING FIELDS

OF TABLE E_T_DATA1

PACKAGE SIZE S_S_IF-MAXSIZE.

IF SY-SUBRC <> 0.

CLOSE CURSOR S_CURSOR.

RAISE NO_MORE_DATA.

ENDIF.

DELETE E_T_DATA WHERE BLART NE 'WE'.

SELECT BUKRS

AUGBL

ZUONR

BELNR

GJAHR

BUZEI

BUDAT

HKONT

BLART

MONAT

BSCHL

SHKZG

DMBTR

WAERS

FROM BSAS

into table E_T_DATA

WHERE BUKRS IN R_BUKRS

AND GJAHR IN R_GJAHR

AND BUDAT IN R_BUDAT

AND HKONT IN R_HKONT.

*

  • FETCH NEXT CURSOR S_CURSOR

  • APPENDING CORRESPONDING FIELDS

  • OF TABLE E_T_DATA

  • PACKAGE SIZE S_S_IF-MAXSIZE.

append LINES OF e_t_data1 TO E_T_DATA.

DELETE E_T_DATA WHERE BLART NE 'WE'.

ENDIF. "First data package ?

DATA: F_YEAR TYPE BKPF-GJAHR.

DATA: F_PERI TYPE BAPI0002_4-FISCAL_PERIOD.

IF E_T_DATA[] IS NOT INITIAL.

SELECT RBUKRS

RYEAR

DOCNR

BUZEI

DOCLN

PRCTR

SEGMENT

FROM FAGLFLEXA

INTO TABLE GT_FAGL

FOR ALL ENTRIES IN E_T_DATA

WHERE RYEAR = E_T_DATA-GJAHR

AND DOCNR = E_T_DATA-BELNR

AND RLDNR = '0L'

AND RBUKRS = E_T_DATA-BUKRS

AND BUZEI = E_T_DATA-BUZEI.

  • WHERE RYEAR = E_T_DATA-GJAHR

  • AND DOCNR = E_T_DATA-BELNR

  • AND RBUKRS = E_T_DATA-BUKRS.

  • AND DOCLN = E_T_DATA-BUZEI.

ENDIF.

LOOP AT E_T_DATA.

IF E_T_DATA-SHKZG = 'H'.

E_T_DATA-DMBTR = E_T_DATA-DMBTR * -1.

ENDIF.

CLEAR: F_YEAR.

CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'

EXPORTING

COMPANYCODEID = E_T_DATA-BUKRS

POSTING_DATE = E_T_DATA-BUDAT

IMPORTING

FISCAL_YEAR = F_YEAR

FISCAL_PERIOD = F_PERI.

DATA: V_DOC(6) TYPE C .

CLEAR: V_DOC.

V_DOC = E_T_DATA-BUZEI.

IF V_DOC IS NOT INITIAL.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = V_DOC

IMPORTING

OUTPUT = V_DOC.

ENDIF.

  • aS PROFIT center is not updated in all the lines in Bsis

READ TABLE GT_FAGL INTO GS_FAGL WITH KEY RYEAR = E_T_DATA-GJAHR

DOCNR = E_T_DATA-BELNR

RBURS = E_T_DATA-BUKRS

BUZEI = E_T_DATA-BUZEI.

IF SY-SUBRC = 0.

E_T_DATA-PRCTR = GS_FAGL-PRCTR.

E_T_DATA-SEGMENT = GS_FAGL-SEGMENT.

ENDIF.

*As we are using the amount DMBTR in which the amount

*will be in company code currency that is Local currency

*group currency always in the main company code currency.

CONCATENATE F_YEAR '0' F_PERI INTO E_T_DATA-FISCPER.

MODIFY E_T_DATA. " from gs_bsis transporting dmbtr fiscper.

CLEAR: E_T_DATA.

ENDLOOP.

S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.

ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 22, 2011 at 05:35 AM

    Hi,

    Seems to be some issue with TRFC or ICOD, check the SM58 & BD87 transactions in your source system. If there are any pending TRFC's in the queue then you can release them manully or contact to your basis team to automate this queue.

    Regards,

    Durgesh.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 22, 2011 at 06:22 AM

    Hi,

    Check for source system job in Sm37 and also checks for TRFC in SM58 might be there are TRFC stuck.

    Thanks,

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Please check the log of same jobs for last week and check is today its taking more time,also check with basis is their any backup initited at same time.

      Moreover until the background job failed automatically its difficult to imagine what is the exact issue.

      Thanks,

  • Posted on Aug 25, 2011 at 08:50 AM

    Hi,

    Looks like datasurce is correct and it is also extracting data is BW.

    Question here is whether data records are getting added or not? or just transferred?

    For eg 188400 transferred and 188400 added?If not looks like it is something to do with memory .Pl take this up with basis. See the job status in SM37 as well whether it is complete or cancelled or waiting?

    Thanks and regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.