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

Create a BAPI for READ_TEXT

Former Member
0 Likes
3,520

Hi SDN,

i had new requirment where i need to create a new BAPI which will work same as READ_TEXT function module.

because they use this BAPI in third party system.

please suggest me how can i start.

and can any one tell how we can convert a Function Module to a BAPI.

Thanks & regards

Naresh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,465

Dear

Function module can be converted into BAPI .

But they ase not similar .

a) First you have to check remote enable tab initially .

b) secondally you have to use the import export paramter as pass by value .

and then finally u have use to create by using swo1 trancation

rgds ankit

9 REPLIES 9
Read only

Former Member
0 Likes
2,466

Dear

Function module can be converted into BAPI .

But they ase not similar .

a) First you have to check remote enable tab initially .

b) secondally you have to use the import export paramter as pass by value .

and then finally u have use to create by using swo1 trancation

rgds ankit

Read only

Former Member
0 Likes
2,465

Hi,

Copy the code of read_text as zread_text

and change the attributes tab click on radio button 'Remote enablled module'

all the parameters in import and export are 'PASS BY VALUE' so there is no nedd to change those

after save check and activate

and create a business object in SWO1 transaction for this module

and then this can be used in remote systems

regards

Krishna

Read only

0 Likes
2,465

for SWO1 the function module should be API method so ZREAD_TEXT won't be a API method.

again we need to create a BAPI for the same.

so please let me know

Read only

0 Likes
2,465

check some online document to create a BAPI and at the end of the steps there is a step called register as an API, once you do that that can be used as a BAPI.

The code insde would be just a select statement from STXH table and get the lines and convert to output..

[BAPI Step by step Guidance|http://www.sap-img.com/abap/bapi-step-by-step-guidance.htm]

Read only

Former Member
0 Likes
2,465

Hi Naresh,

After creating ZREAD_TEXT with the following steps:

ZREAD_TEXT shud be assigned to a package with request.

1) ZREAD_TEXT should be remote enabled

2) marking the parameters pass by value

4) Add the parameter RETURN LIKE BAPIRET2 in the tables tab.

3) Copy the code from the function module READ_TEXT .

4) Activate the function module

5) In the change mode , in the atttibutes tab and and release it ( Function module->Release -> Release )

Now go to SWO1 and create an object.

Create a method in the methods by going to Utilities->API Methods->API Methood.

Give the FM name ZREAD_TEXT , and keep on clicking the NEXT button(>).

It will disply the message method inserted.Keep the cursor on method.

Save it and Go to Edit->Change release status->1)object type-> to modelled

2) to implemented

3) to released

and then Go to Edit->Change release status->1)object type component-> to modelled

2) to implemented

3) to released.

The created object type will be followed by tick mark.

Then Generate the created object by clicking the ball shaped icon.

U can check it that the BAPI has been created in BAPI transaction.

Thanks and Regards,

Krishna Chaitanya G

Read only

0 Likes
2,465

I will check this point let you know how it works

Read only

0 Likes
2,465

hey naresh..let me know if it doesnt work

Thanks and Regards,

Krishna Chaitanya G

Read only

Former Member
0 Likes
2,465

Copy the function module Read_text.

from se37 and change the properties.

Check for remote enabled.

Use like instead of type.

Return table of type bapiret2 for error message.

Regards,

Lalit Mohan Gupta.

Read only

former_member206439
Contributor
0 Likes
2,465

solved