Noob help with creating a new function module
Hi everyone,
I'm just learning SAP and trying to integrate a WMS system towards it and I'm losing hair over it hehehe
The scenario is that I want to extract Purchase Order Rows details and that's not a hard thing to do since there are multiple BAPIs that can be invoked, for example BAPI_PO_GETDETAIL.
I'm using .NET Connector 3 to talk to SAP.
The problem however is that I want to see how many articles that have already been delivered into the warehouse using BAPI_GOODSMVT_CREATE. There is no information returned when using BAPI_PO_GETDETAIL that specifies that a Purchase Order Row has a quantity of 30 and that 20 has already been delivered.
That information can be retrieved by using BAPI_GOODSMVT_GETITEMS.
The problem with using BAPI_GOODSMVT_GETITEMS is that it returns all of the rows and I am only interrested in retrieveing the rows with quantity for a specific purchase order.
So i decided to create my own BAPI or Function Module (or whatever it's called) that would take a PO_NUMBER and PO_ITEM and return the quantity of already delivered items. For example if one of the PO Rows (10) has 100 items and there has been 2 partial deliveries of 20 and 30. The function should return the value of 50 because it's the sum of 20 and 30.
My code looks like this:
FUNCTION ZBAPI_GOODSMVT_GETITEMS.
""Local Interface:
*" IMPORTING
*" VALUE(PO_NUMBER) TYPE BSTNR
*" VALUE(PO_ITEM) TYPE EBELP
*" EXPORTING
*" REFERENCE(ENTRY_QNT) TYPE ERFMG
SELECT SUM( MENGE ) INTO ENTRY_QNT FROM MSEG
WHERE
EBELN = PO_NUMBER AND
EBELP = PO_ITEM.
ENDFUNCTION.
The problem is that when i try to Activate it it says:
REPORT/PROGRAM statement missing, or program type is INCLUDE.
What am i missing? Is there an easier way to extract already delivered quantities when extracting PO information?
A document was produced for Designer 7.1 and the principles still apply.
http://partners.adobe.com/public/developer/en/pdf/lc_designer_perf_guidelines.pdf
You can poke around here as well....
http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm
Steve
Similar Messages
-
How to create a new function module?
I was doing the tutorial to create a SAP data widget and the tutorial was using BAPI_FLIGHT_GETLIST to display the data. However, in my system, theres no data in the table SFLIGHT2 and i couldnt populate any data in it.
So i am trying to create my own function module. Can anyone tell me how should i go about doing it?Hi Low Soon ,
please check the below links for creating a new function module.
SAP Help :
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/frameset.htm
Step by Sterp approach to create a Functional Module:
http://www.****************/Tutorials/ABAP/FunctionModule/page1.htm
Thanks
Jaideep Srinivasan -
Help with creating a new window
Hi there
Could anyone help me with the coding to create a new window in java? Basically its when i click on a button a new window pops up
thanksIcer_age828 wrote:
Could anyone help me with the coding to create a new window in java? Basically its when i click on a button a new window pops upWe need more information on what you mean here, what you know and what you don't know. Do you understand the basics of Java? Are you talking about using Swing? If so, what exactly do you mean by a "new window"? You can create a simple dialog via the method JOptionPane.showMessage(...) method. Do you mean to create and show a new JDialog? JFrame? Do you know about ActionListeners and how to add them to jbuttons? Given your post, I think that your best bet would be to start going through the Sun Java Swing tutorial from the beginning. Look here . -
Help with creating a new document
Hi,
I will have to work on creating a new document from scratch which will serve as a billing statement to a customer.
I have to construct it and I am really confused on how to structure my forms and subforms.
Can any of you please point me to a right place where I can get a good design guidelines?? Or is there anything like a good design for this.
Will the form structuring impact performance. This document can run really long based on the number of transactions.
I am using castor and object to xml mapping and using the data file to dynamically load the data on to pdf.
Since I am going to start this fresh, I want to get the structure and design correct.
Appreciate your time and help.
ThanksA document was produced for Designer 7.1 and the principles still apply.
http://partners.adobe.com/public/developer/en/pdf/lc_designer_perf_guidelines.pdf
You can poke around here as well....
http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm
Steve -
Help with Creating A New Application Form
Hi, completely new to this and trying to create a new application form for a conference.
I've created the form and set each of the packages delegates can buy and added a select button on the right hand side of each of the 6 packages but I can't seem to get it to the point where only one package can be selected - each has details ie B&B and dinner etc so I want delegates to select the one they want beside it.
Also I've managed to create the link to create the email address to populate to send it back but it isn't attaching the completed form - how do I do this?
All help EXTREMELY welcomed! Thanks
ColinHi,
as I know, you can change your cursors by system software or/and browser. On the other hand you can use programs "outside" of your DW. I suggest to "Google" for them, as I did, and found for example this:
http://www.google.de/#hl=de&xhr=t&q=create+cursor&cp=13&pf=p&sclient=psy&site=&source=hp&a q=0&aqi=g2&aql=&oq=create+cursor&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=e8c6fad3e718b799&biw=1280 &bih=785
or http://www.cursors-4u.com/ and while examining this website my cursor changed immediately.
Hans-Günter -
Help with creating a user function
Hi, I have never created a user function in Oracle and need some help. My function takes in a variable, reads the table looking for a match of the first 2 characters, if not found tries based on the first character. This is what I have so far:
CREATE function Get_Country_Of_Origin
(av_SERIAL_ID varchar2)
RETURN varchar2
IS
var_country varchar2;
BEGIN
--If match on first 2 characters of serial id return that value
SELECT DESCRIPTION INTO var_country
FROM M4LOADER.SUPPLIER_TYPE
WHERE SUPPLIER_TYPE = LEFT(av_SERIAL_ID,2)
--Else If match on first character of serial id return that value
SELECT DESCRIPTION INTO var_country
FROM M4LOADER.SUPPLIER_TYPE
WHERE SUPPLIER_TYPE = LEFT(av_SERIAL_ID,1)
--Else return nothing
return var_country;
END;<FONT FACE="Arial" size=2 color="2D0000">
CREATE function Get_Country_Of_Origin (av_SERIAL_ID varchar2)
RETURN varchar2
IS
var_country varchar2;
BEGIN
--If match on first 2 characters of serial id return that value
<font color="#ff8040">Are you sure that the following will return only one single value </font><font color="#800000">( if TO MANY ROWS ARE FOUND then ..?)</font>
SELECT DESCRIPTION INTO var_country FROM M4LOADER.SUPPLIER_TYPE WHERE SUPPLIER_TYPE = <font color="#0080c0">substr(av_SERIAL_ID,0,2)</font>
--Else If match on first character of serial id return that value
<font color="#0d1099">IF var_country is null then</font>
SELECT DESCRIPTION INTO var_country FROM M4LOADER.SUPPLIER_TYPE WHERE SUPPLIER_TYPE = <font color="#0080c0">substr(av_SERIAL_ID,0,1)</font>
<font color="#0d1099">End if;</font></font>
return var_country;
END;
-SK
</FONT> -
Help with creating a new XML file from an existing DOM tree!!
i want to create a new XML file from an existing DOM tree
i used this code to create a new document:
static public Document createDocument(String fileName) throws ParserConfigurationException//,IOException,SAXException
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setIgnoringComments(true);
factory.setIgnoringElementContentWhitespace(true);
factory.setValidating(true);
DocumentBuilder builder =factory.newDocumentBuilder();
return builder.newDocument();
// handle exception creating DocumentBuilder
catch ( ParserConfigurationException parserError ) {
throw new ParserConfigurationException();
}then i used this code to transform the DOM :
public void exportDocument(Document document) {
try {
Source xmlSource = new DOMSource( document );
Result result = new StreamResult( System.out );
TransformerFactory transformerFactory =
TransformerFactory.newInstance();
Transformer transformer =transformerFactory.newTransformer();
transformer.setOutputProperty( "indent", "yes" );
transformer.transform( xmlSource, result );
//then catching the exceptions
But the file was not created and i didn't find where can i specify the DTD that the XML file should use and where can i enter the name of the XML file itself
Another questoin can i write a DTD file dynamically during the execution of the program??Cross-post: http://forum.java.sun.com/thread.jspa?threadID=784467&messageID=4459240#4459240
-
Help with creating a shuffleList function...
I have the following function, which creates and populates a vertical column of draggable clips and populates the dynamic text boxes within the movie clips with data from an xml file, effectively creating an ordered list of movie clips
The code works fine, but I am having some difficulties with the shuffleList function. What I would like to do is randomly sort the data contained in dragClip1.answerText.text so that the ordered list of movie clips becomes an unordered list.
Any ideas would be greatly appreciated.
~Chipleh
function createListContent(evt:Number):void{
var xmlObjectListLength:Number = xml.sim.bodyText.page[evt].para.q.length();
for(var i:Number = 0; i<xmlObjectListLength;i++)
var listObjectAttributes:XMLList = xml.sim.bodyText.page[evt].para.q;
addChild(objectContainer);
var dragClip1:dragClip = new dragClip();
objectContainer.addChild(dragClip1);
dragClip1.answerText.text = xml.sim.bodyText.page[evt].para.q[i];
dragClip1.x = 0;
dragClip1.y = (dragClip1.height * i);
dragClip1.totalClips = xmlObjectListLength;
shuffleList(dragClip1.totalClips);
function shuffleList(listCount:Number,dragClipListText:Array):void
//Not really sure where to start with this function or how to go about shuffling the data
for(var i:Number = 0; i<listCount+1;i++)
var aTarget:Object = objectContainer.getChildByName("listObject" + i);
var theTarget:Object = objectContainer.getChildByName("listObject" + i);
theTarget.answerText.text = aTarget.answerText.text;Hi Ned,
Thanks for the reply. I have come up with this function, using an array like you suggested, but htere is one problem:
function shuffleList(listCount:Number,dragClipListText:Array):void
var tempArr:Array = new Array();
for(var i:int =0;i<listCount;i++)
var theTarget:Object = objectContainer.getChildByName("listObject" + i);
trace("theTarget = "+ theTarget.name);
tempArr.push(theTarget.answerText.text);
trace("temp = "+ tempArr);
var myArray:Array = new Array();
while (tempArr.length > 0)
var r:int = Math.floor(Math.random()*tempArr.length);
myArray.push(tempArr[r]);
tempArr.splice(r,1);
var listString:String = myArray.toString();
trace("listString = "+ listString);
theTarget.answerText.text = listString;
trace("myArray =" +myArray)
I can see my arrays of data being traced out properly, but all the data is populated in the last movie clip, per:
theTarget.answerText.text = listString;
So the data in all movie clips remain uneffected aside from the last clip, which is populated with ALL the listString data.
Hopefully this is clear. If not, let me know and I will try to clarify further.
~Chipleh -
Help with creating a new account!
Due to the fact that I had to erase my hard drive and put a fresh latest version of iLife06 on it, I am having some issues trying to create an account within iTunes Music Store. iTunes wants me to add credit card information for purchases. In the past, I have been buying pre paid iTunes cards and would rather continue doing this. So how can I get around putting my CC info in? It won't let me get pass that step in the setting up the account process.When I click sign in and put my info in it says that my information has never accessed the music store and wants me to register. The first screen that comes up is the Credit Card screen.
Thanks!yea I sent them an email already and waiting for a response. I have tried several different combinations of logins both AOL and a @mac.com and getting no where. In the FAQ's it said there was an option to select NONE if the person did not have credit cards and would have to use the pre paid cards. Well I don't see a NONE listed as an option and I have the very latest version of iTunes too! So who knows whats up! I'll have to wait and hear from them.
-
I need help with creating some formulas
I'm not sure if anyone around here can help me, but I'm trying to create a Numbers document and need some help with creating a formula/function.
I have a column of amounts and I would like to create a formula which deducts a percentage (11.9%) and puts the result in another column.
If anyone can help me, it would be greatly appreciated.Here is an example that shows one way to do this:
The original data is in column A. In column B we will store formulas to adjust the amounts:
1) select the cell where you want to formula (in this case cell B2)
2) Type the "=" (equal sign):
3) click cell A2:
4) now type the rest of the formula which is: "*(100-11.9)/100" that is asterisk, then open parenthesis, 100 minus eleven point nine close parenthesis forward slash one hundred
The Asterisk is the multiply operator (times) and the forward slash is the division operator (divide)
now hit return. select cell B2 and hover the cursor over the bottom edge of the cell:
drag the little yellow dot down to "fill" the formula down as needed. -
How to create a custom function module with the records in SAP R/3?
Hi All,
How to create a custom function module with the records in SAP R/3? Using RFC Adapter I have to fetch the custom function module records.
Regards
SaraHi
goto se37...here u need to create a function group... then u need to create a function module. inside assign import/export parameters. assign tables/exceptions. activate the same. now write ur code within the function module
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm
Look at the below SAP HELP links, These links will show you the way to create a Function Module
http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm -
Need help on mapping of obsolete and new function module
Hi Expert,
We are working on a upgradation tool in which i have to repace the obsolete function module "HELP_VALUES_GET_WITH_CHECKTAB
" by "F4IF_FIELD_VALUE_REQUEST
". I am not sure about the functionalities of these function modules as i have never used it. Can anyone please help me by providing some information abt these FMs. Also i need to do the mapping of parameters of old and new function module. So please provide the details of mapping also. Any pointers on this will be highly appreciated.
Thanks & Regards,
P Sharma
Moderator message : Duplicate post locked. Continue with [Parameter mapping of FMs|Parameter mapping of FMs;.
Edited by: Vinod Kumar on Jul 8, 2011 9:40 AMHey Enivass,
you can ckeck the input field "Account Number" whether it is numeric or Alphabet using *"Conversions ->Fixvalues"*
Steps:
1. Extract first character of input using *" Text -> substring"* -- start position 0 , char count 1
2. In Fix Value table you have to give following values:
Dafault value : Alphabet
key----
value
0----
Number
1----
Number
2----
Number
9----
Number
3. Write logic IF "number" than "Arithmatic -> FormatNumber (0000000000) -
// for leading zeros
ELSE
concat with extra space -
Thanks -
Please help me creating a new listener with different port#.
I have two instances in a server. both have different homes. I want to create a seperate listener for the second one i created.
But that is not happening.
here i tried to give name from LISTENER TO LISTENER1 & Port# from 1521 to 1524.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /apps2/oracle)
(PROGRAM = extproc)
LISTENER1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = aixth53)(PORT = 1524))
When I check lsnrctl status with LISTENER1 , it still shows the other instance home with port#: 1521
Please help me creating a new listener with different port#.
Thanks,marist89 wrote:
sb92075 wrote:
marist89 wrote:
sybrand_b wrote:
The listener is a broker only and doesn't play any role in normal communications.
It just forks a process or a thread, and that's it.And the listener is a single point of failure. Listener goes down, you can't connect to the db. That's why you need two listeners.If listener one goes down, then listener two goes down for exact same reason since it is a single executable file.I'm not playing tit-for-tat with you. Fact is, there are situations where people who are not you might want to use more than one listener.Some folks might want to jab a sharp pencil into their eye, too.
Just because you can do something, it does not necessarily mean it should be done. -
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. -
Help in enhancing CRM logon function module
Hello all,
We have a situation where in the past we have allowed the creation of multiple Business Partners sharing the same e-mail address. We are about to close this loophole but we have this as a master data issue for some existing Customers/Business PArtners.
Currently, our CRM Webshop only uses e-mail address and password for login verification (not using Business Partner/Customer number).
We would like to enhance the webshop logon to include customer number as well ie. We want to determine which customer number associated with the ambiguous e-mail address is used. I have attempted to identify which function module is involved by inserting an endless WHILE loop into the following , but none of them seems to be called :
CRM_ICSS_USER_LOGIN
CRM_ISA_IUSER_LOGINr
CRM_ISAI_BP_LOGIN_BPARTNER_GET
CRM_ISA_BP_LOGIN_CHECK
CRM_ISA_LOGIN_R3USER_CHECK
CRM_ISA_IUSER_LOGIN
CRM_ISA_LOGIN_CHECK
CRM_ISAI_BP_LOGIN_BPARTNER_GET
In addition I notice the function SUSR_CHECK_LOGON_DATA can not be enhanced as it's a Basis FM.
I have attempted to look up documentation in SAP Help and not much joy. Can anyone tell me whether I'm barking up the wrong tree and this needs to be addressed by a kernel level function or recommend another place in the standard code ?
Regards,
GabrielHi Pooja,
Please follow the below steps to create a function module :
1. Goto Transaction code : SE37.
2. Create a Function Group first.
a) From the Menu Bar Choose Goto -> Function groups -> Create group.
b) Specify the function group name and a short text.
c) Choose Save.
When you create a new function group, the system automatically creates a main program containing two includes. Like any other programs and includes, you can display them in the Repository Browser.
3. Now create a Function Module.
4. Enter the function's name in the field Function module.
5. Choose Create.
6. In the Enter function group dialog box, enter the function group to which you want to assign the function module.
7. In The Attributes Tab select Remote Enabled Module (since you want a RFC function module ).
8. Give the Import and Export parameters and exceptions(if any).
9. Write the functioning part of the fuction module in the Source code tab.
10. Save and Activate your function Module.
Now go ahead and use your function module where ever you want.
Hope it helps.
Reward if helpful.
Regards
Hemant Khemani
Maybe you are looking for
-
How do I reduce the megabyte size of a photo to email it
I have a 4 MB photo that I would like to download to a newspaper. The optimal size for downloading is 2 MB. How to I reduce the size of the photo froom 4 MB to 2MB in Elements 8.
-
EA6500 won't work with Windows 8.1--Firmware install stuck in restart...
I upgraded to Windows 8.1 about a week ago, and everything was fine. Then my cleaning lady unplugged my modem, which normally results in the internet no longer working, and necessitates me resetting the router, then going to 192.168.1.1 to set up pa
-
World tv pro HD is not working what do i do
World tv pro HD is not working what do i do
-
How to define Approval Hirearchy for Fixed Assets?
Hello All, Couls someone please tell me How to define Approval Hirearchy for Fixed Assets which should be different as compared to normal item purchase.Reply me ASAP Regards Aditya
-
VKM1 Display Sales Order Authorisation
Hi All I'm Emma and I'm new to this forum so apologies for any incorrect SAP terminology/knowledge etc! We have a scenario where we have a group of users in our credit control area which have access to change sales documents (VA02) but only for certa