Go To Transaction SE11 and Create A Structure As Shown or As Per Your Requirement. Give The Name in The Data Type Field and Click Create
Go To Transaction SE11 and Create A Structure As Shown or As Per Your Requirement. Give The Name in The Data Type Field and Click Create
Go To Transaction SE11 and Create A Structure As Shown or As Per Your Requirement. Give The Name in The Data Type Field and Click Create
Give the name in the Data type field and click create.
In the pop-up that comes up, select the radio button “ structure”.
In the components tab of the structure, give the different fields and their corresponding field types
and press enter to check the compatibility and corrective ness.
Do not forget to save it in a package. You can even save it as a local object. For my example, I save it
in a package.
Check the structure (ctrl + F2) and activate (ctrl + F3) the structure.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++
Go to transaction SE37 where you create function modules. Click on create after you enter the name
of the Function module.
A screen as shown above would pop-up where you mention the function group to save the function
module and also provide some short text describing your function module.
Go to the Attributes tab and select the radio button reading “remote-enabled module”. Come back to
the imports tab and provide the import parameters as shown or as per your requirement.
Now in the Export tab, provide the export parameters as shown or as per your requirement.
In the tables tab, provide the information as shown or as per your requirement.
The next screen you visit is the source code. It would look like this.
In the source code tab, write the following code in order to pick the data based on the input you
provide.
Now, save and check the code and activate the function module.
+++++++++++++++++++++++++++++++++++++++++++++++
Go to transaction SWO1 and enter the name of the BAPI you would like to create or as shown in the
screen and click the create button.
Save in a package.
Click or select the method as shown above and go to the path “Utilities->API methods->Add
methods”.
On the screen that follows, provide the function module name and click on the continue icon.
In the ultimate pop-up, click the next step icon. We observe that the information is predefined in the
fields.
This is the next screen where you would just click on the “next” icon.
Click on Yes. You can see an information message reading “ ZBAPIFMT001” inserted.
Now save after you add the method. Select & Double click on the API method.
The message shows, The object type status set to modeled. (or already modeled)
Now, go to: Edit -> Change Release Status -> Object -> To Released.
There would be two pop ups coming up. Click continue on the Pop Ups.
Go to: Edit -> Change Release Status -> Object type component -> TO Modeled.
You can see the message reading “ status for method ‘zbapifmt001’ set to modeled”.
Now, go to: Edit -> Change Release Status -> Object type component -> TO Implemented
You can see the message reading “ status for method ‘zbapifmt001’ set to implemented”.
Now go to: Edit -> Change Releasse Status -> Object type component -> To Released
You can see the message reading “ status for method ‘zbapifmt001’ set to Released”.
Click on Generate Button. (the red ball kind of button is the Generate button)
After clicking on the generate button, you can see the message reading “Object type 'ZBAPI_T001'
generated successfully”.
Now go to BAPI Tcode (BOR) there we can find the BAPI (our BAPI)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++
Enter the name of your BAPI in the transaction SWO1 and click on ‘Test’.
The above screen is displayed. Click on the Execute icon against the BAPI as shown.
The above screen is displayed where you would require entering the data against the empty input
fields.
We have entered some data in the Field.
After entering the data, click on the execute icon as shown below.
The following screen is displayed which has some values as is indicated by the ITEMTAB.
Click on the Edit table icon as shown below.
We can even check it by passing different values again. Come back to the input and execution screen.
After executing the BAPI based on the input provided, we get the following screen.
Hit on the execute icon.
We are now done with the creation and successful execution of a BAPI.