Conversion Error in JCO due to BigDecimal.toString() change in Java 1.5
Hi folks,
we have a problem here. A field which is set through a java.math.BigDecimal(0) gets very funny values in JCo. We had a look insight JCo und found, that JCo.Record does the following with BigDecimals:
if ((value instanceof BigDecimal) && itype == 2)
try
BigDecimal bd=(BigDecimal) value;
bd=bd.setScale(super.decimals[index], 6);
encodeBCD(bd.toString(), index);
catch (Exception ex)
throw new ConversionException(ex.getMessage());
A value of 0 (and super.decimals[index]==7) is than translatet not to "0.0000000" but to "0E-7". This is a big difference to what JDK 1.4 used to print and encodeBCD fails with "0E-7". JCo with JDK 1.5 should use "toPlainString()" now at this place (or adopt encodeBDC), but that would not be downward compatible anymore...
OK, we solved this issu for now by transforming to a string ourself at a central point befor using "setValue" in JCo. The other way would be to use XML for all settings. But that would mean a change of the whole software.
Does anybody of you know of a different solution we could use? Or will there be a new JCo Version solving this?
Thanks
PS: try this code. It will make all clear to you:
BigDecimal bd = new BigDecimal(0);
BigDecimal bd1 = bd.setScale(7, BigDecimal.ROUND_HALF_EVEN);
BigDecimal bd2 = bd.setScale(6, BigDecimal.ROUND_HALF_EVEN);
System.out.println(bd.toString()+"=="+bd.toPlainString());
System.out.println(bd1.toString()+"!="+bd1.toPlainString());
System.out.println(bd2.toString()+"=="+bd2.toPlainString());
Result is:
0==0
0E-7!=0.0000000
0.000000==0.000000
Message was edited by: Daniel Becker
user712747 wrote:
When we are converting string to BigDecimal, in JAVA 1.5 it is post fixing with extra “0”(zero) if the string value ends with single “ ”0” (zero).That sounds very odd.
To overcome this we can use toPlainString() method in Java 1.5. But it is not feasible to make this change all over places in our code.Aha! This sounds like conversion from BigDecimal to String; not what you described above. And I have to admit, that change mystified me too, because it goes against the grain of backwards-compatibility. It's possible that it was meant to "standardize" output for floating-point values though.
Is there any fix available?Well, one thing might be to use toPlainString() in the places where you're having problems. The string produced by toString() is still suitable for converting back to BigIntegers (and will do so precisely; I believe the toPlainString() style could produce a BigDecimal with the same value but different scale), so unless you actually need the string for viewing you can leave it alone.
But as EJP says, post some code.
Winston
Similar Messages
-
Conversion error in JCo outbound call
hi all
i am working on making OUTBOUND call from SAP using JCo,
our SAP system is Unicoded and i am refering Jco example 5 from JCo2.1.8 demo.
i am able to make connection successfully , but while running test ABAP program for testing connection, i am getting Short dump error headed :
Conversion error "ECHOTEXT" from character set 4103 to character set 4102
A conversion error occurred during the execution of a Remote Function
*Call. This happened either when the data was received * or when it was
*sent. The latter case can only occur if the data is sent from * a Unicode
system to a non-Unicode system.
The current program had to be terminated because of an
error when installing the R/3 System.
my ABAP prg. is this :
REPORT z_jco_test.
PARAMETERS: requtext LIKE sy-lisel.
*ECHOTEXT LIKE SY-LISEL
**" RESPTEXT LIKE SY-LISEL
DATA: echotext type SYLISEL,
resptext LIKE sy-lisel,
rfctest TYPE TABLE OF rfctest,
wa_rfctest TYPE rfctest.
wa_rfctest-rfcdata1 = requtext.
wa_rfctest-rfcdata2 = 'Hello World'.
APPEND wa_rfctest TO rfctest.
CALL FUNCTION 'RFC_PING'
DESTINATION 'JCO'.
*CALL FUNCTION 'STFC_CONNECTION'
* EXPORTING
* requtext =
** IMPORTING
** ECHOTEXT =
** RESPTEXT =
CALL FUNCTION 'STFC_CONNECTION'
DESTINATION 'JCO'
EXPORTING
requtext = requtext
IMPORTING
echotext = echotext
resptext = resptext
TABLES
rfctest = rfctest.
WRITE: 'Echo Text: ', echotext.
WRITE: 'Response Text: ', resptext.
LOOP AT rfctest INTO wa_rfctest.
WRITE: / 'rfcdata1: ', wa_rfctest-rfcdata1.
WRITE: / 'rfcdata2: ', wa_rfctest-rfcdata2.
ENDLOOP.
i have made RFC connection unicode yes.
please guide meHelo!
We have a similar problem here. Could you please explain your solution in a bit more detail ?
Thanks in advance,
Markus -
No correction due to the value change in Rebate
Hi,
I followed the procedure but still it gives me the above error.
Run the SDBONT06 with the Agreement, but it gives me the error No correction due to the value change for the XXX invoices.
Also run the RV15B001 and RV15B002 and again run the SDBONT06 but still not resolved the issue.
Still anything i miss? please suggest
Thanks
HrishiHi Lakshmipathi,
No condition type was removed for the said invoices, but the prices has been changed manually has been observed, hence i think system pop the above message, i also checked the Note that you provided, but i did the right steps as per the note.
Any other input?
Thanks
Hrishi -
Unable to create shopping cart due to currency conversion error.
Hi,
We are currently working in a extended classic scenario. We have about 8 users connected under a common entity ( dept). Out of which for one user (user1) we are able to create the shopping cart and able to run the entire procurement cycle the entire cycle.
When we are trying to create a SHC with any other user ( user2 to 8) its giving the errors like
1) Currency Conversion Error ( to GBP). Please inform help desk.
2) Error in account assignment for item 0.
Attributes for all the users ( user1 to user8) are same and we are not getting any error in the attribute check as well.
Please suggest.Look up note 419423 + related notes to repair incorrect SRM users. What you report sounds a bit strange. A debugging session might be helpful too. Especially the 2nd error looks like something 'home-made'...
-
Short dump due to conversion error on screen
Hello all,
I have designed one screen, and throwing error message if perticular filed is blank as (message e002(z2)). If i keep the filed blank system is throwing error message but giving short dump because of 'Conversion error' .
Error analysis : 'The program has been interrupted and cannot resume. |
Program "SAPMZTIMECOLLECT_NEW" attempted to display fields on screen 0101.
| An error occurred during the conversion of this data. '
Please, could you help to understand why system is giving short dump.
Thanks in advance..!!Solved for me.
If we don't have value for the field which we are passing it to tablecontrol, then declare the variable with the same type and assigned space for the same and submit it to table control output. then the error is not coming.
Ex: If we dont have the value for the table control field (KOSTL), then declare one constant K_KOSTL LIK below,
DATA:K_KOSTL TYPE KOSTL.
K_KOSTL = ' '.
IF the value of table control field is initial, then pass K_KOSTL to it.
This what I have done.
Regards
Ramesh. -
How to detect conversion errors due to charset mismatch client/server?
If a character cannot be converted by OCIStmtExecute (Bind Variable) and/or OCIStmtFetch (Into Variable), either a replacement character (usually question mark) or a similar character (e.g. è -> e) is used instead.
I am looking for a possibility to get an indicator flag if a column could not be converted between client character encoding (NLS_LANG setting) and database encoding (NLS_CHARACTERSET).
If I do the conversion in my code, setting OCI_ATTR_CHARSET_ID to OCI_UTF16ID and using OCICharSetToUnicode(), OCIUnicodeToCharSet() and OCICharSetConversionIsReplacementUsed(), this would be quite a bit of work, allocating extra buffers, and it detects only conversion errors during OCIStmtFetch (into variables), not for bind variables during OCIStmtExecute.If a character cannot be converted by OCIStmtExecute (Bind Variable) and/or OCIStmtFetch (Into Variable), either a replacement character (usually question mark) or a similar character (e.g. è -> e) is used instead.
I am looking for a possibility to get an indicator flag if a column could not be converted between client character encoding (NLS_LANG setting) and database encoding (NLS_CHARACTERSET).
If I do the conversion in my code, setting OCI_ATTR_CHARSET_ID to OCI_UTF16ID and using OCICharSetToUnicode(), OCIUnicodeToCharSet() and OCICharSetConversionIsReplacementUsed(), this would be quite a bit of work, allocating extra buffers, and it detects only conversion errors during OCIStmtFetch (into variables), not for bind variables during OCIStmtExecute. -
SelectOneMenu inside h:dataTable gives conversion error
Hi guys,
I'm enduring quite alot of misery attempting to put selectOneMenu UI components in my h:dataTable. Due to the 30000 character restriction, I can only submit my view and backing bean and DTO and the converter (even though the total characters of my files is only 26,583? [cat * | wc -c]). Perhaps you can figure out a way I can send me all my files and you'll be able to test it much easier.
The jist of the problem is that I get a conversion error between the selectOneMenu and the backing DTO of the <h:dataTable>. After I define a converter I get a ClassCastException.
My BIGGEST question is "Why do I even need a converter?", the selectItem(s)/options are hardcoded label/value Strings and so is the the property of the dataTable row's backing DTO!!!
Here's the files, any assistance will be greatly appreciated.
P.S. I'm running JDeveloper 10.1.3.3.
Thanks.
(All these files are in the same package so you can just put them all in a directory named "example"):
My DTO BudgetEquipmentListVO.java:
package example;
import java.util.Date;
import java.util.List;
public class BudgetEquipmentListVO {
private Integer rowNo = new Integer("0"); //Row number for paging thru dataTables.
private String equipmentListId = new String("0"); //From equipment_list table.
private Integer equipmentCodeId = new Integer("0"); //From equipment_codes table
private String objectCode = "0730"; //So far, 0730,0735 are possible.
private Integer budgetId = new Integer("0"); //fed_budget_id from fed_budget table.
private String description = "";
private String equipNo = ""; //Alphanumeric
private Date dateAcquired = new Date();
private Integer estimatedCost = new Integer("0"); //Used for Stimulus Application
private Integer actualCost = new Integer("0"); //Used for EOY expenditures. Disable for stimulus application
private String bldgLocation = ""; //Address where equipment is at.
private String approvedInd = "N"; //Whether item's been approved or not. Y/N
private Integer amountApproved = new Integer("0"); //Gets set on approval page.
private StringBuffer comment = new StringBuffer(4000); //Currently max 4000 chars
private String suppInstInd = "I"; //Support or Instruction item, S or I
private Integer approvedById = new Integer("0"); //User id of approver.
private Date approvedDate = null; //Date approved
private List<BudgetEquipmentListVO> innerList;
public BudgetEquipmentListVO() {
public void setObjectCode(String objectCode) {
this.objectCode = objectCode;
public String getObjectCode() {
return objectCode;
public void setBudgetId(Integer budgetId) {
this.budgetId = budgetId;
public Integer getBudgetId() {
return budgetId;
public void setDescription(String description) {
this.description = description;
public String getDescription() {
return description;
public void setEquipNo(String equipNo) {
this.equipNo = equipNo;
public String getEquipNo() {
return equipNo;
public void setDateAcquired(Date dateAcquired) {
this.dateAcquired = dateAcquired;
public Date getDateAcquired() {
return dateAcquired;
public void setEstimatedCost(Integer estimatedCost) {
this.estimatedCost = estimatedCost;
public Integer getEstimatedCost() {
return estimatedCost;
public void setActualCost(Integer actualCost) {
this.actualCost = actualCost;
public Integer getActualCost() {
return actualCost;
public void setBldgLocation(String bldgLocation) {
this.bldgLocation = bldgLocation;
public String getBldgLocation() {
return bldgLocation;
public void setApprovedInd(String approvedInd) {
this.approvedInd = approvedInd;
public String getApprovedInd() {
return approvedInd;
public void setAmountApproved(Integer amountApproved) {
this.amountApproved = amountApproved;
public Integer getAmountApproved() {
return amountApproved;
public void setComment(StringBuffer comment) {
this.comment = comment;
public StringBuffer getComment() {
return comment;
public void setSuppInstInd(String suppInstInd) {
this.suppInstInd = suppInstInd;
public String getSuppInstInd() {
return suppInstInd;
public void setApprovedById(Integer approvedBy) {
this.approvedById = approvedBy;
public Integer getApprovedById() {
return approvedById;
public void setApprovedDate(Date approvedDate) {
this.approvedDate = approvedDate;
public Date getApprovedDate() {
return approvedDate;
public void setRowNo(Integer rowNo) {
this.rowNo = rowNo;
public Integer getRowNo() {
return rowNo;
// Helpers ------------------------------------------------------------------------------------
// Getters ------------------------------------------------------------------------------------
public String getKey() {
return equipmentListId;
public BudgetEquipmentListVO getValue() {
return this;
// This must return true for another Foo object with same key/id.
public boolean equals(Object other) {
return other instanceof BudgetEquipmentListVO && equipmentListId != null && equipmentListId.equals(((BudgetEquipmentListVO) other).getEquipmentListId());
// This must return the same hashcode for every Foo object with the same key.
public int hashCode() {
return equipmentListId != null ? this.getClass().hashCode() + equipmentListId.hashCode() : super.hashCode();
// Override Object#toString() so that it returns a human readable String representation.
// It is not required by the Converter or so, it just pleases the reading in the logs.
public String toString() {
return "BudgetEquipmentListVO[" + equipmentListId.toString() + ", " + equipmentCodeId.toString() + ", " + objectCode + ", " + approvedInd + ", " + suppInstInd + "]";
public void setEquipmentListId(String equipmentListId) {
this.equipmentListId = equipmentListId;
public String getEquipmentListId() {
return equipmentListId;
public void setEquipmentCodeId(Integer equipmentCodeId) {
this.equipmentCodeId = equipmentCodeId;
public Integer getEquipmentCodeId() {
return equipmentCodeId;
public void setInnerList(List<BudgetEquipmentListVO> innerList) {
this.innerList = innerList;
public List<BudgetEquipmentListVO> getInnerList() {
return innerList;
The View, equipmentList.jspx:
<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces"
xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
<jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
<jsp:directive.page contentType="text/html;charset=windows-1252"/>
<f:view>
<f:loadBundle basename="myBundle" var="myBundle"/>
<afh:html>
<afh:head title="ARRA - Equipment List (0730, 0735)">
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/>
<link rel="stylesheet" type="text/css" href="/css/crud.css" />
<script type="text/javascript" src="/js/global.js"></script>
</afh:head>
<afh:body>
<h:form id="equipmentForm">
<afh:tableLayout width="100%">
<afh:rowLayout width="100%" halign="center">
<afh:cellFormat columnSpan="1" width="100%" halign="center"
rowSpan="1">
<h:dataTable value="#{backing_equipmentScreen.dataList}"
binding="#{backing_equipmentScreen.dataTable}"
styleClass="dataTable" rowClasses="rowOdd,rowEven"
var="dataItem" id="table" border="2"
bgcolor="#C2DFFF" width="100%"
rows="#{backing_equipmentScreen.numItems}">
<f:facet name="header">
<af:outputText value="#{myBundle.headerTable}"
inlineStyle="font-size:small;"/>
</f:facet>
<h:column>
<f:facet name="header">
<af:outputText value="#{myBundle.headerColumnRowNumber}"
inlineStyle="font-size:small;"/>
</f:facet>
<af:outputText value="#{backing_equipmentScreen.dataTable.rowIndex + 1}"
inlineStyle="font-size:small;"/>
</h:column>
<h:column>
<f:facet name="header">
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{myBundle.headerColumnDesc}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</f:facet>
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{dataItem.description}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</h:column>
<h:column>
<f:facet name="header">
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{myBundle.headerColumnEquipNo}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</f:facet>
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:inputText value="#{dataItem.equipNo}"
/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</h:column>
<h:column>
<f:facet name="header">
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{myBundle.headerColumnDateAcquired}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</f:facet>
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<af:selectInputDate value="#{dataItem.dateAcquired}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</h:column>
<h:column>
<f:facet name="header">
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{myBundle.headerColumnObjCode}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</f:facet>
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:selectOneMenu value="#{dataItem.objectCode}" binding="#{backing_equipmentScreen.objCodeMenu}">
<f:selectItem id="item1" itemLabel="0730" itemValue="0730"/>
<f:selectItem id="item2" itemLabel="0735" itemValue="0735"/>
<f:converter converterId="selectOneMenuConverter"/>
</h:selectOneMenu>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</h:column>
<h:column>
<f:facet name="header">
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{myBundle.headerColumnInsSuppInd}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</f:facet>
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:selectOneMenu value="#{dataItem.suppInstInd}" binding="#{backing_equipmentScreen.suppInstMenu}">>
<f:selectItem id="supportitem1" itemLabel="Support" itemValue="S"/>
<f:selectItem id="supportitem2" itemLabel="Instruction" itemValue="I"/>
</h:selectOneMenu>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</h:column>
<h:column>
<f:facet name="header">
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{myBundle.headerColumnEstCost}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</f:facet>
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:inputText value="#{dataItem.estimatedCost}">
<f:convertNumber
currencySymbol="$"
groupingUsed="#{true}"
maxFractionDigits="0"
type="currency"/>
</h:inputText>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</h:column>
<h:column>
<f:facet name="header">
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{myBundle.headerColumnActualCost}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</f:facet>
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:inputText value="#{dataItem.actualCost}">
<f:convertNumber
currencySymbol="$"
groupingUsed="#{true}"
maxFractionDigits="0"
type="currency"/>
</h:inputText>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</h:column>
<h:column>
<f:facet name="header">
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{myBundle.headerColumnBldgLoc}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</f:facet>
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:inputTextarea value="#{dataItem.bldgLocation}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</h:column>
<h:column>
<f:facet name="header">
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{myBundle.headerColumnApprovedInd}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</f:facet>
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:selectOneMenu value="#{dataItem.approvedInd}" binding="#{backing_equipmentScreen.yesNoMenu}">>
<f:selectItem id="yesnoitem1" itemLabel="Yes" itemValue="Y"/>
<f:selectItem id="yesnoitem2" itemLabel="No" itemValue="N"/>
</h:selectOneMenu>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</h:column>
<h:column>
<f:facet name="header">
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:outputText value="#{myBundle.headerColumnComments}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</f:facet>
<h:panelGroup>
<afh:rowLayout>
<afh:cellFormat inlineStyle="font-size:small;">
<h:inputTextarea value="#{dataItem.comment}"/>
</afh:cellFormat>
</afh:rowLayout>
</h:panelGroup>
</h:column>
<f:facet name="footer">
<h:panelGrid columns="4">
<h:outputLabel for="rows" value="#{myBundle.labelRowsPage}:" />
<h:panelGroup>
<h:inputText id="rows" value="#{backing_equipmentScreen.dataTable.rows}" styleClass="input" size="1"><f:validateLongRange minimum="1" maximum="100" /></h:inputText>
<h:commandButton value="#{myBundle.buttonSet}" action="#{backing_equipmentScreen.pageFirst}" styleClass="input" />
</h:panelGroup>
<h:outputText value="#{myBundle.labelPaging}:" />
<h:panelGroup>
<h:commandButton value="#{myBundle.buttonFirst}" action="#{backing_equipmentScreen.pageFirst}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first == 0}" />
<h:commandButton value="#{myBundle.buttonPrevious}" action="#{backing_equipmentScreen.pagePrevious}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first == 0}" />
<h:commandButton value="#{myBundle.buttonNext}" action="#{backing_equipmentScreen.pageNext}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first + backing_equipmentScreen.dataTable.rows >= backing_equipmentScreen.dataTable.rowCount}" />
<h:commandButton value="#{myBundle.buttonLast}" action="#{backing_equipmentScreen.pageLast}" styleClass="input" disabled="#{backing_equipmentScreen.dataTable.first + backing_equipmentScreen.dataTable.rows >= backing_equipmentScreen.dataTable.rowCount}" />
<h:outputText value="#{myBundle.labelPage}: #{backing_equipmentScreen.currentPage} / #{backing_equipmentScreen.totalPages}" />
</h:panelGroup>
<h:outputLabel for="add" value="#{myBundle.labelAddRows}:" />
<h:panelGroup>
<h:inputText id="add" value="#{backing_equipmentScreen.addCount}" styleClass="input" size="1"><f:validateLongRange minimum="1" maximum="100" /></h:inputText>
<af:commandButton action="#{backing_equipmentScreen.actionAdd}"
styleClass="input"
text="#{myBundle.buttonAdd}"/>
</h:panelGroup>
<h:outputText value="#{myBundle.labelActions}:" />
<h:panelGroup>
<h:commandButton value="#{myBundle.buttonSelectAll}" action="#{backing_equipmentScreen.actionSelectAll}" rendered="#{!backing_equipmentScreen.editMode and !backing_equipmentScreen.selectAll}" styleClass="input" />
<h:commandButton value="#{myBundle.buttonUnselectAll}" action="#{backing_equipmentScreen.actionSelectAll}" rendered="#{!backing_equipmentScreen.editMode and backing_equipmentScreen.selectAll}" styleClass="input" />
<h:commandButton value="#{myBundle.buttonEdit}" action="#{backing_equipmentScreen.actionEdit}" rendered="#{!backing_equipmentScreen.editMode}" styleClass="input" />
<h:commandButton value="#{myBundle.buttonDelete}" action="#{backing_equipmentScreen.actionDelete}" rendered="#{!backing_equipmentScreen.editMode}" styleClass="input" />
<h:commandButton id="save" value="#{myBundle.buttonSave}" action="#{backing_equipmentScreen.actionSave}" rendered="#{backing_equipmentScreen.editMode}" styleClass="input" />
<h:commandButton value="#{myBundle.buttonRefresh}" action="#{backing_equipmentScreen.actionRefresh}" immediate="true" styleClass="input" />
<h:commandButton value="#{myBundle.buttonReset}" action="#{backing_equipmentScreen.actionReset}" immediate="true" styleClass="input" />
</h:panelGroup>
</h:panelGrid>
</f:facet>
</h:dataTable>
<h:panelGroup rendered="#{empty backing_equipmentScreen.dataList and !backing_equipmentScreen.message}">
<h:panelGroup rendered="#{!backing_equipmentScreen.searchMode}">
<h:outputText value="#{myBundle.textNoData}" />
<h:commandButton value="#{myBundle.buttonAdd}" action="#{backing_equipmentScreen.actionAdd}" styleClass="input" />
</h:panelGroup>
<h:outputText value="#{myBundle.textRefineSearch}" rendered="#{backing_equipmentScreen.searchMode}" />
</h:panelGroup>
<h:panelGroup rendered="#{backing_equipmentScreen.message}">
<h:outputText value="#{myBundle.textErrors}" styleClass="error" />
<h:messages styleClass="error" />
</h:panelGroup>
</afh:cellFormat>
</afh:rowLayout>
</afh:tableLayout>
</h:form>
</afh:body>
</afh:html>
</f:view>
</jsp:root>Hi evryone,
I have following piece of code
<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=windows-1252"/>
<f:view>
<af:document>
<af:messages/>
<af:form>
<af:selectOneChoice>
<f:selectItem itemLabel="ABC" itemValue="ABC"/>
<f:selectItem itemLabel="DEF" itemValue="DEF"/>
<f:selectItem itemLabel="GHI" itemValue="GHI"/>
<f:selectItem itemLabel="JKL" itemValue="JKL"/>
<f:selectItem itemLabel="MNO" itemValue="MNO"/>
</af:selectOneChoice>
</af:form>
</af:document>
</f:view>
</jsp:root>
When I run this program , I get following compiler error:
Error(12): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
Error(12): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
Error(13): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
Error(13): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
Error(14): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
Error(14): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
Error(15): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
Error(15): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
Error(16): Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
Error(16): Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
Anyone has any ideas? Where could be problem? -
"character conversion error" while parsing xml files
Hello,
I'm trying to parse MusicXML (Recordare) files, but I'm getting an exception.
I'm using the SAX parser (javax.xml.parsers.SAXParser).
Here is the code I use to instantiate it:
final javax.xml.parsers.SAXParserFactory saxParserFactory = javax.xml.parsers.SAXParserFactory.newInstance();
final javax.xml.parsers.SAXParser saxParser = saxParserFactory.newSAXParser();
final org.xml.sax.XMLReader parser = saxParser.getXMLReader();
I'm using my own handler, but I get the same exception even if I use org.xml.sax.helpers.DefaultHandler.
The error I get is:
Character conversion error: "Illegal ASCII character, 0xc2" (line number may be too low).
The first few lines of my xml files look like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE score-partwise
PUBLIC "-//Recordare//DTD MusicXML 0.6 Partwise//EN"
"http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise>
[...etc...]
If I delete the <!DOCTYPE ...> line, then I don't get the exception anymore. But the MusicXML files I get (from some other program) always contain this line, and it would be quite some work to delete them from every file manually.
So does anyone know if there is a way to avoid deleting that line in every file, while still being able to parse the xml files without exceptions?
Or maybe does anyone know what the exact cause of the exception is? (because I don't know what exactly causes it)
Thank you in advance.
Greetz,
JipoSo does anyone know if there is a way to avoid
deleting that line in every file, while still being
able to parse the xml files without exceptions?ok this is side-stepping the real problem but I've used this code to filterout DTD references for other reasons public static InputStream filterOutDTDRef(InputStream in) throws IOException {
BufferedReader iniReader = new BufferedReader(new InputStreamReader(in));
StringBuffer newXML = new StringBuffer();
for(String line = iniReader.readLine(); line!=null; line = iniReader.readLine())
newXML.append(line+"\n");
in.close();
int s = newXML.indexOf("<!DOCTYPE ");
if(s!=-1)
newXML.replace(s,newXML.indexOf(">",s)+1,"");
return new ByteArrayInputStream(newXML.toString().getBytes());
}and it actually speeds up the parsing phase too (since the DTD ref.s were on the web and the XML standard mandates that there is a fetch for each xml file parsed..)
you can feed the above into the InputSource constructor that takes an InputStream argument.
Now for the real problem... 0xc2 is "LATIN CAPITAL LETTER A WITH CIRCUMFLEX" according to a unicode chart - which is not an ASCII character (as the error message correctly reports). I'm not sure why the file is being parsed as ASCII though? You could try parsing in a FileReader to the inputsource and hope it picks up the default character encoding of your system, and that that character encoding matches the file. Or you could try passing in a FileReader constructed with a explicit character encoding (eg "UTF8") and see if that does the trick?
asjf -
Hi,
i have an attribute customernumber mapped as Long. My developer now wants to do a query like "select * from xy where customernumber like '567%' ".
Is it possible to do this with toplink?
I get conversion errors due to toplink tries to convert 567% to a long value.
builder.get("customernumber").like("567%")
-RobertThe mapping will always try to convert its value passed in to that of the mapped attribute.
Probably the easiest way to address this is to add another direct query key for the field. If you added one in the mapping editor called customerNumberString to the same database field you could then use:
builder.get("customerNumberString").like("567%")Doug -
Conversion error in J1IEX transaction
HI all,
We are doing upgrade from 4.6C to ECC 6.0. After upgrade, when we tried to execute the tcode J1IEX, it returns the following error.
That is, in J1IEX, we select Capture Excise Invoice -> Goods Receipt -> GR number. After entering this GR number and pressed ENTER key, we get the following error.
" Conversion error
Error analysis
The program has been interrupted and cannot resume.
Program "SAPLJ1IEX" attempted to display fields on screen 0200.
An error occurred during the conversion of this data.
How to correct the error
There was a conversion error in the output of fields to the screen.
The formats of the ABAP output field and the screen field may not match.
Some field types require more space on the screen than in the ABAP
program. For example, a date output field on the screen requires two
more characters than the corresponding field in the ABAP program. When
the date is displayed on the screen, an error occurs resulting in this
error message.
Screen name.............. "SAPLJ1IEX"
Screen number............ 0200
Screen field............. "J_1IEXITEM-AVB_CREDIT_QTY"
Error text............... "FX015: Sign lost."
Other data:
Pls help me in correcting this error.Hi all,
Is the DYNPRO_FIELD_CONVERSION error in J1IEX transaction (field conversion error in AVB_CREDIT_QTY field under "Exceise Invoice" tab) due to the negative value passed to this AVB_CREDIT_QTY screen field.
If so, how to correct the negative value problem? -
ResultSet XML Conversion Error
Hi,
BPEL, SOA 11g, DB2 Stored procedure,
In a BPEL service I am getting this error while invoking a DB2 Stored procedure with Strong XSD. I am using assign to copy the input parameter to the input parameters of Stored procedure.
not able to figure out why this error message is coming.
java.lang.Exception: oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'JDE_DBA' failed due to: ResultSet XML Conversion Error. An error occurred while converting from a ResultSet to XML. Unable to convert a ResultSet to XML. Cause: java.lang.NullPointerException ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeOperation(WSTestModel.java:575) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:381) at oracle.sysman.emas.view.wsmgt.WSView.invokeOperation(WSView.java:298) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.el.parser.AstValue.invoke(AstValue.java:157) at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283) a
---------------- BPEL Code --------
<?xml version = "1.0" encoding = "UTF-8" ?>
<!--
Oracle JDeveloper BPEL Designer
Created: Fri Dec 10 10:24:23 PST 2010
Author: chaitanyad
Purpose: Synchronous BPEL Process
-->
<process name="UPCMatchOrder"
targetNamespace="http://xmlns.oracle.com/CD_JDE_Application_jws/JDE_UPCMatchOrder/UPCMatchOrder"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:client="http://xmlns.oracle.com/CD_JDE_Application_jws/JDE_UPCMatchOrder/UPCMatchOrder"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/CD_JDE_Application/JDE_UPCMatchOrder/JDE_DBA"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns2="http://xmlns.oracle.com/pcbpel/adapter/db/QAMODA73/X56714P/">
<!--
PARTNERLINKS
List of services participating in this BPEL process
-->
<partnerLinks>
<!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="upcmatchorder_client" partnerLinkType="client:UPCMatchOrder" myRole="UPCMatchOrderProvider"/>
<partnerLink name="JDE_DBA" partnerRole="JDE_DBA_role"
partnerLinkType="ns1:JDE_DBA_plt"/>
</partnerLinks>
<!--
VARIABLES
List of messages and XML documents used within this BPEL process
-->
<variables>
<!-- Reference to the message passed as input during initiation -->
<variable name="inputVariable" messageType="client:UPCMatchOrderRequestMessage"/>
<!-- Reference to the message that will be returned to the requester-->
<variable name="outputVariable" messageType="client:UPCMatchOrderResponseMessage"/>
<variable name="Invoke_1_InputVariable" messageType="ns1:args_in_msg"/>
<variable name="Invoke_1_OutputVariable" messageType="ns1:args_out_msg"/>
</variables>
<!--
ORCHESTRATION LOGIC
Set of activities coordinating the flow of messages across the
services integrated within this business process
-->
<sequence name="main">
<!-- Receive input from requestor. (Note: This maps to operation defined in UPCMatchOrder.wsdl) -->
<receive name="receiveInput" partnerLink="upcmatchorder_client" portType="client:UPCMatchOrder" operation="process" variable="inputVariable" createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<assign name="Assign_3">
<copy>
<from variable="inputVariable" part="InputMessage"/>
<to variable="Invoke_1_InputVariable" part="InputParameters"/>
</copy>
</assign>
<invoke name="Invoke_1" inputVariable="Invoke_1_InputVariable"
outputVariable="Invoke_1_OutputVariable" partnerLink="JDE_DBA"
portType="ns1:JDE_DBA_ptt" operation="JDE_DBA"/>
<assign name="Assign_2">
<copy>
<from variable="Invoke_1_OutputVariable" part="OutputParameters"/>
<to variable="outputVariable" part="OutputMessage"/>
</copy>
</assign>
<reply name="replyOutput" partnerLink="upcmatchorder_client" portType="client:UPCMatchOrder" operation="process" variable="outputVariable"/>
</sequence>
</process>
Regards,
-CDHi Sanjay,
The JDBC sender adapter returns the rows selected from the database in the follwoing format.
<resultset>
<row>
<column-name1>column-value</ column-name1>
<column-name2>column-value</ column-name2>
<column-name3>column-value</ column-name3>
</row>
<row>
<column-name1>column-value</ column-name1>
<column-name2>column-value</ column-name2>
<column-name3>column-value</ column-name3>
</row>
</resultset>
This error occurs , when the source datatype you have created for the JDBC adapter does not match with this format. I would suggest that you check the source format along with the occurence of your field.
Regards,
Bhavesh -
Character conversion error: "Unconvertible UTF-8 character beginning with 0
Hi All,
I developed an Adapter Module and added to Adapter Framework.
package sample;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import com.sap.aii.af.mp.module.Module;
import com.sap.aii.af.mp.module.ModuleContext;
import com.sap.aii.af.mp.module.ModuleData;
import com.sap.aii.af.mp.module.ModuleException;
import com.sap.aii.af.ra.ms.api.Message;
import com.sap.aii.af.ra.ms.api.XMLPayload;
@ejbHome <{com.sap.aii.af.mp.module.ModuleHome}>
@ejbLocal <{com.sap.aii.af.mp.module.ModuleLocal}>
@ejbLocalHome <{com.sap.aii.af.mp.module.ModuleLocalHome}>
@ejbRemote <{com.sap.aii.af.mp.module.ModuleRemote}>
@stateless
public class SetAttachmentName implements SessionBean, Module {
private SessionContext myContext;
private String mailFileName = "UStN";
public void ejbRemove() {
public void ejbActivate() {
public void ejbPassivate() {
public void setSessionContext(SessionContext context) {
myContext = context;
public void ejbCreate() throws CreateException {
public ModuleData process(
ModuleContext moduleContext,
ModuleData inputModuleData)
throws ModuleException {
// create a second attachment for the receiver mail adapter
try {
// get the XI message from the environment
Message msg = (Message) inputModuleData.getPrincipalData();
// creating parsable XML document
InputStream XIStreamData = null;
XMLPayload xmlpayload = msg.getDocument();
XIStreamData = xmlpayload.getInputStream();
DocumentBuilderFactory docBuilderFactory =
DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(XIStreamData);
// finding the tag's name from the Modules tab in the Directory that will hold the attachment's name
String absenderIDTag = null;
absenderIDTag = moduleContext.getContextData("<RCVPRN>");
// finding the content of the tag that will be used as the attachment's name (assuming it's the only tag with this name)
Element element = doc.getDocumentElement();
NodeList list = doc.getElementsByTagName(absenderIDTag);
mailFileName += "_" + list.item(0).getFirstChild().toString();
String anIDTag = null;
anIDTag = moduleContext.getContextData("<CREDAT>");
element = doc.getDocumentElement();
list = doc.getElementsByTagName(anIDTag);
mailFileName += "_" + list.item(0).getFirstChild().toString();
Date date = new Date(System.currentTimeMillis());
// Add date to the Message
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
mailFileName += "_" + dateFormat.format(date);
String belegNummerTag = null;
belegNummerTag = moduleContext.getContextData("<BULK_REF>");
element = doc.getDocumentElement();
list = doc.getElementsByTagName(belegNummerTag);
mailFileName += "_" + list.item(0).getFirstChild().toString();
// creating the attachment
byte by[] = xmlpayload.getText().getBytes();
XMLPayload attachmentPDF = msg.createXMLPayload();
attachmentPDF.setName(mailFileName);
attachmentPDF.setContentType("application/pdf");
attachmentPDF.setContent(by);
//adding the message to the attachment
msg.addAttachment(attachmentPDF);
// provide the XI message for returning
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {
// raise exception, when an error occurred
ModuleException me = new ModuleException(e);
throw me;
// return XI message
return inputModuleData;
I get the following error
Character conversion error: "Unconvertible UTF-8 character beginning with 0xaa" (line number may be too low).
Any tips, pointers ?
Thanks in Advance
MukhtarHi Henrique,
I am using .getNodeValue()
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import com.sap.aii.af.mp.module.*;
import com.sap.aii.af.ra.ms.api.*;
@ejbHome <{com.sap.aii.af.mp.module.ModuleHome}>
@ejbLocal <{com.sap.aii.af.mp.module.ModuleLocal}>
@ejbLocalHome <{com.sap.aii.af.mp.module.ModuleLocalHome}>
@ejbRemote <{com.sap.aii.af.mp.module.ModuleRemote}>
@stateless
public class UStNAttachmentName3 implements SessionBean, Module {
private SessionContext myContext;
private String mailFileName = "UStN";
public void ejbRemove() {
public void ejbActivate() {
public void ejbPassivate() {
public void setSessionContext(SessionContext context) {
myContext = context;
public void ejbCreate() throws CreateException {
public ModuleData process(
ModuleContext moduleContext,
ModuleData inputModuleData)
throws ModuleException {
// create a second attachment for the receiver mail adapter
try {
// get the XI message from the environment
Message msg = (Message) inputModuleData.getPrincipalData();
// creating parsable XML document
InputStream XIStreamData = null;
XMLPayload xmlpayload = msg.getDocument();
XIStreamData = xmlpayload.getInputStream();
DocumentBuilderFactory docBuilderFactory =
DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(XIStreamData);
// finding the tag's name from the Modules tab in the Directory that will hold the attachment's name
String absenderIDTag = null;
absenderIDTag = moduleContext.getContextData("<RCVPRN>");
// finding the content of the tag that will be used as the attachment's name (assuming it's the only tag with this name)
Element element = doc.getDocumentElement();
NodeList list = doc.getElementsByTagName(absenderIDTag);
mailFileName += "_" + list.item(0).getFirstChild().getNodeValue();
String anIDTag = null;
anIDTag = moduleContext.getContextData("<CREDAT>");
element = doc.getDocumentElement();
list = doc.getElementsByTagName(anIDTag);
mailFileName += "_" + list.item(0).getFirstChild().getNodeValue();
Date date = new Date(System.currentTimeMillis());
// Add date to the Message
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
mailFileName += "_" + dateFormat.format(date);
String belegNummerTag = null;
belegNummerTag = moduleContext.getContextData("<BULK_REF>");
element = doc.getDocumentElement();
list = doc.getElementsByTagName(belegNummerTag);
mailFileName += "_" + list.item(0).getFirstChild().getNodeValue();
// creating the attachment
byte by[] = xmlpayload.getText().getBytes();
XMLPayload attachmentPDF = msg.createXMLPayload();
attachmentPDF.setName(mailFileName);
attachmentPDF.setContentType("application/pdf");
attachmentPDF.setContent(by);
//adding the message to the attachment
msg.addAttachment(attachmentPDF);
// provide the XI message for returning
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {
// raise exception, when an error occurred
ModuleException me = new ModuleException(e);
throw me;
// return XI message
return inputModuleData;
Still I get the same error.
org.xml.sax.SAXParseException: Character conversion error: "Unconvertible UTF-8 character beginning with 0xaa" (line number may be too low).
Adapter-Framework: Character conversion error: "Unconvertible UTF-8 character beginning with 0xaa" (line number may be too low).
Regards,
Mukhtar -
Error in BPEL11g :Parse struct conversion error.
Hi All,
I am facing following error while invoking a procedure which is in apps schema from BPEL by giving it parameters.
actually this procedure/function will accept the payloads as parameters and will give some output parameters, but while processing i am getting following error :
Non Recoverable System Fault :
Exception occurred when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'PreImportCleanup' failed due to: Parse struct conversion error. An error occurred while parsing XML representing a Java struct. Unable to convert the XSD element P_INVOICE_REC whose user defined
type is AXF.AXF_PREIMPORT_CUSTOM_PKG_R_IN to a Java struct.
Cause: java.sql.SQLSyntaxErrorException: ORA-04044: procedure, function, package, or type is not allowed here ".
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.
Any suggestion to get over this issue will be so helpful !
Thanks & Regards,
Nupurwhen configuring DBAdapter , make sure you specify the procedure by prefixing the schema name like APPS. <procedureName>
Also, make sure grants are there for all objects used by procedure to the user which is connected from BPEL.
You can also edit the XSD generated after DBAdapter configuration by manually prefixing the schema name. -
Hi,
I have a file where fields are wrapped with ".
=========== file sample
"asdsa","asdsadasdas","1123"
"asdsa","asdsadasdas","1123"
"asdsa","asdsadasdas","1123"
"asdsa","asdsadasdas","1123"
==========
I am having a .net method to remove the wrap characters and write out a file without wrap characters.
======================
asdsa,asdsadasdas,1123
asdsa,asdsadasdas,1123
asdsa,asdsadasdas,1123
asdsa,asdsadasdas,1123
======================
the .net code is here.
========================================
public static string RemoveCharacter(string sFileName, char cRemoveChar)
object objLock = new object();
//VirtualStream objInputStream = null;
//VirtualStream objOutStream = null;
FileStream objInputFile = null, objOutFile = null;
lock(objLock)
try
objInputFile = new FileStream(sFileName, FileMode.Open);
//objInputStream = new VirtualStream(objInputFile);
objOutFile = new FileStream(sFileName.Substring(0, sFileName.LastIndexOf('\\')) + "\\" + Guid.NewGuid().ToString(), FileMode.Create);
//objOutStream = new VirtualStream(objOutFile);
int nByteRead;
while ((nByteRead = objInputFile.ReadByte()) != -1)
if (nByteRead != (int)cRemoveChar)
objOutFile.WriteByte((byte)nByteRead);
finally
objInputFile.Close();
objOutFile.Close();
return sFileName.Substring(0, sFileName.LastIndexOf('\\')) + "\\" + Guid.NewGuid().ToString();
==================================
however when I run the bulk load utility I get the error
=======================================
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 3 (NumberOfMultipleMatches).
==========================================
the bulk insert statement is as follows
=========================================
BULK INSERT Temp
FROM '<file name>' WITH
FIELDTERMINATOR = ','
, KEEPNULLS
==========================================
Does anybody know what is happening and what needs to be done ?
PLEASE HELP
Thanks in advance
VikramTo load that file with BULK INSERT, use this format file:
9.0
4
1 SQLCHAR 0 0 "\"" 0 "" ""
2 SQLCHAR 0 0 "\",\"" 1 col1 Latin1_General_CI_AS
3 SQLCHAR 0 0 "\",\"" 2 col2 Latin1_General_CI_AS
4 SQLCHAR 0 0 "\"\r\n" 3 col3 Latin1_General_CI_AS
Note that the format file defines four fields while the fileonly seems to have three. The format file defines an empty field before the first quote.
Or, since you already have a .NET program, use a stored procedure with table-valued parameter instead. I have an example of how to do this here:
http://www.sommarskog.se/arrays-in-sql-2008.html
Erland Sommarskog, SQL Server MVP, [email protected] -
WebDynpro call Returns an exception: Type conversion error
Hi,
I'm trying to start some of the standard SAP web dynpro .
most of then work fine.
some don't and i get the following error message.
Root Cause
The initial exception that caused the request to fail, was:
+com.sap.aii.proxy.framework.core.DataAccessException: Type conversion error, field TAX_PER_DIEMTAX, complex type class com.sap.xss.tra.tre.model.expenses.Ptrv_Web_General_Data_Int+
+at com.sap.aii.proxy.framework.core.JcoBaseTypeData.propagateJcoException(JcoBaseTypeData.java:130)+
+at com.sap.aii.proxy.framework.core.JcoBaseTypeData.setElementValue(JcoBaseTypeData.java:751)+
+at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.setAttributeValue(DynamicRFCModelClass.java:482)+
+at com.sap.tc.webdynpro.progmodel.context.GenericModelClassCopyHelper.setAttributeValue(GenericModelClassCopyHelper.java:69)+
+at com.sap.tc.webdynpro.progmodel.context.CopyService.copyCorresponding(CopyService.java:55)+
+... 66 more+
See full exception chain for details.
could anyone give me an hint.
jco connetion are made and testet for:
sap_r3_humanresources
sap_r3_finacials
sap_r3_selfservicegenerics
sap_r3_travel
analog the *_MetaData
Thank in advance
MaximilianHello
did you solve this problem? I have the same error
Regards
Maybe you are looking for
-
Airprint with HP LaserJet Enterprise 500 Color M551
Hi, I've watched the demo video on youtube and 10 minutes in he shows printing via the iphone with the "print" command in Apple's mail app. Is this an error by HP or is airprint available for this model? Thanks
-
I used to be able to choose print options with Firefox and now I can't. It forces me to use photo paper when I want only to use plain paper. I do not have this problem with Safari or IE, just firefox. I have an office jet 4500 HP printer
-
Centro restarts when navigating through photos
I purchased my Centro a couple of months ago. Recently, the Centro has been restarting when navigating through photos I've taken using the Centro's camera. It will also restart when I try to save a photo that has been sent to me via text message, o
-
Hello, I have a 20" intel iMac and sometimes to screen will randomly fade to black and then go back after a few seconds. From what I can tell, it's harmless, but rather annoying.
-
XML and binary with field separator stock quote
Hi All, I'm doing a comparison of data transmission between XML and binary with field separator. Example of XML <nasdaq> <high>100.00</high> <low>90.00</low> </nasdaq> Example of binary with field separator 100.00|90.00 Of course, using XML will cons