3
 Get tin g St art ed Newsl ett ers St ore SearchtheCommunity  Welcome, Guest Login Register Added by Sachin Dhingra, last edited by Sachin Dhingra on Jun 23, 2008 ABAP Development  / Useful ABAP Function Modules Function Module Test Sequence Function Module Test Sequence - By using this option we can test a number of function modules all together where first's output is the Input for the next. Many times we have to use BAPIs in our ABAP code or in XI/PI for some interfacing with SAP. In some BAPIs we need to commit work. Until I was not aware of this option I used to write a piece of code and test it. But now we c an test it as f ollows : Example: I am using the two BAPIs to test in sequence. 1. BAPI_PO_CR EATE1 (T o Create a standard Purchase Order) 2. BAPI_TRANSACTION_COMM IT (To Commit Wor k) BAPI_PO_CREATE1 is used to create Purchase order but even after getting a success message as output we are not able to see the Purchase Order created because the work done by this BAPI is not committed in database. That's why we have to use BAPI_TRANSACTION_COMMIT. Go to transaction SE37. Go to menu Func tion Module->T est->T est Sequences as shown:  Give the name of BAPIs BAPI_PO_CREATE1 and BAPI_TRANSACTION_COMMIT and Execute.  The BAPI_PO_CREATE test is opened. Give the Header and Item Data (Header and Item data may vary according to configuration of your system) Enter the Values for POHEADER Click on the icon next to refresh or (Shift + F7) to have a better view to enter the DATA. Enter the Values for POHEADERX In POHEADERX you have to put 'X' for the values you entered i n POHEADER Enter the Values for POITEM Enter the Values for POITEMX In POITEMX you have to put 'X' for the values you entered in POITEM. Execute the function module and check the RETURN table. If Fu nc tio n Mo du le T est Sequen ce - ABAP Deve lopm en t - S CN Wik i h tt p://wik i.sc n. sap.com /wik i/dis play /AB AP/ Fu nct ion +Modu le+T est +Seq... 1 of 2 06.07.2015 5:06 PM

Function Module Test Sequence - ABAP Development - SCN Wiki

Embed Size (px)

DESCRIPTION

Function Module Test Sequence - ABAP Development - SCN Wiki

Citation preview

  • Getting Started Newsletters Store

    Search the Community

    Welcome, Guest Login Register

    Added by Sachin Dhingra, last edited by Sachin Dhingra on Jun 23, 2008

    ABAP Development / Useful ABAP Function Modules

    Function Module Test Sequence

    Function Module Test Sequence - By using this option we can test a number of function modules all together where first's output is the Input for the next. Many times we have to use BAPIs in our ABAP code or in XI/PI for some interfacing with SAP. In some BAPIs we need to commit work. Until I was not aware of this option I used to write a piece of codeand test it. But now we can test it as follows: Example: I am using the two BAPIs to test in sequence.

    1. BAPI_PO_CREATE1 (To Create a standard Purchase Order)2. BAPI_TRANSACTION_COMMIT (To Commit Work)

    BAPI_PO_CREATE1 is used to create Purchase order but even after getting a success message as output we are not able to see the Purchase Order created because the work done by this BAPI is notcommitted in database. That's why we have to use BAPI_TRANSACTION_COMMIT.Go to transaction SE37. Go to menu Function Module->Test->Test Sequences as shown:

    Give the name of BAPIs BAPI_PO_CREATE1 and BAPI_TRANSACTION_COMMIT and Execute.

    The BAPI_PO_CREATE test is opened. Give the Header and Item Data (Header and Item data may vary according to configuration of your system)

    Enter the Values for POHEADER

    Click on the icon next to refresh or (Shift + F7) to have a better view to enter the DATA.

    Enter the Values for POHEADERXIn POHEADERX you have toput 'X' for the values youentered in POHEADER

    Enter the Values for POITEM

    Enter the Values for POITEMX

    In POITEMX you have to put 'X'for the values you entered inPOITEM. Execute the function moduleand check the RETURN table. If

    Function Module Test Sequence - ABAP Development - SCN Wiki http://wiki.scn.sap.com/wiki/display/ABAP/Function+Module+Test+Seq...

    1 of 2 06.07.2015 5:06 PM

  • you get thesuccess messagethen only the nextBAPI

    BAPI_TRANSACTION_COMMIT is useful.So, once you get the success message go back. It will take you to the nextfunction module.

    Give the value'X' for inputwait andexecute. Workis committednow you cancheck the

    Purchase Order created.

    Go to Transaction Me23/Me23n to check Purchase order created.

    I hope this information is useful for ABAPers and for XI/PI guys as they need to test BAPIs like this.function module test sequance xi_stepbystep_adapters bc-xi-con-rfc

    4 CommentsSachin DhingraSuggestions and comments are always welcome.

    GuestGood

    GuestI have just used this method to test a bapi method. The problem is how to clear the test sequences?

    Rohit AgarwalIs it possible to execute both the BAPIs separately in se37 that is first using se37 Create the PO using bapi and just after that in another session through se37 call bapi transaction commit.

    Will this work too?

    Follow SCNContact Us SAP Help PortalPrivacy Terms of Use Legal Disclosure Copyright

    Function Module Test Sequence - ABAP Development - SCN Wiki http://wiki.scn.sap.com/wiki/display/ABAP/Function+Module+Test+Seq...

    2 of 2 06.07.2015 5:06 PM