Multiple records of schema mapping using looping
Hi,
I am trying to resolve a simple looping scenario. Though I have looked some of the posts but could not conclude myself with any final idea.
In the below shown picture of B2MML maping, I have an input data "OperationsRequest" tree mapped to "Records" tree on the output/right hand side. This works fine if my input message file has one "OperationsRequest" entry of data.
I have multiple records of "OperationsRequest" in the incoming message, which should be linked to "Records". The shown mapping is not working though. That looping used over there may be not correct or incomplete?
How I can achieve this?
Thanks.
Hi Parny,
At the first place even looping functoid should do the job for you.
You have to place a looping functoid and join the Repeating Item Record node from the Source schema to the Repeating Record Node in the Destination Schema.
I think in your destination schema the "Records" record is not unbounded.
Please check the schema.
Rachit
Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem
Hi Parny,
Have you tried this?
Rachit
Similar Messages
-
How to pass multiple records to target side using xquery
Hi Everybody,
I am using xquery transformation.
Input: Source payload contains 5 variables.
Target payload contains 5 variables.
I have input with payload with multiple instance like:
<Input>
<payload1>
<a>1<a>
<b>2<b>
<c>3<c>
<d>4<d>
<e>5<e>
</payload1>
<payload1>
<a>6<a>
<b>7<b>
<c>8<c>
<d>9<d>
<e>10<e>
</payload1>
</Input>
So my requirement is to pass above records into target side,
So I am using xquery Transformation.
I have written code as follows.
(:: pragma bea:global-element-parameter parameter="$tHRecAdv1" element="ns0:THRecAdv" location="../XMLSchemas/THRecAdv.xsd" ::)
(:: pragma bea:global-element-return element="ns1:ShipmentReceiptEBO" location="../../AIAReferenceModelProject/EnterpriseObjectLibrary/Core/EBO/ShipmentReceipt/V1/ShipmentReceiptEBO.xsd" ::)
declare namespace ns2 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/EBO/ShipmentReceipt/V1";
declare namespace ns1 = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/ShipmentReceipt/V1";
declare namespace ns4 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2";
declare namespace ns3 = "http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/Common/V2";
declare namespace ns0 = "http://diversey.com/THRecAdv";
declare namespace xf = "http://tempuri.org/ShipmentReceiptServicesProject/XMLTransformations/THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery/";
declare function xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1 as element(ns0:THRecAdv))
as element(ns1:ShipmentReceiptEBO) {
for $THRecAdvFields in $tHRecAdv1/ns0:THRecAdvFields
return
<ns1:ShipmentReceiptEBO>
<ns4:Identification>
<ns4:BusinessComponentID>{ data($THRecAdvFields/ns0:JD_WHSE_Code) }</ns4:BusinessComponentID>
<ns4:ID schemeID = "{ (data($THRecAdvFields/ns0:JD_PO_Number)) }"
schemeVersionID = "{ data($THRecAdvFields/ns0:JD_PO_Type) }">{ data($THRecAdvFields/ns0:WMS_InternalPONumber) }</ns4:ID>
<ns4:ApplicationObjectKey>
<ns4:ID>{ data($THRecAdvFields/ns0:JD_BranchPlant) }</ns4:ID>
</ns4:ApplicationObjectKey>
<ns4:Revision>
<ns4:Reason>{ data($THRecAdvFields/ns0:ReturnReceiptReasonCode) }</ns4:Reason>
</ns4:Revision>
</ns4:Identification>
<ns1:ExpectedReceiptDate>{ data($THRecAdvFields/ns0:WMS_ReceiptDate) }</ns1:ExpectedReceiptDate>
<ns4:InvoiceReference>
<ns4:InvoiceIdentification>
<ns4:ID>{ data($THRecAdvFields/ns0:JDE_SupplierInvoiceNumber) }</ns4:ID>
</ns4:InvoiceIdentification>
</ns4:InvoiceReference>
<ns1:ShipmentReceiptLine actionCode = "{ data($THRecAdvFields/ns0:ActionFlag) }">
<ns4:Identification>
<ns4:ID schemeID = "{ data($THRecAdvFields/ns0:JD_PO_LineNumber) }"
schemeVersionID = "{ data($THRecAdvFields/ns0:ExternPONumber) }">{ data($THRecAdvFields/ns0:WMS_ReceiptNumber) }</ns4:ID>
<ns4:ContextID>{ data($THRecAdvFields/ns0:WMSReceivingClerk) }</ns4:ContextID>
<ns4:ApplicationObjectKey>
<ns4:ID schemeID = "{ data($THRecAdvFields/ns0:BatchNumber) }"
schemeVersionID = "{ data($THRecAdvFields/ns0:BatchLineNumber) }">{ data($THRecAdvFields/ns0:JD_LocationCode) }</ns4:ID>
</ns4:ApplicationObjectKey>
<ns4:AlternateObjectKey>
<ns4:ID>{ data($THRecAdvFields/ns0:SupplierCode) }</ns4:ID>
<ns4:ContextID>{ data($THRecAdvFields/ns0:LineNumber_Or_SequenceNumber) }</ns4:ContextID>
</ns4:AlternateObjectKey>
<ns4:Revision>
<ns4:Label>{ data($THRecAdvFields/ns0:Records) }</ns4:Label>
</ns4:Revision>
</ns4:Identification>
<ns1:ReceivedQuantity unitCode = "{ data($THRecAdvFields/ns0:ReceiptUOM) }">{ data($THRecAdvFields/ns0:UnitReceipt) }</ns1:ReceivedQuantity>
<ns1:SourceDocumentTypeCode>{ data($THRecAdvFields/ns0:SKU_Code) }</ns1:SourceDocumentTypeCode>
<ns1:DestinationTypeCode>{ data($THRecAdvFields/ns0:DestinationProcessFlag) }</ns1:DestinationTypeCode>
<ns1:Comment>{ data($THRecAdvFields/ns0:Remarks) }</ns1:Comment>
<ns4:Status>
<ns4:Code>{ data($THRecAdvFields/ns0:ProcessSourceFlag) }</ns4:Code>
<ns4:EffectiveDateTime>{ data($THRecAdvFields/ns0:ADDDATE) }</ns4:EffectiveDateTime>
</ns4:Status>
<ns1:ShipmentReceiptTransaction>
<ns1:ShipmentReceiptTransactionLot>
<ns1:ShipmentReceiptItemLotReference>
<ns1:ExpirationDate>{ data($THRecAdvFields/ns0:ExpiryDate) }</ns1:ExpirationDate>
<ns1:CreationDateTime>{ data($THRecAdvFields/ns0:ProductionDate) }</ns1:CreationDateTime>
</ns1:ShipmentReceiptItemLotReference>
</ns1:ShipmentReceiptTransactionLot>
</ns1:ShipmentReceiptTransaction>
</ns1:ShipmentReceiptLine>
</ns1:ShipmentReceiptEBO>
declare variable $tHRecAdv1 as element(ns0:THRecAdv) external;
xf:THRecAdvFile_ShipmentReceiptEBO_JDE_XQuery($tHRecAdv1)
But while importing this code to OSB,and tested it ,
With 1 payload it successfully shows the data in Target side,
But while testing with multiple line items,i am getting an error as follows.
*Error executing the XQuery transformation: line 14, column 17: {err}FORG0005: expected exactly one item, got 2+ items*
So please provide me the steps how to pass multiple records to target side using xquery.
Regards,
Jyoti NayakHi Jyoti Nayak,
You have to do something like the example bellow, you can not just repeat the inner element, you will need an outer "container" tag. So you will have to change the target element of your xq transformation.
declare function xf:setToList($set1 as element(ns0:set))
as element(ns0:list) {
<ns0:list>
for $pair in $set1/ns0:pair
return
<ns0:entry>
<ns0:key>{ data($pair/ns0:key) }</ns0:key>
<ns0:value>{ data($pair/ns0:value) }</ns0:value>
</ns0:entry>
</ns0:list>
Cheers,
Vlad
Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question. If you think this is helpful, please consider giving points -
Updating multiple records without having to use a cursor
I am trying to update multiple records in a table.
Eg
Table A -20 records
Table B -10 records.
Would like to update Table B with the updated records in Table A for those records which the primary key matches
and I dont want to use cursors. Is this possible??
Thanx in Advance.Please refer to the test below, it should give you the general idea,SQL> desc tableA;
Name Null? Type
SEQ NUMBER
INV VARCHAR2(20)
AMT NUMBER(12,2)
AMT2 NUMBER(12,2)
SQL> desc tableB;
Name Null? Type
SEQ NUMBER
INV VARCHAR2(20)
AMT NUMBER(12,2)
AMT2 NUMBER(12,2)
SQL> select count(*) from tableA;
COUNT(*)
6
SQL> select count(*) from tableB;
COUNT(*)
12
SQL> UPDATE tableB b
2 SET b.inv = NVL((SELECT a.inv from tableA a WHERE a.seq = b.seq), b.inv),
3 b.amt = NVL((SELECT a.amt from tableA a WHERE a.seq = b.seq), b.amt),
4 b.amt2 = NVL((SELECT a.amt2 from tableA a WHERE a.seq = b.seq), b.amt2)
5 /
12 rows updated.
*** Please note that this is DIFFERENT from what you asked, here tableB is having more rows, which is fine. We **may not be** able update tableA in this example by reversing the table names, because the join may bring more rows than UPDATE statement needs. ***Thx,
Sri -
How to map single to multiple record in Biztalk Map
Hi,
I have a flat file Input as below
For understandability I am making it as XML:
<Input>
<Name>vignesh</Name>
<Country>India</Country>
<orderNumber>123<orderNumber>
</Input>
I am having a look up table to retrieve multiple LineItem per Name
Output expected
I need to repeat the record based on the table as
<Output>
<Detail>
<Name>vignesh</Name>
<LineItems>38</LineItems>
</Detail>
<Detail>
<Name>vignesh</Name>
<LineItems>45</LineItems>
</Detail>
<Detail>
<Name>vignesh</Name>
<LineItems>88</LineItems>
</Detail>
<Detail>
<Name>vignesh</Name>
<LineItems>99</LineItems>
</Detail>
<Detail>
<Name>vignesh</Name>
<LineItems>85</LineItems>
</Detail>
</Output>
I have created an external assembly to pull the data from database and concatenating the lineitems in a string as (38,45,88,99,85). Now either I need to use map functoids/inline xslt's.
Please help to move further with some samples.
Regards, Vignesh SHi Vignesh,
Add a scripting functiod as shown here in the image, in the scripting functiod call "Inline XSLT Call Template". This scripting functiod would have two parameters.
1- Name link from the soruce schema. 2- Output something like "38,45,88,99,85" (without quotes). This could be link from the functiod which pulls the data from db. In my case, I just used a string fuctiod which would output
38,45,88,99,85 to the scripting functiod.
In the scripting fuctiod, use the below XSLT template. I have commented the XSLT to detail how it works:
<xsl:template name="ConstructDetailNodeTemplate">
<xsl:param name="name" />
<xsl:param name="value" />
<xsl:variable name="NameFromSoruce" select="$name"></xsl:variable>
<!-- call splitter template which accepts the "," separated string -->
<xsl:call-template name="StringSplit">
<xsl:with-param name="nam" select="$NameFromSoruce" />
<xsl:with-param name="val" select="$value" />
</xsl:call-template>
</xsl:template>
<xsl:template name="StringSplit">
<xsl:param name="nam" />
<xsl:param name="val" />
<!-- do a check to see if the input string (still) has a "," in it -->
<xsl:choose>
<xsl:when test="contains($val, ',')">
<Detail>
<Name>
<xsl:value-of select="$nam"/>
</Name>
<!-- pull out the value of the string before the "," delimiter -->
<LineItems><xsl:value-of select="substring-before($val, ',')" /></LineItems>
</Detail>
<!-- recursively call this template and pass in
value AFTER the "," delimiter -->
<xsl:call-template name="StringSplit">
<xsl:with-param name="nam" select="$nam" />
<xsl:with-param name="val" select="substring-after($val, ',')" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<!-- if there is no more delimiter values, print out
the whole string -->
<Detail>
<Name>
<xsl:value-of select="$nam" />
</Name>
<LineItems>
<xsl:value-of select="$val" />
</LineItems>
</Detail>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
The output would look like this as you wanted for the above your input:
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful. -
Send multiple records to rfc without using BPM
Dear Experts,
Could you please help on the following scenario.
I need to send multiple customer master data records from a file to rfc without using BPM.
The following is the mapping i am using
source Target( RFC)
====== =============
Tree occurance type Tree occurance
cust_mt 1..1
customer 0..unbound -
> ztest_cust( rfc ) 1..1
cname 1..1 -
> cname 0..1
cno 1..1 -
> cno 0..1
bank -
> bank 0..1
item : 0..unbound
code -
> code 0..1
name -
> name 0..1
location -
> location 0..1
1. Multiple banks possible for one customer
2. Multiple customers possible in datafile from mdm
Problem 1:Only one customer record from file is being sent to RFC thouth many records are in the file, the second, third .. and so on records not being sent to rfc.
Problem 2:
if add o.. unbound for the rfc occurance, <messages>,<message1> tags are getting added in message mapping, and no single customer record sent to rfc..
Your help is rewarded with good points.
Appreciate your help.
Thanks.
sravya.Hi VJ,
Thank you for the immediate reply.
one more thing, when i tried to change the occurences of ztest_cust( rfc) to 0..unbound,
I am not seeing the occurances updated in the imported rfc structure.
The following is the wsdl for rfc, could you please help me to add occurances 0..unbound.
Thanks a lot.
sraya.
<?xml version="1.0" encoding="ISO-8859-1"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" name="ZTEST_CUST" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<wsdl:documentation>
test for mdm
</wsdl:documentation>
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<xsd:element name="ZTEST_CUST">
<xsd:complexType>
<xsd:all>
<xsd:element name="CNAME" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CNO" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BANK" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" type="ZST_CUST" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element name="ZTEST_CUST.Response">
<xsd:complexType>
<xsd:all>
<xsd:element name="BANK" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" type="ZST_CUST" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="ZST_CUST">
<xsd:sequence>
<xsd:element name="CODE" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="60" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NAME" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="60" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LOCATION" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="60" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="ZTEST_CUST.Input">
<wsdl:part name="parameters" element="rfc:ZTEST_CUST" />
</wsdl:message>
<wsdl:message name="ZTEST_CUST.Output">
<wsdl:part name="parameters" element="rfc:ZTEST_CUST.Response" />
</wsdl:message>
<wsdl:portType name="ZTEST_CUST.PortType">
<wsdl:operation name="ZTEST_CUST">
<wsdl:input message="rfc:ZTEST_CUST.Input" />
<wsdl:output message="rfc:ZTEST_CUST.Output" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ZTEST_CUST.SAPBinding" type="rfc:ZTEST_CUST.PortType">
<rfc:binding style="rfc" />
<rfc:type name="ZST_CUST">
<ifr:container xmlns:ifr="urn:sap-com:ifr:v2:metamodel" xmlns:xlink="http://www.w3.org/1999/xlink">
<ifr:descriptor>
<ifr:description language="EN">
test
</ifr:description>
</ifr:descriptor>
<ifr:properties>
<ifr:sourceSystem />
<ifr:sourceClient>
020
</ifr:sourceClient>
<ifr:release>
640
</ifr:release>
<ifr:category>
structure
</ifr:category>
<ifr:unicode1>
true
</ifr:unicode1>
<ifr:unicode2>
true
</ifr:unicode2>
<ifr:isFlatStructure>
true
</ifr:isFlatStructure>
</ifr:properties>
<ifr:definition>
<ifr:internalLength1>
180
</ifr:internalLength1>
<ifr:internalLength2>
360
</ifr:internalLength2>
<ifr:fields>
<ifr:field name="CODE" category="simple">
<ifr:descriptor />
<ifr:properties>
<ifr:helpValuesSupported>
false
</ifr:helpValuesSupported>
<ifr:offset1>
0
</ifr:offset1>
<ifr:offset2>
0
</ifr:offset2>
</ifr:properties>
<ifr:definition>
<ifr:scalarType>
<ifr:definition>
<ifr:type>
CHAR
</ifr:type>
<ifr:abapType>
C
</ifr:abapType>
<ifr:length>
60
</ifr:length>
<ifr:internalLength1>
60
</ifr:internalLength1>
<ifr:internalLength2>
120
</ifr:internalLength2>
<ifr:decimals>
0
</ifr:decimals>
</ifr:definition>
</ifr:scalarType>
</ifr:definition>
</ifr:field>
<ifr:field name="NAME" category="simple">
<ifr:descriptor />
<ifr:properties>
<ifr:helpValuesSupported>
false
</ifr:helpValuesSupported>
<ifr:offset1>
60
</ifr:offset1>
<ifr:offset2>
120
</ifr:offset2>
</ifr:properties>
<ifr:definition>
<ifr:scalarType>
<ifr:definition>
<ifr:type>
CHAR
</ifr:type>
<ifr:abapType>
C
</ifr:abapType>
<ifr:length>
60
</ifr:length>
<ifr:internalLength1>
60
</ifr:internalLength1>
<ifr:internalLength2>
120
</ifr:internalLength2>
<ifr:decimals>
0
</ifr:decimals>
</ifr:definition>
</ifr:scalarType>
</ifr:definition>
</ifr:field>
<ifr:field name="LOCATION" category="simple">
<ifr:descriptor />
<ifr:properties>
<ifr:helpValuesSupported>
false
</ifr:helpValuesSupported>
<ifr:offset1>
120
</ifr:offset1>
<ifr:offset2>
240
</ifr:offset2>
</ifr:properties>
<ifr:definition>
<ifr:scalarType>
<ifr:definition>
<ifr:type>
CHAR
</ifr:type>
<ifr:abapType>
C
</ifr:abapType>
<ifr:length>
60
</ifr:length>
<ifr:internalLength1>
60
</ifr:internalLength1>
<ifr:internalLength2>
120
</ifr:internalLength2>
<ifr:decimals>
0
</ifr:decimals>
</ifr:definition>
</ifr:scalarType>
</ifr:definition>
</ifr:field>
</ifr:fields>
</ifr:definition>
</ifr:container>
</rfc:type>
<wsdl:operation name="ZTEST_CUST">
<ifr:container xmlns:ifr="urn:sap-com:ifr:v2:metamodel" xmlns:xlink="http://www.w3.org/1999/xlink">
<ifr:descriptor>
<ifr:description language="EN">
test for mdm
</ifr:description>
</ifr:descriptor>
<ifr:properties>
<ifr:sourceSystem />
<ifr:sourceClient>
020
</ifr:sourceClient>
<ifr:release>
640
</ifr:release>
<ifr:package>
$TMP
</ifr:package>
<ifr:akhNode />
<ifr:released>
external
</ifr:released>
<ifr:outbound>
false
</ifr:outbound>
<ifr:synchronous>
true
</ifr:synchronous>
<ifr:asynchronous>
false
</ifr:asynchronous>
<ifr:unicode1>
true
</ifr:unicode1>
<ifr:unicode2>
true
</ifr:unicode2>
</ifr:properties>
<ifr:definition>
<ifr:parameters>
<ifr:parameter name="CNAME">
<ifr:descriptor>
<ifr:description language="EN">
Character Field Length = 10
</ifr:description>
</ifr:descriptor>
<ifr:definition>
<ifr:scalarType name="CHAR10">
<ifr:properties>
<ifr:helpValuesSupported>
false
</ifr:helpValuesSupported>
<ifr:fixedValuesListDefined>
false
</ifr:fixedValuesListDefined>
<ifr:mixedCaseSupported>
false
</ifr:mixedCaseSupported>
<ifr:signedNumber>
false
</ifr:signedNumber>
</ifr:properties>
<ifr:definition>
<ifr:type>
CHAR
</ifr:type>
<ifr:abapType>
C
</ifr:abapType>
<ifr:length>
10
</ifr:length>
<ifr:internalLength1>
10
</ifr:internalLength1>
<ifr:internalLength2>
20
</ifr:internalLength2>
<ifr:decimals>
0
</ifr:decimals>
<ifr:outputLength>
10
</ifr:outputLength>
</ifr:definition>
</ifr:scalarType>
</ifr:definition>
<ifr:properties>
<ifr:direction>
in
</ifr:direction>
<ifr:class>
import
</ifr:class>
<ifr:type>
scalar
</ifr:type>
<ifr:optional>
true
</ifr:optional>
<ifr:basedOnDictionaryReference>
true
</ifr:basedOnDictionaryReference>
</ifr:properties>
</ifr:parameter>
<ifr:parameter name="CNO">
<ifr:descriptor>
<ifr:description language="EN">
Character Field Length = 10
</ifr:description>
</ifr:descriptor>
<ifr:definition>
<ifr:scalarType name="CHAR10">
<ifr:properties>
<ifr:helpValuesSupported>
false
</ifr:helpValuesSupported>
<ifr:fixedValuesListDefined>
false
</ifr:fixedValuesListDefined>
<ifr:mixedCaseSupported>
false
</ifr:mixedCaseSupported>
<ifr:signedNumber>
false
</ifr:signedNumber>
</ifr:properties>
<ifr:definition>
<ifr:type>
CHAR
</ifr:type>
<ifr:abapType>
C
</ifr:abapType>
<ifr:length>
10
</ifr:length>
<ifr:internalLength1>
10
</ifr:internalLength1>
<ifr:internalLength2>
20
</ifr:internalLength2>
<ifr:decimals>
0
</ifr:decimals>
<ifr:outputLength>
10
</ifr:outputLength>
</ifr:definition>
</ifr:scalarType>
</ifr:definition>
<ifr:properties>
<ifr:direction>
in
</ifr:direction>
<ifr:class>
import
</ifr:class>
<ifr:type>
scalar
</ifr:type>
<ifr:optional>
true
</ifr:optional>
<ifr:basedOnDictionaryReference>
true
</ifr:basedOnDictionaryReference>
</ifr:properties>
</ifr:parameter>
<ifr:parameter name="BANK">
<ifr:descriptor>
<ifr:description language="EN">
test bank type
</ifr:description>
</ifr:descriptor>
<ifr:definition>
<ifr:complexType xmlns:xlink="http://www.w3.org/1999/xlink" name="ZST_CUST" type="structure" xlink:role="type" xlink:href="/Content?TYPE=type&NAME=ZST_CUST" />
</ifr:definition>
<ifr:properties>
<ifr:direction>
inout
</ifr:direction>
<ifr:class>
tables
</ifr:class>
<ifr:type>
structure
</ifr:type>
<ifr:optional>
true
</ifr:optional>
<ifr:basedOnDictionaryReference>
true
</ifr:basedOnDictionaryReference>
</ifr:properties>
</ifr:parameter>
</ifr:parameters>
</ifr:definition>
</ifr:container>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions> -
How to update multiple records in custom table using checkbox in APEX 4.1?
Hi,
I have a SQL report which brings up all the data records using the following query.
select
"REC_NO" AS hidden_rec_no,
"REC_NO",
APEX_ITEM.CHECKBOX (3,rec_no) AS edit,
"MEETING_TYPE",
"PAGE_NO",
"CHECKBOX"
from "XX_TEST" m
WHERE page_no = :p_page_no
Out of all records, any records which are checked, I only want to update their flag to 'Y' on the database column "Checkbox". For this, I have a SUBMIT button on the report region. The processing code on pressing the SUBMIT button is:
DECLARE.
l_row NUMBER := 1;
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F03.COUNT
LOOP
FOR j IN l_row..APEX_APPLICATION.G_F01.COUNT
LOOP
IF APEX_APPLICATION.G_F01(j) = APEX_APPLICATION.G_F03(i) THEN
UPDATE xx_test
SET checkbox = 'Y', -- APEX_APPLICATION.G_F03(j)
WHERE rec_no = APEX_APPLICATION.G_F03(i);
l_row := j + 1;
EXIT;
END IF;
END LOOP;
END LOOP;
COMMIT;
END;
However, that is not happening. Please help me with this. Any solutions/suggestions are most welcome.
Regards.Hi,
Try
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
UPDATE xx_test
SET checkbox = 'Y'
WHERE rec_no = APEX_APPLICATION.G_F03(i);
END LOOP;
END;Code loops all checked checkbox. You do not need commit on page process.
Regards,
Jari
http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0 -
How to update multiple records in the table using POST parameters:
i got this idea from this website:http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-s ingle-sql-query/comment-page-1/#comment-5409. Basically i am trying to update all the status in the results page, and by adding $i in front of the id in the text fields, and checkboxes, i can name the different inputs with different names:
The image of how it takes the inputs is shown here:http://forums.adobe.com/thread/709034?tstart=0
I tried this but got this error:Parse error: syntax error, unexpected T_IF, expecting ')' in C:\xampp\htdocs\Database Query\results_change.php on line 51
will not work in the update code section:
for($i=0;$i<$maxRows_Recordset1;$i++)
{$a=sprintf("%s",GetSQLValueString($_POST['changeid $i'],"int"));
$b=sprintf("%s",GetSQLValueString($_POST['checkbox $i'],"text"));
$display_order .= array(
$a => $b
if($i<$maxRows_Recordset1-1)
$ids = implode(',', array_keys($display_order));
$updateSQL = "UPDATE `change` SET Status = CASE Change_id ";
foreach ($display_order as $a => $b) {
$updateSQL .= sprintf("WHEN %d THEN %s ", $a,$b);
$updateSQL .= sprintf("END WHERE `Change_id` IN ($ids)");Hi,
Try
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
UPDATE xx_test
SET checkbox = 'Y'
WHERE rec_no = APEX_APPLICATION.G_F03(i);
END LOOP;
END;Code loops all checked checkbox. You do not need commit on page process.
Regards,
Jari
http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0 -
How to update multiple records in a table using procedure?
Dear All,
1 am using 11.1.2.1.0
my question is i have a table like
emp id(primary key), empname,location
1 damby blore
2 rocky kormangala
3 biswa india
my question is i need to write one procure that at a time i can update empname and location(wat the value are there in empname and location i need to change at a time).
thanks
DambyHi, Damby,
That sounds like what the UPDATE statement does, exactly. Just use an UPDATE statement to change any number of columns in existing rows. You don't need a procedure, but, if you're using a procedure for some other reason, you can do the UPDATE in the procedure. UPDATE works the same in SQL or PL/SQL.
Sometimes MERGE is more convenient than UPDATE. Like UPDATE, it can change any number of columns, either in SQL or PL/SQL.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
Explain, using specific examples, how you get those results from that data.
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Insert Multiple records using Database adapter with Stored procedure func
Hi All,
I want to insert multiple records on a database using a stored procedure. I wanted to insert those records using a Database Adapter and the Database adapter should be invoked by a Mediator.
Can somebody suggest me with ideas whether it can be acheived with OOB capabtilities in SOA suite or not?
Thanks for your help in advance.
Thanks,
ShivThe use case you want to achieve is feature supported by the DBAdapter and it is possible to invoke the same from mediator.
Please have a look at the oracle documentation and you should be able to get the necessary information.
The below links should help you as well:
http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10231/adptr_db.htm
http://blogs.oracle.com/ajaysharma/2011/03/using_file_adapter_database_adapter_and_mediator_component_in_soa_11g.html
There are some video tutorials as well :)
http://www.youtube.com/watch?v=dFldS-fDx70 This should also help
Thanks,
Patrick -
Update Multiple records using NW CE WebDyn Pro 7.2 interface ITEMDETAILS
We are trying to use SAP Netweaver CE 7.2 and NetWeaver Design Studio 7.2 with the Web Dynpro application interfaces configured to connect to our MDM 7.1 SP06 repositories to develop web screens that allow our end users the ability to maintain MDM repository data without the use of DataManager.
Our first application was to be a simple one to show the business the benefit of SAP Netweaver. Itu2019s very easy to use the interfaces for SEARCH, RESULTSET, ITEMDETAILS, MATCH and MERGE if you plan to maintain one record at a time. We would like to update many records at the same time.
Using the configuration described previously, I find that I am able to select multiple records at one time using the RESULTSET interface and the Context folder of u201CSelectedRecordsu201D but I am not able to pass multiple records at one time to the context u201CIODatau201D used by the ITEMDETAILS interface and allow my end users to see and update multiple records at one time.
If I can pass multiple records from RESULTSET to ITEMDETAILS for display and update would you please provide me with an example of how I would do this in NetWeaver Design Studio for NW CE 7.2..
If I can NOT pass multiple records from RESULTSET to ITEMDETAILS for display and update, Would I then have to write my own wrapper application to read multiple records selected using the RESULTSET interface and the develop my own UPDATE view to display and update more than one record at a time. This would be time consuming since I would also have to write my own back out procedures and validation of update procedures that already happen within ITEMDETAILS. Do you happen to have any CE application examples that show how this is done for a NW CE MDM repository that I can see? The current documentation u201CHow to Build Web Applications Using MDM Web Dynpro Components. pdfu201D falls short in the area of updating multiple records.
Thank you in AdvanceBugs aside, if it's VERY noisy, that might just be the out-of-sync problem (something I'm very familiar with now).
Search the forum for "aggregate sync" and you should get some clues, if this is indeed the problem.
Short of it is, you need to sync the two devices together. Easiest way seems to be to connect the two devices via S/PDIF and set Clock Source to S/PDIF for the "slave" device (set in Audio Midi).
You can also just set the Clock Source as the "master" device in the drop down, bypassing the need for the S/PDIF cable altogether, but I haven't tried this myself.
Macbook Pro CD / iMac C2D Mac OS X (10.4.8) -
How to iterate through multiple records read from a file adapter?
I am reading multiple records from a file using SyncRead file adapter.
I want to iterate through the records to perform some action on every record. How to do this?
I found few threads related to this..but did not get the solution.
Please note that I am using Jdev 10.1.3.4
ThanksFor count expression, I am getting following error:
<Faulthttp://schemas.oracle.com/bpel/extensionhttp://schemas.xmlsoap.org/soap/envelope/>
<faultcode>null:subLanguageExecutionFault</faultcode>
<faultstring>business exception</faultstring>
<faultactor>cx-fault-actor</faultactor>
<detail>
<code>XPathExecutionError</code>
<summary>XPath expression failed to execute. Error while processing xpath expression, the expression is "ora:countNodes(bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection','/ns4:EmpCollection'))", the reason is FOTY0001: type error. Please verify the xpath query. </summary>
</detail>
</Fault>
I hard-coded count, in order to proceed. Then I got following error
<Faulthttp://schemas.oracle.com/bpel/extensionhttp://schemas.xmlsoap.org/soap/envelope/>
<faultcode>null:bindingFault</faultcode>
<faultstring>business exception</faultstring>
<faultactor>cx-fault-actor</faultactor>
<detail>
<code>null</code>
<summary>file:/C:/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_BPELProcess4_1.0_dc4a703c46a242f69d6cea305b2df3a3.tmp/WriteDA.wsdl [ WriteDA_ptt::insert(VbEmpCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: Mapping Not Found Exception. The mapping [C1] for descriptor [class bpel___localhost_default_BPELProcess4_1_0__MD5_ad2539e1386433a9e059bcc969732f11_.WriteDA.VbEmp] could not be found. The input xml record had an element [VbEmp/C1]. ; nested exception is: ORABPEL-11627 Mapping Not Found Exception. The mapping [C1] for descriptor [class bpel___localhost_default_BPELProcess4_1_0__MD5_ad2539e1386433a9e059bcc969732f11_.WriteDA.VbEmp] could not be found. The input xml record had an element [VbEmp/C1]. Make sure that the input xml is valid relative to the xsd and that the mapping exists in the Mappings.xml. If an old version of the descriptor without this mapping has been loaded by the database adapter, you may need to bounce the app server. If the same descriptor is described in two separate Mappings.xml files, make sure both versions include this attribute/mapping. </summary>
<detail>null</detail>
</detail>
</Fault>
The bpel code is as follows (I can share entire BPEL project..But not sure how to attach to the thread :( )
<?xml version = "1.0" encoding = "UTF-8" ?>
<!--
Oracle JDeveloper BPEL Designer
Created: Wed Feb 03 18:00:26 IST 2010
Author: administrator
Purpose: Synchronous BPEL Process
-->
<process name="BPELProcess4"
targetNamespace="http://xmlns.oracle.com/BPELProcess4"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:ns4="http://TargetNamespace.com/InboundService"
xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:client="http://xmlns.oracle.com/BPELProcess4"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/ReadFA/"
xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
xmlns:ns3="http://xmlns.oracle.com/pcbpel/adapter/db/top/WriteDA"
xmlns:ns2="http://xmlns.oracle.com/pcbpel/adapter/db/WriteDA/"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
<!--
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="client" partnerLinkType="client:BPELProcess4"
myRole="BPELProcess4Provider"/>
<partnerLink name="WriteDA" partnerRole="WriteDA_role"
partnerLinkType="ns2:WriteDA_plt"/>
<partnerLink name="ReadFA" partnerRole="SynchRead_role"
partnerLinkType="ns1:SynchRead_plt"/>
</partnerLinks>
<!--
VARIABLES
List of messages and XML documents used within this BPEL process
-->
<variables>
<!-- Reference to the message passed as input during initiation -->
<!-- Reference to the message that will be returned to the requester-->
<variable name="inputVariable"
messageType="client:BPELProcess4RequestMessage"/>
<variable name="outputVariable"
messageType="client:BPELProcess4ResponseMessage"/>
<variable name="Invoke_2_insert_InputVariable"
messageType="ns2:VbEmpCollection_msg"/>
<variable name="Invoke_3_SynchRead_InputVariable"
messageType="ns1:Empty_msg"/>
<variable name="Invoke_3_SynchRead_OutputVariable"
messageType="ns1:EmpCollection_msg"/>
<variable name="Invoke_3_SynchRead_InputVariable_1"
messageType="ns1:Empty_msg"/>
<variable name="Count" type="xsd:integer"/>
<variable name="iterater" type="xsd:integer"/>
</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 BPELProcess4.wsdl) -->
<receive name="receiveInput" partnerLink="client"
portType="client:BPELProcess4" operation="process"
variable="inputVariable" createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<invoke name="Invoke_3" partnerLink="ReadFA" portType="ns1:SynchRead_ptt"
operation="SynchRead"
outputVariable="Invoke_3_SynchRead_OutputVariable"
inputVariable="Invoke_3_SynchRead_InputVariable_1"/>
<assign name="Assign_1">
<copy>
<from expression="1"/>
<to variable="iterater"/>
</copy>
<copy>
<from expression="1"/>
<to variable="Count"/>
</copy>
</assign>
<while name="While_1"
condition="bpws:getVariableData('iterater') <= bpws:getVariableData('Count')">
<sequence name="Sequence_2">
<switch name="Switch_1">
<case condition="bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection','/ns4:EmpCollection/ns4:Emp/ns4:C4') = "Pune"">
<sequence name="Sequence_1">
<assign name="Assign_3">
<copy>
<from expression="bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection','/ns4:EmpCollection/ns4:Emp')[bpws:getVariableData('iterater')]"/>
<to variable="Invoke_2_insert_InputVariable"
part="VbEmpCollection"
query="/ns3:VbEmpCollection/ns3:VbEmp"/>
</copy>
</assign>
<invoke name="Invoke_2" partnerLink="WriteDA"
portType="ns2:WriteDA_ptt" operation="insert"
inputVariable="Invoke_2_insert_InputVariable"/>
</sequence>
</case>
<otherwise>
<sequence name="Sequence_3">
<empty name="Empty_1"/>
<assign name="Transform_1">
<bpelx:annotation>
<bpelx:pattern>transformation</bpelx:pattern>
</bpelx:annotation>
<copy>
<from expression="ora:processXSLT('Transformation_3.xsl',bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection'))"/>
<to variable="Invoke_2_insert_InputVariable"
part="VbEmpCollection"/>
</copy>
</assign>
</sequence>
</otherwise>
</switch>
<assign name="Assign_2">
<copy>
<from expression="bpws:getVariableData('iterater') + 1"/>
<to variable="iterater"/>
</copy>
</assign>
</sequence>
</while>
<reply name="replyOutput" partnerLink="client"
portType="client:BPELProcess4" operation="process"
variable="outputVariable"/>
</sequence>
</process>
From the process flow, I can see that the array element expression works and the first employee record is correctly assigned to the Invoke_2_Input_Variable.
However Invoke_2 is erroring out.
Thanks
Edited by: user8645981 on Feb 5, 2010 2:44 AM -
How to concatenate multiple records into one
Hi everybody:
I want to know if exist some way to concat multiple records into one without using cursors. For example, I have a table named "Authors" like this:
Lan|Author
English|Ernest Hemingway
Spanish|Octavio Paz
Spanish|Mario Vargas Llosa
English|Sinclair Lewis
Spanish|Gabriel García Márquez
And I want to get this:
Author
Octavio Paz, Mario Vargas Llosa, Gabriel García Márquez
I have worked with SQL Server and I can do something like this:
CREATE FUNCTION dbo.MyConcat (@lan varchar(10))
RETURNS varchar(5000) AS
BEGIN
declare @retvalue varchar(5000)
set @retvalue=''
select @retvalue = @retvalue + Author +',' from Authors where lan = @lan
return substring(@retvalue,1,len(@retvalue)-1)
END
ie, do not use cursors to concatenate records. However, with ORACLE, I have to do someting like this.
FUNCTION MyConcat(P_Lan IN VARCHAR2) RETURN VARCHAR2 IS
v_ret VARCHAR2(4000);
v_element VARCHAR2(4000);
v_cursor sys_refcursor;
BEGIN
OPEN v_cursor FOR SELECT Author FROM Authors where Lan = P_Lan
LOOP
FETCH v_cursor INTO v_elemento;
EXIT WHEN v_cursor%NOTFOUND;
IF v_ret IS NULL THEN
v_ret := v_element;
ELSE
v_ret := v_ret || ', ' || v_element;
END IF;
END LOOP;
RETURN v_ret;
END;
Exist some other way to do this?
Best Regards
JackTks both for answer... I forgot to mention that I am using Oracle 10g. I read about LISTAGG() but this function is available for Oracle 11g release 2.
I wil read about the other techniques than Hoek mention
Best Regards.
Jack -
Multiple record created in Cube
Hi BI Expert,
I have got a DSO and it's passing data to infocube. When it passes data, the cube generates multiple records. I am using the following code and this was originally written by BI consultant.
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: /bic/azo_sop_100,
/bic/aZO_POP_100,
/bic/azo_pop0600,
/BIC/AZO_PRE_100,
/BIC/AZO_SBP_100,
/BIC/AZO_SDP_100.
DATA: in TYPE f,
out TYPE f,
denom TYPE f,
numer TYPE f,
vc_df_preq type /BI0/OIDF_PREQ.
Def. of 'credit-documents': following doc.categ. are 'credit docs'
return order (H)
credit memo (K)
Credit-documents are delivered with negative sign. Sign is switched
to positive to provide positive key-figures in the cube.
The combination of characteristics DE_CRED and DOC-CLASS provides
a comfortable way to distinguisch e.g. positive incoming orders or
order returns.
Def. der 'Soll-Dokumente': folgende Belegtypen sind 'Soll-Belege'
Retoure (H)
Gutschriftsanforderung (K)
Soll-Dokumente werden mit negativem Vorzeichen geliefert. Um die Kenn-
zahlen positiv in den Cube zu schreiben, wird das Vorzeich. gedreht
Die Kombination der Merkmale DEB_CRED und DOC-CLASS gibt Ihnen die
Möglichkeit schnell z.B. zwischen Auftrags-Eingang oder Retouren zu
unterscheiden.
DATA: deb_cred(2) TYPE c VALUE 'HK'.
DATA: quot(1) TYPE c VALUE 'B'.
CONSTANTS: c_msgty_e VALUE 'E'.
Variable declarations for
derivation of Fiscal week {by SB:18.10.2007}
DATA: lv_createdon TYPE /bi0/oicreatedon,
lv_period LIKE t009b-poper,
lv_year LIKE t009b-bdatj,
lv_fiscweek TYPE /bi0/oicalweek,
w_vendor like /BIC/AZO_POP_100-VENDOR.
Deriving Master Data Attribute (0MRP_CONTRL)
from 0MAT_PLANT {by SB:18.10.2007}
Hashed table declaration for 0MAT_PLANT master data
*DATA: it_mat_plant
TYPE HASHED TABLE OF /bi0/pmat_plant
WITH UNIQUE KEY plant mat_plant
INITIAL SIZE 0.
$$ end of global - insert your declaration only before this line -
FORM compute_data_field
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
USING COMM_STRUCTURE LIKE /BIC/CS8ZO_SOP_5
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING RESULT LIKE /BIC/VZIB_SOP_1T-SUBTOT_1S
RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line -
DATA: VALUE LIKE COMM_STRUCTURE-NET_VALUE.
DATA: US_RATE_TYPE LIKE COMM_STRUCTURE-RATE_TYPE.
CLEAR RESULT.
IF NOT COMM_STRUCTURE-SUBTOTAL_1 IS INITIAL AND
COMM_STRUCTURE-DOC_CURRCY NE COMM_STRUCTURE-STAT_CURR.
US_RATE_TYPE = COMM_STRUCTURE-RATE_TYPE.
IF US_RATE_TYPE EQ SPACE.
US_RATE_TYPE = 'M'.
ENDIF.
ENDIF.
IF COMM_STRUCTURE-DOC_CURRCY NE COMM_STRUCTURE-STAT_CURR.
CALL FUNCTION 'CONVERT_TO_STAT_CURRENCY'
EXPORTING
DATE = COMM_STRUCTURE-ST_UP_DTE
DOCUMENT_AMOUNT = COMM_STRUCTURE-SUBTOTAL_1
DOCUMENT_CURRENCY = COMM_STRUCTURE-DOC_CURRCY
LOCAL_CURRENCY = COMM_STRUCTURE-LOC_CURRCY
STAT_CURRENCY = COMM_STRUCTURE-STAT_CURR
LOCAL_RATE = COMM_STRUCTURE-EXCHG_RATE
STAT_RATE = COMM_STRUCTURE-EXCHG_STAT
LOCAL_TYPE_OF_RATE = US_RATE_TYPE
STAT_TYPE_OF_RATE = US_RATE_TYPE
IMPORTING
STATISTICAL_AMOUNT = VALUE
EXCEPTIONS
LOCAL_RATE_NOT_FOUND = 1
STAT_RATE_NOT_FOUND = 2.
CASE SY-SUBRC.
WHEN 0.
RESULT = VALUE.
RETURNCODE = 0.
WHEN 1.
CLEAR MONITOR.
MONITOR-msgno = '005'.
MONITOR-msgid = 'SDBW'.
MONITOR-msgty = c_msgty_e.
MONITOR-msgv1 = COMM_STRUCTURE-DOC_NUMBER.
MONITOR-msgv2 = COMM_STRUCTURE-ST_UP_DTE.
MONITOR-msgv3 = COMM_STRUCTURE-DOC_CURRCY.
MONITOR-msgv4 = COMM_STRUCTURE-LOC_CURRCY.
append MONITOR.
RETURNCODE = 4.
WHEN 2.
CLEAR MONITOR.
MONITOR-msgno = '006'.
MONITOR-msgid = 'SDBW'.
MONITOR-msgty = c_msgty_e.
MONITOR-msgv1 = COMM_STRUCTURE-DOC_NUMBER.
MONITOR-msgv2 = COMM_STRUCTURE-ST_UP_DTE.
MONITOR-msgv3 = COMM_STRUCTURE-DOC_CURRCY.
MONITOR-msgv4 = COMM_STRUCTURE-STAT_CURR.
append MONITOR.
RETURNCODE = 4.
ENDCASE.
ELSE.
RESULT = COMM_STRUCTURE-SUBTOTAL_1.
ENDIF.
IF COMM_STRUCTURE-DOC_CATEG CA DEB_CRED.
RESULT = RESULT * ( -1 ).
ENDIF.
If the order type is 'Returns' or 'Credit Memo' then the figure will be changed to positive value. But the cube has got both negative and positive value for the order line.
Order line PO no. 0COST 0CML_OR_QTY
89576 10 925401 130.60 1
89576 10 925401 -130.60 1-
Could you please help me as to how I can resolve this issue?
Thanks.
Edited by: Bhai Basnet on Mar 7, 2008 11:58 AMHi,
the code you provided does not duplicate records.
Most probably the records are duplicated in the start routine, or the key figure is copied in the update rule (so you get 0AMOUNT en 0AMOUNT_01).
So I'd check your start routine and take a look if the key figures are copied. -
When creating multiple records in a table using a SBO object eg invoice object, do you have to create a new business object for each record that is created? There is a lot of overhead in doing this (eg each object takes about 1MB of mem so to create 1000 invoices would hog 1GB of mem). Is there a way to create just one instance of the object and use it to create many records? How is the object cleared in between each record creation?
Greg,
Everytime you call GetBusinessObject() you should, at the end, also release the acquired memory.
This can be done with the following code in .net (C#):
System.GC.Collect();
System.GC.WaitForPendingFinalizers();
Another way to clear all the data is to call the <b>GetByKey(-1)</b>; the document with docentry '-1' does never exists and the fields of the object are normally cleared.
Regards,
Jurgen -
TcDataSet for Multiple Records
Hi,
I am trying to write one custom adapter to fetch some values from OIM database using sql query
That sql query returns multiple records.
I am using tcdataset APIs to get values. However I am able to write the code when it returns 1 value
What is the method of tcDataSet can be used when it returns multiple rows.
Pls suggest.It would be great if you could send some used code snippet.
Thanks!!JRS wrote:
Hi,
I am trying to write one custom adapter to fetch some values from OIM database using sql query
That sql query returns multiple records.
I am using tcdataset APIs to get values. However I am able to write the code when it returns 1 value
What is the method of tcDataSet can be used when it returns multiple rows.
Pls suggest.It would be great if you could send some used code snippet.
Thanks!!
tcDataSet dataSet = new tcDataSet();
dataSet.setQuery(this.oDataProvider, strCheckQuery);
dataSet.executeQuery();
for(int i=0;dataSet.getRowCount() i++){
dataset.gotoRow(i);
}
Maybe you are looking for
-
Error while importing sca file in local development
Hi, I am trying to import a sca file (MDMJ71006_0-10006189.SCA) into the local development of my NWDS. I right click on local development--> Import SC --> Gave path of SC --> Next (All DCs gets displayed) --> Finish. After clicking finish I am gettin
-
I wanna install window 7 in MacBook pro. In that, such software like CADD,Pro-E etc will b support to MacBook pro..??
-
Import a backed-up repository in Designer 9i
Hi, I have a 9i repository on WinNT. From the Repository Administration Utility, I have taken a backup of the repository(Export) and stored it as .dmp file. Now i want to import the backed-up .dmp file to replace the existing repository. But the Impo
-
I have a <SPAN class=GraySubTitleBoldund>Sound Blaster Audigy 2 ZS and want to hook up my Sony Handycam DCR-TRV260. <SPAN class=GraySubTitleBoldund>It appears the ieee394 on the Sound Blaster is a 6 pin. <SPAN class=GraySubTitleBoldund>Is that correc
-
How do I import existing song libraries to my I tunes library?
How do I import existing song libraries to my I tunes library?