Calculate a result in a string
I have string, which contains '5 * 7'.
How can I get the result into my integer variable?
Any ideas.
Thanks
Rene
You could do this sort of thing:
REPORT znrw_calculator MESSAGE-ID z1.
PARAMETERS: p_code1(20) LOWER CASE.
DATA t_source_tab(72) OCCURS 0 WITH HEADER LINE.
DATA g_program_name LIKE sy-repid.
DATA g_syntax_message(128).
DATA g_line_no TYPE i.
DATA var TYPE p.
AT SELECTION-SCREEN.
PERFORM check_dynamic_abap.
START-OF-SELECTION.
PERFORM do_the_business IN PROGRAM (g_program_name) CHANGING var .
WRITE:/ p_code1 NO-GAP,'=' NO-GAP,var.
*& Form CHECK_DYNAMIC_ABAP
FORM check_dynamic_abap.
DATA t_abap(80) OCCURS 0 WITH HEADER LINE.
*set up a dynamic program
REFRESH t_source_tab.
APPEND 'REPORT' TO t_source_tab.
APPEND sy-repid TO t_source_tab.
APPEND '.' TO t_source_tab.
APPEND 'FORM do_the_business changing var type p.' TO t_source_tab.
APPEND 'var =' TO t_source_tab.
append p_code1 to t_source_tab.
APPEND '.' TO t_source_tab.
APPEND 'ENDFORM.' TO t_source_tab.
*Generate the dynamic program so that the form can be used subsequently.
GENERATE SUBROUTINE POOL t_source_tab NAME g_program_name
MESSAGE g_syntax_message LINE g_line_no.
IF sy-subrc <> 0.
MESSAGE e999 WITH g_syntax_message.
ENDIF.
ENDFORM. . "CHECK_DYNAMIC_ABAP
Similar Messages
-
I have an SQL Server function to take a JDEdwards numeric date and convert it to an SQL Date field.
CREATE FUNCTION [dbo].[date_ccyyddd_to_mmddyyyy]
@JulianDate as Numeric(18,0)
RETURNS Date
AS
BEGIN
Declare @ResultDate as Date
Set @ResultDate = DATEADD(YEAR, @JulianDate / 1000 + 1899, Cast('01/01/0001' as Date))
Set @ResultDate = DATEADD(Day, @JulianDate % 1000 -1, @ResultDate)
RETURN @ResultDate
END
In many query based reports we have used the function. It works quite nicely for all but one user. For this one user Crystal is casting the date result as a string, it will then display as a yyyy-mm-dd format instead of his default mm/dd/yyyy short date format. It would generally be ok but since it is typed as a string if the user exports the results to excel it is not recognizing the column as a date either. The strange piece of the equation is that if the user saves the report to the enterprise server and I open it, go to edit the SQL command, do nothing, close the edit box, it gives me the unmapped fields wizard where I can fix the report. Thus when I open or generate a new report with this function it "knows" the result is a date but with a specific user it sees the result as a string.
Has anyone had a similar situation or can lead me in the correct direction to fix this? Unfortunately, this user is our power user, he writes more reports than anyone else. It appeared as a problem when we upgraded from Crystal Enterprise 2008 to 2013.
Current work around for user is to use a crystal CDate() function on the report side but I would like to get the correct solution.
Any assistance appreciated,To add to Dell's suggestion:
If OLE DB then use:
MS SQL 2005 - OLE DB Provider
MS SQL 2008 - SQL Native 10
MS SQL 2012 - SQL Native 11
MS SQL 2013 - SQL Native 11
If ODBC then use:
MS SQL 2005 - SQL Native
MS SQL 2008 - SQL Native 10
MS SQL 2012 - SQL Native 11
MS SQL 2013 - SQL Native 11
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter -
How to calculate the results in SAP HR TEM
Hi Experts,
I am the fresher of SAP HR(TEM)consultant.My client wants to upload the historical data into SAP HR TEM. When i am calculating the results of employees, that means competent or non competent using with followup transaction code, but it showing no qualification were found which could be transferred.
can you please help me how to solove this problem.
Thanks,
Swathi.Hi Srininvas,
Thanks for your immediate responce,
Actually the historical data means,employees who attended the training in the last month.I need to upload these data into SAP HR(TEM). I created business event group, business event type and business event(using without resources). I assign attendees for the business event.when i want to calculate the results that means competent or non competent by using PV15-followup transaction code it will showing no qualifications were found which could be transferred in the qualifications to be transferred coloum,and i it will not showing me attendee name,qualification and proficiency that means competent or non competent.
can you please mail me config.docs of TEM to [email protected]
Thanks,
Swathi. -
How to calculate byte size of a string
Hi forum;
Can you tell me how can I calculate byte count of a string.Tahir wrote:
I read somewhere that string 0123456789ABCDEFFEDCBA987654321089ABCDEF01234567 is 192 bit. Where as it is 48 Byte (one char = 1 byte) or 384 Bits. But 192*2=384. So whats this math? Any pointer?It depends what you mean by "byte count", because it's likely to depend on the character encoding you choose, but the definitive answer is probably to use getBytes(). For example:
String s = "0123456789ABCDEFFEDCBA987654321089ABCDEF01234567";
System.out.println(s.getBytes("utf8").length);displays 48, but
System.out.println(s.getBytes("unicode").length);displays 98.
Not quite sure why the extra 2 bytes, but I'm sure someone else will know.
Winston -
Converting Oracle XML Query Result in Java String by using XSU
Hi,
I have a problem by converting Oracle XML Query Result in Java
String by using XSU. I use XSU for Java.
For example:
String datum=new OracleXMLQuery(conn,"Select max(ps.datum) from
preise ps where match='"+args[0]+"'");
String datum1=datum;
I become the following error:
Prototyp.java:47: Incompatible type for declaration. Can't
convert oracle.xml.sql.query.OracleXMLQuery to java.lang.String.
Can somebody tell me a method() for converting to solve my
problem??????
ThanksHmmm.. Pretty basic just look at the example:
OracleXMLQuery qry = new OracleXMLQuery(conn,"Select max(ps.datum) from preise ps where match='"+args[0]+"'");
String xmlString = qry.getXMLString();
Hi,
I have a problem by converting Oracle XML Query Result in Java
String by using XSU. I use XSU for Java.
For example:
String datum=new OracleXMLQuery(conn,"Select max(ps.datum) from
preise ps where match='"+args[0]+"'");
String datum1=datum;
I become the following error:
Prototyp.java:47: Incompatible type for declaration. Can't
convert oracle.xml.sql.query.OracleXMLQuery to java.lang.String.
Can somebody tell me a method() for converting to solve my
problem??????
Thanks -
How to calculate the length of a string
Hi everyone,
A simple question. How to calculate the length of a string?
Thanks!Hi Wuyia Nata,
As everyone has suggested you search the forum before posting a question, i guess for basic questions u never have to post a question, you will get the answer in your search. Anyways see the code below for string lenght.
Data:
w_string type string,
w_lenght type i.
w_string = 'vhdskbvsdkbvdsvnsknvs'.
w_lenght = strlen( w_string ).
Write:
w_lenght.
With luck,
Pritam. -
Unexpected "result of the string concatenation is too long" error
Hello,
I am using Oracle Database 11.2.0.
When querying my database with a common table expression which concatenates VARCHAR2 strings, I receive an ORA-01489 error although I'm doubting that I am concatenating more than 4000 characters.
To be more precise, I have a table entity which basically stores XML elements including their parent element and their sibling position among its siblings. The CREATE statement for this table is listed below.
CREATE TABLE Entity (
ID NUMBER(10,0) NOT NULL PRIMARY KEY,
Name VARCHAR2(100) NOT NULL,
Parent NUMBER(10,0) REFERENCES Entity(ID),
Sibling_Pos NUMBER(2,0) DEFAULT 0
Now, I would like for all elements to be concatenated with their ancestor elements to a structure like this:
"/root_element(sibling_pos)/.../ancestor_element(sibling_pos)/parent_element(sibling_pos)/current_element(sibling_pos)"
(where root_element, ancestor_element, parent_element and current_element are just values from the name column of the entity table)
In order to achieve this, I use a common table expression which concatenates the name and sibling_pos values as shown below:
WITH entity_cte (lvl, id, path) AS (
SELECT 1 AS lvl, id, '/' || name || '(0' || sibling_pos || ')' AS path
FROM entity
WHERE parent IS NULL
UNION ALL (
SELECT lvl + 1 AS lvl, e.id, entity_cte.path || '/' || e.name || '(' || cast(e.sibling_pos AS VARCHAR2(2)) || ')' AS path
FROM entity_cte, entity e
WHERE entity_cte.id = e.parent
SELECT lvl, id, path
FROM entity_cte e
After inserting certain values, I get the ORA-01489 error, that the result of the string concatenation is too long. The maximum is referred to as being 4000 characters for VARCHAR2 in the oracle documentation and in various websites. Of course, it is clear to me by just using the common table expression like that, I could run into such an error. However, due to the structure of my XML documents, I doubted that the resulting strings would be more than 4000 characters long.
So, I rearranged my query in order to count the characters to be concatenated instead of actually concatenating them. The query is stated below as well, the changes are marked bold:
WITH entity_cte (lvl, id, path) AS (
SELECT 1 AS lvl, id, length('/' || name || '(0' || sibling_pos || ')') AS path
FROM entity
WHERE parent IS NULL
UNION ALL (
SELECT lvl + 1 AS lvl, e.id, entity_cte.path + length('/' || e.name || '(' || cast(e.sibling_pos AS VARCHAR2(2)) || ')') AS path
FROM entity_cte, entity e
WHERE entity_cte.id = e.parent
SELECT lvl, id, path
FROM entity_cte e
ORDER BY path DESC
The result of the query gives me a maximum length of 319 characters.
To be sure, I also checked the maximum level depth (indicated by the column named lvl in the common table expression), meaning the maximum number of elements in my path (the concatenated string). The result is 18. As I use VARCHAR2(100) for the name column and add 5 charcaters in each level, the maximum number of characters expected for 18 levels would be 1890.
So, now I wonder is the ORA-01489 maybe raised for another reason? Or is there something else I am missing?
Any help would be appreciated. Further suggestions to track down the error are more than welcome. Thanks in advance.Thanks for the hint, BluShadow.
Still, I don't reach that limit of 1000 characters with my actual data (yet). I understand that if my data changes, I might run into that error with the given query. But I don't understand why this error is raised with the given data I have. The longest string in the column "name" is 32 characters long up to now. When I'm adding 5 characters on each level and I only have max 18 levels that should only result in max 2664 bytes.
@odie_63
The database characterset is: AL32UTF8. If I googled correctly, than it just confirms what BluShadow said, that one character is represented by max 4 byte.
Regarding the sample data, the XML document that I am inserting and which causes the error comprises 1058 nodes. That means I have 1058 entries in my entity table. I think it would be no sense posting all of it here, but is there a way that I can attach a text file containing an insert script to this post?
Some sample data from the entity table orderd by the length of the string in the name column are shown below.
"ID" "NAME" "TYPE" "PARENT" "SIBLING_POS"
90 "representedCustodianOrganization" 1 89 0
109 "serviceProviderOrganization" 1 108 0
58 "standardIndustryClassCode" 1 55 2
186 "standardIndustryClassCode" 1 173 7
150 "standardIndustryClassCode" 1 137 7
106 "dischargeDispositionCode" 1 99 4
35 "administrativeGenderCode" 1 29 3
932 "substanceAdministration" 1 931 0
950 "substanceAdministration" 1 949 0
1043 "representedOrganization" 1 1041 1
71 "representedOrganization" 1 61 6
137 "representedOrganization" 1 128 5
173 "representedOrganization" 1 163 6
504 "substanceAdministration" 1 503 0
223 "representedOrganization" 1 221 1
252 "representedOrganization" 1 250 1
272 "representedOrganization" 1 270 1
477 "substanceAdministration" 1 476 0
481 "manufacturedLabeledDrug" 1 480 0
207 "representedOrganization" 1 205 1
802 "specimenPlayingEntity" 1 801 0
830 "specimenPlayingEntity" 1 829 0
844 "specimenPlayingEntity" 1 843 0
858 "specimenPlayingEntity" 1 857 0
99 "encompassingEncounter" 1 98 0
788 "specimenPlayingEntity" 1 787 0
676 "specimenPlayingEntity" 1 675 0
704 "specimenPlayingEntity" 1 703 0
718 "specimenPlayingEntity" 1 717 0
746 "specimenPlayingEntity" 1 745 0
Any help or further suggestion are appreciated. Thank you. -
Hi,
This is atually a follow-up to other post in the same forum: <b>Sending XMl message as text (Mail body) by receiver mail adapter</b>
We are having problem with UDF to get correct output.
We are getting <b>result of UDF</b> as below:
[[Ljava.lang.String;@f37573 [Ljava.lang.String;@1a409ed [Ljava.lang.String;@87c011 [Ljava.lang.String;@52a077 [Ljava.lang.String;@a4e8e5<BR>[Ljava.lang.String;@f37573 [Ljava.lang.String;@1a409ed [Ljava.lang.String;@87c011 [Ljava.lang.String;@52a077 [Ljava.lang.String;@a4e8e5<BR>[Ljava.lang.String;@f37573 [Ljava.lang.String;@1a409ed [Ljava.lang.String;@87c011 [Ljava.lang.String;@52a077 [Ljava.lang.String;@a4e8e5<BR>[Ljava.lang.String;@f37573 [Ljava.lang.String;@1a409ed [Ljava.lang.String;@87c011 [Ljava.lang.String;@52a077 [Ljava.lang.String;@a4e8e5<BR>]
Does any body know what it mean?
Following are the source ans target XSD's:
Here is the <b>source xsd:</b>
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://NameSpace" targetNamespace="NameSpace">
<xsd:complexType name="row">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
5e090470385011db9654000e7f22e9d4
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="DeliveryNumber">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0a0377b11db91dbf237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="DeliveryLineItem">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0a1377b11db98aaf237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="6" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="OrderNumber">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0a2377b11dbc5c4f237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="OrderLineItem">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0a3377b11db9d84f237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="6" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BillToID">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0a4377b11dbb49bf237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="17" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BillToName">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0a5377b11dbb38ff237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="40" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ShipToID">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0a6377b11db9370f237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="17" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ShipToName">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0a7377b11dbb66cf237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="40" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ProductCode">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0a8377b11db8f94f237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="18" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ProductDesc">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0a9377b11db929ff237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="40" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ScheduledLoadDate">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0aa377b11db8d1df237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="8" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ScheduledLoadTime">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0ab377b11dba57ff237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="6" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Carrier">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0ac377b11dbcc03f237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="40" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CustomerPO">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0ad377b11dbb5a2f237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="35" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="OutYard">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0ae377b11dbcc51f237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="16" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="OrderedQty">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0af377b11dbbe6cf237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="15" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="OrderUofM">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0b0377b11db9264f237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="3" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LabConc">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0b1377b11dbb0e7f237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="50" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="GrossMT">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0b2377b11db99f1f237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="4" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="GrossST">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0b3377b11db9b6ff237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="4" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BilledQty">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0b4377b11db8a9af237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="8" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Status">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
9d3ac0b5377b11dba39cf237ac102206
</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="resultset">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
5e044980385011dbb2d3000e7f22e9d4
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="row" type="row" maxOccurs="unbounded">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
c1cb8fd0377b11db912af237ac102206
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<b>Target xsd:</b>
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.com/xi/XI/Mail/30" targetNamespace="http://sap.com/xi/XI/Mail/30">
<xsd:element name="Mail">
<xsd:annotation>
<xsd:documentation>
Mail package for XI - Mail Adapter
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Subject" type="xsd:string" minOccurs="0" />
<xsd:element name="From" type="xsd:string" minOccurs="0" />
<xsd:element name="To" type="xsd:string" minOccurs="0" />
<xsd:element name="Reply_To" type="xsd:string" minOccurs="0" />
<xsd:element name="Content_Type" type="xsd:string" minOccurs="0" />
<xsd:element name="Date" type="xsd:dateTime" minOccurs="0" />
<xsd:element name="Message_ID" type="xsd:string" minOccurs="0" />
<xsd:element name="X_Mailer" type="xsd:string" minOccurs="0" />
<xsd:element name="Content" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
any type
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="encoding" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:schema>
And <b>following is the UDF we are using</b>:
=========================================
String mailBody = new String();
int inta, intb, intc, intd, inte;
inta = a.length;
intb = b.length;
intc = c.length;
intd = d.length;
inte = e.length;
for(int i = 0; i < a.length; i++)
mailBody = mailBody + a + " " + b + " " + c + " " + d + " " + e + "<BR>";
result.addValue(mailBody);
====================================
<b>Any help to resolve this would be very helpful.</b>
Thanx
SueHi Bhavesh,
We are getting following error if we use the UDF you given below:
Check Result for Object test Source code has syntax error: D:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapf2026120390a11db9d1f000e7f22e9d4/source/com/sap/xi/tf/_test_.java:75: a is already defined in testUDF$(java.lang.String[],java.lang.String[],java.lang.String[],java.lang.String[],java.lang.String[],com.sap.aii.mappingtool.tf3.rt.ResultList,com.sap.aii.mappingtool.tf3.rt.Container) int a = a.length(); ^ D:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapf2026120390a11db9d1f000e7f22e9d4/source/com/sap/xi/tf/_test_.java:75: int cannot be dereferenced int a = a.length(); ^
We have no knowledge of java at all.
We did some modifications to it as below:
String mailBody = new String();
int a = a.length();
int b = b.length();
int c = c.length();
int d = d.length();
int e = e.length();
for(int i = 0; i < a.length(); i++)
mailBody = mailBody + a + " " + b + " " + c + " " + d + " " + e + "<BR>";
result.addValue(mailBody);
It it didn't work. Think we are missing something. Can please help us to figure it out.
Thanx
Sue -
How to get the resulting XML as string
Hello,
I think my question is very simple but i'm new in this area.
What i'm try to do is to parse a XML document with the DOM parser. Then i manipulate the DOM tree. After finishing the process i want to get the resulting XML document as an InputStream to give to another application for storing back into the database.
Until know i print the resulting XML to System.out or I write it to a file.
Do you know where i can find more information about this? Sample code??
Thanks!<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jinyu Wang ([email protected]):
You can try following code. It is not the simplest way, but it works for me:
// Print to temp buffer
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream output = new DataOutputStream(baos);
Xml_doc.print(output);
String outtemp=baos.toString();
System.out.println(outtemp);
include following line for the lib:
import java.io.*;<HR></BLOCKQUOTE>
Many thanks for the reply. It works! -
Calculate a result from a variable input
Hello,
I want to get a particular value for a characteristic when I run the query. I have a query that will return actual results for the month/year (MTD) that the user enters at the beginning. It will also show actual results for two months prior to the current month, budgeted values for current month, actual values for the year, budgeted values for the current year.
I want to calculate the number of patients from an invoice for the current month (MTD), and for all the other fields mentioned above. I want to restrict them to a particular code and their recipient ID. Do I have to write a customer exit and then include it in a formula variable? Ive dont have much experience in doing this. Any help would be greatly appreciated.
Jul 2006 Aug 2006 Sept 2006 Sept 2006 Bud YTD 2006 Act YTD 2006 Bud
of patients
Code A
Code B
Code C
Im using a multiprovider and one of the cubes included is the Invoice cube.
Thanks
SamYou could do this sort of thing:
REPORT znrw_calculator MESSAGE-ID z1.
PARAMETERS: p_code1(20) LOWER CASE.
DATA t_source_tab(72) OCCURS 0 WITH HEADER LINE.
DATA g_program_name LIKE sy-repid.
DATA g_syntax_message(128).
DATA g_line_no TYPE i.
DATA var TYPE p.
AT SELECTION-SCREEN.
PERFORM check_dynamic_abap.
START-OF-SELECTION.
PERFORM do_the_business IN PROGRAM (g_program_name) CHANGING var .
WRITE:/ p_code1 NO-GAP,'=' NO-GAP,var.
*& Form CHECK_DYNAMIC_ABAP
FORM check_dynamic_abap.
DATA t_abap(80) OCCURS 0 WITH HEADER LINE.
*set up a dynamic program
REFRESH t_source_tab.
APPEND 'REPORT' TO t_source_tab.
APPEND sy-repid TO t_source_tab.
APPEND '.' TO t_source_tab.
APPEND 'FORM do_the_business changing var type p.' TO t_source_tab.
APPEND 'var =' TO t_source_tab.
append p_code1 to t_source_tab.
APPEND '.' TO t_source_tab.
APPEND 'ENDFORM.' TO t_source_tab.
*Generate the dynamic program so that the form can be used subsequently.
GENERATE SUBROUTINE POOL t_source_tab NAME g_program_name
MESSAGE g_syntax_message LINE g_line_no.
IF sy-subrc <> 0.
MESSAGE e999 WITH g_syntax_message.
ENDIF.
ENDFORM. . "CHECK_DYNAMIC_ABAP -
Hello I am a wedding planner and have decided to create new website. I would like to have the user make choices of different items and have it calculate so that they can print it off. Like an estimate of what costs would be to plan a wedding . I will be giving them different selections to choose from in drop down or radio selections .
I was thinking much like a shopping cart but that seems too involved is there a simpler way. Thank you for any help.Just based on your question I can tell that you're probably not experienced enough to develop something like a shopping cart. Hiring a web developer is the way to go, as previously said.
-
How could be calculate only result for cummulative value in Webi level?
Hi Expert,
I have to requirement on webi level only result calculation
scenario below like that
Company code % X
100 10
200 13
300 15
Result = only cummulative (not sum eg 38)
So how could be achieve only this result value ??
Pls advice
Regards
WaseemHi,
Gaurav and Arijit,
Thnks for reply
I have to need only Result values . I am giving one more scenario like that
Company code M J L D %
100 70 30 10 = 10/(70+30)*100 = 10
200 80 20 13 = 13/(80+20)*100 = 13
300 150 50 30 = 30/(150+50)*100 = 15
Result = L/(M+J)*M = 53/400*300 = 39.75
I hided the values M , J and L , need only result value above scenario so how could be achieve
pls reply
Regards
Waseem -
How could be calculate only result for cummulative value in bex level?
Hi Expert,
I have to requirement on bex level only result calculation
scenario below like that
Company code % X
100 10
200 13
300 15
Result = only cummulative (not sum eg 38)
So how could be achieve only this result value ??
Pls advice
Regards
WaseemHi Suman,
Thanks for reply
I had already applied its came only sum values
But i have to need only Result values . I am giving one more scenario like that
Comapny code M J L D %
100 70 30 10 = 10/(70+30)*100 = 10
200 80 20 13 = 10/(80+20)*100 = 10
300 150 50 30 = 30/(150+50)*100 = 25
Result = L/(M+J)*M = 53/400*300 = 39.75
I hided the values M , J and L , need only result value above scenario so could be achive
pls reply
Regards
Waseem -
Encoding of java string into euc-jp results in a string of question marks
Hi..
I am developing a java web application that has to display japanse (Kanji) characters. The contents are retrieved from the DB (sybase), encoded using euc-jp and written into an HTML file on the server by a java program. These 'cached' HTML files are picked up to be displayed on the browser. The code that I am using to do the encoding is as below
try
strDataFromDB = getDateFromDB();
encodedString = new String(strDataFromDB, 'euc-jp');
System.out.println("encodedString is " + encodedString);
catch (UnsupportedEncodingException ex)
ex.printStackTrace();
/* Code to write encodedString into the HTML file goes here */However the encodedString value is generated as a string of ???? characters. This behaviour is observed only in our production environment. The test environment does the encoding properly even when connected to the production DB.
Am using the following versions
Server - Red Hat Linux 3.0
App server - Tomcat
JRE - 1.4.2_11
Can somebody help me finding what is going wrong ? Is there any dependancy of the encoding process on some OS parameter that I need to check ?
Thanks in advance,
LalaWell, 4 duke bucks for me, it's charset, not charSet...
-
I have following table
col1 col2
A mouse
B mouse
C mouse
D keyboard
E keyboard
I need to write a query which will give me an output
mouse - A, B, Cthis?
SQL> WITH T AS
2 (SELECT 'A' col1, 'mouse' col2 FROM DUAL
3 UNION ALL
4 SELECT 'B', 'mouse' VALUE FROM DUAL
5 UNION ALL
6 SELECT 'C' ,'mouse' VALUE FROM DUAL
7 UNION ALL
8 SELECT 'D' ,'keyboard' VALUE FROM DUAL
9 UNION ALL
10 SELECT 'E', 'keyboard' VALUE FROM DUAL
11 )--------- end of data
12 SELECT col2
13 , SUBSTR(MAX(SYS_CONNECT_BY_PATH(col1, ',' )),2) con
14 FROM ( SELECT col2
15 , col1
16 , row_number() OVER (PARTITION BY col2 ORDER BY col2) rn
17 FROM T
18 )
19 START WITH rn = 1
20 CONNECT BY PRIOR rn = rn-1
21 AND PRIOR col2 = col2
22 GROUP BY col2;
COL2 CON
keyboard D,E
mouse A,B,C
Maybe you are looking for
-
Can't sync my iPhone 3gs: "store->authorize... ok", "sync ... your compurter is no longer authorized..." error how to solve this issue, help me
-
BP email does not show in list
Hi All. A client is experiencing an issue where one user cannot view the BP's email address. They go to the BP master data screen, does a wildcard search so that a list of all BP's comes up. Even when they do a wildcard search on the email filed it d
-
Class Object array!!! HELP
Customer[] C = new Customer[100]; // Trying to call a constructor from an object of a class Customers C[1].("01", Tom Evans", 6500,"36 Lakes st ", "05/07/2004", 900); // it want let me do this !!! :(Please tell me what are my alternatives appart from
-
I cannot define where the problem is... It is charging when it is in 70% below but when it reaches 80% it indicates that "plugged in, not charging" why is this happening? Help me please..
-
Hierarchy - drill from master to detail
Hi, BOXI 3.1 on RHEL 5 connecting to MySQL 5 I'm keen to test a hierachial report. OUr users want to have a report that displays master or summary info and then they want the ability to srill down and see detailed info associated with that same recor