Generic extractor OK in RSA3 but no result with IP
Hi Gurus
I have a generic extractor which runs well in RSA3 but when I call it with an IPAK the R/3 job (BI_REQ) runs forever and gives no result.
This happens in full and delta mode.
Any ideas ?
Thanks
Here is the main code.
The idea is to use the input packet to create an output packet with the same structure but different fields populated.
FUNCTION zbw_biw_pricing.
*"*"Interface locale :
*" 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 STRUCTURE ZBW_KONH OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
* DI.08.0055 Remontée prix VKPB
* 'Delta hook' par BTE, voir transactions FINF, FIBF et
* MF Z_BW_BTE_DELTA_00503301_01 et Z_BW_BTE_DELTA_00503301_01_WRI
* Création
* Auteur: JWA Date: 30/04/2007
* DataSource for view of Delta Q alimenté par le BTE
TABLES: zbw_konh, usr01.
* 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,
* Vue 1 article actifs -> 1 GM
t_mara TYPE STANDARD TABLE OF zmatnr_matkl,
* Vue 1 GM -> n articles actifs
t_mara2 TYPE STANDARD TABLE OF zmatnr_matkl,
* Vue 1 division -> 1 OA + 1 Société
t_zvt001_wk TYPE STANDARD TABLE OF zvt001_wk,
* Date de validité pricing
w_datextract TYPE sydatum,
w_separator TYPE zseparateur,
* Data pour selections IP
l_r_matnr TYPE STANDARD TABLE OF matnr_ran WITH HEADER LINE,
l_r_werks TYPE STANDARD TABLE OF werks_ran WITH HEADER LINE,
l_r_spart TYPE STANDARD TABLE OF spart_ran WITH HEADER LINE,
l_r_matkl TYPE STANDARD TABLE OF matkl_ran WITH HEADER LINE.
* Data pour paramètrer VKPB
DATA :
t_matnr_low TYPE STANDARD TABLE OF matnr_ran ,
t_werks_low TYPE STANDARD TABLE OF werks_ran ,
w_t_mara TYPE zmatnr_matkl,
w_e_t_data TYPE zbw_konh,
* Data pour liste VKPB
t_liste TYPE STANDARD TABLE OF abaplist ,
t_listasci TYPE STANDARD TABLE OF zchar150 ,
* Paquet retourné d'après la liste VKPB.
e_t_data2 TYPE STANDARD TABLE OF zbw_konh .
* 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 'ZDS_PRICING'.
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
APPEND LINES OF i_t_fields TO s_s_if-t_fields.
* Date extraction
w_datextract = sy-datum.
* Vue 1 article actif -> 1 GM pour binary search.
SELECT matnr matkl spart FROM mara INTO TABLE t_mara
WHERE lvorm = ' '.
SORT t_mara BY matnr.
* Vue 1 GM -> n articles actifs pour binary search.
t_mara2[] = t_mara[].
SORT t_mara2 BY matkl.
* Vue 1 division->1 OA, divison->1 société pour binary search
SELECT * FROM zvt001_wk INTO TABLE t_zvt001_wk.
SORT t_zvt001_wk BY werks.
* Séparateur
SELECT SINGLE * FROM usr01
WHERE bname = sy-uname.
IF usr01-dcpfm = 'X'. "decimal separator is point
w_separator-sep1 = ',' . "suppress commas
ELSE.
w_separator-sep1 = '.' . "suppress points.
ENDIF.
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'.
LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'MATNR'.
MOVE-CORRESPONDING l_s_select TO l_r_matnr.
APPEND l_r_matnr.
ENDLOOP.
LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'WERKS'.
MOVE-CORRESPONDING l_s_select TO l_r_werks.
APPEND l_r_werks.
ENDLOOP.
LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'SPART'.
MOVE-CORRESPONDING l_s_select TO l_r_spart.
APPEND l_r_spart.
ENDLOOP.
LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'MATKL'.
MOVE-CORRESPONDING l_s_select TO l_r_matkl.
APPEND l_r_matkl.
ENDLOOP.
* Determine number of database records to be read per FETCH statement
* from input parameter I_MAXSIZE.
OPEN CURSOR WITH HOLD s_cursor FOR
* SELECT (s_s_if-t_fields) FROM zbw_konh
SELECT kotabnr vakey FROM zbw_konh
WHERE
kvewe = 'A' AND "Détermination prix
kappl IN ('M','V') AND "ADV et Achats'
* A modifier si nouvelle condition, + extraction des champs paramètre
kotabnr IN ('017', '018', '071', '073', '074', '079') .
ENDIF. "First data package ?
* Fetch records into interface table.
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.
* Dérivation des paramètres pour VKPB
PERFORM params_vkpb
TABLES
* Paquet entrée
e_t_data
* Paramètres lancement VKPB
t_matnr_low
t_werks_low
* Paramètres venant de l'IP
l_r_matnr
l_r_werks
l_r_matkl
l_r_spart
* vues
t_mara
t_mara2
t_zvt001_wk.
* Appel de VKPB si au moins un article trouvé
IF NOT t_matnr_low[] IS INITIAL.
PERFORM submit_vkpb
TABLES
* Paramètres lancement VKPB
t_matnr_low
t_werks_low
t_listasci
USING w_datextract.
* Interpretation Liste VKPB
* BREAK ALEREMOTE.
* BREAK JWADDELL.
PERFORM list_vkpb
TABLES
t_listasci
e_t_data2
* Paramètres venant de l'IP pour filtrage
l_r_spart
* pour le cas toutes divisions
l_r_werks
* vues
t_mara
t_zvt001_wk
* Date validité
USING w_datextract
w_separator.
* Retourner paquet
e_t_data[] = e_t_data2[].
REFRESH e_t_data2[].
ELSE.
* no data
REFRESH e_t_data[].
ENDIF.
s_counter_datapakid = s_counter_datapakid + 1.
ENDIF. "Initialization mode or data extraction ?
ENDFUNCTION.=
Similar Messages
-
Generic Extractor on Table VBAP
Hi Gurus,
I want to develop a Generic Extractor on table VBAP, but unfortunately its not giving me the extract structure when I save in RSO2, the screen wherein we select our fields are not displayed. Is there anything i am missing in the steps. Pls help us out with this issue.
I am able to create the generic extractor with other tables with usual proceedure.
Thanks in Advance.
Regards,
MSSHi
This is the problem with the amount and currency reference fields in your extract structure.
"This operation failed, because the template structure quantity fields or currency fields, for example, field CMPRE_FLT refer to a different table."
As you have an amount field, the currency reference table might be different and hence, it is giving this error.
I think u need to create view and then append the currency or quanity fields , and populate them through User exit.
Hope this helps.
Sonal... -
Generic extractors on pool table and Cluster tables
Good Afternoon all,
Can we create generic extractors on Cluster or pool Table. If yes Let me know how?
I am trying to create a Generic Extractor on BSEC Table but it is not allowing me to do this. It throws error that"Extraction from pool tables and cluster tables is not permitted"
Kindly guide me on this
Thanks,
Vaishali.Hi
you cannot do generic extraction directly on pooled or cluster tables.
You can create a function module, then you can create a Generic Data source based on this..
Hope it helps,
Thanks,
Teja
Edited by: Teja badugu on Apr 15, 2008 12:24 PM -
F1 & F2 interfaces in generic extractors using function module
Hi experts,
I created generic extractor using copy of function module RSAX_BIW_GET_DATA_SIMPLE with Delta capability. In ROOSOURCE, DataSource Extraction Method showing as F2. I checked In some blogs that we need to change the DataSource Extraction Method in ROOSOURCE table from F2 to F1 using test program . here my concern is:
1) What is meant by complete(F1) and simple(F2) interface, where our generic DataSource differs with this interface?
2) Do we need to change it from F2 to F1 in my case?
Many thanks,
Zakir.Here is the difference between an F1 interface and a F2 interface (more importing parameters for the F1 interface):
Interface F1 :
FUNCTION BUPA_CCARD_EXTRACT_BW.
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SBIWA_S_INTERFACE-REQUNR
*" VALUE(I_CHABASNM) TYPE SBIWA_S_INTERFACE-CHABASNM OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SBIWA_S_INTERFACE-INITFLAG OPTIONAL
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE OPTIONAL
*" VALUE(I_DATAPAKID) TYPE SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
*" VALUE(I_S_TIMEINT) TYPE SBIWA_S_TIMEINT OPTIONAL
*" VALUE(I_READ_ONLY) TYPE RSONLYREAD OPTIONAL
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SBIWA_T_FIELDS OPTIONAL
*" E_T_BUS0CC_BW STRUCTURE BUS0CC_BW OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
Interface F2 :
FUNCTION RSVL_CHARNO_GET_MASTER_DATA.
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE
*" OPTIONAL
*" VALUE(I_INITFLAG) LIKE RSAAPI_IF-INITFLAG OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE
*" OPTIONAL
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR OPTIONAL
*" TABLES
*" I_T_SELECT STRUCTURE RSSELECT OPTIONAL
*" I_T_FIELDS STRUCTURE RSFIELDSEL OPTIONAL
*" E_T_DATA STRUCTURE ROVERCHAR OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
The function module you copy (RSAX_BIW_GET_DATA_SIMPLE) seems actually more compatible with the F1 interface than the F2 (due to the I_REQUNR parameter).
So yes, I think you should switch your interface type to F1.
Regards,
Fred -
Missing new fields in generic extractor but present in table view
Hi
I can't see new fields in generic extractor but they are present in the table view.
Few days ago I created a generic datasource based on table view. Now I included 2 more fields in the table view but these fields doesn't show in RSA6 and RSO2.
how can i resolve this.
thanksHi Bhat,
GO to RSA5 and give ur generic extractor name ....
Click on edit the newly added fields will be hided ...so u need to uncheck the hide olumn
once this is done save that.
U will find the fields in RSA3 and RS02
Regards
vamsi -
Error while creating Generic Extractor via Function Module
Hello Guys
I have created a Generic Extractor through a Function Module. I took the Standard FM: RSAX_BIW_GET_DATA_SIMPLE, gave it a new name and activated it. I made a few changes in it, like giving my structure name for E_T_DATA and giving the list of tables, from where I need to get the data. Then I created the datasource in RSO2 by giving this function module and the extract structure.
The DS was created properly, but when I check in RSA3 for records, its giving me an error: ---> <b>The extraction program does not support object YCNA_INVY_TRNS</b>
What do i do now? Can someone please tell me, what changes I need to make in the standard FM to suit my requirements??
Thanks.Hi,
Just try to reactivate the structure once again. And when you open the function module, if the problem still persists just try to press Return key several times. The message you are getting is just a warning message.
PS: I am not sure whether this is the correct way, but i personally resolved this by pressing the ENTER key 4 or 5 times. So just give a try.
Regards
Sunil -
Error in delta generic extractor
I made a generic extractor using a Module Function. And I used the RSVD_BW_GET_DELTA_DATA function, as an example to implement the Delta process for my own generic extractor.
Although when I executed the Delta process in the RSA3 transaction, the program did not use the function I made, but used the RSC1_DELTA_BIW_GET function! So the delta process did not extract any data.
I also modified EXMETHOD field from the ROOSOURCE table:
I changed the status from F2 to F1.
Could you explain me how the delta process works in a Generic Extractor?
Is any special configuration that I missed?
Thanks for your cooperation and regards.Hi Sirneni,
Is your Init load in BW successfull. Only after
successfull completion of init load in BW the data source appears in delta queue RSA7 in R/3. Also check whether any materials are being changed in R/3 because u r delta is based on last changed date.
Regards,
Prakash B -
Generic Extractor using FM with Delta Logic
Hi,
i want to create a generic extractor with Delta Logic based on a FM.
The extractor works fine for full loads (extractor method "F" or "C"), but delivers no record for the extractor method "D" (Delta). I placed a hard coded break-point in the FM, so that the processing should stop while testing it with TC "rsa3". Using the extractor method "D" the debugger doesn't stop. So it seems, that this FM will not be processed for method "D". What could be wrong?
I tried different ways to create the generic extractor:
First i copied the template "RSAX_BIW_GET_DATA_SIMPLE" and tried to get the information for delta-run by "LOOP AT i_t_select INTO l_s_select WHERE fieldnm = 'DATE_FIELD'." But as the processing for method "D" does not consider the FM, there is no chance to get delta data.
On second try i used the template "RSAX_BIW_GET_DATA" and changed "EXMETHOD" from "F1" to "F2" in table ROOSOURCE for the Data Source. In this case i get information about the Update mode (Parameter i_updmode). But the processing leaves the FM for extractor method "D" out too.
Does anybody know, why the FM is not processed for extractor method "D"?
Is there another way to get delta capable extractors based on FMs?
Thanks for help in advance!Hello
See this blog which uses the same FM with explanation
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
See this forum too
Generic Delta Function Module
Other docs
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
http://help.sap.com/saphelp_nw04/helpdata/en/37/4f3ca8b672a34082ab3085d3c22145/content.htm
Thanks
Chandran -
Data error with generic extractor
Hi Friends!
I have a generic extractor based on view z_customer
The view is easy:
table: KNVP
fields: KUNNR, KUNN2, PARVW, MANDT
conditions: PARVW eq 'RG'
When I check the table (SE16) with customer 'X', show me only one record,
but when I run the extractor (RSA3) show me four records.
- What is wrong in my view? Perhaps something relative with the client (MANDT)?
Thank you in advance!Hi.,
It's not mandatory that you must include MANDT field in view.
check check the number of records in the created view, not in the table.
If the number of records matches in view with RSA3, then it is fine.
-- Selva -
Hi,
Has anyone attempted to write their own generic extractors to mimic the LO process because the results from this module did not meet their requirements? Would you recommend doing this?
Thanks
"<i>Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws</i>." ~ Plato (427-347 B.C.)
"<i>Forgive your enemies, but never forget their names.</i>" ~ John F. Kennedy (1917-1963)
Forgivenes - <i>Just get out of my life and spare me the anguish of pitying you</i> ~ Anonymous Author
Message was edited by:
Ellen DeGeneresThe LO process of extraction cannot be mimicked. If the requirement is such that you need more/different fields then you have the following options.
1. If the fields are in the extract structure of the datasource in question then just add the fields to the datasource and use the LO extraction process.
2. If you need to add some fields which are not in the extract structure of the datasource then add them to the datasource and use user exit to fill them.
3. If the need is for a completely different extractor. Then creat the extractor in RSO2,
More detailed info is in the weblogs by Robert Negro.
Hope this helps.
Bhargava -
Creation of generic extractor in CRM
Hi Experts,
I want to create generic extractor in CRM.
In R/3 we can use table like VBAK,VBAP..etc while creating Generic extracor.But I am not able to find tables for transactions like Activities,Opportunities ...etc in CRM.
Pls let me know how to find tables in CRM.
Regards
Vishal.Hi Vishal,
The orders tables in CRM are CRMD_ORDERADM_H (header) and CRMD_ORDERADM_I (item-level).
For other tables, usually they begin with CRMD_*. They're related to document informations, like for example: CRMD_PARTNER for partners, CRMD_ORGMAN for document organizational data, and so on....
Kind regards, -
Delta fo Generic extractor using function module
Hi,
I am using the following function module for generic extractor but its always showing me extraction error.Could anyone please suggest to resolve the issue.
Thanks in advance fo rsuggestion.
FUNCTION Z_BW_SALESDATA_EXTRACT_CHNG2.
""Local interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SBIWA_S_INTERFACE-REQUNR
*" VALUE(I_ISOURCE) TYPE SBIWA_S_INTERFACE-ISOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SBIWA_S_INTERFACE-INITFLAG OPTIONAL
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE OPTIONAL
*" VALUE(I_DATAPAKID) TYPE SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
*" VALUE(I_PRIVATE_MODE) OPTIONAL
*" VALUE(I_CALLMODE) LIKE ROARCHD200-CALLMODE OPTIONAL
*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SBIWA_T_FIELDS OPTIONAL
*" E_T_DATA OPTIONAL
*" E_T_SOURCE_STRUCTURE_NAME OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
The input parameter I_DATAPAKID is not supported yet !
Example: InfoSource containing TADIR objects
TABLES: VBFA,VBRK,tadir.
Auxiliary Selection criteria structure
DATA: l_s_select TYPE sbiwa_s_select.
Maximum number of lines for DB table
STATICS: l_maxsize TYPE sbiwa_s_interface-maxsize.
user defined variables.
DATA : X_UPDMODE(1) Type c, " Update Type
X_LastUpdate Like Sy-Datum. " Last Update Date
X_LastUpdate TYPE RODELTAID. " Last Update Date "TCS_KAP
Select ranges
RANGES: L_R_VBELN FOR VBAK-VBELN,
L_R_AUDAT FOR VBAK-AUDAT.
Parameter I_PRIVATE_MODE:
Some applications might want to use this function module for other
purposes as well (e.g. data supply for OLTP reporting tools). If the
processing logic has to be different in this case, use the optional
parameter I_PRIVATE_MODE (not supplied by BIW !) to distinguish
between BIW calls (I_PRIVATE_MODE = SPACE) and other calls
(I_PRIVATE_MODE = X).
If the message handling has to be different as well, define Your own
messaging macro which interprets parameter I_PRIVATE_MODE. When
called by BIW, it should use the LOG_WRITE macro, otherwise do what
You want.
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
The input parameter I_DATAPAKID is not supported yet !
Invalid second initialization call -> error exit
IF NOT g_flag_interface_initialized IS INITIAL.
IF 1 = 2. MESSAGE e008(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'008' "message number
' ' "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDIF.
Check InfoSource validity
CASE i_isource.
WHEN 'Z_BW_SDDATA_CREATEON'.
WHEN 'Y'.
WHEN 'Z'.
WHEN OTHERS.
IF 1 = 2. MESSAGE e009(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'009' "message number
i_isource "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDCASE.
Check for supported update mode
CASE i_updmode.
WHEN 'F'.
WHEN OTHERS.
IF 1 = 2. MESSAGE e011(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'011' "message number
i_updmode "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDCASE.
Check for obligatory selection criteria
READ TABLE i_t_select INTO l_s_select WITH KEY fieldnm = 'VBELN'.
IF sy-subrc <> 0.
IF 1 = 2. MESSAGE e010(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'010' "message number
'PGMID' "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDIF.
APPEND LINES OF i_t_select TO g_t_select.
Fill parameter buffer for data extraction calls
g_s_interface-requnr = i_requnr.
g_s_interface-isource = i_isource.
g_s_interface-maxsize = i_maxsize.
g_s_interface-initflag = i_initflag.
g_s_interface-updmode = i_updmode.
g_s_interface-datapakid = i_datapakid.
g_flag_interface_initialized = sbiwa_c_flag_on.
Store Update mode in static variable...
X_UPDMODE = I_UPDMODE.
Select Single DELTAID
Into X_LastUpdate
From ROOSGENDLM
Where OLTPSOURCE = 'Z_BW_SDDATA_CREATEON'.
If X_LastUpdate Is Initial.
X_LastUpdate = '19800101'. " The oldest..., this should not happen
Endif.
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 g_t_segfields.
ELSE. "Initialization mode or data extraction ?
Data transfer: First Call OPEN CURSOR + FETCH
Following Calls FETCH only
X_UPDMODE = I_UPDMODE.
First data package -> OPEN CURSOR
IF g_counter_datapakid = 0.
Fill range tables for fixed InfoSources. In the case of generated
InfoSources, the usage of a dynamical SELECT statement might be
more reasonable. BIW will only pass down simple selection criteria
of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
LOOP AT g_t_select INTO l_s_select WHERE fieldnm = 'VBELN'.
MOVE-CORRESPONDING l_s_select TO L_R_VBELN.
APPEND L_R_VBELN.
ENDLOOP.
LOOP AT g_t_select INTO l_s_select WHERE fieldnm = 'AUDAT'.
MOVE-CORRESPONDING l_s_select TO L_R_AUDAT.
APPEND L_R_AUDAT.
ENDLOOP.
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 InfoSource table lines and database entries, this is trivial.
In other cases, it may be impossible and some estimated value has to
be determined.
*added by Yogesh
DELETE FROM ZBWSALEDATA.
*ended by Yogesh
l_maxsize = g_s_interface-maxsize.
Check for supported update mode
CASE X_UPDMODE.
WHEN 'F' Or 'I'. " Full or Init
**get sales orders
SELECT *
INTO CORRESPONDING FIELDS OF TABLE I_SALESDATA
FROM VBAK AS K
INNER JOIN VBAP AS P
ON PVBELN = KVBELN
WHERE K~VBELN IN L_R_VBELN
AND K~AUDAT IN L_R_AUDAT
AND K~VBTYP = 'C'.
IF I_SALESDATA[] IS NOT INITIAL.
PERFORM F_GET_DATA. "get data
PERFORM F_DEL_VATCOND. "delete vat conditions
PERFORM F_GET_TAR_COSTUNIT. "get tariff cost unit
PERFORM F_GET_NETVAL TABLES IT_VBDPA1. "get net val of the item
PERFORM F_GET_SALESDATA.
*write perform with name F_INSERT_DB_ZBWSALEDATA.
PERFORM F_INSERT_DB_ZBWSALEDATA. "insert into table ZBWSALESDATA
LOOP AT I_SALESDATA WHERE NETPR = 0.
MOVE-CORRESPONDING I_SALESDATA TO I_SALESDATA_FIN.
APPEND I_SALESDATA_FIN.
ENDLOOP.
SORT I_SALESDATA_FIN BY VBELN POSNR KSCHL.
DELETE ADJACENT DUPLICATES FROM I_SALESDATA_FIN
COMPARING VBELN POSNR
KSCHL.
INSERT ZBWSALEDATA FROM TABLE I_SALESDATA_FIN.
ENDIF.
WHEN 'D'. " Delta
SELECT *
INTO CORRESPONDING FIELDS OF TABLE I_SALESDATA
FROM VBAK AS K
INNER JOIN VBAP AS P
ON PVBELN = KVBELN
WHERE K~ERDAT >= X_LastUpdate
WHERE K~ERDAT >= X_LastUpdate+0(8) "TCS_KAP
AND K~VBTYP = 'C'.
IF I_SALESDATA[] IS NOT INITIAL.
PERFORM F_GET_DATA. "get data
PERFORM F_DEL_VATCOND. "delete vat conditions
PERFORM F_GET_TAR_COSTUNIT. "get tariff cost unit
PERFORM F_GET_NETVAL TABLES IT_VBDPA1. "get net val of the item
PERFORM F_GET_SALESDATA.
*write perform with name F_INSERT_DB_ZBWSALEDATA.
PERFORM F_INSERT_DB_ZBWSALEDATA. "insert into table ZBWSALESDATA
LOOP AT I_SALESDATA WHERE NETPR = 0.
MOVE-CORRESPONDING I_SALESDATA TO I_SALESDATA_FIN.
APPEND I_SALESDATA_FIN.
ENDLOOP.
SORT I_SALESDATA_FIN BY VBELN POSNR KSCHL.
DELETE ADJACENT DUPLICATES FROM I_SALESDATA_FIN
COMPARING VBELN POSNR
KSCHL.
INSERT ZBWSALEDATA FROM TABLE I_SALESDATA_FIN.
ENDIF.
WHEN OTHERS.
IF 1 = 2. MESSAGE E011(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'011' "message number
I_UPDMODE "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.
**end get sales orders
OPEN CURSOR WITH HOLD g_cursor FOR
SELECT (g_t_fields) FROM ZBWSALEDATA.
WHERE pgmid IN l_r_pgmid AND
object IN l_r_object.
ENDIF. "First data package ?
Fetch records into interface table. There are two different options:
- fixed interface table structure for fixed InfoSources have to be
named E_T_'Name of assigned source structure in table ROIS'.
- for generating applications like LIS and CO-PA, the generic table
E_T_DATA has to be used.
Only one of these interface types should be implemented in one API !
FETCH NEXT CURSOR g_cursor
APPENDING CORRESPONDING FIELDS
OF TABLE E_T_DATA
PACKAGE SIZE l_maxsize.
IF sy-subrc <> 0.
CLOSE CURSOR g_cursor.
RAISE no_more_data.
ENDIF.
g_counter_datapakid = g_counter_datapakid + 1.
ENDIF. "Initialization mode or data extraction ?
Best regards,
YogeshDear Yogesh,
Try to debug the code by putting a break point at select statement...is the FM Syntactically correct ??
Check the Select statements..if all fields are not required avoid using Select * , and use always for all entries rather than JOINS..
Note : For Joins you have to specify the Fields in the Select...Dont use Select * ....
Hope it helps..
Thanks,
Krish -
How to reduce long extraction time - Generic extractor based on view
Hello. The previous thread about this error was closed without any answer.
I'm in the same configuration.
"Using a generic extractor (Delta enabled on confirmation date) based on view to load data from ECC6 to BI.
Now my issue is that the delta extraction is running for a long time (around 1 hr) even if the data volume is very small
While checking the job overview in source system i saw that the job is hanging at the below step for almost 1 hr."
1 LUWs confirmed and 1 LUWs to be deleted with function module MF RSC2_QOUT_CONFIRM_DATA.
I am not understanding why this is happening.
Here is the log of the job:
30.05.2011 03:58:11 Job started
30.05.2011 03:58:11 Step 001 started (program SBIE0001, variant &0000000166864, user ID ALEREMOTE)
30.05.2011 03:58:11 Asynchronous transmission of info IDoc 2 in task 0001 (0 parallel tasks)
30.05.2011 03:58:11 DATASOURCE = 0CO_OM_WBS_6
30.05.2011 03:58:11 *************************************************************************
30.05.2011 03:58:11 * Current Values for Selected Profile Parameters *
30.05.2011 03:58:11 *************************************************************************
30.05.2011 03:58:11 * abap/heap_area_nondia......... 4000000000 *
30.05.2011 03:58:11 * abap/heap_area_total.......... 8000000000 *
30.05.2011 03:58:11 * abap/heaplimit................ 100000000 *
30.05.2011 03:58:11 * zcsa/installed_languages...... DEFS *
30.05.2011 03:58:11 * zcsa/system_language.......... E *
30.05.2011 03:58:11 * ztta/max_memreq_MB............ 2047 *
30.05.2011 03:58:11 * ztta/roll_area................ 6500000 *
30.05.2011 03:58:11 * ztta/roll_extension........... 2000000000 *
30.05.2011 03:58:11 *************************************************************************
30.05.2011 03:58:11 1 LUWs confirmed and 1 LUWs to be deleted with function module RSC2_QOUT_CONFIRM_DATA
30.05.2011 05:02:53 Call customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 171 records
30.05.2011 05:02:53 Result of customer enhancement: 171 records
30.05.2011 05:02:53 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 171 records
30.05.2011 05:02:53 Result of customer enhancement: 171 records
30.05.2011 05:02:53 Asynchronous send of data package 1 in task 0002 (1 parallel tasks)
30.05.2011 05:02:53 IDOC: Info IDoc 2, IDoc No. 4667050, Duration 00:00:00
30.05.2011 05:02:53 IDoc: Start = 30.05.2011 03:58:11, End = 30.05.2011 03:58:11
30.05.2011 05:02:53 tRFC: Data Package = 1, TID = AC11082D38B44DE308DD028A, Duration = 00:00:00, ARFCSTATE = RECORDED
30.05.2011 05:02:53 tRFC: Start = 30.05.2011 05:02:53, End = 30.05.2011 05:02:53
30.05.2011 05:02:53 Altogether, 0 records were filtered out through selection conditions
30.05.2011 05:02:53 Asynchronous transmission of info IDoc 3 in task 0003 (0 parallel tasks)
30.05.2011 05:02:53 IDOC: Info IDoc 3, IDoc No. 4667051, Duration 00:00:00
30.05.2011 05:02:53 IDoc: Start = 30.05.2011 05:02:53, End = 30.05.2011 05:02:53
30.05.2011 05:02:53 Synchronized transmission of info IDoc 4 (0 parallel tasks)
30.05.2011 05:02:53 IDOC: Info IDoc 4, IDoc No. 4667052, Duration 00:00:00
30.05.2011 05:02:53 IDoc: Start = 30.05.2011 05:02:53, End = 30.05.2011 05:02:53
30.05.2011 05:02:53 Job finished
Thanks for your help.
YannParth Kulkarni,
following the note and the other thread, I've check the index 4 of the table COEP.
Here is what I got:
Index ID COEP - 4
Short text MANDT/TIMESTMP/OBJNR, Index for Delta read method (CO-PA)
Last changed SAP 04.01.2010
Status Active Saved
Does not exist in the database
DB index nme
Not defined as DB index in the ABAP Dictionary
Is the fact that it doesn't exist in the database a problem ?
Is the fact that it is active is good enough ?
By the way thanks for your speedy reply !
Yann
Edited by: Yann GOFFIN on May 30, 2011 1:35 PM -
Create generic extractor based on 2 tables
hey BI gurus,
I have to create a generic extractor based on these 3 tables:
eban - i need all fields
vttk - i need only 4 fields i.e
route,
tknum,
datbg,
daten
ekbe - budat.
now the problem is thr is no common field between vttk & eban AND vttk & ekbe. but thr is a common field between eban & ekbe.so i can create a view only on these 2 tables but i want 3 tables
how do i proceed???Hi,
Sometimes, if your application or requirement makes it necessary, you have to create your own function module to extract the data from whatever sap system to bw.
Therefore you normally make a copy of the standard fm 'RSAX_BIW_GET_DATA_SIMPLE'. To make this new function work for you, you have to realize the following.
1.) the fm gets called by the extraction api for at least 2 times. First time is for initialization and from the 2nd time on it is for data extraction.
2.) right after the last data package (somehow you need to make sure that it is the last one) you have to raise the exception no_more_data.
Refer this links for more Info
SAP BI Generic Extraction Using a Function Module
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
SAP Network Blog: Generic Extraction via Function Module
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
Take the help of an ABAPer if your are new to this process
Regards
Karthik
Assigning points is the way to say thanks -
0RecordMode implementation in Generic Extractor & ODS
Hi All,
We have scenario of generic extractor supplying data to ODS . Now we want to implement deletion functionality using record mode .
We have added 0recordmode to ODS and infosource . What additional thing we need to do in case of achieving deletion of data from ODS . ( Tried supplying record mode D to ODS but system doesnt delete the record).
One more thing is in ods we have 4 keyfields out of which we are able to supply only 3 fields in the infosource which supplies data deletion records.
Could any body please explain as how to achieve this ...
Thanks !
Regards
Mr KapadiaHi Kapadia,
In transfer rules level change the record mode to R rather than D. Let me know if you have any questions.
Assign points if it helps.
Regards
Satish Arra
Maybe you are looking for
-
Episode shows up in Podcast app but is "not downloadable"
I am aware that iTunes is having some problems but I can't tell if this is associated with those since I had this same problem once back in November and it was never resolved. I podcast on Tumblr, but I use feedburner to create enclosures on rich med
-
How to import schema into logical standby database
i had created a new schema(A)in different database and exported the schema into a dmp file using export utility from the exported dmp file i want to import that schema(A) into logical standby database using import utility iam importing as system user
-
Getting source codn with TEXT file
Hi everyone. I have a question about to get a source code using some kind of function or class. In case of report program coded in ABAP, I can get using "read report ... " In case of BSP,However, I don't know how. Anyone who knows the method lets me
-
Where can i find the serial no for my copy of LR 5.7?
i need to find the serial no for my copy of lr 5.7 to activate my copy of LR 6. Where should i look. The serial no in my system info has the last 4 digits x out.
-
Cannot get the App store on my IPhone to accept my password....worked on the MacPro....gave up and reset a new password and it still doesn't work on the IPhone. Error message is "Unknown Error". Anyone else having these issues?