Upload
wicval
View
218
Download
10
Embed Size (px)
DESCRIPTION
Generic extracción - function module
Citation preview
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 1/11
Getting Started Newsletters Store
Products Services & Support About SCN Downloads
Industries Training & Education Partnership Developer Center
Lines of Business University Alliances Events & Webinars Innovation
Login RegisterWelcome, Guest Search the Community
Activity Communications Actions
Brow se
siegfried.szameitat
Previous
post
Next
post
0 Tweet 0
How does the extraction api work in case you are extracting data using a self defined function module with
generic delta?
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.
Example with lots of comments
FUNCTION RSAX_BIW_GET_DATA_SIMPLE.
*"--------------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" 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 SFLIGHT OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
*"--------------------------------------------------------------------------
* 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.
* Initialization mode (first call by SAPI) or data transfer mode
IF I_INITFLAG = SBIWA_C_FLAG_ON.
* the coding here will be processed the first time the fm gets called.
* it is used to populate static or global variables and to check wether
* it's called by the right datasource or not.
ELSE. "Initialization mode or data extraction ?
* this part will be executed from the 2nd call on
* First data package -> OPEN CURSOR
Generic Extraction via Function Module
Posted by Siegfried Szameitat in siegfried.szameitat on Sep 29, 2005 9:14:25 AM
Share 0Like
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 2/11
Average User Rating
(0 ratings)
My Rating:
0 Tweet 0
IF S_COUNTER_DATAPAKID = 0.
* in case it is for the first data package, range tabs gets filled, a cursor will
* be opened or a initial dataset will be read from database into a global internal table
* this has to be done here, with the first data package, to avoid getting the same data with
* each call of the fm.
* additionally you can check wether you get select-options for your 'generic delta'-field or not,
* and, if it is provided, you are able to set a flag in order to do different selections
* based on this flag for delta or full load.
ENDIF. "First data package ?
* from now on records gets fetched from the database or gets read from the internal table
* and the return table e_t_data gets populated with the number of rows given by parameter s_s_if-maxsize.
* if the last record is populated to table e_t_data you need to raise the exeption no_more_data
* and you need to close the cursor, if you opened one.
* with each data package you also have to increase s_counter_datapakid.
ENDIF. "Initialization mode or data extraction ?
ENDFUNCTION.
If you forget to raise no_more_data, the extraction api will call the fm forever.
7481 View s
Share 0Like
44 Comments
Like (0)
Arturo Snchez Mar 2, 2006 11:11 AM
Hi Siegfried,
Your example is very good, but I dont understand manage of delta load, this is a work of BW or Ineed to develop it in my FM? I was created a FM for generic extraction, with a Extract Structure view(and fill it a select condition tab with because a need to save DB space:table field operator Comparative ValueEKPO AEDAT GE '20051001').
The FM ran wrong because the delta is mayor than the initialization delta load.
I have only a difference than the standard FM this manage is correct? I only need the information bythe last 62 days.
data: f_extra = sy-datum - 62. SELECT (S_S_IF-T_FIELDS) FROM EKPO WHERE AEDAT >= f_extra.
Can U send me an example code of a FM with a few fields?
Thanks for your help.
Regards,Arturo
Like (0)
Siegfried Szameitat Mar 3, 2006 6:38 AM (in response to Arturo Snchez)
Hi Arturo,
please let me know your email adress and I will sent you a template.
Siggi
Siegfried Szameitat Mar 3, 2006 6:40 AM (in response to Siegfried Szameitat)
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 3/11
Like (0)
Arturo,
my email can be found in my business card.
Siggi
Like (0)
Arunava Ganguly Apr 5, 2006 11:25 PM (in response to Siegfried Szameitat)
Hi Siggy,
I have written a FM ( QUITE A COMPLEX ONE) data extractor using. Mymain table has two fields( create /change DATA and Create/ChangeTime) How can I effectively write this to make this delta enabled.ThxArunava
Like (0)
Community User Jul 3, 2008 8:13 AM (in response to Arunava Ganguly)
Hi Siggy, I have the same problem with him. Pls send medocument. My email is : [email protected]
Like (0)
Community User Jul 3, 2008 8:13 AM (in response to Arunava Ganguly)
Hi Siggy, I have the same problem with him. Pls send medocument. My email is : [email protected]
Like (0)
Sreeni N Jan 13, 2009 9:50 PM (in response to Siegfried Szameitat)
Hi Siggi,
Could you please send a copy of the Function Module extraction(deltaextraction) template to my mail id.
thanks,
my email is: [email protected]
Sai
Like (0)
Meena Kabra Oct 30, 2009 6:16 AM (in response to Sreeni N)
Please can anyone send me the same.Thanks
Like (0)
Saleem Shaikh Dec 30, 2010 6:15 AM (in response to Sreeni N)
Can anyone please send me the same i.e. manage delta in theFM
ThanksSal
Like (0)
Saleem Shaikh Dec 30, 2010 6:25 AM (in response to Saleem
Shaikh)
Please send me the FM to manage delta.Please sendto [email protected]
Like (0)
Jose Angelo Ladim Sep 17, 2006 11:56 PM (in response to Siegfried Szameitat)
Hi Siggy,
Could you send a copy of the template you mentioned? i am trying to extract anabap report using FM. thanks! my email ad is [email protected].
Chandu Mandepudi Apr 15, 2008 1:14 AM (in response to Siegfried Szameitat)
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 4/11
Like (0)
Hi Siggi
Could you please send the template to [email protected].
Regards,
Chama.
Like (0)
Paul Porta May 9, 2008 4:01 AM (in response to Siegfried Szameitat)
Hi Siggy,
Could you send a copy of the template you mentioned? (delta extractor)thanks! my email is [email protected].
Like (0)
Aline Brunen Jun 18, 2009 1:48 AM (in response to Siegfried Szameitat)
Hi Siggi,can you send me the template also. I am facing the same problems.
[email protected] a lot!!Aline
Like (0)
Meena Kabra Oct 30, 2009 6:17 AM (in response to Siegfried Szameitat)
My email id [email protected]. Please send me the template yo handlethe delta in FM.
Like (0)
Arturo Snchez Mar 3, 2006 5:34 PM
[email protected] I will appreciate your help.
Thanks
Arturo.
Like (0)
Mariem GHOUAIEL May 24, 2006 8:11 AM
Hello,I have a different problem whith FM and DS :We use the 0MATERIAL_LKLS_HIER hierarchy datasource to load material hierachy in BW.I had to modify the function module CLBW_HIERARCHY_TRANSFER_LKLS that creates thehierarchy.Now, i need to create a new datasource based on the new function module(Z_CLBW_HIERARCHY_TRANSFER_LKLS).To do so, i created a generic datasource (with SBIW), a master data attributes datasource. I tried to put the same parameters that in 0MATERIAL_LKLS_HIER, but i didn't find how to indicatethat it's a hierarchy and some other parameters (as you can see in RSA2 for0MATERIAL_LKLS_HIER in the "semantic attributes" area).Also, i couldn't run the new datasource in RSA3 because it didn't show me the right selection fields.Then i tried BW10 but it generated a datasource for application component FI-SL-IO (internal nameROOTYPEHC) and with the extractor GSBH_HIERARCHY_TRANSFER_SETS, when what i need is adatasource for application component LO-IO (internal name 0MATERIAL) and with extractor Z_...Have you any idea form me ?thanks.MGH
rishi malhotra Aug 25, 2006 12:25 AM
Hi Siegfried,
I am not able to manage delta loads in my FM.
I need to have deltas for the last 3 days ( sy-datum - 3) I can compare it in my 'where' condition of my select statement. But how the program will know whether its a delta load or a full load.Can you help mer in this ?
Regards, Rishi
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 5/11
Like (0)
Like (0)
SHIRISH MAHAJAN Jan 17, 2008 6:25 AM (in response to rishi malhotra)
Hi friends,
I am facing exactly similar issue with the Function Module's interface not providing meansto identify whether the load is a delta. Did any of you get a solution to this issue. I will greatlyappreciate some tips on this.Thanks
Like (0)
SHIRISH MAHAJAN Jan 17, 2008 6:30 AM (in response to rishi malhotra)
I am facing exactly similar issue with the Function Module's interface not providing meansto identify whether the load is a delta. I will greatly appreciate knowing how this issue canbe handled.Thanks
Like (0)
Sajeed M S Sep 18, 2006 2:14 AM
Hi Siggi,
Can you send me the template of Delta Loads in FM.
ThanksSajeed
Like (0)
Markus Hochreiter Sep 18, 2007 1:10 AM (in response to Sajeed M S)
can you also sent me the mentioned delta [email protected]
Thanks,markus
Like (0)
Uma mahesw ara Rao A Nov 22, 2006 11:59 PM
i have a doubt........ i have to make changes in FM of extractor. What the FM does give some valueswhich are extracted into the item table...when i check or test the extractor for a value of commorcial agreement say 717 it gives me all thevalues present in the table but i want only the distinct values of 717 in testing the extractor.
Like (0)
arvind mohan Dec 21, 2006 7:31 AM
Hi Siggi,
Could you please send me the document for creating with Delta enabled and also how does it work.
Kindly let me know what fields are passed to I_T_SELECT and I_T_FIELDS.
Please draft this to [email protected]
Thanks,Arvind M
Like (0)
Linda Brunton Jan 18, 2007 5:57 PM
Hi Siggy,
I am trying to create an FM in a CRM 5.0 system. I have copied the sample FMRSAX_BIW_GET_DATA_SIMPLE. When I try to change the E_T_DATA table parameter to mystructure, I receive message FL069 "TABLES parameters are obsolete!". Have you encountered thisproblem ?
Thanks and regards,Linda
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 6/11
Like (0)
Siegfried Szameitat Jan 23, 2007 3:17 AM (in response to Linda Brunton)
Hi Linda,
yes I already faced the same issue. But it is just a warnig and you can ignore it. I guess inthe next future there will be a change here.
kind regards
Siggi
Like (0)
Linda Brunton Jan 23, 2007 7:34 PM (in response to Siegfried Szameitat)
Thanks Siggi,I could not exit the tables tab once the warning message was displayed. However, I have since discovered that you don't need to specify the type spec andthe associated type at all. You can just leave them blank and only specifyE_T_DATA in the Parameter Name. The extractor seems to work just fine.Cheers,Linda
Like (0)
Yuva Raaju Jan 20, 2007 6:08 AM
Hello Sig, Could you please send me the document for creating data extract with Delta enabled.
Thanks.
Like (0)
G P Feb 13, 2007 9:13 AM
Hi - RSAX_BIW_GET_DATA_SIMPLE is assuming that the data source is a TABLE. I have a similar needwherein my function is pulling data from various sources & loading the net result into an internaltable (structure). Do I have to follow the same methodology to feed my cube from this internal table ?
Like (0)
Claes Widestadh Mar 6, 2007 6:49 AM (in response to G P)
HI GP, I have the exact same problem, have you figured out how to manage this?
Best RegardsClaes
Like (0)
Andrei Grechko Nov 11, 2008 11:41 AM (in response to Claes Widestadh)
did you figure it out?
"Hi -RSAX_BIW_GET_DATA_SIMPLE is assuming that the data source is a TABLE. Ihave a similar need wherein my function is pulling data from various sources &loading the net result into an internal table (structure). Do I have to follow the samemethodology to feed my cube from this internal table ?
* Extraction via Function Module 2007-03-06 06:49:31 Claes Widestadh Business Card [Reply]
HI GP, I have the exact same problem, have you figured out how to manage this?"
Thanks
Nishu Gupta Mar 8, 2007 6:20 AM
Do i need to copy all the includes dat are present in standard function module ..wen i m using rsa3 its giving errorError 6 in function module RSS_PROGRAM_GENERATEdo let me know my code is
FUNCTION Z_BIW_GET_DATA_SIMPLE.*"----------------------------------------------------------------------
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 7/11
*"*"Local Interface:*" IMPORTING*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR OPTIONAL*" 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 OPTIONAL*" EXCEPTIONS*" NO_MORE_DATA*" ERROR_PASSED_TO_MESS_HANDLER*"----------------------------------------------------------------------
* Example: DataSource for table SFLIGHT
TABLES: ZQUOTATION.
* Auxiliary Selection criteria structureDATA : L_S_SELECT TYPE SRSC_S_SELECT.DATA : GIT_QTN type table of ZQUOTATION with header line .DATA : GIT_TAB type table of BBP_PDS_CND with header line .
* Maximum number of lines for DB tableSTATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
* counterS_COUNTER_DATAPAKID LIKE SY-TABIX,
* cursorS_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 validityCASE I_DSOURCE.WHEN '0SAPI_SFLIGHT_SIMPLE'.WHEN OTHERS.IF 1 = 2. MESSAGE E009(R3). ENDIF.* this is a typical log call. Please write every error message like thisLOG_WRITE 'E' "message type'R3' "message class'009' "message numberI_DSOURCE "message variable 1' '. "message variable 2RAISE ERROR_PASSED_TO_MESS_HANDLER.ENDCASE.
APPEND LINES OF I_T_SELECT TO S_S_IF-T_SELECT.
* Fill parameter buffer for data extraction callsS_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 CURSORIF 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'.select * from ZQUOTATIONinto table GIT_QTN .
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 8/11
Like (0)
LOOP AT GIT_QTN .CALL FUNCTION 'BBP_PDCND_GETDETAIL'EXPORTINGi_p_guid = GIT_QTN-GUID1* I_P_KIND = 'B'* I_OBJECT_TYPE = 'BUS2000136'* IV_VERSION_TYPE = ' 'iv_header_guid = GIT_QTN-HEADER* IV_WITH_DELETED_RECORDS = ' 'IMPORTINGET_CONDITIONS = GIT_TAB* E_COM =* TABLES* E_T_DATA =.MOVE-CORRESPONDING GIT_TAB TO E_T_DATA.
ENDLOOP.
* LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CARRID'.* MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.* APPEND L_R_CARRID.* ENDLOOP.** LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.* MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.* APPEND L_R_CONNID.* 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 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.
S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
ENDIF. "Initialization mode or data extraction ?
ENDFUNCTION.
Like (0)
Bhaskar Rao Javvaji Sep 13, 2007 5:16 AM
Hi,i am tyring to craete ZCOPY of "RSAX_BIW_GET_DATA_SIMPLE" . but if i try to check this one, itsshowing "SRSC_S_IF_SAMPLE" is unkmnown even after mention 'SRSC' type-pools.
Thanks in advance,Bhaskar
Like (0)
sreenu vasu May 31, 2008 12:21 AM (in response to Bhaskar Rao Javvaji)
hello,
can u help me in this problem.i am also facing same problem
D d Oct 7, 2007 2:24 PM
HI SIGGI,how would i do delta on only VBBE TABLE
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 9/11
Like (0)
Regards pallavi
Like (0)
Abhi Pandey May 13, 2008 9:49 AM
Hi Siggy - I need to do a delta extraction based on AEDAT or ERDAT. If AEDAT is initial, then load delta basedon ERDAT. If AEDAT is not initial, then load delta based on AEDAT. Is this possible via the delta-enabled generic extractor using FM.
Thanks!!abhi
Like (0)
Andrew Jabbitt May 27, 2008 5:09 AM
Hi siggi,
Thanks for a great weblog. I have been able to apply it successfully to extract long texts from tableSTXL.
But I have a problem whenever the parameter: i_maxsize is greater than the size of the extracteddataset. It seems the 'no_more_data' exception closes the connection before e_t_data is receivedand I get 0 records.
Any idea what I am doing wrong?
Rgrds,Andrew
Like (0)
Romina Canales Jun 11, 2008 2:21 PM
Hi,Im new at this.. I am also trying to craete a COPY of "RSAX_BIW_GET_DATA_SIMPLE" . Its showing"SRSC_S_IF_SAMPLE" is unkmnown. I added: Type-pools: SRSC. in the main program of thefunction group.
Thanks for your help,Romina
Like (0)
Lucas Mena May 27, 2010 12:18 PM (in response to Romina Canales)
Hi Romina!did you solve the problem?i have the same errorregards
LUCAS
Like (0)
Shalini R Jun 18, 2008 6:05 AM
Hi,I am in a situation whereby a generic extractor has to be created based on the table CDHDR andCDPOS(Cluster table) to track change document details.I guess a FM is an only way out.
Do you have any suggestions on how to maintain a delta extraction on this?
Thank you.
Kenneth Hartman Jul 22, 2008 2:46 PM
It seems that if I populate E_T_DATA priror to the "Fetch" statement I receive 0 records, but if I do itafterwards I go into an endless loop. Please see the code below and provide a sample or critique onwhere the code is incorrect. tables: pa0000. data: l_s_selecttype srsc_s_select.* t_pernr TYPE TABLE OF w_pernr.* Maximumnumber of lines for DB table statics: s_s_if type srsc_s_if_simple,*counter s_counter_datapakid like sy-tabix,* cursor s_cursor typecursor.* Select ranges ranges: l_r_pernr for zbw_payroll_str-pernr, l_r_fpbeg for zbw_payroll_str-fpbeg, l_r_fpend for zbw_payroll_str-fpend,* L_R_Z_P_FRDAT FOR ZBW_PAYROLL_STR-Z_P_FRDAT,* L_R_Z_P_FRTIM FORZBW_PAYROLL_STR-Z_P_FRTIM, l_r_chkdt for zbw_payroll_str-chkdt.*Initialization mode (first call by SAPI) or data transfer mode* (following calls) ? ifi_initflag = sbiwa_c_flag_on.
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 10/11
Like (0)
*********************************************************************** Initialization: check inputparameters* buffer input parameters* prepare dataselection*********************************************************************** append lines of i_t_select to s_s_if-t_select.* Fill parameter buffer for dataextraction 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 casethat there is no 1:1 relation between InfoSource fields* and database table fields this may be farfrom beeing trivial) append lines of i_t_fields to s_s_if-t_fields. else. "Initialization mode or data extraction ?*********************************************************************** Data transfer: FirstCall OPEN CURSOR + FETCH* Following Calls FETCHonly*********************************************************************** First datapackage -> OPEN CURSOR* BREAK-POINT. if s_counter_datapakid = 0.*Fill range tables BW will only pass down simple selection criteria* of the type SIGN = 'I' andOPTION = 'EQ' or OPTION = 'BT'. loop at s_s_if-t_select into l_s_select where fieldnm ='PERNR'. move-corresponding l_s_select to l_r_pernr. append l_r_pernr. endloop.* LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM ='FPBEG'.* MOVE-CORRESPONDING L_S_SELECT TO L_R_FPBEG.* APPENDL_R_FPBEG.* ENDLOOP. LOOP AT S_S_IF-T_SELECT INTO L_S_SELECTWHERE FIELDNM = 'FPEND'.* MOVE-CORRESPONDING L_S_SELECT TO L_R_FPEND.* APPEND L_R_FPEND.* ENDLOOP. LOOP AT S_S_IF-T_SELECTINTO L_S_SELECT WHERE FIELDNM = 'CHKDT'.* MOVE-CORRESPONDINGL_S_SELECT TO L_R_CHKDT.* APPEND L_R_CHKDT.* ENDLOOP. loop at s_s_if-t_select into l_s_select where fieldnm = 'Z_P_FRDAT'. move-corresponding l_s_select to s_frdat. append s_frdat. endloop. loop ats_s_if-t_select into l_s_select where fieldnm = 'Z_P_FRTIM'. move-corresponding l_s_select to s_frtim. append s_frtim. endloop.*Determine number of database records to be read per FETCH statement* from input parameterI_MAXSIZE. If there is a one to one relation* between DataSource table lines and databaseentries, this is trivial.* In other cases, it may be impossible and some estimated value hasto* be determined. open cursor with hold s_cursor for select distinct pernrfrom pa0000 where pernr in l_r_pernr and stat2 = '3'. 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. perform fill_e_t_data tablese_t_data using s_counter_datapakid . close cursor s_cursor. raise no_more_data. else.* Fill E_T_DATA* PERFORM fill_data TABLESl_r_pernr e_t_data* USING s_counter_datapakid . perform fill_e_t_datatables e_t_data using s_counter_datapakid . endif. s_counter_datapakid = s_counter_datapakid + 1. endif. "Initialization mode or dataextraction ?&----
& Form fill_e_t_data&--
text*--
-->E_T_DATA text* >REF_COUNTER_DATAPAKID text*--
form fill_e_t_data tables e_t_data structure zbw_payroll_str usingref_counter_datapakid. FIELD-SYMBOLS :
Like (0)
Sameer Pathak Jul 23, 2008 6:09 AM
Hi,
I was wondering if creating multiple extraction FMs in the same function group, affects it's working ifevery FM is run in parallel.
Kindly comment.
Regards,Sameer
Like (0)
Nagesw ara Reddy Jul 9, 2009 12:16 AM
Hi Siggi,
I created a Custom Extractor using FM RSAX_BIW_GET_DATA_SIMPLE for Full Upload. Therequirement now is that it should be able to handle Delta also.
Please suggest me the changes I have to make in this to be able to upload Delta also.
My mail id is [email protected]
Ramona Leabu Feb 5, 2010 1:40 PM
Can anybody send me the template for delta extraction?
3/5/2014 Generic Extraction via Function Module | SCN
http://scn.sap.com/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module 11/11
Follow SCNSite Index Contact Us SAP Help Portal
Privacy Terms of Use Legal Disclosure Copyright
Like (1)
Thank you very muchRamona