Function Module for Generic Extractor
Hi, I have a generic extractor that uses a Function Module to extract the data. I have a change I need to make that only affects the code in the Function Module. Do I need to regenerate the DataSource or can I just change the function Module and transport the change to the function module?
Thanks for any details...
As long as you are not changing the extract structure, you do not need to regenerate the datasource or replicate. Send FM only.
Regards,
Chad
Similar Messages
-
How to identify update mode in function module for generic extractor
Hi All,
I have created generic extractor using function module which supports delta load.
Delta logic is handeled in coding...by using ROOSGENDLM table.
Now problem is we need to identify the update mode, requested from infopackage in our function module in order to apply logic for Repair full.
I would like to know table or parameter in source system, which contain the update mode (Init , Delta , Full).
Thanks,
NirajHi Niraj
You can use the FM import parameter "i_updmode" (This is of type "SBIWA_S_INTERFACE-UPDMODE") to determine if infopackage triggerred in full or delta mode.
I_REQUNR TYPE SBIWA_S_INTERFACE-REQUNR
I_ISOURCE TYPE SBIWA_S_INTERFACE-ISOURCE InfoSource Name
I_MAXSIZE TYPE SBIWA_S_INTERFACE-MAXSIZE Data Packet size
I_INITFLAG TYPE SBIWA_S_INTERFACE-INITFLAG Initial Flag
I_UPDMODE TYPE SBIWA_S_INTERFACE-UPDMODE Update Mode
I_DATAPAKID TYPE SBIWA_S_INTERFACE-DATAPAKID Datapacket Id
I_PRIVATE_MODE
I_CALLMODE TYPE ROARCHD200-CALLMODE Single-Character Flag
I_REMOTE_CALL TYPE SBIWA_FLAG
Cheers
Vasu Sattenapalli -
When we go for Views and Function Modules for Generic Extraction
Hi Experts,
Can you please explain when we go for extracting the data using Views and when we got using Function Modules using Generic Extraction from R/3 system to BW with examples. And also can you explain when we go for delta for the above both scenarios.
Thanks for you help in advance
RohithHi,
Scenario for Extarction using FM
Imagine the scenario where you need to extract data from
tables having no common field between them and thereby preventing you from creating a view on top of those tables..
Or simply consider tables that are highly unrelatd in terms of fields, but you have a requiremnt to extract data from them.
Also Refer.
create generic extractor based on 2 tables
Generic Extraction via Function Module
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
Steps.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
http://help.sap.com/saphelp_nw04/helpdata/en/86/1c8c3e94243446e10000000a114084/frameset.htm
Scenario for Extraction using View
If there are more number of tables and data in those tables can be represented using joins then we can use this type of extraction
For more info Refer these links
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ecf9446011d189700000e8322d00/frameset.htm
Difference between "Help View" and "Search Help"
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed06446011d189700000e8322d00/frameset.htm
for more detailed info look on:
http://www.sap-img.com/abap/what-is-the-different-types-and-usage-of-views.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap+dictionary&
For GEneric Delta refer these links
[generic with delta;
[https://forums.sdn.sap.com/click.jspa?searchID=11388803&messageID=5164737] -
Creating Function Module in Generic Extractor?
Hello All
DO anyone has steps how to create a Functional Module in Generic Extraction?
Pl let me know
Many Thanks
balajihi Balaji,
first create your function module (se37),
sample code see function module
RSAX_BIW_GET_DATA_SIMPLE.
then follow steps in create generic datasource
http://help.sap.com/saphelp_nw04/helpdata/en/3f/548c9ec754ee4d90188a4f108e0121/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/86/1c8c3e94243446e10000000a114084/frameset.htm
hope this helps. -
Any docs regarding Table/View,Function Module for Generic Extraction
Hello All
I need to do Generic Extraction,for that if anyone has docs., I need docs on how to create table,view,Function module and infoset query ,on that pl forward to my id
[email protected]
Many Thanks
balajihi Amit
Thanks for your docs,but this docs i have already,do u have any thing different one,if so please forward?
Facing a Problem
Iam trying to create view(database view)for <b>vbak</b> and <b>vbap</b> and given in Tables in <b>Table/Join Conditions</b> tab and clicked in <b>Relationship</b> and the relantionship has been generated automatically,now when i tried to activate this view its saying like "<b>No tables and/or fields are defined for view xxxxx</b>(xxxx-> name of a view)
what will be the problem?pl let me know how to create a view?
And also I need to know the diffference between database view,Manintenance view,Projection view and help view?
Pl let me know on this?
Many Thanks
balaji -
Error while activation Function module for generic data extraction
Hi,
I have created a generic data source ZMATERIAL in which i have selected the Extraction by Function module. I copied the function module RSAX_BIW_GET_DATA_SIMPL to ZMATERIAL_FM, but when i activate this module it gives me error
REPORT/PROGRAM statement missing, or program type is I (INCLUDE).
The main program of the function "Z_BWGENDATAMATERIAL" does not begin with "FUNCTION-POOL".
Please help me in this.Hi Dipika,
I think a similar issue is discussed
Refer this thread
REPORT/PROGRAM statement missing, or program type is I (INCLUDE).
Compiling INCLUDE progam
question related to includes
question related to includes
Hope these helps
Regards
Karthik -
Function module based generic extractor - Problem with the selection
Hi all
The following is my code in the function module. I am able to get the entire data if i dont give any selections and the number of records is also correct. But when i select a MATNR value, it returns 0 records where as it needs to return 3 records. If i give selection based on bukrs, werks, lgort its working fine. But if i give selection based on MATNR, then it is not working.... I think there is a problem in the bold part of my code. If i debug, LS_MATNR is having the correct value which indicates that there is no problem with the value being passed to LS_MATNR from my selection screen of my datasource in RSA3. Even GT_WERKS is also having data. Please help.
OPEN CURSOR WITH HOLD S_CURSOR FOR
SELECT MARA~MANDT
MARA~MATNR
MARC~WERKS
MARD~LGORT
MARA~MEINS
MARD~LABST
MARD~EINME
MARD~SPEME
MARD~RETME
MARD~INSME
MARD~UMLME
MARD~VMLAB
MARD~VMEIN
MARD~VMSPE
MARD~VMRET
MARD~VMINS
MARD~VMUML
MARC~XCHPF
MARD~KLABS
MARD~KEINM
MARD~KSPEM
MARD~KINSM
from MARA inner join MARC on
MARAMANDT = MARCMANDT AND
MARAMATNR = MARCMATNR
inner join MARD on
MARAMANDT = MARDMANDT AND
MARAMATNR = MARDMATNR
AND MARCWERKS = MARDWERKS
for all entries in gt_werks
where MARC~werks EQ gt_werks-werks
AND MARA~MATNR in LS_MATNR.
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.try this
select marc~matnr MARC~WERKS into t_marc for all entries in gt_werks
where werks EQ gt_werks-werks and lvorm = space.
if t_marc is not initial.
select MARD~LGORT MARD~WERKS MARA~MEINS MARD~LABST MARD~EINME
MARD~SPEME MARD~RETME MARD~INSME MARD~UMLME
MARD~VMLAB MARD~VMEIN MARD~VMSPE MARD~VMRET
MARD~VMINS MARD~VMUML MARC~XCHPF MARD~KLABS
MARD~KEINM MARD~KSPEM MARD~KINSM MARA~MEINS from
mard inner join MARA on mard~matnr = mara~matnr
for all entries in t_marc where mard~matnr = t_marc-matnr and mard-werks = t_marc-matnr
and mard~lvorm = space. -
Generic function module for delta - which FM ?
Hi all,
I want to create a custom generic datasource in R3 which uses a function module for delta extraction. This is straight forward for full extract (copy FM RSAX_BIW_GET_DATA_SIMPLE - I already did this and have a full extraction working to BW). However I need to extract delta - and the above function module does not have example code for that (I have seen some forum posts that it 'can' be used - but this looks like a pseudo get around where the delta field name is passed in I_T_SELECT).
FM RSVD_BW_GET_DELTA_DATA seems to be an example code of a FM which can allow delta (i.e. manually codes how to fill date/time stamp information). However when I code this and try test in RSA3 it seems to try to populate the delta selection field before calling my function module! I need it to call my function and allow the function to specifiy the date criteria.
Can anyone help with an example of how this should best be done ?
Or can it only be done in a pseudo form using 'RSAX_BIW_GET_DATA_SIMPLE' example FM.
Note: I have setup the RSO2 datasource to allow delta.
Also - I have spent several hours searching the forum - but please answer with a link if you think it does answer exactly this problem.
Thanks for any help
MartinHi again,
Have had a few requests for the code I used - I created a new custom function copied from 'RSAX_BIW_GET_DATA_SIMPLE'. AEDAT has been set as the delta date for this data source in transaction RSO2.
Main sample code is -
1. Code to receive selection criteria and store in internal ranges -
FUNCTION zbw_sodetail_get_detail.
""Global interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG
*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY
*" 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_SODETAIL OPTIONAL
*--- Sales order item create date
LOOP AT i_t_select INTO l_s_select WHERE fieldnm = 'ERDAT'.
MOVE-CORRESPONDING l_s_select TO r_erdat.
APPEND r_erdat.
ENDLOOP.
*--- Sales order item change date - DELTA only - auto filled before
this function is called.
C (Initialise Delta) - Low = blank, High = today - safety limit
D (Delta) - low = , High = . *from roosgendlm
LOOP AT i_t_select INTO l_s_select WHERE fieldnm = 'AEDAT'.
MOVE-CORRESPONDING l_s_select TO r_aedat.
APPEND r_aedat.
ENDLOOP.
2. Code to use selection criteria to get initial or delta. Note that for delta the delta date field to be used is automatically populated with the date of the last delta run (from table roosgendlm) -
SELECT VBAK~KNUMV
VBAPVBELN VBAPPOSNR VBAPMATNR VBAPARKTX VBAP~SPART
VBAPWERKS VBAPERDAT VBAPAEDAT VBAPNETWR VBAP~WAERK
VBAPABGRU VBAPZPROMISE VBAP~CUOBJ
VBEP~EDATU
INTO CORRESPONDING FIELDS OF TABLE ZBW_SODETAIL_ITAB
FROM VBAK JOIN VBAP ON VBAKVBELN = VBAPVBELN
JOIN VBEP ON VBAPVBELN = VBEPVBELN
AND VBAPPOSNR = VBEPPOSNR
WHERE VBAP~VBELN IN R_VBELN "Order number
AND VBAP~POSNR IN R_POSNR "Order item number
AND VBAP~ERDAT IN R_ERDAT "Order item date created
AND ( VBAP~ERDAT IN R_AEDAT OR "Created date in Delta range
VBAP~AEDAT IN R_AEDAT OR "Order item change Delta range
VBAK~AEDAT IN R_AEDAT ). "Order header change Delta range
Note that if the data source is called in initial or full extract mode the delta change date (aedat) will automatically be blank.
I have been using this successfully.
I hope this helps
Martin. -
Infoset Query is not available for generic Extractor
Hi,
I've created an infoset in SAP ECC with sq02. Then I've created an Infoset Query on top of this Infoset, because I wanted to exclude records with specific values. Now I want to use this Infoset Query (with the filter restrictions) in my generic DataSource. I can only chosse the Infoset, but not the InfoSet Query. Normally I use the filter in the InfoPackage, but neither IP nor DTP can exclude values with a pattern (f.e. exclude all record that contains a $ symbol in the string)
Any suggestions?
Thanks and regards,
SebastianI agree with Jen, that BW side routines would work just fine.
If it is extractor performance you are worried about and that is why you want to build the $ exclusion in the select, then I would suggest just creating an extractor from scratch using a custom written function module. It's actually very strait forward and provides many advantages over table/view/InfoSet based generic extractors.
I am not a fan of using InfoSets for generic extractors.. but you can create InfoSets based on a data read program in which case you code all the selects and whatnot. But if you go that far with the InfoSet, why not just write the FM...
Thanks -
Function Module in Generic DataSources in BI
Hi,
I appreciate your answer about the Function Module in Generic DataSources in BI.
These are the steps I followd on R/3 side.
1) Create a structure with the R/3 table fileds based on the requirement.
2) Create a function module by copying RSAX (Function Group) and RSAX_BIW_GET_DATA_SIMPLE (Functin Module) into our own function group & Function Module (name starting with Y /Z). And use the structure(ex: ZSPMT) created in the reference data of 'Tables' tab (ex: E_T_DATA LIKE ZSPMT).
3) Use the structure name & function module name in the Generic DataSource
Finally when I want to use the Generic DataSource, do i need to insert the records myself in the table (or structre) I created ZSPMT? (which is used in Function Module)
If I need to insert the data into table ZSPMT myself, what is use of function module?
Can't I use the view of this table (ZSPMT) directly in Generic DataSource?
Is the function module used to filter/restrict the data based on client need?
Thank you in advance for you answers
It will help undderstand the difference among View, InfoSet Query & Function Module
used in creating Generic DataSource.
Regards,
Lakshmihi,
why did you prefered function module?
if the table ZSPMT egts the data that you enter automatically then no need to use FM.
directly extract with tables/if more than one table then use views.
if you need especially the FM that could solve ur complex requirmnet.
http://help.sap.com/saphelp_nw04/helpdata/en/3f/548c9ec754ee4d90188a4f108e0121/content.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5-b062adbb3e33
Ramesh -
How to extract data by using function module in generic extraction please
how to extract data by using function module in generic extraction please give me steps required
Dear Deba,
Generic Extraction via Function Module
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
If the requirement is like extracting data from multiple tables with some complex logic then views cannot be used..so u cna go for FM is used where it can be achieved.
Chk these
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
check the following thread
generic extraction with function module
Generic Extraction with function module
Regards,
Ram. -
Function module for sending email
Hi all,
Can I know list of function modules for sending emails.
Other than "SO_DOCUMENT_SEND_API1"
pls let me knowHi Praveen,
Below is the sample code to send the external mail.
&**********Reward Points if helpful**********&
DATA: ld_mtitle LIKE sodocchgi1-obj_descr,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des .
ld_receiver LIKE sy-subrc.
DATA: it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
it_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c, "#EC NEEDED
w_doc_data LIKE sodocchgi1.
REFRESH it_receivers . CLEAR it_receivers .
IF v_trip_send = 'X'.
it_receivers-receiver = it_trip_dload-approver_email .
ELSE .
it_receivers-receiver = it_adv_dload-approver_email .
ENDIF.
it_receivers-rec_type = c_u .
APPEND it_receivers. CLEAR it_receivers.
it_receivers-receiver = " ------> pass your reciever email id.
IF v_trip_send = 'X' .
it_receivers-receiver = it_trip_dload-requester_email .
ELSE .
it_receivers-receiver = it_adv_dload-requester_email .
ENDIF .
it_receivers-rec_type = c_u .
it_receivers-copy = 'X' .
APPEND it_receivers. CLEAR it_receivers.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = c_saprpt.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = c_saprpt.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = c_f.
CLEAR it_attachment.
REFRESH it_attachment.
it_attachment[] = it_attach[].
Describe the body of the message
CLEAR it_packing_list.
REFRESH it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES it_packing_list-body_num.
it_packing_list-doc_type = c_raw.
APPEND it_packing_list.
Create attachment notification
it_packing_list-transf_bin = c_x.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = ld_format.
it_packing_list-obj_descr = ld_attdescription.
it_packing_list-obj_name = ld_attfilename.
it_packing_list-doc_size = it_packing_list-body_num * 255.
APPEND it_packing_list.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = c_x
commit_work = c_x
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = it_packing_list
contents_bin = it_attachment
contents_txt = it_message
receivers = it_receivers. -
Functional module for automatic creation of pur requisition & pur order
hello,
what is the functional module for automatic creation of puchase requisition and automatic creation of purchase order which we will assign in action box in service order processing management.
please let me know as early as possible
regards,
rajesh kumar rajuHi,
Please check with following.
IDOC_INPUT_ACC_PURCHASE_REQUI
IDOC_INPUT_ACC_PURCHASE_ORDER
/ISDFPS/OR_PURCHASE_ORDER_CR
BS01_PURCHASE_DOCUMENT_CREATE
CO_MP_CREATE_PURCHASE_ORDER
Thanks & Regards
Sadhu Kishore -
Function module for calculating planned and actual cost of production order
Hi ,
Do we have any standard function module for calculating planned and actual cost for production order?
i need to implement this in a Z-report.
Thanks
SriniHi,
try below function module
CRMCO_GET_PLAN_ACTUAL_COSTS
CO_IH_GET_PLANNED_COSTS_TOTAL
Regards,
Sankaran -
How to create the INBOUND Function Module for INBOUND IDOCs
Hi Friends,
Can any Suggest me How to proceed to Create an INBOUND Function Module for Processing the INBOUND IDOCS
which are recieved from XI Server ?
I am working in SAP-ISU
Here i will recieve the INBOUND IDOCs for the Meter Reading Orders.
We have a Standard INBOUND FUNCTION MODULE
IDOC_INPUT_ISU_MR_UPLOAD
which Uploads the Meter Reading Results.
I copied the Same function Module into ZIDOC_INPUT_
and working on it.
Can any one suggest me, whether i am going in correct way or not.
In IDOC_INPUT_ISU_MR_UPLOAD Inbound fun module,
BAPI_MTRREADDOC_UPLOAD is used to Update or Insert the Meter Reading Results,
My requirment is to Insert and Update the Meter Reading Orders which are Inbounded from XI.
Can I Use the Same BAPI
BAPI_MTRREADDOC_UPLOAD
to Update the below fields,
EABL-SERNR
EABL-ZWNUMMER
EABLG-ABLESGR
EABL-V_ZWSTAND
EABL-N_ZWSTAND
EABL-ABLHINW
EABL-ZSKIPC
EABL-ADAT
EABL-ATIMTATS
EABL-ADATTATS
EABL-ATIM
EABL-ZMESSAGE
EABL-ABLESER(Meter reader number)
Kindly Suggest me,
Thanks in Advance,
GaneshHello Ganesh
I think you are going completely astray with you z-function module for IDoc processing.
If you look at TABLES parameter METERREADINGRESULTS (type BAPIEABLU ) of BAPI_MTRREADDOC_UPLOAD you will find many of the requested fields already:
EABL-SERNR => BAPIEABLU-SERIALNO
EABL-ZWNUMMER =>REGISTER
EABLG-ABLESGR
EABL-V_ZWSTAND
EABL-N_ZWSTAND
EABL-ABLHINW
EABL-ZSKIPC
EABL-ADAT
EABL-ATIMTATS => ACTUALMRTIME
EABL-ADATTATS => ACTUALMRDATE
EABL-ATIM
EABL-ZMESSAGE
EABL-ABLESER(Meter reader number)
Field EABL-ZMESSAGE appears to be custom field (at least I cannot find it on ECC 6.0). If this field was added using include CI_EABL then you probably can get these values into the BAPI using the EXTENSIONIN parameter.
Check routine CHECK_UPLOADRECORDS in the BAPI which allows two extension structures:
- BAPI_TE_EABL
- BAPI_TE_EOSB
Not surprisingly BAPI_TE_EABL contains the include CI_EABL.
Regards
Uwe
Maybe you are looking for
-
How to create a text box in ascreen painter?
HI friends can anyone tell me how to create a text box in a screen painter? And attachment BROWSER like what we attach for any documents in over mail. Example when we click on browser the path of the computer has to be opened and by giving the docume
-
Vendor Transfer from ECC to SRM-EBP
I want to transfer vendor from ECC to SRM-EBP.I tried the T code BBPGETVD. But I am getting the below log: "Error: Error while Creating Business Partner (BP) Module: BUPA_CREATE_FROM_DATA Vendor: 0000100011". Please suggest.
-
Gmail Not Showing up in Messaging or Universal Mailbox
All my other apps and e-mails (Corporate Sync, Cox, Facebook, Twitter, Text Messages) all appear in my Messaging shortcut, but my Gmail account does not. I've looked at seeing if I can add it, but there's no option (that I can see). I have syncing
-
My iPad 2 screen won't "lock" or "turn off" after being left unused since ios7 update
Hi, I hope this hasn't already been covered I have had a look and on other sites but haven't come across nothing. Since I have updated to ios7 my iPad 2 screen now doesn't lock when left unused, I can manually lock it by pushing the lock button but i
-
Macbook Pro Retina crashes with thunderbolt display
Whenver I plug the thunderbolt display into my macbook pro retina both displays black out and the computer becomes semi-unrespsonsive (ie I can hear the volume controls however that is all. I need to force shutdown. I've noticed this problem happenin