+++ 8.Generic Extraction - Based on FM


                 
                                  This post explains creating a generic Data Source in SAP R/3 which uses a Function Module to extract data and this Data Source can be used in SAP BI/BW to extract data from R/3.
Function Module Extraction Steps:
1) Go to T-Code SE11
Check Data Type check box and enter ZFM_EXST_VBAK and press create button

https://lh3.googleusercontent.com/FkjR7pYaF_wvsKD9NdFfjmMs7Ppadm_xT5oNYg-9aetF9SElYLOhTDj5X4jhpfOeicGC_NXiJQrFs-0VEAaSwstHBcB41cXDikEAdHybtZqpwuTMFHb3N1HecVZQgF91DXk0arbIW1kY3fXzMg

2) A small window pop’s up select check box Structure and press Tick mark.

https://lh5.googleusercontent.com/DHzjhAmcZh5ZOjxhkB4IENdQrNgV7UGmC44UnIbsT_3Cg5MNksrxs0qoW9kNiIg-Unq0-E8nCYCa0PURXFwqugxW_VxHiI2aRoyesuPw5zKpm_W_Q-ZXLWwXHWJ6moq7BCzqG4-zzhzLOZQueQ


3) Maintain Structure Windo pop’s up give Short Description, then click on Components header, In Component and Component type give the extraction Structure necessary fields as shown. The Currency WEARK field and Quantity NETWR fields much be included with reference fields.

https://lh4.googleusercontent.com/9cmlrFZg9FrIMYxgJFgiy6iWJUfHhrdBiSvLWSPQ32yvifZbRF6Owcj0_lBJtqbbz5auPz3qowZjsOdwOukMCVFLUX7SZ0NB_JfQAF8I5p6bCIHY3XqKZPCPUOa-7RmA2v5J2EhAKXM6sMd_9w

4) Now go Currency/quantity fields as shown.
NETWR Net value in document currency field must have reference field that in the base table. Enter Currency / Quantity field name as shown and activate it

https://lh5.googleusercontent.com/0VcSZx2IZenthauS6OlwM1SjeXS1aXqumdezAKUu3irkdWk8btN_7VZ9vEwpka8JJx8m4joox0LkDiammvGkfqofPGUFFB8VTmKe_VVCc8ljuJLILjEIvGUg0ZMsfer1VO6tJ2erJXZM_t58rA

5) Create Object Directory Entry Window pop’s up Give Package name as $temp, save it and press Local Object.

https://lh3.googleusercontent.com/Fv9L8ywH7DGCJJXiElSOPSRDOe92-AqcSAAX3rfYSIDkErzV65NoGGfDrG4qQ7ejHwNAXj7O0Z4lBReiPezljAYFkxnc5PpLBYZ8KfuTrAlB0aw3M2Z0sQepjcJsdYVgOxgWlfW-MWTuoVHqsA

6) Inactive Objects for USER04, Local Objects with selected Object name is pop’s up Click Enter

https://lh5.googleusercontent.com/dtih8Mt0qcZHol4DOsi81dZyCyG3cGz5YXQjbkah7kkO7YyyfrXEhDKm_3Ry-nZ5ikHc7kCD7cSvja7poN36xWYOtqsiUhbqjSMcamSiPPqgmRUCORhkJxHRrwytiQwuyloTPpH11b5ulVTDpg

7). Warning during Activation window pops up to check any Warning in the extraction Structure.

https://lh3.googleusercontent.com/xILmWX4EgwBW_TvoLvuMBS6w2eSRHxfFKNEjRQGKW8yEYHV3RXobtbXWOU6ThNTKa1RAvkHWMiGhokKBIZMH--t3E_D-yVJibuJ5ssTYslea0fqW7iKYtfX5jniuFQIOktM2gZ35Fi9hEPoIVQ

Now Go To T-Code: SE80, Select Function Group, Name RSAX.

https://lh3.googleusercontent.com/i_Pxr_vf6DsNk7QyllNKE_ZbqEovU_w6gu_f0zdMphMl0v8CiTHV_YLZQuMD_MzF7WwVK5St2HXKuAc7DWk_i6a8bgajsXihm4z5JozlxuZgLasWdk8Ftyy2rprVhlr-Zs_r83syBCOFc-GDvQ

9) Now Select RSAX Object Name Folder Right Click, press copy.

https://lh5.googleusercontent.com/0464dFGbf8VspqCP5Gq4sSbIeC1QRfazaKNLnuIoOMFeqNmiJ61ujE0U3e5WXdOCd2m623-uLNtoJDG3dYwqqlBT6txQO-oImeyOgADw1xN3TlTrysdsrzfynbvT2NnjmP_S4KqsEjHwUAzOMQ

10) Now Give Name of a New Function Group Ex: ZZRSAX and press Enter. ( Function group for transporting the function module to other environment )

https://lh3.googleusercontent.com/-CBAf8sj9WMMQ1zCx--atxn-IO0YBBU8tVz227UOJKH3GT0-GY3KcannErzSndGffR2rew7wy2Id6CDXeGs9IUOiwPdC8terfKT2hJOwtLYeu4iafSv4YfmPaOVj4mm3VeaYUznUYcmCvACDNg

11) select only one needed Function module Ex: RSAX_BIW_GET_DATA_SIMPLEand press Enter

https://lh5.googleusercontent.com/5LbDrf2f6csJZ7sjqQu0s7awvqaFN7_7sR2eePNp5flhRsvQWnXUW_QNs9yNWhJqCnL3QN6WIxJuHKP2zmTEOEb4DQ6JVsnuj0ZGtcZe0pueviFdnkOxfLUeNUTD8vo1h5KGgfrH7P3CLb5ItA

12) A small window pop’s up saying Copy Function Module EditTo with some name Ex: Z5_FM_RSAX_BIW_GET_DATA_SIMPLE and press Enter.

https://lh6.googleusercontent.com/5SCRkbgTUUtoZQ5kYafNvY7kpUCjGHixWvP0c680QbIzj6aK4rYvRba1UgtmUpQW0SQK57aO_0OXm9JnpqxyIfa5NeW7vYF3QTJ6oGznEyTiYd0mK-TjNYJ7altD42ijip1CiebVNunPTGbPyQ

13) Now Go to T-Code SE37 and give Function module name Ex: Z5_FM_RSAX_BIW_GET_DATA_SIMPLE and press Create button

https://lh6.googleusercontent.com/XXcLgSk8HNNOZx69uvs0mKvjLFaS8ii2OoBxoFptaLYieGyUnbL2JcGko4ei47vnXXHwrwowv0l2Kt3Q90YZgL-dKmyyBvtjwel8NUeADsZNZxHBW--k2gfpym1MUIIy1bgF8XRna-UbyJuERw

14) Below Screen pop’s up Check attributes as shown

https://lh3.googleusercontent.com/dMS4G7g4ko8yfEbIVcBs65-wLIiVQfDaFU3ZUI0GmPzRUnNIuoCgwNzcN2_kwvABfx8TtnrQdsEwQQ6Ibd-CiVtAGo9Llr0scxEvRE0udveKBBXibwwJHAwTOPK97iughXCreUqqVe7OL_z9sQ

15) You will not change Import, Export, Changing Tabs Now Change Tables Tab give Type spec LIKE and Associated Type ZFM_EXST_VBAK and short text as Extract Structure

https://lh3.googleusercontent.com/P1gKEjuFIA2ZM4JUjSqHYVYNmzp3kAFFnkWcYcmrgSrWHIKiOIifZfOYtQCSjq0SZK-Sjk2UX-OmY0DFly6KnvUVbUXYDLsFQ82RWrWuIAqcjK_7Frp2SkUSi2C0sXHjmCZhRcC76Vl_7oNUIA

16) Now go to Source Code to edit as shown in RED

https://lh6.googleusercontent.com/QNV-MyR0g3pyeHEDJFZEw1d2EL7tD6UYJlU-svMXKVF-ZNLzf0pxERTCR756R8_-2DCzRTO8MI2XCtZwclC1hS4w0XT1-IPNUDpsnkTYrUG1tUxVUJWjcbRZH0fxkjsbm53bGcKD3_1T1U31Sg


17) Edit the Code RANGES and WHEN ‘xxxxx’. (Xxxxx Is the Name of Data Source given in RS02)

https://lh6.googleusercontent.com/7ZphrmqkJy87j9_oH60OGj9vr_rKmJLSS8d0wtlyKze33haEkSIVbEyDQEPxMEvZi7hpu_96Ixvbmmr-PD_RQemgJ3EYKSd2sCj0AA5mWAQsTjBER187WGBJTCwJ6-heg6P5DPOaSWQs54O5_g

18) Change the Code as shown

https://lh4.googleusercontent.com/-1slp_s4FutUmdWpyLQigc_8Y9XL57qATcw7KKczVfVAdOCBR_E5yV34XSne_35khxv6INT0xtPl173MiGcyi__2577GvhTh81hE6HTGtfPj3gSrktfFSJPADJMBi6dIIy8KlaTZIxnDFk0vTQ

19) Now SAVE, Activate the function module.
Goto SE80 select function group, activate function group
Note: With out activation of Function Group, you will not be able to create data source in RS02
20) Data Source Creation T-Code RSO2
Create Data Source, give Data Source name must be same as given in the source code of the function module. Ex ZFMEDS4 then press Create button

https://lh6.googleusercontent.com/iJ4ZVN5zBgeisGi3chwjRafY59ZYexoNjMc9fzIEkyxeDfZybh6P6dljCoIMbsAsp5a3WBFRFuqiuTWtxEkSSgQKHqSpHNKnA2HdPxPYg72rYBTX3BU8_s51Vq16d5INptXoMHtf2lj6B6PR5Q

21) Change Data Source for Transaction data: ZFMEDS4 will pop’s up give Application Component related to table as SD and give Texts Short/Medium/Long description and press Function module button, you will see Extraction by Function Module gets Enabled to enter Function Module and Extract Structure name.

https://lh3.googleusercontent.com/f3lPlY0SGiEySHRjcAL9SVphIr4qpHs1CRvZq0FmgKY11aKEo3jKf3bedrCZ8oM9F2uPL1pQhXqb333myEPM9Mq3Rfx45XbA8j39SJJWaLoHm_yII7a9N3MqrwLo5eM4zSh7_SlCiKS7IVdpAQ

SAVE
it and Check Extraction
22) Now go to T-code RSA3 Extractor Checker
Give Data Source name as ZFMEDS4 and click Extraction button.

https://lh4.googleusercontent.com/xNiqOrkqBr2Bus-YXlcIa4qw5nJnCODyY_Hjvc0FgWP_BXsgnyACObI_Err0X84-RTOY-9N6_hl5yAduAAJZuT74zq65V9nCJIzM1G_dkTKeirKgbMoTrw-QggsCMWfEef9M8wlGzvEotZ4U-Q



SAP BW/BI side:

Step 1) go to T-Code: RSA1 , double Click Source System and then Select your Client System> it will take you to DataSources go to Over view, Application Component >Right Click > press Replicate Metadata.
Find your DataSource providing name as ZFMEDS4

https://lh4.googleusercontent.com/4JzJGYjsKLXembK6hBHKTGlK3pq5_7L8XVOfxHMzrP9zXytjJL_mbTUGkmSjIwlyvxMcPx-TIHNVNFCtFS-y4BKMyPuuCcSwwME17ImhrpRDLyL2C8ZAWA6ontYTP4pGoJUsvSGuHjPFSHNYBw

Step 2) Now go Info provider create a Cube with info Object related to Function module Extraction Structure or Select SAP defined Objects related to Function Module Extraction Structure as shown. press Activate

https://lh6.googleusercontent.com/36aBQVlANLkddnVWkl_qIdv6EwYfrqLDCsMde4nyavsCKpO6CEvSoDSm6oiHwzclNLzDBAj891ESfrasezWpuEFHxq4gR4LdMyHnfEE5AHu6vSg8Ew-ZmMk1Pm0JSJeTXmfRIpkWA861YzWtog

Step 3) Using DTP we are sending to data through PSA to Data Target

https://lh5.googleusercontent.com/kxaPkOFKSNV4F793rxrbG9GgYwJNj4GIlOQhbjVZfqMPUgAhufmhvh9xvrZpklvYWnKf8-vF-Dg9HT-jhBrShInFAc2UO-8DtPwRv6xNt2LsH3bBsk0kc7OJgxx0JJDyocPNX2CoETQZdN4aGQ


https://lh3.googleusercontent.com/dFFW4TH8swTqa8BELZC864vwTkBjfQwMqn-G1y4GOjvp6FO5aFscOsySyhV8ws43fQRvelS_tzgu7JMjKsbrc3PfRwlpraq-ZT-k9aqxJ02bMV4xKeu2zUyf_38ihL9zRkfCDfCeU7P0DlJEJg


https://lh4.googleusercontent.com/NzZtZ-SfJKyqe_k8H7LdlBqALewG82hVs0d6YWRRHxeHoRQqAfrH6DjnGel8WDc_WtBX5U6Zc8dJz6yD6euwM12r8pdBrjo6GNZcxubGgf3YD8bWzaSamud8jSj2zrMZ86PL2-PIrZBCsksjKQ

.


******************************************
End