FM to call RFC dynamically
Experts,
I have a set of RFC's which has to be called dynamically. All RFCs have different set of input parameters. Is there any standard FM with which i can call RFCs with variant? similar to what we do for report using submit <progname> with selection-set <Variant>.
Hi
There is way
One Question
does the Input Parameters differ in the FM...
Please do one thing you can cal lthe RFC Dynamically using the Tables Parameters..
Using the tables parameters , pass this using Dynamic internal table..
Inside the FM read this..
do not use the Importing Parameters here
Similar Messages
-
Hi,
I require calling 2 different RFC in the same receiver dynamically based on one of the content in my Message. How can I do this.
Basically, assume i have a message with Create='Y', need to call a one RFC and if Create='N', need to call another RFC.
This is just an example not the actual scenario.
Regards
UnniHey,
we can have two solution for this.
Solution 1:
Use a BPM . in that use a switch case.
based on your condition provided in the switch case(for eg create=y or create=N) choose the interface mapping(using transformation step of BPM). two different RFC's will be having two different interface mappings.
Solution 2:
In your configuration you need to create two different services for the same R3. and have two diffent communication channels.
In your reciever determination give your condition(eg create = y or create=N). Give both the services in the service field.
Now give the interface mappings(different for the two RFCs) in the interface determination for each reciever.
I would suggest you to go with solution 1.
Reward points if helpful. -
Help for Calling RFC in B2C application.
hi,
We had written one RFC and all java classes related to that.
we are able to call RFC in b2c application.we are calling RFC on loading of JSP.
now my requirement is to call same RFC in other JSP but muliple times(in a for loop).But how can i do that?
one thing is sure we cannot calll this RFC on loading of new jsp page.we have to call inside jsp page(in a loop).
there is any way?
please help me out.
thanks in advance.
jayesh talrejaTwo things I would like to say here:
1) Calling RFCs directly from JSP is not supported so we need to use interfaces and backend classes.
2) Calling an rfc is java code and in jsp we write java code along with html to make it dynamic...so dynamic
call is also possible.
ie. suppose we want to call our rfc for fetching some data from the backend based on the data entered at item level once the user clicks on update button on order creation page.So we can write the code like below
<%-- messages --%>
<%@ include file="/b2b/itemErrMsg.inc.jsp"%>
<% } %>
<%-- ui.showItemDetailButton() --%>
<% } %>
<%-- ui.isBOMSubItemToBeSuppressed() --%>
<%--Start of addition by Arshid --%>
<!-- From here our custom rfc call is starting-->
<%
String arg1[]= {"crm~isa~isacore~resources_en"};
if((JspUtil.removeNull(item.getProduct()).length()) !=0 && !(JspUtil.removeNull(item.getNetValue()).equals(WebUtil.translate(pageContext,"yourcompany.order.minimumValue",arg1))) )
String baseUOM = "";
int enteredQuan= 0;
double minOrderQuan = 0.00;
double roundingValue = 0.00;
BusinessObjectManager isaBOM = (BusinessObjectManager)userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);
User user = (User)isaBOM.getUser();
Shop shop = (Shop)isaBOM.getShop();
String distrChannel = shop.getDistributionChannel();
String sod = shop.getSalesOrganisation();
Z_CustomBusinessObjectManager customBOM = (Z_CustomBusinessObjectManager)userSessionData.getBOM(Z_CustomBusinessObjectManager.CUSTOM_BOM);
//Z_prodInfoValue is a bo that will hold the data returned from rfc call
Z_prodInfoValue z_prodinfo = customBOM.getZ_prodInfobo().getProdInfo(Zeropadding.productInfoNoPadding(item.getProduct()), sod, distrChannel);
<!-- Call ends here and this piece of code is called for every item on clicking on update buton -->
Although this is not a good code design as instead of making multiple calls to the backend we can get the above thing done in a single call also.I wrote this code just to give an example .
This clearky proves we can have dynamic calls to the backend through jsps also.
But Jayesh, your question is not very clear to me.
If its about for loop, where you want to call the backend for multiple times with different set of values than i would rather suggest you to create lists of these different datasets and send these in a single call to the backend and fetch the data similarily in tables in a single call.
Regards,
Arshi -
New JAAS Logon Module that calls RFC
I want to build a new logon module that extends AbstractLoginModule.
I want to call an RFC in ECC using JCA in this logon module. The purpose of this RFC call is to read the users roles in the backend, if they have a certain role I will dynamically assign them a portal group using the UME API.
which method in the Logon Module (AbstractLoginModule) should I make the call to the RFC? (initialize(), login(), commit(), etc.)
Does anybody have any examples of how to make the RFC call from a custom logon module using JCA?Hi K,
I tend to put the bulk of the logic for my login modules in the login() method - although usually this is for checking authentication rather than assigning roles/groups.
Have you thought about using UME type ABAP to map ECC roles to Portal Groups? If you then need to write a login module to handle, say, LDAP authentication, then at least it is doing what it should be - i.e. authentication, and the heavy-lifting to do with JCA, roles, etc is handled by SAP-standard code.
For sample JCA code, there is some in the [Universal Worklist Wiki|https://wiki.sdn.sap.com/wiki/display/BPX/DeveloperStudioProject+Files] - just download and extract the Devlopment Component there (don't forget to remove the .gif extension - a hack I used to get a Zip file into the Wiki). The file SapRfc.java gives you a user-friendly way of calling RFCs using JCA. To see it in use, see AbsenceApproval.java - the method getWorkitemDescription() is a good example to look at.
The only downside of the SapRfc.java library is that the constructor takes a IPortalComponentRequest object as an argument (allowing you to use a Portal System Alias), and you don't really have access to one of those in a JAAS module. You will have to modify this code to take a set of ConnectionProperties instead (see the documentation [Using the SAP System Connector|http://help.sap.com/saphelp_nw04/helpdata/en/89/8a185c148e4f6582560a8d809210b4/frameset.htm]).
Really, the component you want to develop might be better deployed as a Portal component. Your users would access this component first of all, and when it completes it would forward them on to the Portal proper.
Hope this helps,
Darren -
Hello Experts,
I have a requirement where in i need to call RFC(Which is created in R/3 system) In ABAP XSLT Mapping(defined iN xi system).
Can some one help me to achieve this??
**ITS URgent****
Thanks and Regards,
Prakash Babu.Hi James,
Check here............
/message/5182263#5182263 [original link is broken]
RFC connections
/message/5102602#5102602 [original link is broken]
Regards,
Vijay. -
Error when call RFC Function module in R/3
Dear All,
We are trying to call RFC function module CBIF_GLM1_PROCESS_ORDER_READ (This is not a BAPI and also not released ) in R/3 from XI system.
we are facing the error "Error while lookup Exception during processing the payload. Error when calling an adapter by using the communication channel CC_PPPI_MES_RFC_Rcvr (Party: , Service: WCD_320, Object ID: 16563889b449328eac76caa6a3bc592e) XI AF API call failed. Module exception: 'error while processing the request to rfc-client: com.sap.aii.adapter.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.adapter.rfc.core.client.RfcClientException: failed to parse BAPI response due to: com.sap.aii.adapter.rfc.util.bapi.BapiException: Parameter with name RETURN not found.'. Cause Exception: 'com.sap.aii.adapter.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.adapter.rfc.core.client.RfcClientException: failed to parse BAPI response due to: com.sap.aii.adapter.rfc.util.bapi.BapiException: Parameter with name RETURN not found.'."
This is the first time we are doing this configuration.
Could you please let me know what woulbe the reason.read the original message
We are trying to call RFC function module CBIF_GLM1_PROCESS_ORDER_READ (This is not a BAPI and also not released ) in R/3 from XI system.
I am talking about the above Receiver RFC channel which you guys are using to call R/3 from XI. That where you need to change the commit parameter -
Error while calling RFC when using BSP Web Interface
Hi,
we have a problem with the Authorization when we use an Web Interface for BSP. We have assigned all roles to the user which were mentioned in the SAP standard documentation:
R_AREA
R_METHOD
R_PACKAGE
R_PARAM
R_PLEVEL
R_PM_NAME
R_PROFILE
R_STS_PT
R_STS_SUP
R_WEBITF
S_RS_ADMWB
S_RS_AUTH
S_RS_COMP
S_RS_COMP1
S_RS_DAS
S_RS_ICUBE
but we still get the error message: "Error while calling RFC".
When using a user with SAP_ALL, it works.
What can we do?
Thx for your time.
JoergActually that's surprising - because BSP (Business Server Pages) and RFC (Remote Function Call) are not related; they use totally different transport protocols (http vs. RFC). Even if an BSP application is calling a function module remotely (acting as RFC client) no authorizations for S_RFC are required - in the calling system (but in the called system, i.e. the RFC server).
Since assigning SAP_ALL seems to "cure" the problem, it seems to be an authorization issue, indeed. In that case it makes sense to use the authorization trace (ST01 - notice: that's specific to one single ABAP application server; you might have to activate the trace on multiple instances) to find out which authorizations are checked / demanded. -
Java call rfc check in original:error while checking in and storing.
hi,experts.
java call rfc check in original:error while checking in and storing. BAPI in the RFC is "BAPI_DOCUMENT_CJANGE2",
the RFC was fine in SE37 and calling by Visual Basic. and in java,when mConnection.setAbapDebug(true), and runing by step and step, was fine too.
if mConnection.setAbapDebug(false) in JAVA, up error in title was displayed.
what cause this error?
Best Regards.Hi Priya
Please use Su53 after getting the error and find any authorization is missing for the user..
S_GUI Full Authorization is required..
Since by giving BASIS Authorization its rectificed, then it shud be mostly due to Auth issues only
Regards
Aby -
Hi all WebDynpro Gurus
I am using EP7.
I am developing an WD application for KM functionality in which I need to call RFC from backend. I followed the "<b>Creating WD application accessing ABAP function</b>" example.
But when I executed the application I got following exception.
<i><b>Root Cause</b>
The initial exception that caused the request to fail, was:
com.sap.lcr.api.cimclient.CIMClientException: java.net.MalformedURLException: URL must have a host part
<b>Correction Hints</b>
Accessing the System Landsape Directory (SLD) failed. Depending on the concrete reason (see root cause) check the following:
is the SLD Supplier in the J2EE engine configured correctly? See the SLD documentation for more details about the SLD and about how to configure it.
are all JCO destinations maintained correctly? Use the preinstalled Web Dynpro Content Admin application to check/edit the destination. Use the Ping and Test functions of the Content Admin to verify that each destination is properly configured.</i>
I checked JcO connections in the webdynpro content admin. There the status is unknown and create tabs are disabled.
I checked the SLD connections in content admin , the entries are as below:
<b>Host name : blank
Port: -1
User: blank
Url: http://.-1/sld</b>
Where could i configure these SLD settings and what should be the new entries ?
I dont have permission to view WebDynpro console.
Please help me out.Vinod,
Claim: "Hello, World" application with WD and RFC is the "Hello, World" application with most complex configuration.
Prove:
1. You need to run http://host:port/sld and import CIM context
2. You need to add technical WebAS ABAP systems to SLD (same URL)
3. You need to run Visual Administrator and setup SLD connection parameters (host, port, user, password)
4. You need to (re)deploy your WD application
5. You need to run web-based WebDynpro Content Administrator and configure JCO connections.
Fortunately, [1]-[4] is necessary only ones per server, [5] is necessary per every application.
Valery Silaev
SaM Solutions
http://www.sam-solutions.net
P.S. After I'd started working with XI I understood that procedure described above is not complex at all -
Standard Component in CRM that will call RFC Function Module
HI all,
Is there any Standard Component in CRM that will call RFC Function Module from ECC and that called RFC FM should Fetch the data from ECC.You can call RFC from different places, like programs, function modules, web dynpros, classes...
So you just have to have appropriate RFC on ERP side and call it from CRM side. To call it you use the following statement...
CALL FUNCTION 'YOUR RFC FUNCTION'
DESTINATION i_dest "name of server
EXPORTING
your export parameters
IMPORTING
your import parameters
Regards. -
Hi experts,
we try to integrate a machine into SAP.
Therefore we want to use RFC-Communication.
This means, the machine will call RFC-FMs on SAP.
I know that this works and I only need to create a "normal" RFC-FM.
But how can I call a RFC-FM on the machine out of SAP?
Do I need to make a an RFC-FM like in ABAP but the destination is the machine (which is defined in SM59)?
Kind regardsHi ,
Please learn this link Connections to Non-SAP Systems (SAP Library - ALE Programming Guide)
http://help.sap.com/saphelp_nw04/helpdata/en/52/16aafa543311d1891c0000e8322f96/content.htm
You can take a look into idocs. For idocs processing you require RFC Library of the RFC Software Development Kit (RFC-SDK) on the non sap system side for processing RFC's.
Regards,
Sivaganesh -
Can we call RFC in any other way except using adaptive
Hi,
I want to know if there is any possible way to call RFC other than using the adaptive model.
Answers will rewarded.
RegardsHi,
you can use JCO or Enterprise Connector to connect with R/3.
JCO-->http://www.sapdevelopment.co.uk/java/jco/jcohome.htm
EC-->http://help.sap.com/saphelp_webas630/helpdata/en/79/c6213e225f9a0be10000000a114084/content.htm
Regards,
Naga -
Hi,all
I am a SAP newbie .I have a strange question. My Delphi Development Environment is Delphi 7. SAP ECC 6 , Delphi Call RFC through COM.
procedure TFrm_SAP.Button3Click(Sender: TObject);
var
myIFunction:IFunction;
myIStructure_EDRAT:IStructure;
myIStructure_ORDER:IStructure;
myIParam_AUFNR :IParameter;
myIParam_AUTYP10:IParameter;
myIParam_WERKS :IParameter;
begin
if not Logon_bool then
begin
Showmessage('Logon SAP/R3 Failure');
Exit;
end;
SAPFunctions1.Connection:=Connection;
myIFunction:=SAPFunctions1.Add('Z_XX_GET_PRODORDER_HEADER') AS IFunction;
myIParam_AUFNR:=myIFunction.Exports_['I_AUFNR'] AS IParameter;
myIParam_AUFNR.value:='000001002864';
myIParam_AUTYP10:=myIFunction.Exports_['I_AUTYP10'] AS IParameter;
myIParam_AUTYP10.Value:='X';
myIParam_WERKS:=myIFunction.Exports_['I_WERKS'] AS IParameter;
myIParam_WERKS.Value:='2010';
myIStructure_EDRAT:=myIFunction.Exports_['IT_ERDAT'] AS IStructure;
myIStructure_EDRAT.Value['SIGN'] :='I';
myIStructure_EDRAT.Value['OPTION']:='BT';
myIStructure_EDRAT.Value['LOW'] :='20090101';
myIStructure_EDRAT.Value['HIGH'] :='20090330';
if not myIFunction.Call then
begin
ShowMessage(myIFunction.Exception);
end
else
begin
myIStructure_ORDER:=myIFunction.Imports['ET_ORDER'] AS IStructure;
end;
end;
after execute myIFunction.Call method ,Show
I trace Log file , as following Show
T:764 Error in program '': ======> Data error (invalid data type 17) in a Remote Function Call
T:764 Error in program '': <* RfcReceive [1] : returns 3:RFC_SYS_EXCEPTION
T:764 Error in program '': <* RfcCallReceive [1] : returns 3:RFC_SYS_EXCEPTION
Could anybody have helped me to resolve this problem?Hi
Check RFC Import Parameters Data Type and Data Sent from your Delphi System is not matching , Some data type mismatch is going on.
Check Data Type of when Sent from Delphi == Import (Request) of RFC is equal
rgds
srini -
HR_INFOTYPE_OPERATION not working when called from Dynamic action
Hi ,
Senario : I would like to execute a form from dynamic action which
creates a record in 0015 (Additional payment IT) .
I have writen the code as shown below am using FM HR_INFOTYPE_OPERATION
. When i execute the program from se38 it is creating a record, however it is
not created when it is called from dynamic action..when i debugged the code in
inside the FM HR_INFOTYPE_OPERATION there is a FM HR_MAINTAIN_MASTERDATA where
they are using call dialog (statement) and
sy-oncom = 'N' when called from Dynamic action and
sy-oncom = 'S' when called executed directly.
I tried to change the sy-oncom to S while run from Dynamic action it created
the record.
So Can anyone explain me abt sy-oncom and how can i resolve the issue..
code..
REPORT ZHRPYENH01 .
perFORM TERMIATION_9000.
INCLUDE DBPNPMAC.
FORM Termiation_9000 *
FORM TERMIATION_9000.
INFOTYPES : 0015.
*data : i .
*i ='c'.
*break-point.
*message i000(000) with i.
TABLES : PRELP.
DATA : P9000 TYPE PA9000." with header line.
DATA : P0000 TYPE STANDARD TABLE OF P0000 WITH HEADER LINE.
DATA : P0015 TYPE STANDARD TABLE OF P0015 WITH HEADER LINE.
DATA : HIRE_DATE LIKE SY-DATUM,
TERM_DATE LIKE SY-DATUM.
DATA : MOLGA LIKE T500L-MOLGA VALUE '25',
SEQNR LIKE PC261-SEQNR.
DATA : RGDIR TYPE STANDARD TABLE OF PC261 WITH HEADER LINE.
DATA : ACTUAL_PERIOD LIKE PA9000-RETENTION.
DATA : PNP-SW-FOUND TYPE SY-SUBRC ,
PNP-SY-TABIX TYPE SY-TABIX.
DATA : TER_PERNR LIKE PA0001-PERNR.
DATA : REF_PERNR LIKE PA0001-PERNR.
data : key type BAPIPAKEY.
data : payed_amount type p0015-BETRG.
data : future_payment_amount type p0015-BETRG.
data : p0002 like pa0002.
types : begin of t_deduction ,
deducation_date like p0015-begda,
future_payment_amount type p0015-BETRG.
types : end of t_deduction.
data : future_deduction type standard table of t_deduction with
*header line.
data : future_deduction type t_deduction .
data : RETURN type BAPIRETURN1.
*data : deduction_p0015 like standard table of p0015 with header line.
data : deduction_p0015 like p0015 .
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
****Prepare 0015 data for deduction
*deduction for payed amount
clear deduction_p0015.
*refresh deduction_p0015.
deduction_p0015-pernr = REF_PERNR.
*deduction_p0015-pernr = TER_PERNR.
deduction_p0015-lgart = 'M120'.
deduction_p0015-begda = sy-datum + 1 .
deduction_p0015-endda = sy-datum + 1 .
deduction_p0015-BETRG = payed_amount.
deduction_p0015-WAERS = 'SGD'.
deduction_p0015-ZUORD = TER_PERNR.
*append deduction_p0015.
**deduction for future payment amount
*loop at future_deduction.
*clear deduction_p0015.
*deduction_p0015-pernr = REF_PERNR.
**deduction_p0015-pernr = TER_PERNR.
*deduction_p0015-lgart = 'M120'.
*deduction_p0015-begda = FUTURE_DEDUCTION-DEDUCATION_DATE.
*deduction_p0015-endda = FUTURE_DEDUCTION-DEDUCATION_DATE.
*deduction_p0015-BETRG = future_deduction-future_payment_amount.
*deduction_p0015-WAERS = 'SGD'.
*deduction_p0015-ZUORD = TER_PERNR.
*append deduction_p0015.
*endloop.
Create a deduction wage type in 0015 for the employee
break-point.
CLEAR RETURN.
CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'
EXPORTING
NUMBER = REF_PERNR
VALIDITYBEGIN = '18000101'
IMPORTING
RETURN = return
if not return is initial.
message E000(000) with
'Referred Employee could not be locked for referal payment deducation,
please try after some time'.
endif.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0015'
NUMBER = REF_PERNR
SUBTYPE = 'M120'
OBJECTID =
LOCKINDICATOR =
VALIDITYEND = SY-DATUM
VALIDITYBEGIN = SY-DATUM
RECORDNUMBER =
RECORD = deduction_p0015
OPERATION = 'COPY'
TCLAS = 'A'
DIALOG_MODE = '2'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
RETURN = return
KEY = key
break-point.
COMMIT WORK.
if not return is initial.
*return-TYPE
*ID
*NUMBER
*MESSAGE
message I000(000) with return-MESSAGE.
endif.
CALL FUNCTION 'BAPI_EMPLOYEET_DEQUEUE'
EXPORTING
NUMBER = REF_PERNR
VALIDITYBEGIN = '18000101'
IMPORTING
RETURN = return
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
Thanks and regards
-Senthil Bala
Message was edited by: senthil balaHi Senthil
Why at all U want a subroutine to create a record in IT0015 through Dynamic action.There are some standard codes available to update infotypes.
Let me give U an example
14 9CON BETRG 4 2 I INS,0015 This will create a record in IT0015 when IT0014 is updated with Wagetype 9CON
14 9CON BETRG 4 3 W P0015-LGART='5400' Set wagetype for IT0015(Here U can use a subroutine call to set the wagetype)
14 9CON BETRG 4 4 W P0015-BETRG=P0014-BETRG set amount for IT0015(Here U can use a subroutine call to get the amount)
14 9CON BETRG 4 5 W P0015-BEGDA=P0014-ENDDA set the dates(Here U can use a subroutine call to set the dates)
Hope this will help U.
Please award points if helpful -
Calling RFC from Adobe Interactive Form
Hello,
After creating and calling Adobe Interactive form from ABAP web dynpro, within the form designer is it possible to call RFC or Business Object method from the form script to get the data back from SAP for specific Click events?Yes,
this is possible, but not through pure RFC, but using webservices and webservice enabled function modules within SAP.
Technically it is quite simple. Create a functionmodule, and create a webserve from that (all SE37 or SE80 but from WAS 6.40). Generate a WSDL (with the Java tool) and import that into the form that you are designing. From there you can bind the data from the dataset (as defined in the WSDL) to screenfields or treat the data any other way Javascript can.
BTW. I only managed this so far by using anonymous logins, so with a password and username bound to the webservice (in SICF).
Hope this helps, regards, Hans Gmelig Meyling
Maybe you are looking for
-
I get double the amount of gmail notifications on my iPhone 4 or iPad 2 using iOS 5. Any ideas how to fix?
-
After upgrade to Photoshop CC 2014 Adobe Bride does not open anymore
(File - search in Adobe Bridge) but the Adobe Creative Cloud opens and wants to intall the prior Bridge version. Mini Bridge doesn't work either. From LR - PS doesn't open either (right click in LR and open in PS only open PS but not the photo itsel
-
Hi We are sending information using web service we generate data in XML. Many time we received information contains "&" value. Due to which XML fails to parse. Can anyone suggest me how to deal with this issue. Thanks and regards, RSD
-
Hp t510 right alt key mapping not working with ctrl + s
Using the HP t510 to launch a xendesktop session via storefront. We have a mission critical application that uses the ctrl + alt + s hotkey to secure itself. The left alt key with ctrl + s is working as it should but the right alt key does not. When
-
Hi, How do you phase out a material, then Phase IN another material? The scenario is, i need to Phase out Material A on 12/31/2008 then replace the it with Material B on 01/01/2009 so that, the FG will use this Material B in its BOM on that date. T