Calling r/3 function module from crm using rfc
Dear SDN Members,
I'm given a task to write a method on CRM side which sets the equipment status to "lost" in ABAON transaction on R/3 side. There is a function module on r/3 side which is RFC enabled and it will set the stuatus to LOST when we call that from CRM. This RFC fm is not available on CRM side, so I cannot used Pattern. I'm very new to abap and when i've gone through abap help I got the syntax which i've write with destination parameter. But I'm really not understanding how to pass Lost status to that fm.
Here-with I put the coding so far i've done on crm side and also the rfc fm coding aswell on r/3 side.
Should any one need for more info please do let me know to my yahoo ID:
[email protected]. I would be pleased to provide you the same.
The coding on crm side to call the r/3 fm through rfc follows here..
method IF_EX_EXEC_METHODCALL_PPF~EXECUTE.
21st November 2006
Created by Venkata Sunder
Method for
Loss Disposal - ERP Equipment Status Update
Damage Notifications
Called by actions
DATA: lv_guid_ref TYPE crmt_object_guid,
lv_kind_ref TYPE crmt_object_kind. "#EC NEEDED
DATA: lv_preview TYPE char1. "#EC NEEDED
DATA:
lt_header_guid TYPE crmt_object_guid_tab,
lt_orderadm_i_buffer TYPE crmt_orderadm_i_wrkt,
gs_orderadm_i_buffer TYPE crmt_orderadm_i_wrk,
lt_orderadm_i_db TYPE crmt_orderadm_i_wrkt,
gs_orderadm_i_db TYPE crmt_orderadm_i_wrk,
lt_customer_i_buffer TYPE crmt_customer_i_wrkt,
gs_customer_i_buffer TYPE crmt_customer_i_wrk,
lt_log_handle TYPE balloghndl,
return TYPE bapiret2_t,
gs_return TYPE bapiret2,
ev_rfcdest TYPE rfcdest.
get guid for referenced object
CALL METHOD cl_hf_helper=>action_helper->get_ref_object
EXPORTING
io_appl_object = io_appl_object
ip_action = ip_action
ii_container = ii_container
IMPORTING
ev_guid_ref = lv_guid_ref
ev_kind_ref = lv_kind_ref
ev_preview = lv_preview.
current crm transaction is identified
IF lv_guid_ref IS INITIAL.
RAISE EXCEPTION TYPE cx_socm_condition_violated.
ENDIF.
Header GUID
APPEND lv_guid_ref TO lt_header_guid.
Read order details from buffer
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = lt_header_guid
IMPORTING
et_orderadm_i = lt_orderadm_i_buffer
et_customer_i = lt_customer_i_buffer
CHANGING
cv_log_handle = lt_log_handle
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.
IF sy-subrc <> 0.
ENDIF.
call function destination 'DERCLNT200'.
(I'm not understanding how and wt to pass to this fm.)
The fm 'Z_SET_EQUIPMENT_STATUS_RFC' on r/3 side has the following coding..
DATA:
lv_objnr LIKE equi-objnr,
lv_estat LIKE tj30-estat,
wa_return LIKE bapiret2.
LOOP AT equipment_status.
SELECT SINGLE objnr
FROM equi
INTO lv_objnr
WHERE equnr EQ equipment_status-equnr.
SELECT estat
FROM tj30t
INTO lv_estat
WHERE stsma = equipment_status-stat_profile
AND txt04 = equipment_status-status
AND spras = sy-langu.
ENDSELECT.
CALL FUNCTION 'STATUS_CHANGE_EXTERN'
EXPORTING
CHECK_ONLY = ' '
client = sy-mandt
objnr = lv_objnr
user_status = lv_estat
SET_INACT = ' '
SET_CHGKZ =
NO_CHECK = ' '
IMPORTING
STONR =
EXCEPTIONS
object_not_found = 1
status_inconsistent = 2
status_not_allowed = 3
OTHERS = 4.
IF sy-subrc NE 0.
MOVE:
equipment_status-equnr TO wa_return-message_v1,
'E' TO wa_return-type,
' Equipment Update failed' TO wa_return-message.
APPEND wa_return TO return.
ELSE.
COMMIT WORK.
ENDIF.
CLEAR wa_return.
ENDLOOP.
ENDFUNCTION.
Thanks in advance.
Best Regards!
Sam.
Hi,
You can write similar to the below.
CALL FUNCTION 'CRM_ORDER_READ'
<b>DESTINATION 'DERCLNT200'</b>
EXPORTING
it_header_guid = lt_header_guid
IMPORTING
et_orderadm_i = lt_orderadm_i_buffer
et_customer_i = lt_customer_i_buffer
CHANGING
cv_log_handle = lt_log_handle
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.
Thanks
Ramakrishna
Similar Messages
-
Calling Remote enabled Function module in java using RFC Destination
Hi
We are on Portal 7.3 ehp1 sp9.
Steps followed are :
RFC Destination called “SAP_RFC” has been created as below :
Configuration -> Destinations -> RFC Destinations
Connection and Transport:
Load balancing :Yes
Provided : SystemID / MS Server / MS Server Service / Logon Group / Gateway Host / Gateway Service
SNC : Inactive
Logon Data:
Authentication : Current User (Assertion Ticket)
Language : EN
Client : XXX
Repository Connection:
Destination Name : This Destination
Specific Data:
pooled Connection Mode : Yes
Max : 5
Size : 10
Max. wait time : 10,000
Ping Destination results : Successfully connected to System XXX as per user XXXXXXX.
JAVA Code as Follows:
JCoDestination destination = JCoDestinationManager.getDestination("SAP_RFC");
//destination.ping();
JCoRepository repository = destination.getRepository();
JCoFunction function = repository.getFunction("FM_NAME");
function.execute(destination);
Lines highlighted in RED color throwing an error as below :
{"ERROR":"Initialization of destination JCO_RFC failed: Incomplete logon data. on <SID> mshost <MS_HOST>/ com.sap.conn.jco.JCoException: (103) JCO_ERROR_LOGON_FAILURE: Incomplete logon data. on SID mshost MS_HOST"}
And found that no COOKIE with the name “SAP_SESSIONID_<system>_<client>” was not found, I am afraid that “Assertion Ticket” was not created in above scenario.
To confirm SSO configuration working, i have followed below steps:
1) Created System Object pointing to R/3 and tests were successful for authentication type "SSOLOGONTICKET / ASSERTIONTICKET"
It's J2EE application, no references or any other additional configuration been made part from above.
Any help ?
ThanksHere is log ..Assertion ticket could not be retrieved. Error was null
Log Record Details
Message:
Assertion ticket could not be retrieved. Error was null
Severity:
Error
Date:
2014-04-23
Time:
20:28:26:056
Category:
/System/Security/destinations
Location:
com.sap.security.core.server.destinations.service.AssertionTicketRetriever
Application:
Thread:
System [2]
Data Source:
j2ee/cluster/server0/log/system/security_00.log
Arguments:
Passport User Activity ID:
3a7af5ddca8b11e384bd8adb6f484d33
Message ID:
Session:
Transaction:
User:
Time Zone:
+0800
Customer Message Component:
BC-JAS-SEC
Runtime Component:
tc~sec~destinations~service
Correlation ID:
3643650000002747
Passport Session:
3A7AF5DDCA8B11E384BD8ADB6F484D33
Passport Connection:
3a7af5ddca8b11e384bd8adb6f484d33
Passport Connection Counter:
0
Log ID:
C0000AD01D7B002200000EA5009800B2
Host:
host
System:
XXX
Instance:
J00
Node:
server0 -
Is it possible to call Normal function Module from WD4A , Not RFCs
Is it possible to call Normal function Module(FM) from WebDynPro for ABAP , Not RFCs
There is no difference, unless you are specifically calling the RFC to connect to another system. If so, then you need to add the DESTINATION keyword to the function call and specify the destination name. This name must be defined in SM59. But, if you are not going to another system, you can call the RFC the same way you call the regular function module.
REgards,
Rich Heilman -
Call a function module from CRM 5.0 via ITS to FICA
Hi
I want to call a function module in FICA (FICA is using sapgui) from CRM (IC-web) via ITS (Not integrated in FICA)
Is it possible and how should this be done???
If someone know how, please help
BR//JLgenerally RFCs should not have user dialogs.
any how to handle your case, you need ITS and since FICA is a WAS 6.20 system, you need to have a ITS installed for FICA system, without which you cannot do that.
alternatively you can mimic the functionality of the RFC by programming the same in a BSP and call this from CRM system
Regards
Raja -
Call of a function module from a method / catch of exceptions
Hello,
how do you catch the error of a function module that is called within the start routine of a data transfer process? The process terminates in case of an exceptions
E.G.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
client = sy-mandt
date = SOURCE_FIELDS-xxx
foreign_amount = SOURCE_FIELDS-xxx
foreign_currency = SOURCE_FIELDS-xxx
local_currency = SOURCE_FIELDS-xxx
IMPORTING
local_amount = RESULT
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6.uncomment the exceptions section of your call. ie
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6.
Afterwards check sy-subrc value to see if exception has occured. If it is zero, call was successful otherwise it will have a value corresponding to the exception occured (as specified in the code above) -
Call ABAP function module from script?
Hi,
I have an ABAP function module, which works fine when I call it in a transformation.
Since I don't need to execute this function for each record but rather for each file I process, I would like to move the call from the DataFlow to a script in the WorkFlow. When I click on the 'functions' button the ABAP FM is available in my SAP Datastore, so I drag and drop it into my script. I also make sure to populate all required variables.
There are no error messages or warning when I check my job definition.
When I execute it, I get the following RFC error:
Function call <xxx ( abcd ) > failed, due to error <150413>: <RFC CallReceive exception <FUNCTION_NOT_FOUND>.>.
Is it just not possible to call an RFC enabled function module in SAP from a script or am I doing something wrong here?
Thanks,
Jan.Could you please let me know how I can call an abap function module from a transformation? (from abap xslt program). I know how we can call methods of a class from the transformations, but no idea how we can call function modules. Any suggestions or a sample code snippet towards this will be very useful for me.
Thanks,
Shashi. -
How to call a function module from a transformation
Hi,
Could somebody please let me know how I can call an abap function module from a transformation (abap xslt program). I know how to call the class methods from transformation, but how do i call a function module..?
Thanks,
Shashi.
Edited by: Shashi Kanth Kasam on Apr 8, 2010 12:45 PMYa. I can do that. But I don't want to use a class and a method to call that function module. Want to directly call function module from transformation. Is that possible..?
Thanks,
Shashi -
Call an Function Module from BSP page to import an CSV file to internal tab
Hi Experts,
I am working on creating a web application in BSP which will call the function module ALSM_EXCEL_TO_INTERNAL_TABLE.
This function module imports an excel file into an internal table.
Since this is the first time I am working on BSP I am not sure how to call this FM from event handler tab in BSP page.
What I could gather from previous posts is that we need to create an attribute which should take the value of the export parameter of the function module.But I am kind of messed up on this.
Could u guys please help ,I would be extremely grateful.Points will be assigned for sure
Thanking in anticipation
AnkitCould you please let me know how I can call an abap function module from a transformation? (from abap xslt program). I know how we can call methods of a class from the transformations, but no idea how we can call function modules. Any suggestions or a sample code snippet towards this will be very useful for me.
Thanks,
Shashi. -
Calling Z function module from BSP page
hi,
i am calling a z function module from BSP application ROS_SELF_REG ,The z function module is inside a z function group,It does not give any sytnax error..but while running BSP application ,it is going into dump saying that Z function module is not found..Any idea why this is happening???Hi,
Check whether the Z function module is spelled correctly. Also try activating the whole function group and function module in se80 transaction.
Check whether the BSP application is calling the Z FM from the correct server/client where it is available.
Regards,
Harish -
Debugging RFC function module from ECC to CRM
Hi All,
My requirement is to debug an RFC function module present in CRM(7.0) system from ECC(6.0) system. A report program in ECC will call CRM custom FM. I found many posts in SDN with the same issue and tried to implement suggestions provided there. But I couldn't succeed. The approach I followed is:
I logged in to ECC report program and kept an external breakpoint just before the function module call.
I logged in to CRM system, opened the function module and kept an external breakpoint there.
In both the systems I provided the dialogue userid( id through which I log in to SAPGUI) in the system->settings->debugging option.
In CRM I activated the external break point in transaction SRDEBUG.
Now when I execute the report program in ECC, control stops at the breakpoint. If I press F5 at the function call, control is not going to the external break point set in the CRM FM. I am getting output of FM directly.
I tried with different settings like turning on the check box for IP matching and session breakpoint active immediate, switching to classic debugger etc. I also tried to provide the RFC user id instead of dialogue user but system throws exception saying only dialogue userids are allowed. I found that by inserting an infinite loop statement, control goes inside the RFC CRM FM but I prefer not to change the code.
Please let me know if I missed anything.
Thanks and Regards,
NarenHi,
Debug RFC calls
When an RFC function module is called it is usually not possible to debug the call, using the below techniques we can achieve the same. For this example we are calling an RFC enabled FM in ECC system from CRM system.
Scenario 1: Calling a custom RFC FM
STEP 1: Add an infinite loop in the remote custom Function Module (adding a u201CDO. ENDDO.u201D statement at the start of the FM would be enough).
STEP 2: Execute your program in the CRM system. The execution stops at the RFC call, because of the infinite loop.
STEP 3: Now login to the ECC system and go to transaction SM51 select the process which is executing the RFC and navigate to the menu: u201CProgram/Session->Program->Debuggingu201D this triggers the debugger session in a separate window.
Scenario 2: Calling a Standard RFC FM
When we are debugging a standard program we cannot add the infinite loop, hence we cannot go to SM51 and debug the work process. The RFC destination for the ECC system has a User specified, the RFC function module gets executed using this users credentials. Usually the basis team set up the RFC user as non Dialog user, this does not allow debugging. Contact your Basis team and get this changed to a dialog user enabling you to debug RFC function calls via the normal debugger.
Note: User name configured in the RFC destination (transaction SM59)
Note: User type for the RFC User (transaction SU01D)
Hope this will be helpful.. -
Calling New Function Module from JAVA ISA b2b
I need to call a new function module which accepts some parameters as input and
returns some result parameters back as output.
These returned value needs to be displayed on the JSP pages of ISA B2B applications.
Can someone please guide me and provide code snippet on how to do this?
Thanks in advance.
Points will be awarded for all relevant and helpful answers.Stride,
I did this on CRM ISA 4.0... I used the dev and extension guide as a basis - I think the ISA 5.0 guide has the examples and tutorials in a separate document that can also be downloaded from service.sap.com.
Heres some info on how to do it although I can't guarantee this is the full solution or that it will work the same for ISA 5.0, and I will probably forget a lot of stuff as its been a few years since I did it! I also cant guarantee it is the correct way to do it but it worked! Basically, we built a link into the order overview page to display urls to order tracking websites using an RFC on the backend CRM system. Hope it helps anyway.
1. Create RFC enabled function module in backend.
2. Edit file backendobject-config.xml in folder project_root\b2b_z\WEB-INF\xcm\customer\modification:-
[code] <backendobject
xmlns:isa="com.sapmarkets.isa.core.config"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xml="http://www.w3.org/XML/1998/namespace">
<configs>
<!-- customer changes in backendobject-config should be done here by extending/overwriting the base configuration-->
<xi:include
href="$
Template for backend object in customer projects
Concrete implementation of a backend object
This implemenation demonstrates how a backend object
is used to communicate with the CRM system
@see com.ao.isa.backend.boi.Z_AOFuncBackend#getOrderDeliveryTrackingData(java.lang.String)
Interface used to communicate with a backend object
The purpose of this interface is to hide backend implementation details
from the business objects
Returns a vector of Z_OrderDeliverTracking objects containing data to link
to external delivery tracking websites
@param orderNo The sales order document number
@return A vector of order tracking objects
@return
@return
@return
@return
@return
@param string
@param string
@param string
@param string
@param string
/modification/backendobject-config.xml#xpointer(backendobject/configs/*)"/>
<!-- This is an example customer extension. A new Backend Object is registered in the framework using XCM extension mechanism. -->
<!-- If you write customer extensions you should register your backend objects in the same way. -->
<!-- Please make sure that you use the correct base configuration (e.g. crmdefault for CRM or r3default, r3pidefault for R/3) -->
<config
isa:extends="../config[@id='crmdefault']">
<businessObject
type="Z_AO_Custom"
name="Z_AO_Custom"
className="com.ao.isa.backend.crm.Z_AOFuncCRM"
connectionFactoryName="JCO"
defaultConnectionName="ISAStateless"/>
</config>
</configs>
</backendobject>
[/code]
File com.ao.isa.backend.crm.Z_AOFuncCRM.java looks like this :-
[code] package com.ao.isa.backend.crm;
//jco imports
import java.util.Vector;
import com.ao.isa.backend.boi.Z_AOFuncBackend;
import com.ao.isa.businessobject.order.Z_OrderDeliveryTrackingItem;
import com.sap.mw.jco.JCO;
import com.sap.mw.jco.JCO.ParameterList;
import com.sapmarkets.isa.core.eai.BackendException;
import com.sapmarkets.isa.core.eai.sp.jco.BackendBusinessObjectBaseSAP;
import com.sapmarkets.isa.core.logging.IsaLocation;
public class Z_AOFuncCRM
extends BackendBusinessObjectBaseSAP
implements Z_AOFuncBackend
// initialize logging
private static IsaLocation log =
IsaLocation.getInstance(Z_AOFuncCRM.class.getName());
/* (non-Javadoc)
public Vector getOrderDeliveryTrackingData(String orderNo)
Vector urlData = new Vector();
try
// get Java representation of function module
JCO.Function func =
getDefaultJCoConnection().getJCoFunction(
"Z_BAPI_CRM_ORDER_TRACKING_URLS");
// provide export parameters
ParameterList params = func.getImportParameterList();
params.setValue(orderNo, "ORDER_NO");
func.setExportParameterList(params);
// execute function
getDefaultJCoConnection().execute(func);
// get result table
JCO.Table table =
func.getTableParameterList().getTable("TRACKING_DATA");
int numRows = table.getNumRows();
for (int i = 0; i < numRows; i++)
// get row
table.setRow(i);
// create a new Z_orderdeliverytracking object
Z_OrderDeliveryTrackingItem trackItem =
new Z_OrderDeliveryTrackingItem(
table.getString(0),
table.getString(1),
table.getString(2),
table.getString(3),
table.getString(4));
urlData.addElement(trackItem);
trackItem = new Z_OrderDeliveryTrackingItem();
return urlData;
catch (BackendException bex)
// The following key has to be added to WEB-INF/classes/ISAResources.properties
// in order to see the exception correctly
log.config("ao.b2b.order.error.getOrderTrackingURLs", bex);
return null;
[/code]
And file com.ao.isa.backend.boi.Z_AOFuncBackend.java looks like this:-
[code] package com.ao.isa.backend.boi;
//package java.ao.com.ao.isa.backend.boi;
import java.util.Vector;
import com.sapmarkets.isa.core.eai.sp.jco.JCoConnectionEventListener;
public interface Z_AOFuncBackend
public Vector getOrderDeliveryTrackingData(String orderNo);
[/code]
Whilst file com.ao.isa.businessobject.order.Z_OrderDeliveryTrackingItem.java looks like this:-
[code]
package com.ao.isa.businessobject.order;
// Referenced classes of package com.sapmarkets.isa.businessobject.order:
// PaymentType
public class Z_OrderDeliveryTrackingItem // extends SalesDocument implements OrderData
private String deliveryDocNo;
private String goodsIssuedDate;
private String consignmentNo;
private String status;
private String url;
public Z_OrderDeliveryTrackingItem()
public Z_OrderDeliveryTrackingItem(
String delDocNo,
String GIDate,
String consNo,
String status,
String url)
this.setDeliveryDocNo(delDocNo);
this.setGoodsIssuedDate(GIDate);
this.setConsignmentNo(consNo);
this.setStatus(status);
this.setUrl(url);
public String getConsignmentNo()
return consignmentNo;
public String getDeliveryDocNo()
return deliveryDocNo;
public String getGoodsIssuedDate()
return goodsIssuedDate;
public String getStatus()
return status;
public String getUrl()
return url;
public void setConsignmentNo(String string)
consignmentNo = string;
public void setDeliveryDocNo(String string)
deliveryDocNo = string;
public void setGoodsIssuedDate(String string)
goodsIssuedDate = string;
public void setStatus(String string)
status = string;
public void setUrl(String string)
url = string;
[/code]
3. Edit file bom-config.xml in folder project_root\b2b_z\WEB-INF\xcm\customer\modification :-
[code] <BusinessObjectManagers
xmlns:isa="com.sapmarkets.isa.core.config"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xml="http://www.w3.org/XML/1998/namespace">
<!-- customer changes in bom-config should be done here by extending/overwriting the base configuration-->
<xi:include
href="$/modification/bom-config.xml#xpointer(BusinessObjectManagers/*)"/>
<!-- This is an example Business Object Manager. It can act as template for customer written Business Object Managers -->
<BusinessObjectManager
name="Z_AO-BOM"
className="com.ao.isa.businessobject.Z_AOBusinessObjectManager"
/>
</BusinessObjectManagers>
[/code]
File com.ao.isa.businessobject.Z_AOBusinessObjectManager.java looks like this:-
[code] package com.ao.isa.businessobject;
// Internet Sales imports
import com.sapmarkets.isa.core.businessobject.management.BOManager;
import com.sapmarkets.isa.core.businessobject.management.DefaultBusinessObjectManager;
import com.sapmarkets.isa.core.businessobject.BackendAware;
Template for a custom BusinessObjectManager in customer projects
public class Z_AOBusinessObjectManager
extends DefaultBusinessObjectManager
implements BOManager, BackendAware {
// key used for the backend object in customer version of backendobject-config.xml
public static final String CUSTOM_BOM = "Z_AO-BOM";
// reference to backend object
private Z_AOFunc mCustomBasket;
constructor
public Z_AOBusinessObjectManager() {
Method is called by the framework before the session is invalidated.
The implemenation of this method should free any allocated resources
public void release() {
Returns custom business object
public Z_AOFunc getCustomBasket() {
if (mCustomBasket == null) {
mCustomBasket = new Z_AOFunc();
assignBackendObjectManager(mCustomBasket);
return mCustomBasket;
[/code]
And uses file com.ao.isa.businessobject.Z_AOFunc.java which looks like this:-
[code]
package com.ao.isa.businessobject;
// Internet Sales imports
import com.sapmarkets.isa.core.businessobject.BOBase;
import com.sapmarkets.isa.core.businessobject.BackendAware;
import com.sapmarkets.isa.core.eai.BackendObjectManager;
import com.sapmarkets.isa.core.eai.BackendException;
import com.sapmarkets.isa.core.logging.IsaLocation;
// custom imports
import com.ao.isa.backend.boi.Z_AOFuncBackend;
import java.util.Vector;
Template for business object in customer projects
public class Z_AOFunc extends BOBase implements BackendAware
// initialize logging
private static IsaLocation log =
IsaLocation.getInstance(Z_AOFunc.class.getName());
private BackendObjectManager bem;
private Z_AOFuncBackend backendAOBasket;
Returns a reference to the backend object. The backend object
is instantiated by the framework.
@return a reference to the backend object
private Z_AOFuncBackend getCustomBasketBackend()
if (backendAOBasket == null)
//create new backend object
try
backendAOBasket =
(Z_AOFuncBackend) bem.createBackendBusinessObject(
"Z_AO_Custom");
// the backend object is registered in customer version
// of backendobject-config.xml using the 'Z_AO_Custom' type
catch (BackendException bex)
// The following key has to be added to WEB-INF/classes/ISAResources.properties
// in order to see the exception correctly
log.config("ao.b2b.order.error.getOrderTrackingURLs", bex);
return backendAOBasket;
This method is needed when a business object has a corresponding
backend object.
public void setBackendObjectManager(BackendObjectManager bem)
this.bem = bem;
Returns a vector of url links for tracking
@return vector of urls
public Vector getOrderDeliveryTrackingData(String orderNo)
// the call is delegated to the CRM aware backend object
return getCustomBasketBackend().getOrderDeliveryTrackingData(orderNo);
[/code]
4. Edit file config.xml in folder project_root\b2b_z\WEB-INF to add custom actions (the section below is just the custom stuff added at the end of the file the Z_orderTracking is the relevant one) :-
[code] <!-- Begin of custom AO action definitions -->
<action path="/b2b/Z_orderTracking" type="com.ao.isa.order.actions.Z_OrderTrackingAction">
<forward name="success" path="/b2b/order/Z_orderTracking.jsp"/>
</action>
<action path="/catalog/Z_displaySVGPage" type="com.ao.isa.catalog.actions.Z_SVGPageAction">
<forward name="success" path="/catalog/Z_SVG_fs.jsp"/>
</action> [/code]
Which points at Java file com.ao.isa.order.actions.Z_OrderTrackingAction.java which looks like this :-
[code] package com.ao.isa.order.actions;
// internet sales imports
import com.sapmarkets.isa.core.BaseAction;
import com.sapmarkets.isa.core.UserSessionData;
// struts imports
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
// servlet imports
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
// Internet Sales imports
import com.ao.isa.businessobject.Z_AOBusinessObjectManager;
import java.util.Vector;
This action acts as a template for customer extensions
public class Z_OrderTrackingAction extends BaseAction
This method is called by the ISA Framework when the
action is executed
public ActionForward doPerform(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException
// get user session data object
UserSessionData userSessionData =
UserSessionData.getUserSessionData(request.getSession());
// gettting custom BOM
Z_AOBusinessObjectManager myBOM =
(Z_AOBusinessObjectManager) userSessionData.getBOM(
Z_AOBusinessObjectManager.CUSTOM_BOM);
// get the order number being processed
String orderDocNumber = request.getParameter("orderNo");
// pass the order number back to the page
request.setAttribute("orderNo", orderDocNumber);
if (orderDocNumber != null)
// Get a vector of delivery tracking objects from lower layers (Business Object layer =>
// Business Logic Service Layer)
Vector trackingTable =
myBOM.getCustomBasket().getOrderDeliveryTrackingData(
orderDocNumber);
String error = "";
if (trackingTable != null)
if (trackingTable.size() == 0)
error = "true";
else
error = "false";
else
error = "true";
request.setAttribute("errorMessage", error);
request.setAttribute("trackingTable", trackingTable);
return mapping.findForward("success");
[/code]
5. I added the call to the function module for page orderstatusdetail.jsp in folder project_root\b2b_z\b2b\order to display a custom page Z_orderTracking.jsp in the same folder. To do this I added a link into the HTML to call a JavaScript function that passed the current order number to the /b2b/Z_orderTracking.do actionhandler mapped in the config.xml file.
So, in summary! Create an RFC; define business managers for it in the XML files; create a new Strut action and supporting Java class; create all the Java class for the managers.
I hope this makes some sense!
Gareth. -
Call an ABAP program or a function module from command prompt/python script
Dear All,
I want to call a function module/ABAP program from command prompt or a python script.
Let me explain with an example.
There is a function module "z_add" that takes two integers as input parameters and generates their sum.
the sum is the output parameter.
Now i want to call this function module from command prompt / python script and pass parameters to this function module.
In return i must get the sum(i.e. the output of function module).
I tried using STARTRFC ,was able to call the FM but could not get the return value(output) from FM.
Can you please provide me the code of such a function module and the method to call it thereby passing parameters and getting the sum.
Thanks and regards,
Gaurav
Edited by: gauravkec2005 on Mar 4, 2010 7:41 AMthank you both! helpful answers! :o)
anyway!
i have written the program which is called from the SAPScript:
/: PERFORM GET_VATNUMBER IN PROGRAM ZFI_F140_OPERATIONS
/: USING &BKPF-BUKRS&
/: CHANGING &VATNUMBER&
CE VAT Registration No : &VATNUMBER&
REPORT zfi_f140_operations.
FORM get_vatnumber TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
DATA: lv_co_code TYPE bukrs,
lv_vat_no TYPE stceg.
READ TABLE in_par WITH KEY name = 'BKPF-BUKRS'.
MOVE in_par-value TO lv_co_code.
SELECT SINGLE stceg FROM t001
INTO lv_vat_no WHERE bukrs = lv_co_code.
out_par-name = 'VATNUMBER'.
WRITE lv_vat_no TO out_par-value.
CONDENSE out_par-value.
MODIFY out_par INDEX 1.
ENDFORM.
it is not working and i cannot work out why...
i have not been ABAPing for very long but have had a go....
any thoughts as to what i have done wrong?
or point me where i should be looking? thank you! -
How to call a ECC 6 Function module from BI 7 process chain
Hi BI Gurus
I wann to push the data from infocube to ECC 6 ( Tcurr) table on a daily basis, and we have a function module written in ABAP and this FM is in ECC 6 sytem and we need to call this function module from BI inorder to update the TCURR table.
I used ABAP programm in Process chain but i failed as i dint see any functionality for FM. i could see only abap programm.
I need any you advise on this.
thanks in advanceHi,
If you are able to see the ABAP report of ECC 6, this ABAP report will inturn call this function module.
Call the report in process chain. -
Can we call Function Module from Process Chain?
Hello experts,
I have a small question.
Can we call Function Module(SE37) from Process Chain?
If yes can you please provide some example link?
I m new to BI world.
regardsHi,
Create one ABAP program and call the function module from that program. Check the link to know how to call a function module from an ABAP program.
http://help.sap.com/saphelp_wp/helpdata/en/d1/801edb454211d189710000e8322d00/content.htm
http://help.sap.com/saphelp_wp/helpdata/en/9f/db98ef35c111d1829f0000e829fbfe/content.htm
Then use process type "ABAP Program" in your process chain and add the program you have created. So then this program will be executed via process chain and this program will call the function module.
Indrashis -
CALLING AN FUNCTION MODULE FROM ILE/RPG
Hello all,
We are trying to call this function module ''CRM_CALL_ATP_BAPI'' from an ILE RPG program using and RFC call.
This function module only have tables to pass and receive parameters. We have a hard time trying to make it work. We did'nt find any documentation for Ile RPG on how to define a structure table and on how to pass it to the function module.
Did somebody that already done that would be kind enough to send us an exempple of the code.
Claude Bernier
Southshore industriesHello Claude,
we are doing this kind of programming pretty often.
If you are interested, you can contact us on that. It is pretty tricky with the iTabs, because the description is not really good and clear.
Regards
Volker Gueldenpfennig, consolut.gmbh
http://www.consolut.de - http://www.4soi.de - http://www.easymarketplace.de
Maybe you are looking for
-
How do I use Sun Web Server 7.0u1 reverse proxy to change public URLs?
Some of our installations use the Sun Web Server 7.0 (update 1, usually) for hosting some of the public resource and reverse-proxying other parts of the URI namespace from other backend servers (content, application and other types of servers). So fa
-
Opening an image from LR3 or LR4 into Ps
I still have Ps 4 on my computer and installed Ps 6 Beta. Now when I am in LR (I have both LR 3 and LR 4 full versions) and right click an image to "edit in Ps) I only have the option of editing in Ps6 Beta. What happened to the "edit in Ps 4" optio
-
Please help me stop itunes from reacting when i plug in my iphone
i have my iphone dock connected to my macbook that i work on during the day, i am really getting annoyed by itunes dancing around either to the front or simply waking from a minimised state (where i want it to stay) every time i end a call and replac
-
Send data complext to Net Webservice
Hello, I need to send array of array to Net webservice (rest) but the webservide respond the error: {"Exception":"Object reference not set to an instance of an object.","StackTrace":" I have an sample how can I send the with PHP and works but I try t
-
Safari shows colors different than other browsers and GoLive
Does anyone know why Safari shows colors differently than Firefox, Explorer and Opera, Mozilla and Golive? For example if I use "websafe" colors in photoshop with 2.2 gamma and sRGBie...2.1 and save, then import into Go Live with the working space th