Application Development 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: 

How to develop an Remote Enabled Function Module

Former Member
0 Kudos

Hi All,

I'm totally new to ABAP. I have a requirement to create a Remote Enabled Function Module, which I can use to call from an external program like Java using JCo.

The functionality of the Remote Function is to write some data into certain fields of the tables AFPO and JEST.

Can someone please guide me, how to do the above described task. Is there any code snippets available, that would be really gr8.

Thanks & Best Regards,

Chandrasekhar.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

While creating the Function Module, in the attributes section, there is a radiobutton called "Remote-enabled module". You need to select that & you are ready to go.

For an example, see attributes for Function Module RFC_ABSENCETYPES_READ / RFC_CALL_TRANSACTION.

Hope this helps, do award points if you find this useful.

13 REPLIES 13

Former Member
0 Kudos

While creating the Function Module, in the attributes section, there is a radiobutton called "Remote-enabled module". You need to select that & you are ready to go.

For an example, see attributes for Function Module RFC_ABSENCETYPES_READ / RFC_CALL_TRANSACTION.

Hope this helps, do award points if you find this useful.

0 Kudos

Its just like developing a regular function module, setup your import/export/tables parameters, I would suggest not having any exceptions. And make sure that you check the right radio-button in the attributes tab.

Regards,

Rich Heilman

0 Kudos

Check out this documentation.

http://help.sap.com/saphelp_erp2005/helpdata/en/d1/801ee8454211d189710000e8322d00/frameset.htm

Also, DO NOT update those tables directly. You must find a function module or BAPI to handle that.

Regards,

Rich HEilman

0 Kudos

Hi,

All ur replies were very useful. I will certainly reward points immediately after my issue is resolved. The main problem is I don't have ABAP knowledge, thats why I want to know how to develop a function module which can write data into few fields of AFPO and JEST tables.

If I can get any code samples with the similar functionality that would be a gr8 help.

Thanks in advance,

Chandrasekhar.

0 Kudos

Can you Give some idea of FM what it will do.

regards

vijay

0 Kudos

Hi Vijay,

The FM is to add values to the following fields in AFPO(Order Table)

1. AUFNR - Order Number

2. MATNR - Material Number Order

3. WEMNG - Quantity of goods received for the order item

4. LTRMI - Actual delivery/finish date

5. MEINS - Base Unit of Measure

6. DWERK - Plant

and also to the STAT(Object Status) field in JEST(Individual Object Status) table.

Once this is FM is built and Remote Enabled, I'm going to call this FM from Java program using JCo.

Hope, this gave the understanding of my requirement.

Waiting for ur reply !!!

0 Kudos

Hi Chandra,

Is it ok if you Don't maintain in header table.

and what about the Item POSNR this is key field.

what exactly you will do, i mean modification, or new entries.

regards

vijay

0 Kudos

Hi Vijay,

Please assume that the FM need to add records to EKPO(Purchasing Document Item) table.

The input to the FM will be the values to WERKS, MATNR and LEWED fields. If there is any other key fields also need to be inputted, assume that I will input them.

It will be a gr8 help if u can give the code snippet to the above. That will help me to build other FMs by myself.

Thanx for ur responces,

Chandrasekhar.

0 Kudos

Hi Chandrasekar,

See the sample code to do this. I am taking one test

table in the same way you can do according to ur req.

1) Goto SE37 and give some name and press create.

It willa sk you to enter function group name if

you have already function grioup defined use that

or lese in the menu Goto -> Function group ->Create

group. Come back and use the same group here.

2) In the attributes screen Seelct Radio button Remote

enable func.

3) If you want to update multiple entries in the table

go to tabe Tables and

in that Parameter name - i_tab

Type - Like

reference type - Your table name (MARA).

4) Now goto Source code tab and do the below.

if not i_tab[] is initial.

MODIFY MARA FROM TABLE I_tab.

endif.

Then save it and activate.

This is for you undersatnding and if they ask you to do some validations then do tehn befire updating.

Thanks & Regards,

Siri.

0 Kudos
you shuld have import parameters like this
 i_aufnr tpye afpo-aufnr.
 i_posnr tpye afpo-posnr.
 i_matnr tpye afpo-matnr.
 i_wemng tpye afpo-wemng.
 i_ltrmi tpye afpo-ltrmi.
i_meins tpye afpo-meins.
i_dwerk tpye afpo-dwerk.
i_objnp tpye afpo-objnp.
i_stat type jest-stat.
in exceptions 
enter_key_data.

assume all the fields are mandatory.
types: begin of t_ekpo,
      aufnr like ekpo-aufnr,
      posnr like ekpo-posnr,
      matnr like ekpo-matnr,
      wemng like ekpo-wemng,
      ltrmi like ekpo-ltrmi,
      meins like ekpo-meins,
      dwerk like ekpo-dwerk,
      objnp like ekpo-objnp, "for Status update
      end of t_ekpo.
types: begin of t_jest,
       objnr like jest-objnr,
       stat  like jest-stat,
       end of t_jest
data: x_ekpo type t_ekpo,
      x_jest type t_jest.
**need to validate before sending it to EKPO.
if not i_aufnr is initial
     and not i_posnr is initial
     and not i_objnp is initial
     and not i_stat is initial.
   
X_ekpo-aufnr = i_aufnr.
X_ekpo-posnr = i_posnr.
X_ekpo-matnr = i_matnr.
X_ekpo-wemng = i_wemng.
X_ekpo-ltrmi = i_ltrmi.
X_ekpo-meins = i_meins.
X_ekpo-dwerk = i_dwerk.
x_ekpo-objnp = i_objnp.
modify EKPO from X_ekpo .
if sy-subrc = 0.
commit work.
endif.
x_jest-objnr = i_objnp.
x_jest-stat = i_stat.
modify JEst from X_jest .
if sy-subrc = 0.
commit work.
endif.
else.
raise exception enter_key_data.
endif.

please let me know if you need any validation on those.

regards

vijay

Message was edited by: Vijay Babu Dudla

Former Member
0 Kudos

Hi,

Create function module and in the attributes check the

radio button 'Remote Enable func'.

and also make sure that when you are passing

parameters Check pass by value check box.

Thanks&Regards,

Siri.

Former Member
0 Kudos

Hi Chandrasekhar,

You can refer this link.

http://help.sap.com/saphelp_nw04/helpdata/en/22/04250b488911d189490000e829fbbd/content.htm

Even this link might proove useful for you...

http://help.sap.com/saphelp_nw04/helpdata/en/66/6f040c5ce8214eaf48c92e691639ed/content.htm

Regards,

Raj

Message was edited by: Rajasekhar Dinavahi

former_member188685
Active Contributor
0 Kudos

Hi Chandra,

Write Normal Function module and Go to attributes

in that there is an option to Make it RFC . check the check box. then it will be RFC enabled.

regards

vijay