Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Function Module on MAST,STPO

Former Member
0 Kudos

Hi all,

             I want to create a FM for a generic datasource with tables MAST and STPO for BOM report.I have created a structure(ZMASTSTPO) with all the fields of MAST,STPO tables(included common fields from MAST table not from STPO table) and also included the reference fields from reference tables T001,RC29P,CKHS in the same structure and given the same structure name and fields as the reference fields.We  also need to call standard FM CSAP_MAT_BOM_ITEM_SELECT in the FM we create.I have copied RSAX function group with the FM RSAX_BIW_GET_DATA_SIMPLE and in TABLES section i have given the structure ZMASTSTPO.I really don't know what to do with the rest of the sections like in IMPORT,EXPORT,CHANGING,SOURCECODE.I understand that i need to write SELECT statement which gets all the fields from the tables that i have given to populate the structure ZMASTSTPO.

Could you please anybody explain me how to write the code to populate the fields of the structure or could if anybody already has done the similar approach please explain me?

Thanking you,

1 ACCEPTED SOLUTION

former_member213275
Contributor
0 Kudos

Hi,

Refer below document  which clearly explains how to extract BOM header and BOM item details into BW.  You can also see page number 7 where there is logic written calling FM "CSAP_MAT_BOM_ITEM_SELECT". Hope this helps. Please close the thread if it is answered.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0af489e-72b1-2b10-159d-abb8058fb...

Srikanth.

7 REPLIES 7

NAeda
Contributor
0 Kudos

Do a search on how to write a FM and use of  import, export and table parameters

Moderator Message :Links without explanations are not permitted.

http://help.sap.com/saphelp_nw70/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm

Message was edited by: Venkat Gowrishankar

former_member213275
Contributor
0 Kudos

Hi,

Refer below document  which clearly explains how to extract BOM header and BOM item details into BW.  You can also see page number 7 where there is logic written calling FM "CSAP_MAT_BOM_ITEM_SELECT". Hope this helps. Please close the thread if it is answered.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0af489e-72b1-2b10-159d-abb8058fb...

Srikanth.

Former Member
0 Kudos

thanks Aeda and Srikanth.Srikanth i already have that document but the process they have explained is not clear and its not working.I have tried that.has anybody done this scenario if in case they were part of BW project.

Note: the table i have mentioned above CKHS..its actually STKO

0 Kudos

Hi,

Can i know where you are struck. Have you created generic data source in RSO2 specifying the Extraction method as "Function module" , Extractor as your new Function module name, and Extract Structure with your new structure ?

How to create generic data source using FM can be found from document mentioned in below link

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70806d62-1c59-2e10-7597-91c114600...

If you are facing trouble in creating functtion module then below link would be useful.

http://www.newtosap.info/2012/07/creating-function-module-and-using-it.html

Srikanth.

Former Member
0 Kudos

Hi Srikanth sorry for late reply.I have created FM and Extract structure and finally created Generic dataosurce.When im checking in RSA3 it is giving ERRORS OCCURRED DURING EXTRACTION..not fetching any data.Do you have any idea.I think the code is looking fine.I have checked it ,no errors find.

Former Member
0 Kudos

thanks everybody.I have copied a standard FM and used it for my scenario.Its working fine

0 Kudos

Hi,

Please close the thread.

Srikanth.