Application Development and Automation 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: 
Read only

BAPI Functiona module

Former Member
0 Likes
906

what are the steps to create BAPI functionalodule?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
871

hi,

Scenario: Step-by-step creation of a BAPI to retrieve fields from table T001.

Procedure: 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.

In the pop-up that comes up, select the radio button u201C structureu201D.

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.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Now we are done with the creation of a 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.

In the next pop-up that follows, click on continue as shown above.

The function module screen would look like the one above.

Go to the Attributes tab and select the radio button reading u201Cremote-enabled moduleu201D. 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.

After successful activation, Go to the attributes tab. Go to Function moduleàReleaseàRelease.

+++++++++++++++++++++++++++++++++++++++++++++++

Now we are done with the creation of a 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.

Give the name of the BAPI as above and click on create.

Give the above-mentioned details and click on the continue icon.

Save in a package.

The resulting screen is as follows.

Now click on the methods to drop down and see what methods are provided by default. There would be two methods, showing in red color which come by default while creating the BAPI.

Click or select the method as shown above and go to the path u201CUtilitiesàAPI methodsàAdd methodsu201D.

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 u201Cnextu201D icon.

Click on Yes. You can see an information message reading u201C ZBAPIFMT001u201D inserted.

Now save after you add the method. Select & Double click on the API method.

Go to Tab: ABAP Check 'API Function'.

The above screen is displayed. Go to the ABAP tab as shown below.

Select the Radio button reading u201CAPI Functionu201D as already said above.

click on the continue icon to proceed further.

Now select the Object u201CZBAPI_T001u201D as shown below.

Go to : EditàChange Release StatusàObject type àTo Modeled.

The above shown screen will be displayed. Click on yes.

The message shows, The object type status set to modeled. (or already modeled)

Go to : EditàChange Release StatusàObject type à To Implemented.

You can see a message reading u201CObject type status set to implementedu201D

Now, go to: EditàChange Release StatusàObjectàTo Released.

There would be two pop ups coming up. Click continue on the Pop Ups.

Keep the cursor on the 'Method'.

Go to: EditàChange Release StatusàObject type componentàTO Modeled.

You can see the message reading u201C status for method u2018zbapifmt001u2019 set to modeledu201D.

Now, go to: EditàChange Release StatusàObject type componentà TO Implemented

You can see the message reading u201C status for method u2018zbapifmt001u2019 set to implementedu201D.

Now go to: EditàChange Releasse Status à Object type component à To Released

You can see the message reading u201C status for method u2018zbapifmt001u2019 set to Releasedu201D.

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 u201CObject type 'ZBAPI_T001' generated successfullyu201D

7 REPLIES 7
Read only

Former Member
0 Likes
871

This message was moderated.

Read only

Former Member
0 Likes
872

hi,

Scenario: Step-by-step creation of a BAPI to retrieve fields from table T001.

Procedure: 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.

In the pop-up that comes up, select the radio button u201C structureu201D.

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.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Now we are done with the creation of a 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.

In the next pop-up that follows, click on continue as shown above.

The function module screen would look like the one above.

Go to the Attributes tab and select the radio button reading u201Cremote-enabled moduleu201D. 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.

After successful activation, Go to the attributes tab. Go to Function moduleàReleaseàRelease.

+++++++++++++++++++++++++++++++++++++++++++++++

Now we are done with the creation of a 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.

Give the name of the BAPI as above and click on create.

Give the above-mentioned details and click on the continue icon.

Save in a package.

The resulting screen is as follows.

Now click on the methods to drop down and see what methods are provided by default. There would be two methods, showing in red color which come by default while creating the BAPI.

Click or select the method as shown above and go to the path u201CUtilitiesàAPI methodsàAdd methodsu201D.

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 u201Cnextu201D icon.

Click on Yes. You can see an information message reading u201C ZBAPIFMT001u201D inserted.

Now save after you add the method. Select & Double click on the API method.

Go to Tab: ABAP Check 'API Function'.

The above screen is displayed. Go to the ABAP tab as shown below.

Select the Radio button reading u201CAPI Functionu201D as already said above.

click on the continue icon to proceed further.

Now select the Object u201CZBAPI_T001u201D as shown below.

Go to : EditàChange Release StatusàObject type àTo Modeled.

The above shown screen will be displayed. Click on yes.

The message shows, The object type status set to modeled. (or already modeled)

Go to : EditàChange Release StatusàObject type à To Implemented.

You can see a message reading u201CObject type status set to implementedu201D

Now, go to: EditàChange Release StatusàObjectàTo Released.

There would be two pop ups coming up. Click continue on the Pop Ups.

Keep the cursor on the 'Method'.

Go to: EditàChange Release StatusàObject type componentàTO Modeled.

You can see the message reading u201C status for method u2018zbapifmt001u2019 set to modeledu201D.

Now, go to: EditàChange Release StatusàObject type componentà TO Implemented

You can see the message reading u201C status for method u2018zbapifmt001u2019 set to implementedu201D.

Now go to: EditàChange Releasse Status à Object type component à To Released

You can see the message reading u201C status for method u2018zbapifmt001u2019 set to Releasedu201D.

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 u201CObject type 'ZBAPI_T001' generated successfullyu201D

Read only

Former Member
0 Likes
871

This message was moderated.

Read only

Former Member
0 Likes
871

This message was moderated.

Read only

Former Member
0 Likes
871

hi, Scenario: Step-by-step creation of a BAPI to retrieve fields from table T001. Procedure: 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. In the pop-up that comes up, select the radio button u201C structureu201D. 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. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Now we are done with the creation of a 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. In the next pop-up that follows, click on continue as shown above. The function module screen would look like the one above. Go to the Attributes tab and select the radio button reading u201Cremote-enabled moduleu201D. 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

Read only

Former Member
Read only

Former Member
0 Likes
871

User ID's all deleted for asking and answering easily searchable questions... and copy&pasting...