on 04-04-2006 9:59 AM
Hi Pals,
I ahve created generic data source using function module . it is working fine in the RSA3.
But when i am trying to pull data from BW it is not picking data.
Pls help me out.
Thanks in Advance.
Rgds,
RAvindra.
Hello Ravi,
The datasource needs to be replicated.
Also check for the selection conditions if any in the infopackage while loading....
thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pals ,
Is there any way i can debug the Function module(Generic Datasource) when calling from BW .
Bcs i dont understand the problem here my Datasource is perfectly working in R/3(RSA3) Transac. But not picking from BW .
Thanks in Advance.
Any thing and Every Thing will be Appreciated and Rewarded.
Rgds,
Ravindra.
Hi Ravindra,
did you check in your source system if there are any errors? Check out sm37 for jobname BIREQU* if you can find errors in the joblog for the jobs related to your load. Also check sm21 and st22. Let us know the details.
Additionally, did you check the psa? May be the data arrived there and the further processing failed.
Siggi
Hi Siggi,
Thanks for the reply . I have checked the SM37 . the job is running for long . i cancelled it and tried it again it.Same Status again. There are no dumps in ST22.
It is working fine in RSA3 what could be the reason why BW is not picking the Data.
Is there any possibility to Debugg the extraction by passing the parameters from Inbound Idoc in R/3.
Thanks in advance.
Rgds,
Ravindra.
Hi,
if the job is running too long it might depend on the logic in your fm. Remember that in rsa3 you normally will get a limited no. of records and datapackages. Is it possible for you to post the code of the fm in here? Did you check my weblog for the functionality of the template fm?
Siggi
Hi Siggi,
Actually we are getting data from YMFG* Table and MBEW Table.
Here is the Code for Fuction Module.
FUNCTION ZLRCN_VALUE.
*"----
""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
*" 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 TYPE /BAJAJ/YMFG_BW_LRCN1 OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
*"----
Example: DataSource for table ymfgt_confnotif
TABLES: ymfgt_confnotif,
mbew.
DATA : w_vprsv LIKE MBEW-VPRSV,
w_stprs LIKE MBEW-STPRS,
w_verpr LIKE MBEW-VERPR.
data wa type /BAJAJ/YMFG_BW_LRCN.
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.
Select ranges
RANGES: L_R_qmart FOR ymfgt_confnotif-qmart,
L_R_qcode FOR ymfgt_confnotif-qcode.
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 'ZLRCN_VALUE'.
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'.
L_R_QMART-SIGN = 'I'.
L_R_QMART-OPTION = 'EQ'.
L_R_QMART-LOW = 'VA'.
APPEND L_R_QMART.
L_R_QMART-SIGN = 'I'.
L_R_QMART-OPTION = 'EQ'.
L_R_QMART-LOW = 'VC'.
APPEND L_R_QMART.
L_R_QMART-SIGN = 'I'.
L_R_QMART-OPTION = 'EQ'.
L_R_QMART-LOW = 'VJ'.
APPEND L_R_QMART.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '01'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '02'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '03'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '04'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '05'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '06'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '07'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '08'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '09'.
APPEND L_R_QCODE.
refresh e_t_data.
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.
SELECT QMNUM FENUM QMART ERDAT WERKS BERID
KOSTL MATNR QANZFEHL4 FEGRP FECOD MNGRP
QCODE VEND_DB_NO VEND_DB_DT PAR_MATNR PARNR
appending corresponding fields of table e_t_data PACKAGE SIZE
S_S_IF-MAXSIZE
FROM ymfgt_confnotif WHERE qmart IN L_R_QMART AND
QCODE IN L_R_QCODE.
endselect.
delete e_t_data where qcode not in l_r_qcode.
ENDIF. "First data package ?
LOOP AT E_T_DATA.
select single vprsv stprs verpr
into (w_vprsv,w_stprs,w_verpr)
from mbew
where bwkey = E_T_DATA-werks
and matnr = E_T_DATA-MATNR.
if w_vprsv = 'S'.
E_T_DATA-stprs = w_stprs * E_T_DATA-QANZFEHL4.
else.
E_T_DATA-stprs = w_verpr * E_T_DATA-QANZFEHL4.
endif.
MODIFY E_T_DATA.
ENDLOOP.
S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
ENDIF. "Initialization mode or data extraction ?
ENDFUNCTION.
Rgds,
Ravindra.
Hi Siggi,
This the fuction Module Code.
Actually this is getting Data from 2 Tables Y* and MBEW.
FUNCTION ZLRCN_VALUE.
*"----
""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
*" 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 TYPE /BAJAJ/YMFG_BW_LRCN1 OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
*"----
Example: DataSource for table ymfgt_confnotif
TABLES: ymfgt_confnotif,
mbew.
DATA : w_vprsv LIKE MBEW-VPRSV,
w_stprs LIKE MBEW-STPRS,
w_verpr LIKE MBEW-VERPR.
data wa type /BAJAJ/YMFG_BW_LRCN.
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.
Select ranges
RANGES: L_R_qmart FOR ymfgt_confnotif-qmart,
L_R_qcode FOR ymfgt_confnotif-qcode.
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 'ZLRCN_VALUE'.
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'.
L_R_QMART-SIGN = 'I'.
L_R_QMART-OPTION = 'EQ'.
L_R_QMART-LOW = 'VA'.
APPEND L_R_QMART.
L_R_QMART-SIGN = 'I'.
L_R_QMART-OPTION = 'EQ'.
L_R_QMART-LOW = 'VC'.
APPEND L_R_QMART.
L_R_QMART-SIGN = 'I'.
L_R_QMART-OPTION = 'EQ'.
L_R_QMART-LOW = 'VJ'.
APPEND L_R_QMART.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '01'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '02'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '03'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '04'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '05'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '06'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '07'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '08'.
APPEND L_R_QCODE.
L_R_QCODE-SIGN = 'I'.
L_R_QCODE-OPTION = 'EQ'.
L_R_QCODE-LOW = '09'.
APPEND L_R_QCODE.
refresh e_t_data.
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.
SELECT QMNUM FENUM QMART ERDAT WERKS BERID
KOSTL MATNR QANZFEHL4 FEGRP FECOD MNGRP
QCODE VEND_DB_NO VEND_DB_DT PAR_MATNR PARNR
appending corresponding fields of table e_t_data PACKAGE SIZE
S_S_IF-MAXSIZE
FROM ymfgt_confnotif WHERE qmart IN L_R_QMART AND
QCODE IN L_R_QCODE.
endselect.
delete e_t_data where qcode not in l_r_qcode.
ENDIF. "First data package ?
LOOP AT E_T_DATA.
select single vprsv stprs verpr
into (w_vprsv,w_stprs,w_verpr)
from mbew
where bwkey = E_T_DATA-werks
and matnr = E_T_DATA-MATNR.
if w_vprsv = 'S'.
E_T_DATA-stprs = w_stprs * E_T_DATA-QANZFEHL4.
else.
E_T_DATA-stprs = w_verpr * E_T_DATA-QANZFEHL4.
endif.
MODIFY E_T_DATA.
ENDLOOP.
S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
ENDIF. "Initialization mode or data extraction ?
ENDFUNCTION.
Rgds,
Ravindra.
Hi Ravindra,
please change your code to the following:
refresh e_t_data.
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 QMNUM FENUM QMART ERDAT WERKS BERID
KOSTL MATNR QANZFEHL4 FEGRP FECOD MNGRP
QCODE VEND_DB_NO VEND_DB_DT PAR_MATNR PARNR
FROM ymfgt_confnotif WHERE qmart IN L_R_QMART AND
QCODE IN L_R_QCODE. " and qcode not in l_r_qcode.
ENDIF. "First data package ?
clear e_t_data[].
fetch next cursor s_cursor into corresponding fields of table e_t_data package size s_s_if-maxsize.
if sy-subrc <> 0.
if e_t_data[] is initial.
close cursor s_cursor.
raise no_more_data.
endif.
endif.
LOOP AT E_T_DATA.
select single vprsv stprs verpr
into (w_vprsv,w_stprs,w_verpr)
from mbew
where bwkey = E_T_DATA-werks
and matnr = E_T_DATA-MATNR.
if w_vprsv = 'S'.
E_T_DATA-stprs = w_stprs * E_T_DATA-QANZFEHL4.
else.
E_T_DATA-stprs = w_verpr * E_T_DATA-QANZFEHL4.
endif.
MODIFY E_T_DATA.
ENDLOOP.
S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
ENDIF. "Initialization mode or data extraction ?
ENDFUNCTION.
Additionally create a index on table ymfgt_confnotif on fields qmart, QCODE and create a index on table mbew on fields bwkey and matnr.
Hope that helps!
regards
Siggi
hi Ravindra,
see that datasource of r/3 get replicated or not.if not go to the source system-->select ur application component-->replicate datasource...
after that you will get option .....
assign data source ,in this you will have 3 options like
1.content
2.application proporsal
3.others
select one and do the further process to get access the data.then when u run the infopackage u can get the data from r/3.
is this is the issue to you or anything else .just respond ....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Ravindra,
1) Are there any errors? with the source system?
2) Please replicate the data source again and activate the transfer structure again in the BW and relaod and see..
3) tryloading up to PSA only..
regards,
Hari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Inputs Pls
Any thing and every thing will be rewarded.
Rgds,
Ravindra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.