How to map an array to fixed fields using Biztalk mapper
I need to remap an array of objects like this:
<Root>
<ListOfObjs>
<Obj>
<Attr1>0000</Attr1>
<Attr2>Hello!</Attr2>
</Obj>
<Obj>
<Attr1>1111</Attr1>
<Attr2>Hello1!</Attr2>
</Obj>
</ListOfObjs>
</Root>
in an output like this:
<Root>
<Obj1_Attr1>0000</Obj1_Attr1>
<Obj1_Attr2>Hello!</Obj1_Attr2>
<Obj2_Attr1>1111</Obj2_Attr1>
<Obj2_Attr2>Hello1!</Obj2_Attr2>
</Root>
So in my XSD schema I have something like this:
Schema Input
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element name="ListOfObjs">
<xs:complexType>
<xs:sequence>
<xs:element name="Obj">
<xs:complexType>
<xs:sequence>
<xs:element name="Attr1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Attr2">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Schema output
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element name="Obj1_Attr1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Obj1_Attr2">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Obj2_Attr1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Obj2_Attr2">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
In addiction I have to evaluate every single value because when I found some conditions (like if value=0000 output should be NULL).
What would be the best way to do it? I'm thinking to develop a custom functoid but I'm not sure it would be the best way, probably it could be done even using XSLT inline transforms, can you point me in the best direction?
Thank you
Hi,
You cannot directly map an array output to any single field in BizTalk mapper.
Couple of options :
1) create
the Xslt or inline C# code
Refer:
http://seroter.wordpress.com/2008/10/07/splitting-delimited-values-in-biztalk-maps/
2) Shankycheil has
provided a solution to similar requirement in the below link, u can also refer that.
https://social.msdn.microsoft.com/Forums/en-US/55ec472d-4f34-4057-b1c6-0e50740f0f6e/how-to-itterate-string-array-values-in-biztalk-mapper?forum=biztalkgeneral
Rachit
Thank you, I already seen both posts, but I'm not sure they are what I need or I can't understand well how to use them.
Speaking about the first solution, as I told before, in the example I should have an array already formed and delimited by a char (something like "obj1attr1-obj1attr2-ob2attr1-obj2attr2". In this situation probably this example could be a good
point to start from, but how to transform my complex input object in a similar formatted string?
About the second I don't understand well what is the working solution that they have adopted. Is the 4 steps solution suggested by Shankycheil? If yes, how can I loop between all array elements and extract all their values?
Similar Messages
-
How to map xml to a fixed length string?
Hi All,
I have a requirement to map request xml to a string of fixed length and format:
For eg,
Source:
<Person>
<Name>George</Name>
<Age>21</Age>
</Person>
Target:
String of format
Name : 8 chars
Age : 2chars.
so the required mapping should result in
"George 21".
Note: 2 blanks after "George" to allow for 8 characters. Is this kind of mapping possible using ALSB xquery? I have tried to create a MFL representation for the string , and used it in the xquery as the targer but it is generating
"George21".Only data present in source is getting mapped :(My advice would be to use MFL transformation for that.
Documentation about MFL can be found at edocs: http://edocs.bea.com/alsb/docs26/fbhelp/index.html
Find tips and tricks about ALSB at my blog: http://dev2dev.bea.com/blog/jordinho/ -
How to Display string array in jsp page using netui-data:repeater tag ??
hi,
I am trying to display a string array in a table using the netui-data:repeater tag.
I have to use a page flow controller Array(1 Dimensional) to be displayed in the jsp.
Can any one tell me how to print the array in a table of 3rows & 5 columns.
Here is the code on which I am crrently working on.
<netui-data:repeater dataSource="{pageFlow.strWorkObject_Array}">
<netui-data:repeaterHeader>
<table cellpadding="4" border="1" class="tablebody">
</netui-data:repeaterHeader>
<netui-data:repeaterItem>
<tr>
<td><netui:label value="{container.item}" >
</netui:label></td>
<td><netui:label value="{container.item}">
</netui:label></td>
<td><netui:label value="{container.item}">
</netui:label></td>
</tr>
</netui-data:repeaterItem>
<netui-data:repeaterFooter>
</table>
</netui-data:repeaterFooter>
</netui-data:repeater>weblogic.developer.interest.workshop
Mansoor Naseem wrote:
I would like to know where the pageflow newsgroup is.
These are all the groups in weblogic.developer.interest:
weblogic.developer.interest.60beta.* (5 groups) weblogic.developer.interest.management
weblogic.developer.interest.61beta.* (2 groups) weblogic.developer.interest.misc
weblogic.developer.interest.clustering.* (1 group) weblogic.developer.interest.performance
weblogic.developer.interest.commerce weblogic.developer.interest.personalization
weblogic.developer.interest.ejb.* (3 groups) weblogic.developer.interest.portal
weblogic.developer.interest.environment weblogic.developer.interest.rmi-iiop
weblogic.developer.interest.jdbc weblogic.developer.interest.security
weblogic.developer.interest.jms weblogic.developer.interest.servlet
weblogic.developer.interest.jndi weblogic.developer.interest.tools
weblogic.developer.interest.jsp weblogic.developer.interest.weblogicenterprise
MN -
How do i outline the outside of fields using numbers?
How do I outline the outside of different fields using numbers?
You can use the tools in the toolbar after you selected the cell(s) you want to change the border of:
after you select the cells select (one at a time) the option circled in green, left to right:
1) select the edges
2) select the style
3) select the weight
4) selec the border color
you can get additional details from the Numbers users guide you can download for free from Apple:
http://support.apple.com/manuals/#productivitysoftware
page 87 covers borders -
I am making a form in Acrobat XI pro.
In one text field, I created an array of several elements. I want other text fields to display certain elements from that array. For instance, one field should display the 3rd element, another field should display the 13th element, etc.
The Javascript for making the array is very long, and so I don't want to have to re-calculate the array every single time (in order to reduce rendering time when I open the form on an iPad). This is why I'd like to only have to create the array once, and simply refer to it throughout the form.What code are you using to update the array currently? Are you completely rebuiding it when an element changes, or just changing specific elements for certain fields? I'm still not sure what exactly you are trying to do, but something like this in a document level script will create your array:
var myArray;
// Call 'updateArray' to initialize array
updateArray();
function updateArray() {
// Code here to create/update array
myArray = new Array();
myArray[0] = "Value 1";
myArray[1] = "Value 2";
myArray[2] = "Value 3";
Then, for each field that needs to update this array, you can add a call to 'updateArray()' in the appropriate event. This will rebuild the array completely; if you just want to update specific elements, then you can access them directly. -
JPA - How to map relation with NON-KEY field.
Hello.
Problem with mapping is NullPointerException when calling EntityManager em.createNativeQuery:
Table1 (Bm_Treeassoc):
MY_ID (Primary Key)
BOOKMARKID (-> MY_ID in Table2)
Text
Table2 (Bm_Bookmark):
MY_ID ( Primary Key)
Text
//CLASS BmTreeassoc
@OneToMany(targetEntity=BmBookmark.class, mappedBy="treeMaster", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private BmTreeassoc treeMaster = null ;
//CLASS BmBookmark
@ManyToOne(targetEntity=BmTreeassoc.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = true)
@JoinColumn(name="MY_ID", referencedColumnName="BOOKMARKID", unique=true)
private ArrayList<BmBookmark> bookmarks = new ArrayList<BmBookmark>() ;
This Leads to the exception.
Mapping form MY_ID to MY_ID instead BOOKMARKID will not throw the exception,
so I assume I have a problem with the KEY Field?
Any ideas?
Kind regards
FrankOK,
after reflecting (after maniacally trying for days).
Here is the answer by myself:
I do not use the mapping stuff at all no more.
I solved my join by using a view:
CREATE VIEW SAPDEMO.VTree
AS SELECT t.TreeID, b.MY_ID, b.CLIENTID, b.Nickname, u.URL
FROM SAPDEMO.BM_TreeAssoc as t
JOIN SAPDEMO.BM_BOOKMARK as B ON t.BookmarkID = b.MY_ID
JOIN SAPDEMO.BM_URL as U ON b.URL = u.MY_ID
Create the entity and then do a:
select * from VTREE where clientid=1 and treeid=446
Works great, simple, fast. -
How to define an array of fixed length
hello, i have a basic application in which i need to define an array of size 19; and add 19 elements to it.
Once 19 elements have been written to the array, i want to start writing to the array from index 0.
It's like in C language, where-in you define array_size in init, and once the array is full, you overwrite the 1st element and so on.
i hope my question makes sense...
any help is appreciated.
Now on LabVIEW 10.0 on Win7Hi Check out these VIs as per your discription. You can try your own method.
PBP (CLAD)
Labview 6.1 - 2014
KUDOS ARE WELCOMED.
If your problem get solved then mark as solution.
Attachments:
Your VI.vi 10 KB
Fill Array.vi 16 KB -
How to find Maximum of a date field using BEx
We are trying to just display the maximum of a date field in a BEx report along with some fixed text .
If we need to create a formula using Maximum function , how to use the same?
For ex, we have a field "Flight Date" in the cube and cube has been updated with flight date till 10.09.2006.
we want to display in the BEx report something like "Flight details are available only till <maximum of the flight date field from the cube>"
Please help.Srilakshmi,
Create a formula on the data and then sort the query on the date , that way the latest date would come on top. I am not sure if you can have something the way you have described..
an option could be :
Have a query on the cube with a condition of top date where the date could be a formula , this way you would get the latest date. se this as a value set to filter another query that displays only the date and nothing else , have some static text beside the query to indicate that this is the latest date.
Hope it helps..
Arun
Assign points if helpful -
How to Generate sales orders with custom Fields using BAPI_BUSPROCESSND_CREATEMULTI
Hi,
I need to generate sales orders with custom fields on table CRMD_ORDERADM_H using BAPI_BUSPROCESSND_CREATEMULTI, after changing the structure BAPI_TE_CRMD_ORDERADM_H, and feed the EXTENSIONIN table of the BAPI with data, the order is created, but any value on custom fields.
After debuging, I saw that the BAPI search for structure conversion in table CRMC_OBJECTS_GEN, but we haven't entry with BAPI_TE_CRMD_ORDERADM_H in this table. is that the problem ?, Is there any way to fix it?
Best Regards,
Salah.That depends on where do you have the customer fields, check the table CRMD_CUSTOMER_H, if your custom fields are there, you need to use the changing parameter CUSTOMER_HEAD, I guess your already checked that one, right? but there's no custom fields, well...AET/EEWB doesn't enhance the strcuture of the BAPI, so you should do it manually, check the note following note for further details.
988410 - FAQ: User-defined fields in the BAPI
If you don't have access to the SAP Marketplace, in resume you should create an append on the structure BAPIBUS20001_CUSTOMER_H and include the following strcutrue CI_EEW_CUSTOMER_H
Cheers!
Luis -
How to update a People and group field using a sandbox solution
Hi,
I am creating a sandbox solution for office 365 and creating a custom form using visual web part, which will allow users to enter data in a custom list.
And that list also have a user field. I am able to get SharePoint user field on the form (using javascript) which is searching for the user and get a value (working fine).
Issue: But I am not able to save the user value. Because to save user value I require web, UserID and login name, to construct SPFieldUserValue object or string in "111;#TestUser" format. Moreover that user should be present in
SiteUserInfoList.
I tried web.EnsureUser() but did not work under sanbox solution.
Can you please provide any pointer or workaround to the problem? I may be missing something here.
Thanks,
HimanshuHi,
According to your description, my understanding is that you want to update the people and group field in Sandbox solution.
In the sandbox solution, you can still use the web.EnsureUser() function to get the user information, see the thread below:
EnsureUser in sandboxed solution
In additional, there is a demo with your similiar requirement for your reference:
Using the People Picker Control in Sandbox Solutions / Office 365
Thanks
Best Regards,
Jerry Guo
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
How to encrypt byte array with out padding using RSA in Java?
I've modulus and public exponent as byte[] array, so I'm trying to convert into BigIntegers and then create public key and then Cipher. Here is the example code:
With this I'm always getting different encrypted bytes, is it because of padding. I dont want to use any padding so what parameter I need to pass along with RSA? I've modulus byte[] array size 64 bytes. I believe I'll get 64 encrypted bytes. I've content size of 32 bytes to be encrypted.
--------code begin ---------------------------
BigInteger bexponent = new BigInteger(pubExpo);
BigInteger bmodulus = new BigInteger(modulus);
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(bmodulus, bexponent);
RSAPublicKey pubKey = (RSAPublicKey)keyFactory.generatePublic(pubKeySpec);
Cipher c = Cipher.getInstance("RSA");
c.init(Cipher.ENCRYPT_MODE, pubKey);
return c.doFinal(content);
--------code end---------------------------With this I'm always getting different encrypted
bytes, is it because of padding. Yes, if you're using PKCS1Padding (which is the default in SunJCE if you don't specify it). Have a look at the PKCS1 spec if you haven't seen it already.
http://www.rsasecurity.com/rsalabs/pkcs
Section 7.2.1 talks about type 2 padding, which uses random bytes as the PS string.
I dont want to use
any padding so what parameter I need to pass along
with RSA? NOPADDING. You should be able to find this out by look at the "Supported Paddings" parameter in your provider's database. Which of course, means you'll need to supply the right number of bytes to the Cipher. -
How to parse/extract XML from clob field using ODI
Hi,
I am very new to ODI. I have an oracle table which has clob field. This clob field contains xml. I would like to parse this xml and convert it to oracle table. Means I would like to make all the tags of xml as oracle table columns.
I have created a PL/SQL procedure and used XMLTABLE function and I have achieved my goal. The same this I am trying to do with ODI. Since I am new to ODI so any help is appreciated.
ThanksIn 9.2, you are limited into your options. Have a look into, among others, updateXML. Updating tp 10gR2 will give you more options to succeed.
-
How to make an array with ActiveX Excel using Excel_RangeSetValue2?
Hello,
I want to make an array on Excel. For that, I'm using two functions : Excel_WorksheetGetRange and Excel_RangeSetValue2.
I write the array on Excel file but only the first case of the array is copied.
Here, a part of my program :
char * DataToWrite = {"A", "B", "C", "D"}
char cCell[10];
VARIANT vCell, Data;
ExcelObj_Worksheet hWorksheet;
ExcelObj_Range hRange;
CA_VariantSetCString (&vCell,cCell); //cCell = A1:A4
Excel_WorksheetGetRange (hWorksheet, NULL, vCell, CA_DEFAULT_VAL, &hRange);
CA_VariantSetCString (&Data,DataToWrite );
Excel_RangeSetValue2 (hRange, NULL, Data);
Here what I obtain when I'm compiling on Excel file :
A
A
A
A
Solved!
Go to Solution.You should use other instructions to fill the range of cells:
strcpy (msg, "A1:A4");
CA_VariantSetCString (&MyVariant, msg);
Excel_WorksheetRange (ExcelWorksheetHandle, NULL, MyVariant, CA_DEFAULT_VAL, &ExcelRangeHandle);
Excel_RangeActivate (ExcelRangeHandle, NULL, NULL);
// Create a SafeArray from array of data
CA_VariantSet2DArray (&MyVariant, CAVT_CSTRING, righe, 1, array);
// Transfer data to Excel range
Excel_SetProperty (ExcelRangeHandle, NULL, Excel_RangeValue2, CAVT_VARIANT, MyVariant);
ClearObjHandle (ExcelRangeHandle);
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
How to Map the Unit field in case of DSO and INFOCUBE
Dear Experts,
I have a issue ,Please help me to solve this
I have DSO as provider ,
And, i have to map transformations btw the Datasource and DSO.
In generic Data source, i have unit fields like BASME,MEINS (Quantity units) & STWAE (currency field)
and normal Quantity fields like KWMNG,OAUME(quantity related),OAUWE (value related).
In DSO data fields as Key figure info objects like 0Quantity (which have 0Unit as unit of measure) and some other key figures which have there respective unit of measure in info object definition.
So you Please tell me how to map the Quantity ,Amounts, unit fields to key figures that we have.
(How it will be for both DSO and Info cube is there any difference?)
Edited by: AnjunathNaidu on Jan 18, 2012 1:20 PMNavasamol ,
If it is works ,will u please tell me what is the difference ,if the transformations btw data source and DSO and
what is the difference btw data source and info cube and btw DSO to Infocube or cube to cube .
And i have seen the Quantity fields and there respective unit fields are mapped directly to key figure info object
in case of Info cube . Its working fine .
If only 1:1 mapping allowed in DSO data fields key figures and there respective unit of measure characteristic.
why this difference btw DSO and Info cube can any one explain me in detail.
Expecting your valuable suggestions.
Thanks & Regards,
Anjunath Naidu
Edited by: AnjunathNaidu on Jan 18, 2012 4:05 PM -
How to map the user to Responsible Person for Proj/ Capital Investment Prog
Hi All,
Could you please help me in mapping the user to Responsible Person for Proj/ Capital Investment Prog.
Here is the scenario. I am trying to restrict the user to access only WBS under a cost center but not to have complete access to the Cost Center. I in my way to do, I found out that we can create a user name using OPS6 tcode and use the reference number of the user we created in CJ20N, so as only the person who was added in the Responsible Person for Proj/ Capital Investment Prog list will be able to access particular WBS.
Now my question is, How to map the user which I created using OPS6 tcode to user in user master record. I am not able to map the user, as its taking any random name to add in the list. Could some one please help me in mapping the user created in the list with the user master record.
Hope I managed to put the question clearly. If you have any queries, please feel free to ask. Appreciate your time and thanks in advance.
Farooq.Hi Stephan,
Thanks for your time and finding SAP note for me. I got the problem fixed. The solution for the above problem is, When we create a responsible person for the project through OPS6 tcode, we have a column called "Offer User", next to the person responsible. We must add the user name next to it. And we can add only the user name which is present in the user master record.
It solved my problem, but when I pressed F1 for help in this column, there is nothing mentioned about its mapping or anything.
Thanks again for the help, Cheers,
Regards,
Farooq.
Maybe you are looking for
-
How do I get just the tracks I want!
I'm still new to sound track and I'm having some problems. I have been given a voice over recording on cd and it has several takes on it. In soundtrack I have imported these clips and put tighter the version of the voice over I want to use. To make t
-
System Win7 Prof Nightly 13.0a1 Latest Adobe Flash Player Whenever I try to open a video browsing any news-paper, I receive sound but no picture to the sound; the picture is a white screen only.
-
No error messages by Syntax Checker, even there a lot
Our Design Editors (9.0.2.94.11) Syntax Checker gives never an error message, not even there are syntax errors. What can I do?
-
I authorize my computer, but my iphone wont sync
I have an new 5c and want to sync to my computer. I authorize my computer, but the new 5c will not sync. Why?
-
My daughter wants to play Minecraft PE with her friends when they are here at the house, but I cannot get things to work. I suspect this is an Airport issue because we have done everything that the Minecrafte forums suggest to do to get this to work