How to handle "byte" data type
Hi,
In web dynpro java project to consume a web service, I am unable to handle "byte" data type in binding wizard. It is not allowing to bind a element saying that "Context Attribute with Java Native Type BYTE cannot be selected". Please help me to resolve this.
Thank you.
Regards
Bhanu.
Hi
you can define byte[] in golobal area, at the end of iview.
//@@begin others
byte b1[];
//@@end
IWDResource r;
byte b[];
InputStream inputStream;
try {
inputStream = r.read(true);
int x = inputStream.read(b);
} catch (IOException e) {
e.printStackTrace();
Regards
Anup
Similar Messages
-
How to handle "Variant" data type?
I am using SQL 2000, and want to use "Variant" data type. Can I handle it in java with ODBC connection? What classes and methods need I use? Thanks a lot.
ODBC does not have a notion of variant types. This limits the use of the sql_variant data type with an ODBC driver in SQL Server 2000. In SQL Server 2000, if binding is specified, the sql_variant data type must be bound to one of the documented ODBC data types.
(Quote from http://msdn.microsoft.com/library/en-us/odbcsql/od_6_020_28yr.asp )
Possible solutions:
- CAST or CONVERT the datatype to another suitable data type in the query
OR
- Retrieve the column as a binary stream -
How to handle NUMBER data type of SQL
Hello All,
I have to call an Oracle store procedure developed by 3rd party, it has once of the input parameter as NUMBER.
Since NUMBER SQL data type is not support by PI 7.0 (http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b72b2fde93673e10000000a114a6b/content.htm),
when I am execute this scenario, it through an error for - Unsupported parameter type 'NUMBER'.
I cannot change the store procedure or any thing in Oracle.
I gone through some thread but did not find any help. NUMBER type for Oracle SP
Please let me know if there any work around.
Thanks in Advance.
PradeepThanks for your reply.
I cannot customize the stored procedure parameter to NUMERIC, as this is standard SP is from a product.
Below is the final XML generated with error on PALC and PREL parameter for NUMBER, ideally it should be
<PALC isInput="true" type="NUMBER"/>
<PREL isInput="true" type="NUMBER"/>
<Statement xmlns="">
<LSA_REL_DM action="EXECUTE">
<table>ACQDR.lsa_rel_dm</table>
<PPROJECTID isInput="true" type="VARCHAR">85LJ24210</PPROJECTID>
<PDMC isInput="true" type="VARCHAR">LJ200-A-J00-00-00-00-00AAA-00K-AA</PDMC>
<PLCN isInput="true" type="VARCHAR"/>
<PALC isInput="true"/>
<PTYPE isInput="true" type="CHAR"/>
<PSOURCE_CODE isInput="true" type="VARCHAR"/>
<PREL isInput="true"/>
<PRFU isInput="true" type="VARCHAR"/>
<POBJECT isInput="true" type="BLOB"><dmodule xsi:noNamespaceSchemaLocation="C:/Projects/S1000D/Document/schema/TIR_Parts_Vendors.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><identAndStatusSection><dmAddress><dmIdent><dmCode modelIdentCode="LJ200" systemDiffCode="A" systemCode="J00" subSystemCode="00" subSubSystemCode="00" assyCode="00" disassyCode="00" disassyCodeVariant="AAA" infoCode="00K" infoCodeVariant="A" itemLocationCode="A"/><language languageIsoCode="US" countryIsoCode="sx"/><issueInfo issueNumber="0" inWork="1"/></dmIdent><dmAddressItems><issueDate year="20111107" month="20111107" day="20111107"/><dmTitle><techName>General</techName><infoName>Organizations technical information repository</infoName></dmTitle></dmAddressItems></dmAddress><dmStatus><security securityClassification="01"/><responsiblePartnerCompany enterpriseCode="24210"><enterpriseName>Learjet</enterpriseName></responsiblePartnerCompany><originator enterpriseCode="24210"><enterpriseName>Learjet</enterpriseName></originator><applicCrossRefTableRef><dmRef><dmRefIdent><dmCode modelIdentCode="LJ200" systemDiffCode="A" systemCode="J00" subSystemCode="0" subSubSystemCode="0" assyCode="00" disassyCode="00" disassyCodeVariant="A" infoCode="00W" infoCodeVariant="A" itemLocationCode="A"/></dmRefIdent></dmRef></applicCrossRefTableRef><brexDmRef><dmRef><dmRefIdent><dmCode modelIdentCode="LJ200" systemDiffCode="A" systemCode="J00" subSystemCode="0" subSubSystemCode="0" assyCode="00" disassyCode="00" disassyCodeVariant="A" infoCode="022" infoCodeVariant="B" itemLocationCode="D"/></dmRefIdent></dmRef></brexDmRef></dmStatus></identAndStatusSection><content><techRepository><partRepository/></techRepository></content></dmodule></POBJECT>
<PSTATUS isInput="true" type="CHAR">D</PSTATUS>
<PISSTYPE isInput="true" type="CHAR"/>
<POBJECT_CLASS isInput="true" type="VARCHAR">XML</POBJECT_CLASS>
</LSA_REL_DM>
</Statement>
Thanks in Advance -
How to handle boolean data type
class one{
public static void main(String args[]){
two obj=new two();
int number=5;
boolean answear=obj.greater(number);
if(answear=true){
System.out.println("number is greater than 3");}
else {
Sytem.out.println("number is less than 3"); }
//main
}//class
class two{
boolean greater(int no){
if (no>=3) return true;
else return false;
}//greater
}//class two
What i want is to pass variable 'number' in to
class two method greater and print the greatest
number in main method.
but this don't give me the correct answear . whats wrong .
Please help me..You must be getting the output as
number is greater than 3
everytime. right?
its because of this line
if(answear=true)
This line will make the if loop as true everytime irrespective of answear, as you are not comparing true with answear but ur assigning true to answear.
it should be
if(answear == true)
then it will work -
Regardibg double byte data type in Xi(japanese character)
hi am giving japanese character(double byte) as a input data types, will you please tell me how to give whether as a string or constant ..etc. and please give information generally about double byte data type
regards,
S.K.Karthikeyan.Hi Stefan,
I got your point it's really helpful for me.
I have one more doubt;
Is there any equivalent type for double byte char in XI ?
regards,
S.K.Karthikeyan. -
Problem loading PostgreSQL Bytea data type to Oracle Raw data type
We are migrating our database from PostgreSQL to Oracle. First, we convert the BYTEA data type in PostgreSQL to Oracle RAW. The BYTEA data type is variable bytes array. How can we load the BYTEA data type to Oracle RAW data type? Or I have to convert to different data type. thanks.
Peter,hi,
Instead of 'interval day to second' in method declaration use internal datatype 'DSINTERVAL_UNCONSTRAINED'.
There are more unconstrained types in oracle.
Bartek -
Unsigned byte: Java byte data type (0-255)?
I need an "unsigned" byte type.
How can I implement a one byte data type with values from 0-255 in Java?No there isn't an unigned byte, but you don't need
one. You just separate storage representation from
calculation representation. When you store the
"unsigned byte" you use a signed byte. When you make
calculations on the "unsigned byte" you use an
integer. For this you need two conversion functions,
public static int toInt(byte b) {
return b + 128;
public static byte toByte(int i) {
return (byte)(i - 128);
}These amazing functions must be tested off course.
public void testUnsigned(int unsgn) {
byte bA[] = new byte[1];
int i = unsgn; // 0 to 255
bA[0] = toByte(i); // stored as -128 to 127
int j = toInt(bA[0]); // 0 to 255
if (i==j)
System.out.println("Yes it works!");
Sorry, but your code doesn't work. I also tried the byte & 0xFF and I get strange results too. 0xFF transfer to 129, which (I think, but maybe I'm wrong) should transfer to 255 (0xFF == 1111 1111, no?). After some tests, I found that "ounos" solution is the best fitted (byte < 0 ? b+256 : b)
If you only do a (byte + 128), you'll get, for example:
0000 0000 (should be 0) == 128
I think that only 1 case is enough to proove that this code doesn't work... :-) -
How to find the Data Type of a column
Dear All,
How to find the Data Type of a Column dynamically in oracle Form.
Thanks and Regards,
Fazil
Edited by: user11334489 on Aug 25, 2012 9:06 PMhi,
you can use get_item_property built-in
eg:
declare
l_item VARCHAR2(10);
begin
l_item := Get_Item_Property('item_name',DATATYPE);
end; -
In BDC how you handled header data and item data
In BDC how you handled header data and item data
Raja,
Can you be more clear ?
Usually you load the header data one and then loop at the item data and then load the item data.
This example should help you.
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Regards,
Ravi
Note - Please mark all the helpful answers -
How to add TIMESTAMP data type in Enterprise Architect...?
Hi all
There is no data type of timestamp in Enterprise Architech. There is only
DATE type. I have ERD prepared from Enterprise Architech. How to modify
DATE type to TIMESTAMP type.
How to add TIMESTAMP data type in Enterprise Architect or in ERD ?
Thanks in advance,
PalHave you asked this question of the vendor of Enterprise Architect? They may have a later version that supports the various TIMESTAMP data types. If your ERD tool doesn't support a data type, other than talking to the vendor or working around the problem (i.e. generate DDL to a text file and edit it before applying it to the database), you're probably out of luck.
Justin -
How to use same Data Type and Length for two fields
How to use same data type and length for two fields when using 'FOR ALL ENTRIES IN' in a select statement? For instance the select queries are :
SELECT bukrs gjahr belnr lifnr budat bldat zlspr dmbtr waers shkzg
FROM bsik
INTO TABLE it_bsik
WHERE bukrs = p_bukrs
AND lifnr IN s_lifnr.
IF it_bsik IS NOT INITIAL.
SELECT belnr gjahr awkey awtyp
FROM bkpf
INTO TABLE it_bkpf
FOR ALL ENTRIES IN it_bsik
WHERE belnr = it_bsik-belnr
AND gjahr = it_bsik-gjahr.
IF it_bkpf IS NOT INITIAL.
SELECT belnr gjahr lifnr xblnr
FROM rbkp
INTO TABLE it_rbkp
FOR ALL ENTRIES IN it_bkpf
WHERE belnr = it_bkpf-awkey+0(10)
AND gjahr = it_bkpf-awkey+10(4).
ENDIF.
ENDIF.
Here it gives an error in the 3rd select query that 'When you use the addition "FOR ALL ENTRIES IN itab", the fields "GJAHR" and "IT_BKPF2-AWKEY+10(4)" must have the same type and the same length.'
Kindly clarify.Hi Saurabh,
Please see the example code that I have developed for you. It will help you solve the problem.
REPORT ZTEST_3 .
tables : BKPF.
data : begin of it_bkpf occurs 1,
belnr type RE_BELNR,
awkey type awkey,
awtyp type awtyp,
gjahr type GJAHR,
end of it_bkpf.
data : begin of it_bkpf1 occurs 1,
belnr type RE_BELNR,
awkey type gjahr, " change the data type
awtyp type awtyp,
gjahr type GJAHR,
end of it_bkpf1.
data : begin of it_rbkp occurs 1,
belnr type BELNR_D,
gjahr type gjahr,
lifnr type LIFRE,
xblnr type XBLNR,
end of it_rbkp.
select belnr
awkey
awtyp
gjahr
from bkpf
into table it_bkpf
where BUKRS = 'TELH'.
loop at it_bkpf.
it_bkpf1-belnr = it_bkpf-belnr.
it_bkpf1-awkey = it_bkpf-awkey+10(4). "Here only append the required length.
it_bkpf1-awtyp = it_bkpf-awtyp.
it_bkpf1-gjahr = it_bkpf-gjahr.
append it_bkpf1.
clear it_bkpf1.
endloop.
select belnr
gjahr
lifnr
xblnr
from RBKP
into table it_rbkp
for all entries in it_bkpf1
where belnr = it_bkpf1-belnr
This is just an example. Change the fields according to your requirement.
Regards
Abhii
Edited by: Abhii on Mar 9, 2011 9:08 AM -
How to read XI Data type in Java code and populate as array list, using UDF
Hi,
How to read XI Data type in Java code and populate as array list, using UDF?
Is there any API using which the XI data types can be read?
Kindly reply.
RichaInput Structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
<CUSTOMER>
<item>
<CUSTOMERNO/>
<MDMCUSTOMER/>
<CREATE_DATE/>
<RETURN>
<TYPE/>
<MESSAGE/>
</RETURN>
<PT_CONTPART_RETURN>
<item>
<MDM_CONTACT/>
<CONTACT/>
</item>
</PT_CONTPART_RETURN>
<PARTNERS>
<item>
<CUSTOMERNO/>
<PARTNER_FUNCTION/>
<PARTNER_NUMBER/>
<DEFAULT_PARTNER/>
</item>
</PARTNERS>
</item>
</CUSTOMER>
</ns0:CustomerCreateResp>
Output structure
(Sample output structure.This actually needs to be mapped and generated using UDF)
<?xml version="1.0" encoding="UTF-8"?>
<ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer> -
can anyone tell me how to handle time&date correctly?using Calendar,GregorianCalendar,TimeZone,Locale
thank you very muchThis is too large a topic to discuss in depth here. Here is a link to a tutorial on times and dates, and a search link that references many documents on the subject.
http://java.sun.com/docs/books/tutorial/i18n/format/dateintro.html
http://onesearch.sun.com/search/developers/index.jsp?and=calendar+&nh=100&phr=how+to&qt=¬=&field=&since=&col=javatecharticles&col=javatutorials&col=devall&rf=0&Search.x=20&Search.y=7
When you have specific questions, just ask. -
SAP ABAP have the ability to handle complex data types
Hi all,
We are developing a Function Module/BAPI that is actually sending and receiving information to and from a third-party system and none of them are "complex data types".
I have a question does SAP ABAP have the ability to handle complex data types ???could you give an instance of the same...& to what extent can it handle???
we have a web service layer to handle complex data types between BAPI calls and the third party system. -
How to handle multiple exception types in JSF 2?
I'm trying to handle multiple exception types in JSF2, including a default error page for any unexpected exception types. The problems I'm having are:
1) ViewExpiredException is handled only when no generic exception handler is specified
2) "Regular" exceptions like NullPointerException are never handled
My managed bean:
@Named
@SessionScoped
public class MyController implements Serializable {
/* A method that does nothing */
public void doNothing() {
//do nothing
/* Generate a null pointer exception on purpose */
public void generateNpe() throws NullPointerException {
Object x = null;
x.toString();
My test page to generate the exception:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>Test page</title>
</h:head>
<h:body>
<h:form>
<h:commandButton id="button1" value="do nothing" action="#{myController.doNothing}" />
<h:commandButton id="button2" value="generate NPE" action="#{myController.generateNpe}" />
</h:form>
</h:body>
</html>
My web.xml:
<!-- Redirect all NPEs to this page; this never works! -->
<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/error/error003.jsf</location>
</error-page>
<!-- Redirect all VEEs to this page; this works fine if the next section is excluded -->
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/error/error002.jsf</location>
</error-page>
<!-- This grabs everything, even with the previous sections defined. If I exclude this error-page section, VEE works fine but NPE still does not get redirected -->
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error/error001.jsf</location>
</error-page>My questions are as follows:
1) How can we handle "regular" java exceptions like NPE?
2) How can we define a catch-all for unexpected exception types, while still respecting specific exception handlers for VEE, etc?
Thanks,
BenjaminIs your data model right? If you are adding in one and deleting in another it sounds to me more like a process that an entity, in which case you may revisit your data model and simplify it, add in a session bean with the process method to co-ordinate between the two.
However, if you want to map multiple different tables within a single entity bean it is possible and just part of the mapping. How you actualyl specify it depends on which implementation you are working with.
Cheers,
Peter.
Maybe you are looking for
-
Trying to install iTunes on my XP machine after the operating system was reloaded. Getting a message "iTunes not installed correctly" Error 7 Windoes Error 998. Removed and retried installgot same message??????
-
Hi SAP Guru's I am Hari, new to SAP FI/CO. at the time of Postings keys F-43,F-53,F-44, i get the some error like this Vendor xxxxx has been blocked by the SAPUSER please find solution for this problem, if any get solution fot this problem, please
-
Inconsistent space after graphic frames
Hi, I'm trying to create a consistent-looking manual, where space after imported graphics is consistent. Currently, that is not proving to be easy. For example, look at the difference between the space after the first and second graphics below (the f
-
Product Information Name OrgChart Version 3.0 SP1 Build 0701040400 Hi we are having problems bringing the the objects that where created with the language spanish. On listing we are only getting 8 results for a search that in R/3 is getting a lot of
-
About communication method with integration server?
can anybody explain clearly what difference between using proxy and adapters at runtime? especially for adatpers,i am confused. there is a the following explanation in online help. Communication using adapters. In this case, you create interfaces for