on 03-24-2006 5:04 AM
Hi,
I am trying to execute a method associated with a function module (in BWAFMAPP table)
when I create the outboundfactory instance like below:
OutboundContainerFactory outfactory = OutboundContainerFactory.getInstance();
It throws an exception with message as:
Method <method name> is not registered.....
Can anyone please help me....
Thanks
Deepak
Hello Deepak,
<b>1. First you write InboundProcessor for the method you want to call.</b>
import com.sap.ip.me.api.sync.InboundProcessor;
// For every method you want to call, there must be a InboundProcessor aasociated with it.
public class MyInboundProcessor implements InboundProcessor {
public String getMethodName() {
// In transaction ME_WIZARD you enter java name for the method.
// This is the name by which Mobile applications refer to method in R/3.
return "ENTER YOUR JAVA NAME FOR THE METHOD HERE";
}
public void process(InboundContainer container) {
// Write code here to read return data from the R/3
}
}
<b>2. Now register this processor to InboundProcessorRegistry.</b>
MyInboundProcessor processor = new MyInboundProcessor();
InboundProcessorRegistry.getInstance().register(processor);
<b>3.Now create OutBoundContainer.</b>
OutboundContainer container = OutboundContainerFactory.getInstance().createOutboundContainer(VisibilityType.SEPARATED,"JAVA METHOD NAME",OutboundContainer.TYPE_REQUEST);
<b>4. Add paramters values for the method to be called.</b>
container.addItem("ITEM1",itemValue);
<b>
5.Close the container.</b>
container.close();
<b>6. Start Synchronization</b>
SyncManager.getInstance().synchronizeWithBackend();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhijit,
thanks for the responce,
But I have done all these 5 steps in the same manner,
But I am getting the Exception at
OutboundContainerFactory outfactory = OutboundContainerFactory.getInstance();
Can u please suggest some solution for this,
Can I do something at the time when I generate entry through ME_WIZARD,
Please rply,
thanks,
Deepak
Hello Deepak ,
getInstance() method of OutboundContainerFactory class does not throw any exception.
Exception will be thrown by createOutboundContainer method of OutboundContainerFactory class. You can refer to MDK documentation for this.
<a href="http://media.sdn.sap.com/public/html/submitted_docs/MI/MDK_2.5/content/javadoc/com/sap/ip/me/api/sync/OutboundContainerFactory.html#getInstance()">getInstance & createOutboundContainer methods</a>
Check if your InboundProcessor's getMethodName method is returning the same name which is there in BWAFMAPP .
Also while creating outbound container i.e. at
createOutboundContainer method second parameter gives the same java method name.
Still if you find any problem then reply.
hello deepak,
take note also that you have to register your processors
PRIOR to synchronization. you might want to implement a
SyncEventListener in your application that will register
your processor incase when it is not yet registered prior
to synchronization.
take note as well that InboundProcessing interface extends
Serializable. MI framework will try to serialize your
processor on the first time you register it. but if MI
encounters an exception during the serialization process,
it will be ignored. thus you need to listen to the SyncEvent
and register your processor if necessary.
hope this help.
regards
jo
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.