Calling an RFC from an EJB over an Enterprise Connector
Hi all,
I would like to call an RFC enabled Function Modul (FuBa) from a BW-System over an EJB in a Web AS environment bei passing SAP Logon Ticket.
To achive this goal, i've generated proxy classes (Enterprise Connector) via NWDS .
If i call enterprise connector localy from an example class (See attachment), it works.
BUT
if I use the same Code within an EJB, bei correct deployment , it doesn't work. I become an exception, during to establish a connection
What is wrong here ?
What do i have to do in an a EJB-Environment to use an Enterprise Connector ?
Best Regards
A. Büyükyilmaz
ATTACHMENT
Created on 13.02.2007
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
package de.xxx.test.ep.main;
import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import com.sap.aii.proxy.framework.core.ApplicationFaultException;
import com.sap.aii.proxy.framework.core.SystemFaultException;
import com.sap.mw.jco.JCO;
import de.xxx.yyy.zzz.connectivity.fuba.Anlage_PortType;
import de.xxx.yyy.zzz.connectivity.fuba.Zge_Gerel_Data_For_Kne_Kn_Input;
import de.xxx.yyy.zzz.connectivity.fuba.Zge_Gerel_Data_For_Kne_Kn_Output;
@author pg4011
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
public class GetAnlage {
private JCO.Client mConnection = null;
public boolean connectToSAP(
String client,
String user,
String passwd,
String lang,
String appServer,
String sysNo) {
try {
mConnection =
JCO.createClient(client, user, passwd, lang, appServer, sysNo);
mConnection.connect();
} catch (Exception e) {
e.printStackTrace();
return false;
return true;
public static void main(String[] args) {
GetAnlage anlage = new GetAnlage();
if (anlage.connectToSAP ("50", "abc", "pwd", "DE", "system", "00")) {
System.out.println("Anlage wird erstellt");
anlage.getData();
System.out.println("");
System.exit(0);
private void getData() {
// ImportParameter
Zge_Gerel_Data_For_Kne_Kn_Input input = new Zge_Gerel_Data_For_Kne_Kn_Input();
// Hole proxy Instance mit JCO.Client instance
Anlage_PortType proxy = new Anlage_PortType();
proxy.messageSpecifier.setJcoClient(mConnection);
Zge_Gerel_Data_For_Kne_Kn_Output output = new Zge_Gerel_Data_For_Kne_Kn_Output();
input.setI_Bp_Nr("7901514764");
input.setI_View("03");
input.setI_Spras("DE");
Date stichtag = new Date(2006, 9, 22);
input.setI_Stichtag(stichtag);
//Rufe RFC auf
try {
output = proxy.zge_Gerel_Data_For_Kne_Kn(input);
String s = "";
System.out.println(s);
} catch (SystemFaultException e) {
e.printStackTrace();
} catch (ApplicationFaultException e) {
e.printStackTrace();
Hi Rajesh,
it's realy funny. Although, i inserted som trace outputs behind of catch-statement, i do not see any information about exception in application log.
but i see, that the method becomes correct inputparameters and i see it try to make a connection. After that, it end without a trace.
Best Regards
Ahmet
Similar Messages
-
How can I call a RFC from dynpage ?
Hi!
I would like to know how can I call a RFC from a Portal aplication, dynpage or jspdynpage. there include some libraries ?
any idea?
thanksfor deploying SAP Jra :
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4#search=%22how%20to%20use%20jca%20sapjra%20site%3Asap.com%22
For lookup of SAP Jra use:
com.sapportals.connector.connection.IConnectionFactory connectionFactory =(IConnectionFactory) initctx.lookup( "deployedAdapters/SAPFactory/shareable/SAPFactory");
Using SAP Jra
http://help.sap.com/saphelp_nw04s/helpdata/en/47/13044258bdd417e10000000a1550b0/content.htm
The important jars required are:
connector.jar
Genericconnector.jar
prtjndisupport.jar
Thanks -
Error while calling an RFC from R/3
Hi all,
I am new to webdynpro. I am calling a RFC from R/3/.the code is like this.
Zhr_Fm_Loan_Input input = new Zhr_Fm_Loan_Input();
wdContext.nodeZhr_Fm_Loan_Input().bind(input);
input.setUsrid(wdContext.currentContextElement().getEmpnoa());
try
wdContext.nodeZhr_Fm_Loan_Input().currentZhr_Fm_Loan_InputElement().modelObject().execute();
catch(Exception e)
wdComponentAPI.getMessageManager().reportException("Exception "+e,true);
In the output i am getting an eror Exception com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException.
Can anybody explain the error.
Regards,
RajeshHi Rajesh
Kindly check ur BAPI once from Backend, i hope there is no other mandatory field required apart from Usrid.
I hope BAPI doesnot have any mandatory Structure in it. in case it has , u have to pass that also..
Try printing this context also ..wdContext.currentContextElement().getEmpnoa().. i hope it is not returning a null.
wdContext.nodeZfm_Input().nodeOutput().invalidate(); // Add this line after execute statement
Regards
Puneet -
How to call the RFC from R/3 to SRM, when we use webdynpro abap? (Urgent)
Hello
We use SRM Server 5.5 with classic scenario.
We want to call RFC in R/3 from webdynpro ABAP.
How can we do that?
We are developing the web report using webdynpro abap.
So we need some of R/3 data such like PR(EBAN)and PO(EKKO,EKPO).
When user choose the search parameter, report diplay the Shopping cart, PR and PO data on webdynpro. So we call the R/3 RFC to display the PR, PO data.
But I tired to call the RFC in R/3, We could not call it.
How to call the RFC from R/3 to SRM, when we use webdynpro abap?
Thank you,
Best Regards,
SH.Hi
<b>Please look at the following threads as well -></b>
WebDynpro in SRM
BAPI's /RFC's in SRM
BAPI to Change Shopping Cart by RFC
SRM60 and webdynpro
Webdynpro Services Exception
WebDynpro using BAPI has an error
SRM60 and webdynpro...
<b>SAP uses META Function modules in SRM to get data from R/3 back-end.</b>
<u>For getting Purchase requistion data, use the function modules -></u>
META_REQUISITION_CHANGE Change purchase requisition
META_REQUISITION_CREATE Create Requisition
META_REQUISITION_DELETE Delete/close purchase requisition
META_REQUISITION_GETDETAIL Display requisition details
META_REQUISITION_GETITEMS Display requisition items
META_REQUISITION_GETRELINFO Get Releasease Info for requisitions
<u>For getting Purchase order data, use the function modules -></u>
META_PO_CREATE Create purchase order
META_PO_DELETE Delete reservation
META_PO_GETDETAIL Display purchase order details
META_PO_GETITEMS Display purchase order items
META_PO_GETRELINFO Display purchase order release information
Hope this will definitely help. Do let me know.
Regards
- Atul -
Hi,
My question is how to call an RFC from a bean Class (stateless Session Bean). I have followed a link and wrote a following class :
public class Bapi1
public static void main(String args[])throws ApplicationFaultException, SystemFaultException
String aMonth[] = null;
String aMonthVal[] = null;
JCO.Client jcoclient = null;
Yfunc001_Output output = null;
try {
jcoclient = JCO.createClient("Client","Username","Password","Lang","SAP Application System"," SAP System Number");
try {
jcoclient.connect();
System.out.println(""+ jcoclient.getASHost()+ jcoclient.getClient()+ jcoclient.getLanguage()+ jcoclient.getSystemNumber()jcoclient.getUser()jcoclient.isValid());
} catch (RuntimeException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e.getLocalizedMessage());
e.printStackTrace();
Yfunc001_Input input = new Yfunc001_Input();
Graph_PortType mytype = new Graph_PortType();
mytype.messageSpecifier.setJcoClient(jcoclient);
try {
output = mytype.yfunc001(input);
} catch (SystemFaultException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (ApplicationFaultException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
jcoclient.disconnect();
YstructType_List list = output.get_as_listItab();
int listsize = list.size();
for (int i = 0; i < listsize; i++) {
YstructType elem = list.getYstructType(i);
aMonth<i> = elem.getMth();
aMonthVal<i> = elem.getMval();
When I try to Execute this class I get the following Exception
java.lang.NoClassDefFoundError
* at com.sap.mw.jco.MiddlewareJRfc$Client.connect(MiddlewareJRfc.java:882)*
* at com.sap.mw.jco.JCO$Client.connect(JCO.java:3159)*
* at com.ltil.fusionejb.Bapi1.main(Bapi1.java:32)*
Exception in thread "main"
I get an Error on Line : jcoclient.connect();
What All libraries I need to install? Please List down the Steps if possible. Points with be awarded...
Thanks,
Prasanna.Hi,
Add the following jar to the classpath,
<Drive>:/usr/sap/<SID>/JC00/j2ee/cluster/server0/bin/ext/com.sap.mw.jco/jrfc.jar
Hope this helps in solving the issue !
Regards,
Srinivasan T -
HI Guys,
I have a requirement to call ABAP RFC from Message Mapping.
Can any one pls share the document links or ideas with me.
Thanks,
MSHi
u can use RFC LoopUp
if PI 7.0 / 3.0 -- need to write the UDF to execute
link
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70d90a91-3cf4-2a10-d189-bfd37d9c3231
if PI 7.1 then u have functionality in MM itself to do so
rgds
srini -
Procedure to call an RFC from another R/3 system
Hi ,
I am new to RFC, how can we do the following steps:
1. Run a routine in Dev environment which calls an RFC which is in testing
2. The RFC performs the task as written in it
3. RFC passes the result to routine in Dev and
4. We display the return in the end in Dev.
Do i need any authorization for that?
Regards,
PoojaHi,
I wanted to know how to call an RFC from one R/3 system to another R/3 system .
And what settings should be made to do a RFC in T code SM59?
what does the function module RFC_READ_REPORT do? Can i call any program through this?(As the documentation is not available I am not able to understand the functionality of this Function module)
Regards,
Pooja -
I want to call SAP RFC from ODI. Client has provided only a set of RFC's. So I want to call these RFC's to extract data from SAP ERP system or BW to Oracle Staging using ODI. Would anyone please tell me how it will be possible?
I want to call SAP RFC from ODI. Client has provided only a set of RFC's. So I want to call these RFC's to extract data from SAP ERP system or BW to Oracle Staging using ODI. Would anyone please tell me how it will be possible?
-
Unable to call the RFC from the WD java Program
Hi All,
I have a table and three buttons Create, Edit, Save in the layout.
If no record available in the R3 the the end user will click on create and then he will click on save so that the insert RFC will be called accordingly and the record will be inserted.My table is limited to 5 records only. If i enter all the 5 records and Click on submit the record is inserting in the backend , but if i enter less than 5 records im unable to call the RFC what might be the issue.
My insert RFC takes one Table node and 4 import parameters i'm passing all of the all the mentioned import parameters.
Code:-
View Controller code
// This file has been generated partially by the Web Dynpro Code Generator.
// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
package com.gmr.ess;
// IMPORTANT NOTE:
// ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateAPPView).
// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
// OF IMPORT STATEMENTS.
//@@begin imports
import java.math.BigDecimal;
import java.util.Date;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Iterator;
import com.gmr.ess.wdp.IPrivateAPPView;
import com.gmr.pck.Zst_Hr_Nominee;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
import com.sap.tc.webdynpro.services.sal.um.api.IWDClientUser;
import com.sap.tc.webdynpro.services.sal.um.api.WDClientUser;
//@@end
//@@begin documentation
//@@end
public class APPView
Logging location.
private static final com.sap.tc.logging.Location logger =
com.sap.tc.logging.Location.getLocation(APPView.class);
static
//@@begin id
String id = "$Id$";
//@@end
com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
Private access to the generated Web Dynpro counterpart
for this controller class. </p>
Use <code>wdThis</code> to gain typed access to the context,
to trigger navigation via outbound plugs, to get and enable/disable
actions, fire declared events, and access used controllers and/or
component usages.
@see com.gmr.ess.wdp.IPrivateAPPView for more details
private final IPrivateAPPView wdThis;
Root node of this controller's context. </p>
Provides typed access not only to the elements of the root node
but also to all nodes in the context (methods node<i>XYZ</i>())
and their currently selected element (methods current<i>XYZ</i>Element()).
It also facilitates the creation of new elements for all nodes
(methods create<i>XYZ</i>Element()). </p>
@see com.gmr.ess.wdp.IPrivateAPPView.IContextNode for more details.
private final IPrivateAPPView.IContextNode wdContext;
A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
Represents the generic API of the generic Web Dynpro counterpart
for this controller. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDViewController wdControllerAPI;
A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
Represents the generic API of the Web Dynpro component this controller
belongs to. Can be used to access the message manager, the window manager,
to add/remove event handlers and so on. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
public APPView(IPrivateAPPView wdThis)
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
//@@begin javadoc:wdDoInit()
/** Hook method called to initialize controller. */
//@@end
public void wdDoInit()
//@@begin wdDoInit()
try{
IWDMessageManager manager1 = wdComponentAPI.getMessageManager();
IWDClientUser user = WDClientUser.getLoggedInClientUser();
String logUser= user.getSAPUser().getUniqueName();
wdContext.currentContextElement().setUserid(logUser);
wdThis.wdGetAPPController().executeBapi_Employee_Getdata_Input();//Returns the user id for the employee
Collection nomineeList = new ArrayList();
wdThis.wdGetAPPController(). executeZ_Hrfm_Nominee_Disp_Input( );
int nomineeTableSize = wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().size();
for(int i=0;i< nomineeTableSize;i++){
IPrivateAPPView.IDisplay_table_nodeElement ele = wdContext.nodeDisplay_table_node().createDisplay_table_nodeElement();
ele.setAddr(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getAddr());
ele.setDob(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getDob());
ele.setGuard(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getGuard());
ele.setName(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getName());
ele.setPerc(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getPerc());
ele.setRelat(wdContext.nodeZ_Hrfm_Nominee_Disp_Input().nodeOutput_Nominee().nodeNominee().getNomineeElementAt(i).getRelat());
nomineeList.add(ele);
wdContext.nodeDisplay_table_node().bind(nomineeList);
wdContext.currentContextElement().setEdit_val_attr(true);
if(nomineeTableSize<=0){
wdContext.currentContextElement().setCreateButtonEnable(true);
wdContext.currentContextElement().setEditButtonEnable(false);
else{
wdContext.currentContextElement().setCreateButtonEnable(false);
wdContext.currentContextElement().setEditButtonEnable(true);
catch(Exception e){
wdComponentAPI.getMessageManager().reportException("",true);
//@@end
//@@begin javadoc:wdDoExit()
/** Hook method called to clean up controller. */
//@@end
public void wdDoExit()
//@@begin wdDoExit()
//@@end
//@@begin javadoc:wdDoModifyView
Hook method called to modify a view just before rendering.
This method conceptually belongs to the view itself, not to the
controller (cf. MVC pattern).
It is made static to discourage a way of programming that
routinely stores references to UI elements in instance fields
for access by the view controller's event handlers, and so on.
The Web Dynpro programming model recommends that UI elements can
only be accessed by code executed within the call to this hook method.
@param wdThis Generated private interface of the view's controller, as
provided by Web Dynpro. Provides access to the view controller's
outgoing controller usages, etc.
@param wdContext Generated interface of the view's context, as provided
by Web Dynpro. Provides access to the view's data.
@param view The view's generic API, as provided by Web Dynpro.
Provides access to UI elements.
@param firstTime Indicates whether the hook is called for the first time
during the lifetime of the view.
//@@end
public static void wdDoModifyView(IPrivateAPPView wdThis, IPrivateAPPView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
//@@begin wdDoModifyView
//@@end
//@@begin javadoc:onActionGetData(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionGetData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionGetData(ServerEvent)
//$$begin ActionButton(-535519310)
//wdThis.wdGetAPPController().executeZ_Hrfm_Nominee_Disp_Input();
//$$end
//@@end
//@@begin javadoc:onActionEdit(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionEdit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionEdit(ServerEvent)
//$$begin ActionButton(-535519310)
displayTablesize=wdContext.nodeDisplay_table_node().size();
if(displayTablesize<5){
for(int i=0;i<size-displayTablesize;i++){
IPrivateAPPView.IDisplay_table_nodeElement ele = wdContext.nodeDisplay_table_node().createDisplay_table_nodeElement();
wdContext. nodeDisplay_table_node().addElement(ele);
operation="MOD";
wdContext.currentContextElement().setTableReadOnly(true);
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setOperation(operation);
//$$end
//@@end
//@@begin javadoc:onActionCreate(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionCreate(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionCreate(ServerEvent)
int month=0,year=0,day=0;
String month1,day1,year1;
try{
displayTablesize=wdContext.nodeDisplay_table_node().size();
wdContext.currentContextElement().setEdit_val_attr(false);
if(wdContext.nodeDisplay_table_node().isEmpty()){
if(displayTablesize<5){
Calendar cal=Calendar.getInstance();
month=cal.get(Calendar.MONTH)+1;
if(month==1||month==2||month==3||month==4||month==5||month==6||month==7||month==8||month==9){
month1="0"+month;
else{
month1=""+month;
day = cal.get(Calendar.DAY_OF_MONTH);
if(day==1||day==2||day==3||day==4||day==5||day==6||day==7||day==8||day==9){
day1= "0"+day;
else{
day1=""+day;
year = cal.get(Calendar.YEAR);
year1=""+year;
String strFormat=day1"."month1"."year1;
wdContext.currentOutput_NomineeElement().setBegda(strFormat);
wdContext.currentOutput_NomineeElement().setEndda("31.12.9999");
for(int i=0;i<size-displayTablesize;i++){
IPrivateAPPView.IDisplay_table_nodeElement ele = wdContext.nodeDisplay_table_node().createDisplay_table_nodeElement();
wdContext. nodeDisplay_table_node().addElement(ele);
operation="INS";
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setOperation(operation);
wdContext.currentContextElement().setTableReadOnly(true);
catch(NullPointerException npe){
wdComponentAPI.getMessageManager().reportException("No Data Available",true);
//@@end
//@@begin javadoc:onActionSaveData(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionSaveData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionSaveData(ServerEvent)
float percentage=0;
float dupePercentage=0;
boolean isTest = false;
Collection DispTList = new ArrayList();
IWDMessageManager manager1 = wdComponentAPI.getMessageManager();
try{
displayTablesize = wdContext.nodeDisplay_table_node().size();
//for(int i=1;i<=displayTablesize;i++){
for(int i=0;i<displayTablesize;i++){
BigDecimal share = wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getPerc();
String name = wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getName();
percentage = share.floatValue();
dupePercentage = dupePercentage + percentage;
if(name!=null && share!=null){
Zst_Hr_Nominee nominee = new Zst_Hr_Nominee();
nominee.setAddr(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getAddr());
manager1.reportSuccess(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getAddr());
nominee.setDob(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getDob());
manager1.reportSuccess(""+wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getDob());
nominee.setGuard(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getGuard());
manager1.reportSuccess(""+wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getGuard());
nominee.setName(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getName());
manager1.reportSuccess(""+wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getName());
nominee.setPerc(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getPerc());
manager1.reportSuccess(""+wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getPerc());
nominee.setRelat(wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getRelat());
manager1.reportSuccess(""+wdContext.nodeDisplay_table_node().getDisplay_table_nodeElementAt(i).getRelat());
DispTList.add(nominee);
wdContext.nodeZ_Hrfm_Nominee_Ins_Mod_Input().nodeNominee_ins().bind(DispTList);
if((dupePercentage)!=100)
wdComponentAPI.getMessageManager().reportException(
"The sum of the share Percentages is not 100. Modify the percentages accordingly",true);
wdContext.nodeZ_Hrfm_Nominee_Ins_Mod_Input().nodeNominee_ins().bind(DispTList);
IWDMessageManager manager = wdComponentAPI.getMessageManager();
String beginDate = wdContext.currentOutput_NomineeElement().getBegda();
manager.reportSuccess(wdContext.currentOutput_NomineeElement().getBegda());
String endDate=wdContext.currentOutput_NomineeElement().getEndda();
manager.reportSuccess(wdContext.currentOutput_NomineeElement().getEndda());
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setBegda(beginDate);
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setEndda(endDate);
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setOperation(operation);
wdComponentAPI.getMessageManager().reportSuccess(operation);
wdThis.wdGetAPPController().executeBapi_Employee_Getdata_Input();
wdThis.wdGetAPPController().executeZ_Hrfm_Nominee_Ins_Mod_Input();
//wdContext.currentContextElement().setTableReadOnly(false);
catch(Exception e){
e.getMessage();
//@@end
The following code section can be used for any Java code that is
not to be visible to other controllers/views or that contains constructs
currently not supported directly by Web Dynpro (such as inner classes or
member variables etc.). </p>
Note: The content of this section is in no way managed/controlled
by the Web Dynpro Designtime or the Web Dynpro Runtime.
//@@begin others
int nomineeTableSize = 0;
int displayTablesize = 0;
String operation= null;
int size=5;
// float dupePercentage=0;
//String mod_op="MOD";
//@@end
content of obsolete user coding area(s) -
//@@begin obsolete:javadoc:onActionSave(ServerEvent)
// /** Declared validating even
Component controller code
// This file has been generated partially by the Web Dynpro Code Generator.
// MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
// ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
package com.gmr.ess;
// IMPORTANT NOTE:
// ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
// BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
// AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateAPP).
// OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
// A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
// OF IMPORT STATEMENTS.
//@@begin imports
import java.util.Iterator;
import com.gmr.ess.wdp.IPrivateAPP;
import com.gmr.pck.Bapi_Employee_Getdata_Input;
import com.gmr.pck.Bapip0002B;
import com.gmr.pck.Z_Hrfm_Nominee_Disp_Input;
import com.gmr.pck.Z_Hrfm_Nominee_Ins_Mod_Input;
import com.gmr.pck.Zst_Hr_Nominee;
import com.sap.lcr.api.util.SetProfileConnect;
import com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
//@@end
//@@begin documentation
//@@end
public class APP
Logging location.
private static final com.sap.tc.logging.Location logger =
com.sap.tc.logging.Location.getLocation(APP.class);
static
//@@begin id
String id = "$Id$";
//@@end
com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
Private access to the generated Web Dynpro counterpart
for this controller class. </p>
Use <code>wdThis</code> to gain typed access to the context,
to trigger navigation via outbound plugs, to get and enable/disable
actions, fire declared events, and access used controllers and/or
component usages.
@see com.gmr.ess.wdp.IPrivateAPP for more details
private final IPrivateAPP wdThis;
Root node of this controller's context. </p>
Provides typed access not only to the elements of the root node
but also to all nodes in the context (methods node<i>XYZ</i>())
and their currently selected element (methods current<i>XYZ</i>Element()).
It also facilitates the creation of new elements for all nodes
(methods create<i>XYZ</i>Element()). </p>
@see com.gmr.ess.wdp.IPrivateAPP.IContextNode for more details.
private final IPrivateAPP.IContextNode wdContext;
A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
Represents the generic API of the generic Web Dynpro counterpart
for this controller. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdControllerAPI;
A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
Represents the generic API of the Web Dynpro component this controller
belongs to. Can be used to access the message manager, the window manager,
to add/remove event handlers and so on. </p>
private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
public APP(IPrivateAPP wdThis)
this.wdThis = wdThis;
this.wdContext = wdThis.wdGetContext();
this.wdControllerAPI = wdThis.wdGetAPI();
this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
//@@begin javadoc:wdDoInit()
/** Hook method called to initialize controller. */
//@@end
public void wdDoInit()
//@@begin wdDoInit()
//$$begin Service Controller(1490375209)
// wdContext.nodeZ_Hrfm_Nominee_Ins_Mod_Input().bind(new Z_Hrfm_Nominee_Ins_Mod_Input());
Z_Hrfm_Nominee_Ins_Mod_Input input = new Z_Hrfm_Nominee_Ins_Mod_Input();
input.addNominee(new Zst_Hr_Nominee());
wdContext.nodeZ_Hrfm_Nominee_Ins_Mod_Input().bind(input);
//$$end
//$$begin Service Controller(-932523997)
wdContext.nodeZ_Hrfm_Nominee_Disp_Input().bind(new Z_Hrfm_Nominee_Disp_Input());
//$$end
//$$begin Service Controller(-368783613)
wdContext.nodeBapi_Employee_Getdata_Input().bind(new Bapi_Employee_Getdata_Input());
//$$end
//@@end
//@@begin javadoc:wdDoExit()
/** Hook method called to clean up controller. */
//@@end
public void wdDoExit()
//@@begin wdDoExit()
//@@end
//@@begin javadoc:wdDoPostProcessing()
Hook called to handle data retrieval errors before rendering.
After doModifyView(), the Web Dynpro Framework gets all context data needed
for rendering by validating the contexts (which in turn calls the supply
functions and supplying relation roles). In this hook, the application
should handle the errors which occurred during validation of the contexts.
Using preorder depth-first traversal, this hook is called for all component
controllers starting with the current root component.
Permitted operations:
- Flushing model queue
- Creating messages
- Reading context and model data
Forbidden operations:
- Invalidating model data
- Manipulating the context
- Firing outbound plugs
- Creating components
@param isCurrentRoot true if this is the root of the current request
//@@end
public void wdDoPostProcessing(boolean isCurrentRoot)
//@@begin wdDoPostProcessing()
//@@end
//@@begin javadoc:wdDoBeforeNavigation()
Hook before the navigation phase starts.
This hook allows you to flush the model queue and handle any
errors that occur. Firing outbound plugs is allowed in this hook.
Using preorder depth-first traversal, this hook is called for all component
controllers starting with the current root component.
@param isCurrentRoot true if this is the root of the current request
//@@end
public void wdDoBeforeNavigation(boolean isCurrentRoot)
//@@begin wdDoBeforeNavigation()
//@@end
//@@begin javadoc:wdDoApplicationStateChange()
Hook that informs the application about a state change.
<p>
This hook is called e.g. to tell the application that will be
<ul>
<li>left via a suspend plug and therefore should go into a suspend/sleep
mode with minimal need of resources. errors that occur. Firing
outbound plugs is allowed in this hook.
<li>left due to a timeout and could write it's state to a data base if the
user comes back later on
</ul>
The concrete reason is available via IWDApplicationStateChangeInfo
<p>
<b>Important</b>: This hook is called for the top level component only!
@param stateChangeInfo contains the information about the nature of the state change
@param stateChangeReturn allows the application to ask for a different state change.
The framework is allowed to ignore it considering i.e. the current resources situation.
//@@end
public void wdDoApplicationStateChange(com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeInfo stateChangeInfo, com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeReturn stateChangeReturn)
//@@begin wdDoApplicationStateChange()
//@@end
//@@begin javadoc:executeBapi_Employee_Getdata_Input()
/** Declared method. */
//@@end
public void executeBapi_Employee_Getdata_Input( )
//@@begin executeBapi_Employee_Getdata_Input()
//$$begin Service Controller(1705750894)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
Iterator itrGetData = null;
Bapip0002B out = null;
try
wdContext.currentBapi_Employee_Getdata_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
itrGetData = wdContext.currentOutputElement().modelObject().getPersonal_Data().iterator();
while (itrGetData.hasNext()) {
out = (Bapip0002B) itrGetData.next();
empNo = out.getPerno();
wdContext.currentZ_Hrfm_Nominee_Disp_InputElement().setPernr(empNo);
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().setPernr(empNo);
// manager.reportSuccess(empNo);
//wdThis.executeZ_Hrfm_Nominee_Disp_Input();
catch(WDDynamicRFCExecuteException e)
manager.reportException(e.getMessage(), false);
//$$end
//@@end
//@@begin javadoc:executeZ_Hrfm_Nominee_Disp_Input()
/** Declared method. */
//@@end
public void executeZ_Hrfm_Nominee_Disp_Input( )
//@@begin executeZ_Hrfm_Nominee_Disp_Input()
//$$begin Service Controller(-366407911)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
wdContext.currentZ_Hrfm_Nominee_Disp_InputElement().modelObject().execute();
wdContext.nodeOutput_Nominee().invalidate();
catch(WDDynamicRFCExecuteException e)
manager.reportException(e.getMessage(), false);
//$$end
//@@end
//@@begin javadoc:executeZ_Hrfm_Nominee_Ins_Mod_Input()
/** Declared method. */
//@@end
public void executeZ_Hrfm_Nominee_Ins_Mod_Input( )
//@@begin executeZ_Hrfm_Nominee_Ins_Mod_Input()
//$$begin Service Controller(1524028406)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
wdContext.currentZ_Hrfm_Nominee_Ins_Mod_InputElement().modelObject().execute();
wdContext.nodeOutput_nominee_ins_mod().invalidate();
catch(WDDynamicRFCExecuteException e)
manager.reportException(e.getMessage(), false);
//$$end
//@@end
The following code section can be used for any Java code that is
not to be visible to other controllers/views or that contains constructs
currently not supported directly by Web Dynpro (such as inner classes or
member variables etc.). </p>
Note: The content of this section is in no way managed/controlled
by the Web Dynpro Designtime or the Web Dynpro Runtime.
//@@begin others
String empNo = null;
//@@end
Suman
Edited by: sumankumar kurimilla on Dec 23, 2008 9:26 AMHi,
I have checked from RFC side that is working fine only java app its not working can you tell any thing needs to be changed from my application end.
Please check in Savedata action.
Regards,
Suman
Edited by: sumankumar kurimilla on Dec 23, 2008 11:01 AM -
Error while calling an RFC from R/3 to XI
Hello,
I am calling an RFC to send data from R/3 to XI which uses an RFC destination of TCP/IP type. I am getting the following error:
"call to messaging system failed: com.sap.aii.af.ra.ms.api.DeliveryException".
Kindly provide some inputs.
-kshitija.hi
i think error lies with ur authorization...
check the following thread .....
Re: com.sap.aii.af.ra.ms.api.DeliveryException
hope this helpful... -
Computer name in R3 when call function RFC from CRM to R3
Hi all,
i nead the computer name in R3 when I come to R3 from CRM .
In R3 i call function 'TERMINAL_ID_GET' in R3 but I don't retrieve the computer name.
i tried also to call function 'TERMINAL_ID_GET' in destination 'CRM' but I don't retrieve the computer name.
The code in R3:
CALL FUNCTION 'TERMINAL_ID_GET' DESTINATION 'R3GETCRM'
EXPORTING
username = sy-uname
IMPORTING
terminal = l_terminal_usr41
EXCEPTIONS
multiple_terminal_id = 1
no_terminal_found = 2
OTHERS = 3.
This function works ok when i call her direct from R3 or direct from CRM,
but not give me in R3 the computer name when i came to R3 From CRM.
Thanks for your cooperation.
danythats because 'TERMINAL_ID_GET' is not a RFC (check the attributes tab of the FM from SE37)
if you dont find a RFC to do t his you can wrap this FM with a custom RFC and use it.
if you want all the logged on users info (computer name and other info) then you can use THUSRINFO FM which a RFC
Raja -
Call an RFC from a PC (C++ program)
Hello, I would like to call an RFC Function from a PC program. (The PC program is writen in C++.)
I am experienced in ABAP coding and in SE37, but for PC programming, I would confess to be a "rookie".
I know that I will have to learn a lot, but I do not find a good starting point. So here are my questions:
- What documents should I read?
- What trainings should I attend?
- Which of the SAP-tools should I use (Connector, XI,...)
Thank you for your help.
Martin SchlegelHi Martin,
I am not sure about C++, but you can use SAP java connector JCo in a java progarm to make a RF call. Documentation and examples are available in the internet for the same.
Regards
Anand -
How to call the RFC from XI system
Dear Friends,
My requirement is RFC to RFC scenario i.e SAP to XI to Third party system.
I have the BAPI_EUQI_CREATE rfc, this RFC is available in ECCsystem, that RFC I imported in XI system, so third party system how to call this RFC.
please give me the suggestion it is very helpful.
Regards,
Shalini ShahHi Shalini,
You have create a RFC in the 3rd party system and import that RFC in XI System using 3rd party adapter.Do the necessary mapping and configure the sender RFC Adapter and at receiver side configure 3rd paty Adapter.
The 3rd party adapters must be installed via Deploy Tool or JSPM. But u should have a sda file with the adpater content.
see here for more details on JSPM
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5006901f-925c-2910-5f98-9ae26cc07eca
For more info:
If you still want to do it,
1. Import the RFCs of sender and of receiver.
2. Do the necessary mapping.
3. Configure sender and receiver RFC adapters.
Before that check if you have RFC destination for the RFC adapter. If not You should establish it. To establish an RFC destination for the RFC adapter.
1. Call the transaction Display and Maintain RFC Destinations (SM59).
2. Select an existing RFC destination of type ABAP Connections (for example, ABAP_Old) by double-clicking it.
3. Choose Destination ® Copy and copy the RFC destination using a new name (for example, ABAP_New).
4. Save the new RFC destination (ABAP_New) and delete the old RFC destination (ABAP_Old).
5. Create a new RFC destination (for example, RFC_Adapter) of type T (TCP/IP connection) as the RFC destination for the RFC adapter.
6. Select the registration type Registered Server Program and in the Program ID field enter the corresponding program ID from the configuration of the sender RFC adapter.
7. In the Gateway host and Gateway service fields, enter the gateway host and gateway service from the configuration of the sender RFC adapter.
8. If the sender system is a Unicode system, define the RFC destination as Unicode.
9. Using the name of the old ABAP connection (ABAP_Old), create a new RFC destination of type L (logical destination with reference entry).
10. In the Reference Entry field enter the RFC destination (RFC_Adapter) for the RFC adapter.
For more details take a look at this link. http://help.sap.com/saphelp_nw70/helpdata/en/25/76cd3bae738826e10000000a11402f/content.htm
Dont forget to Reward points if this helps
Regards
Pragathi.
Edited by: Pragathi on May 24, 2008 7:21 AM -
Calling the RFC from other system.
Hi Everybody.
I have two systems.One is ECC and other is SAP R/3.
I have created one RFC in SAP R/3 system and I am calling this
RFC fom ECC system.On click of one button,I have to show some
fields from the RFC onto the screen of WDA .
How can I achieve it ? Is there any code for that or some link
available for that.
Thanks In Advance.hi vaibhav...
using rfc you will be calling a function module in r/3. so it will return some exporting parameters, bind it to the attributes that are created in the context or
create a destination in ecc6 to call the r/3 system .u se service call and mention that destination while creating it.
---regards,
alex b justin -
CALL 2 RFCS FROM ONE SYSTEM...
One of my function module FUNCTION_Y on the system Y is calling a RFC FUNCTION_X to a system X. Once the call is over. it returns to the system Y data needed to generate a program, Function module FUNCTION_Y generates then the program within the one it calls an RFC to the same system X
The problem is that it prompt the user twice for a user and a password. And as between the two calls there is no user dialog. The user does not notice that he is prompt a second time for his user and pass...
If you have any suggestions? How can I may be do so the user is only asked once ? Maybe can I retain User and password and then call a function module to create the connection ?
Thank youHi Stephen,
I assumed you know that you can control in SM59 the login id and password of you RFC destination system. Your requirement is to prompt user login for the first RFC call but not the second.
If this is the case, you might want to create another RFC destination for the same system you are having. In the second RFC destination, populate the user id and password. Then in your program, the first RFC call, you use the first RFC destination which prompted you for id and password. For the second RFC call, use the second RFC destination.
Maybe you are looking for
-
AppleScript to make All-Day Events?
I'm new at this, so forgive the question if it's obvious. I routinely import a calendar using Outlook2Cal from a Windows machine to iCal 2.0.3 on my PowerBook. It works fine, but All-Day events in Outlook show up in iCal as starting at 12:00 AM the f
-
Connect using OS authentication in SQL Developer
Hi, We are using OS authentication to connect on Oracle, if I use SQL*PLUS I use only sqlplus /@instance but someone knows how can I connect on Oracle using OS authentication ? I tried to use / or blank username in SQL Developer and it requests an us
-
Is there a way to wildcard the people search in the search center? Most of the time the people picker suggestion drop down doesn't load quick enough for our users so they type half of someone's name and hit enter which then produces an error about n
-
Database Migration Verifier execution error
Hi, We have just completed a migration from Sybase Adaptive Server 12 to Oracle9i and wish to use the DMV tool to perform a check on the result. The DMV tool is installed on an IBM z-linux server. The following command is used to run the tool: %>java
-
Unknown error occured (-15000) when trying to connect to AppleTV.
Hi all I used Apple TV 2 to Airplay music files into a hifi system from iTunes (WIndows 7 through a wifi connection). After AppleTV did a software upgrade couple of months ago Airplay stopped working and I get "an uknown error occured (-15000)" after