Any upcoming new functionality RFID AutoID R/3 ????????
Does any one have info regarding new functionality in upcoming releases regarding RFID enabled processes ? Any new processes to be supported, like for example integrating Transfer Orders with reads from AutoID ?
This would support internal movements within a warehouse and movements to and from production area.
So far only deliveries are enabled, we look forward to see the integration with transfer orders enabled.
Also interested in any other new functionality.
Message was edited by: Marc Korstanje
Hi Srivatsan,
How are you? Hope you remember me..We got a similar kind of requirement in our project. Do you have solution for this issue?
regards
Paris
Similar Messages
-
Cannot see any actions while creating a new function in CC5.2
Hi All,
We recently installed GRC Access Control 5.2.At the backend we are using SAP R/3 4.7.The system has been installed and I am currently trying to configure it.I am trying to create a new function.After chosing a function ID and description when I try to insert an action,it comes up blank for my production server and even if I choose the option "All".
Any assistance in the matter would be greatly appreciated.Helo Neo,
For making the functions, risks etc, you need to have some standard procedures being followed and up in place. Uploading transactions,, authorization objects and text are one of these.
Thus before you start actually using/implementing the GRC the system, I would like to advice you to go through the documentation for the same, which suggests the step by step procedure for accomplishing the same.
The problem that you have encountered is a bit easy to track as it suggests the Auth objects and texts might not probably be uploaded. But there might be something you have missed while going the procedural way, which may cause a lot of problems while troubleshooting.
Kindly upload the files in the config tab, under "Upload Objects" and let us know if there is still an issue.
Regards,
Hersh. -
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 -
I think I finished installing Mountain Lion, and am at the "log in" page with the Mountain Lion icon, but I cannot do any of the functions on screen. That is, I cannot log in, sleep, restart, or shut down. I am running it on an Early 2009 Macbook Pro, which is said to have the capabilities of running Mountain Lion.
BrettGoudy wrote:
...Is there any way I can install a partition that runs snow leopard on my early 2011 MB pro with what I have (new SSD, New RAM, Current version Lion running, no external drive, lack of original snow leopard disks [I lost them ] and the general 10.6.3 snow leopard boot disks)...
As the last post suggests, call Apple and order a replacement original disc for about $17. They will ask you the model and serial numbers.
Your retail version of Snow Leopard OS 10.6.3 will not work on that Mac as it requires a minimum of OS X 10.6.7 to boot and operate.
Another alternative is to again borrow another Mac to install your retail Snow Leopard into an external HD or partition, upgrade it to 10.6.8 and then clone it back to a partition on your MBP. -
New functionality in ECC 6.0 with Enhancement Package 3
Hi Experts,
Can any one tell me what new functionality is added in Enhancement package 3 (ECC 6.0)?
Thanks & Regards,
SimarHi,
There no new functionality in ECC 6.0 for auto clearing of bank clearing account. Still you need to depend on Manual / Electronic bank statement to clear them.
Thanks
Prasada -
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. -
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 -
Can i create a new function (Fade out, Amplify down, Fade In)
Hi,
I am using Adobe Audition version 3.0
Is it possible to define a new function, so that i can select a short piece of the audio file within Edit View, so that the first 5 miliseconds (of the selected piece of audio) will be applied a Fade Out, and the last 5 miliseconds will be applied a Fade In, and in-between will be Amplified by -12dB.
I have to do this hundreds of times within a 1 hour recording of speech which has many short pauses, in order to remove small external noises between the words.
I normally select (one by one) the space/pause between the words and amplify this by -12 dB. Then i select the preceeding 5 miliseconds and apply a Fade Out. And the 5 miliseconds after the pause a Fade In.
I have only discovered today how to create short-cuts, so at least i have a short cut for the Amplify, Fade Out and Fade In.
But it would be great, if i could somehow define a function as i described above, to do all 3 steps within the one function.
Any help or tips appreciated.
Dave[email protected] wrote:
Hi,
I am using Adobe Audition version 3.0
Is it possible to define a new function, so that i can select a short piece of the audio file within Edit View, so that the first 5 miliseconds (of the selected piece of audio) will be applied a Fade Out, and the last 5 miliseconds will be applied a Fade In, and in-between will be Amplified by -12dB.
I have to do this hundreds of times within a 1 hour recording of speech which has many short pauses, in order to remove small external noises between the words.
I normally select (one by one) the space/pause between the words and amplify this by -12 dB. Then i select the preceeding 5 miliseconds and apply a Fade Out. And the 5 miliseconds after the pause a Fade In.
I have only discovered today how to create short-cuts, so at least i have a short cut for the Amplify, Fade Out and Fade In.
But it would be great, if i could somehow define a function as i described above, to do all 3 steps within the one function.
Any help or tips appreciated.
Dave
You might be able to - but this is going to require quite a complex script that would need some serious editing by hand, and even then I'm not absolutely sure that it would work. The previous problem with this sort of script was that due to an 'anomaly' in the program, the - (minus) sign wouldn't work in a script, but I think that with the 3.0.1 patch, it does again. And even with this working, it's going to require some experimentation. Initially you need to refer to ryclark's method of entering absolute values which you will find here, and then you have to find a way to realise the whole operation a step at a time. You'd have to handle the fade out and the fade in separately, but where I think you might come considerably unstuck is trying to fade to -12dB for the middle section - that's probably the bit that would perhaps require slightly more than might actually be possible. I'd be quite happy to be proved wrong about that though!
I'm afraid that there's no documentation at all for the scripting language - this is something that Adobe, and Syntrillium before them, have never quite managed to provide, despite promising me some a while back. The good news though is that if you can make this work, then it's relatively straightforward to assign a shortcut key to it. But I should warn you now that this would be one hell of a script... -
New functionality in ECC 6.0 for auto clearing of bank clearing account.
Is there any new functionality in ECC 6.0 for auto clearing of bank clearing account.
Regards,
KishoreHi,
There no new functionality in ECC 6.0 for auto clearing of bank clearing account. Still you need to depend on Manual / Electronic bank statement to clear them.
Thanks
Prasada -
New function Planning Group and Affiliate in Business partner/Account tab
Hi all!
I'm using SAP 8.8 PL10 , Localization Australia. I have new function in Business partner/Account tab is Planning Group and Affiliate.
Can you explain ? i don't see any help file about this.Hi,
You may check this: What is the use of AFFILIATE check box in Business partner?
Thanks,
Gordon -
Error with new function u00E9lement is not in use
I designed quickly a new function in the backend with no input and only output which give me the url off the bsp server. (since there is nobody in the house who can make the iview bsp template)
I select the function from find data and put it in the model which gives the output to a store. when I deploy I get an error 1.1
element 'z retrieve http server' is not in use
anybody any clue what to do ??
kind regards
arthur de smidtthanks for the help but I already find out what happenend. I had linked my function direct to a store but apperantly there is no trigger for the function to execute since it is on it's own without input needed. apparently I have to trigger it to implement it in a flow or something like that
kind regards
arthur -
Can i add new function in B1.Example exist function in 2005 version is Concat(,) if i want to add new function can i do.I want function to convert number to text for decribe total price, example total price = 3250 the text must show as 'three thousand and two hundred fifty'.Can i do.Please reply.
thank youHi Virasak
Where are you trying to do this??? In your program or the pld. If in the pld it can be done, works great.
In the sdk itself i do not think there is any functions for this, but you should check in your programming enviroment to see if it has such a function.
Hope this helps -
Hi :)
I made a new function in PL/SQL transfering BLOB to CLOB.
i made this function, because I know how to translate CLOB in Oracle BI.
with this function for example:
EVALUATE('DBMS_LOB.SUBSTR(%1,40,1)',PACKET_CONTENTS)
but in my case, this Packet_content is BLOB, so i want to translate it to CLOB and than use the substr function to translate it (or part of it).
so I tried doing that:
EVALUATE('DBMS_LOB.SUBSTR(%1,40,1)',EVALUATE('BLOB_2_CLOB(%1)','111'))
the parameter "111" is a param i give to my function (just for test). and my function should return the results from the PACKET_CONTENTS in CLOB type.
the answer error i get is the following one:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14027] The navigator cannot handle the following request containing constants only: Evaluate( DBMS_LOB.SUBSTR(%1,40,1),Evaluate( BLOB_2_CLOB(%1),'111') ) as c1. (HY000)
SQL Issued: SELECT EVALUATE('DBMS_LOB.SUBSTR(%1,40,1)',EVALUATE('BLOB_2_CLOB(%1)','111')) saw_0 FROM RWD ORDER BY saw_0
Any ideas? or any other information you want to know?
thanks :)
P.S: im really new in the Oracle BI things, so I might be do silly things I cant do... so please fix me if you can :)
thanks !Are you trying to return a text string from the BLOB/CLOB? Can you not do this in a database view over the top of your existing table, removing any potential ODBC/OCI issues?
ie.
CREATE VIEW test_view AS
SELECT dbms_lob.substr( blob_column,4000,1) text_column
FROM <table>; -
New Functionality in ECC 6.0
Hi All,
Can any one guide me about the new functionality of "Work Center for Purchasing Documents" in ECC 6.0?
Regards
Edited by: sapsarang on Jan 12, 2011 7:15 AMHi Sarang
Please refer the release notes with the following link
http://erp.fmpmedia.com/Default.aspx?alias=erp.fmpmedia.com/english
Here you select
Source release version as SAP ERP 6.0
Target Release Version as SAP enhancement package 4 for SAP ERP
Solution Area as Procurement and Logistics Execution
Then click search
You find Release availiable and delta functionality
On Page 4 you find Work center for purchasing documents
Cheers
Kris
Edited by: KRISHNA AKULA on Jan 12, 2011 8:23 AM -
Length of a string without using any built-in functions
code that returns the length of a string without using any built-in functions.
thanks
SamA string is internally represented by a character array. An array of characters will reside on the stack, not the heap. Yes, we always learned that String is a reference type, but what goes on in your memory might still surprise you...
A struct is internally represented by only it's private properties, sequentially on the stack.
So basically, what I thought is happening by messing with the structlayout: is only tricking our programming a bit into thinking that the top X bytes on the stack represent a chararray, while actually we put them there as a string.
Wrong. True. And wrong.
A string is internally represented by, in that order, an array length, a string length, the chars. None of them resides on the stack.
An array is internally represented by, in that order, an array length and the chars. None of them resides on the stack.
When you use the FieldOffset attribute to handle the string as a char array, you don't get anything right:
- the Length returned is the "array length" of the string, which is equal to the string length + 1.
- the chars returned by the array indexer are shifted by 2 chars (the length of the "string length" field).
You can use the FieldOffset to make that work, but it needs a little bit more work.
unsafe static int Test()
string myString = "This string may contain many string inside this string";
string testString = "string";
int countResult = 0;
fixed (char* myChars = new StringToChar { str = myString }.chr, testChar = new StringToChar { str = testString }.chr)
// The 2 first chars of the array are actually the string length.
int myCharsLength = myChars[1] << 16 | myChars[0];
int testCharLength = testChar[1] << 16 | testChar[0];
for (int i = 0; i < myCharsLength - testCharLength + 1; i++)
if (myChars[i + 2] == testChar[2])
for (int j = 1; j < testCharLength; j++)
var c = testChar[7];
if (myChars[i + 2 + j] != testChar[j + 2])
goto endOfCharAnalyses;
countResult++;
endOfCharAnalyses:
continue;
return countResult;
Maybe you are looking for
-
Creating Sales Order using Web Dynpro for java
Hi SDN, I am new to Web Dynpro for java. I have developed an application for creating a sales order using adaptive RFC Model using BAPI. It's working fine when i create a single order. I wanna create SO with more than one line item. I have used the T
-
How do you add a device to Image Capture?
Does anyone know how to add a device to IMAGE CAPTURE?
-
It seems there was something in the recent iOS7 release that have made a few changes in the way itunes is viewed on the iPhone. In the past I would sort by artist, which would then show all the albums. Now it shows all the albums, but with all the s
-
Thats what my friend in Australia said to me (I am in New Zealand so 4 hours on a plane away! so cant go look) Itunes was copying a cd and was about to burn it evidently and asked her to insert a blank disk so she stuck it gently in the slot and it s
-
Weblogic Admin server startup failure in Fusion Apps environment.
I am getting the following exception trace after applying SOA B5 patch: Caused By: oracle.security.jps.service.igf.IGFException: JPS-02592: Failed to push ldap config data to libOvd for service instance "idstore.ldap" in JPS context "default", cause: