Sie sind auf Seite 1von 18

6/15/2015

4.BAPICreatingacustomBAPI

23rdJune2014

4.BAPI Creating a custom BAPI

Scenario:SAPprovidesanumberofStandardBAPIsforallthemodulestoachievethebusinessprocess.Butinvery
rarecasewemayneedacustomBAPIourspecificbusinessneeds.Thebelowpostshowsthestepshowwecan
createacustomBAPI.
*NB*Saveallthestructures,FGandFMinatransportablepackageinordertocreateaBusinessobjectandAPI
method.
Step1.Letshavethebelowtableforthedemopurpose.

[http://1.bp.blogspot.com/C5b7B7761f4/U6cNvGFuyeI/AAAAAAAAJeU/k_QOfUgitqk/s1600/1.png]

Step2.MaintainSometableentries.

[http://2.bp.blogspot.com/d0xJkK7bBvA/U6cN2G3wt5I/AAAAAAAAJg0/Jutu7tbUoi4/s1600/2.png]

Step3.CreateaStructureanditshouldcontainnameZBAPI*asitistobeusedinthebapifunctionmodulecreation.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

1/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://4.bp.blogspot.com/pAD67HHeszw/U6cN_GOTkPI/AAAAAAAAJhE/8jqJRQaacaw/s1600/3.png]

Step4.Selecttheappropriateradiobutton.

[http://2.bp.blogspot.com/hBH3waJP7SI/U6cOG128QyI/AAAAAAAAJik/UVKQBbgxX4M/s1600/4.png]

Step5.Providethebelowfieldswhicharemaintainedintheabovedatabasetable,Save&Activateit.

[http://3.bp.blogspot.com/lfI4n08Sd4/U6cOJUDBOiI/AAAAAAAAJi8/wqn8fEbceMU/s1600/5.png]

Step6.InTxSE80createafunctiongroupasourbapifunctionmoduleneedstobeassignedtotheFunctiongroup.
Activatethefunctiongroup.
http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

2/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://2.bp.blogspot.com/rLsxoUA7PuI/U6cOJviKhpI/AAAAAAAAJjI/TWaYyBVjrg/s1600/6.png]

Step7.InTxSE37createaFunctionmodule.

[http://1.bp.blogspot.com/Qu6eVkEcCsE/U6cOJzsKEjI/AAAAAAAAJjE/c_B419_wYo8/s1600/7.png]

Step8.ProvidetheabovecreatedFunctiongroupandselectRemoteEnabledModule.

[http://2.bp.blogspot.com/V5p0n7ftNGg/U6cOLVbLquI/AAAAAAAAJjU/nSF_PAyV2bA/s1600/8.png]

Step9.ProvidethebelowfieldsintheImportingsection.AsthisisRemoteEnabledFMsotheallparametersshouldbe
passbyvalue.
http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

3/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://1.bp.blogspot.com/LW7815IRzQs/U6cOLjadIZI/AAAAAAAAJjY/Szx2eCMA7Fk/s1600/9.png]

Step10.ProvidebelowparametersintheExportingsection.

[http://1.bp.blogspot.com/boZ52Ci_sJk/U6cNvToLdjI/AAAAAAAAJek/ZbSSpiThz3w/s1600/10.png]

Step11.ProvidebelowcodeintheSourcecodesection&activateit.Thisjustgetstheemployeedetailsbasedonthe
Emp_IDinput.

[http://3.bp.blogspot.com/ULpsgk9j0g/U6cNvSK0NAI/AAAAAAAAJeo/ToCJJKjsGME/s1600/11.png]

Step12.ThenreleasetheFunctionmodule.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

4/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://4.bp.blogspot.com/rxMS0cuPjKM/U6cNw_XkH_I/AAAAAAAAJe4/w_Vu7un8UmQ/s1600/12.png]

Step13.Afterreleasethebelowmessageappears.

[http://3.bp.blogspot.com/D4vNd92vzlQ/U6cNw8D3fI/AAAAAAAAJfE/SOr_VxSdKbw/s1600/13.png]

Step14.ToCreatetheBusinessObjecttypeGotoTxSWO1.ProvidetheObjectnameandclickonCreatebutton.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

5/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://4.bp.blogspot.com/tyegBkBpEvQ/U6cNw1OCsWI/AAAAAAAAJe8/3N3H1EMbnBo/s1600/14.png]

Step15.ProvidethedetailsandclickonContinueButton.

[http://3.bp.blogspot.com/P_8DFZE0BUU/U6cNxuI9_5I/AAAAAAAAJfo/bR9JhP8VLv4/s1600/15.png]

Step16.GotoutilitiesandaddanAPIMethod.

[http://3.bp.blogspot.com/8OJ15VE5sKo/U6cNxwf6GLI/AAAAAAAAJfU/76L3qmGbOBU/s1600/16.png]

Step17.ProvidetheFunctionmoduleNameandContinue.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

6/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://3.bp.blogspot.com/ST7AoQMVUFs/U6cNyWiyZGI/AAAAAAAAJfQ/NO2LISLzPk/s1600/17.png]

Step18.ProvidetheTextsandClickontheRightArrowButton.

[http://4.bp.blogspot.com/_jGn3E3t87Q/U6cNyjW1JLI/AAAAAAAAJfY/IB2_01gAbJE/s1600/18.png]

Step19.AgainclickontheRightArrowButton.

[http://1.bp.blogspot.com/9MlZ34qrst8/U6cN0EpAiI/AAAAAAAAJfg/VddH5g4Nr_8/s1600/19.png]

Step20.ClickonYESbutton.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

7/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://1.bp.blogspot.com/wB46Cah3Q10/U6cN2sATqEI/AAAAAAAAJf0/mFLrvPbXajo/s1600/20.png]

Step21.NowtoseetheMethodDetailsdoubleclickonit&Ucanseethedetails.

[http://4.bp.blogspot.com/jNXfGdgOIW8/U6cN3AFwoiI/AAAAAAAAJf4/jD7lt3GAwg0/s1600/21.png]

Step22.DetailsoftheMethodUnderABAPtab.

[http://1.bp.blogspot.com/4k7QRCDCEK8/U6cN3hAYyRI/AAAAAAAAJgE/Wzs8bsDbXw/s1600/22.png]

Step23.clickonthehighlightedbuttontoseethestatusoftheBusinessObject.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

8/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://4.bp.blogspot.com/t281wWZ56dA/U6cN3wFEwHI/AAAAAAAAJgI/rPMqTM9Awug/s1600/23.png]

Step24.TheStatusoftheBOisModeled.GoBack.

[http://2.bp.blogspot.com/7wHbjO3SVO0/U6cN4zA0jbI/AAAAAAAAJgQ/ltNUrsu0mDI/s1600/24.png]

Step25.FromtheEDITmenunavigatealongthepathandselectToImplemented.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

9/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://1.bp.blogspot.com/kIPSEBwCRW0/U6cN5KE_OlI/AAAAAAAAJgc/KJstEkg8D0Y/s1600/25.png]

Step26.AgainnavigatetotheHeadersectionoftheBOandwecanseetheStatusisimplemented.GoBACK.

[http://1.bp.blogspot.com/_wwEQnTjaiE/U6cN7KSKnwI/AAAAAAAAJgs/6DrdyvTJOpg/s1600/26.png]

Step27.NavigatealongtheHighlightedpathunderEDITmenuandSettheBOstatustoReleased.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

10/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://1.bp.blogspot.com/2Cf8qYPp_pA/U6cN8XLnunI/AAAAAAAAJgo/CjgMgYxILHg/s1600/27.png]

Step28.Thestatusissettoreleased.

[http://1.bp.blogspot.com/hDROqvXvOKw/U6cN9HBsTSI/AAAAAAAAJg4/8BJNhQKwPAA/s1600/28.png]

Step29.GototheheaderSection&UcanseetheBOstatusisReleased.GoBACK.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

11/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://1.bp.blogspot.com/Nhcaky64SZ8/U6cN4_2lVI/AAAAAAAAJhI/xMLYDKS7oaY/s1600/29.png]

Step30.Nowwehavetoreleasethemethodaswell.GototheEditmenuandnavigatealongthehighlightedpathto
releaseit.

[http://2.bp.blogspot.com/KRRyqQfFqfw/U6cOANXhFZI/AAAAAAAAJhY/MCzM1bsw61w/s1600/30.png]

Step31.Doubleclickonthemethodnameandthestatusisreleased.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

12/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://3.bp.blogspot.com/GAGkIBLV_6g/U6cOAheCb3I/AAAAAAAAJhc/qqD_82GwZM/s1600/31.png]

Step32.ClickontheProgrambutton.

[http://3.bp.blogspot.com/LYbOpgQ0IQI/U6cOA9_thNI/AAAAAAAAJhk/qEqFdr45SWM/s1600/32.png]

Step33.Thebelowprogramisautomaticallycreated.Sometimesthisprogramcanalsobemodifiedbythe
programmeraspertheneed.GoBack.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

13/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://4.bp.blogspot.com/R_GwPx3GeSw/U6cOCK36_pI/AAAAAAAAJhs/r_a_KkJAU5s/s1600/33.png]

Step34.LetstesttheMethod.SelectthemethodandclickontheTestbutton.

[http://3.bp.blogspot.com/7j_cMPYDxSE/U6cODP0kZII/AAAAAAAAJhw/rS5x7SGDtTw/s1600/34.png]

Step35.ClickontheF8button.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

14/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://4.bp.blogspot.com/HtnlxZcihSo/U6cOEOC_CyI/AAAAAAAAJiE/QXbSnM4ob4Q/s1600/35.png]

Step36.ProvidetheEmployeeIdnumberas0002andclickontheExecutebutton.

[http://3.bp.blogspot.com/YqVUwsDr1x0/U6cOEvOx3WI/AAAAAAAAJh8/rhIN3KfdiDs/s1600/36.png]

Step37.Wereceivedthebelowoutput.SotheAPIMethodworksfine.

[http://3.bp.blogspot.com/e7CtuWSudgw/U6cOFT7QUfI/AAAAAAAAJiI/XtdSYud8sko/s1600/37.png]

Step38.WefindthenewlycreatedBusinessobjectTypeintheTransactionBAPI,clickonthegeneratebuttonor
fromtheMenuchooseGenerate.

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

15/18

6/15/2015

4.BAPICreatingacustomBAPI

[http://2.bp.blogspot.com/ljIrN7vX7I/U6cOGQHo_hI/AAAAAAAAJiY/KiWzI4E9w9I/s1600/38.png]

Step39.Wereceivedamessagefortehgeneration.

[http://2.bp.blogspot.com/AoUV_y0zKiE/U6cOGuopEZI/AAAAAAAAJic/ucCTZdNAPRY/s1600/39.png]

Step40.NowgotoTxBAPIandclickontheAlphabeticaltab.HerewecanfindtheBusinessObjecttype.

[http://2.bp.blogspot.com/uAYT2t8OYs/U6cOHr4unJI/AAAAAAAAJio/c4PhRX1We48/s1600/40.png]
http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

16/18

6/15/2015

4.BAPICreatingacustomBAPI

Step41.HerewecanseethebusinessobjectAPIMethod.

[http://2.bp.blogspot.com/1QD8vR31BlY/U6cOJEEyHzI/AAAAAAAAJjA/MIQJkgTbBjg/s1600/41.png]

xxxxxxxxxxxx
Posted23rdJune2014bySPrasad
0 Viewcomments

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

17/18

6/15/2015

4.BAPICreatingacustomBAPI

No comments yet

Add a comment

http://freesapabap.blogspot.in/2014/06/4bapicreatingcustombapi.html

18/18

Das könnte Ihnen auch gefallen