Message Mapping : Set Field Name at Runtime
Hi All,
Source structure of my message is :
<recordset>
<Query></Query>----
0 to unbounded
</recordset>
Target Structure :
<SQL>
<key></key>----
0 to unbounded
</SQL>
Now my requirement is such that....if the source message has 3 Query elements then XI should generate key node in target message 3 times but with names key1,key2,key3.
I am not able to set the names of these target nodes at runtime based on the number of query elements in source message.
Can anybody please help me?
HI,,
YOu can not change the names of your "Fields".
Hi,
If you want to change Value you can do that by writing UDF.
Enter this code in UDF.
for(int i=0;i<a.length();i++)
result.addValue("");
Regards,
Akshay Jamgoankar.
Reward points if find useful.>
Similar Messages
-
Hi All,
Source structure of my message is :
<recordset>
<Query></Query>----
0 to unbounded
</recordset>
Target Structure :
<SQL>
<key></key>----
0 to unbounded
</SQL>
Now my requirement is such that....if the source message has 3 Query elements then XI should generate key node in target message 3 times but with names key1,key2,key3.
I am not able to set the names of these target nodes at runtime based on the number of query elements in source message.
Can anybody please help me?your schema already predefine with 'key' as tag name in your target structure,
so you can not do that.
note:
mapping just map data instead of structure.
structure is predefined by you. -
Java mapping - Setting the name of the file dinamically
Hi all,
Problem: I know how to set the name of the file in an Idoc to file interface if I'm using a message mapping, but not if I'm using a Java mapping.
I'm using this code inside a user-defined function of the message mapping so that I can set the name of the file dinamically:
public String GetFileName(String inboundParameter,String IdocNumber,Container container){
String filename;
java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
filename = "cikk_" + dateformat.format( new java.util.Date() ) "_" IdocNumber + ".txt";
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
conf.put(key, filename);
return inboundParameter;
(See also: /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14)
But how can I do that if I'm using a Java mapping??
I don't have the class Container there. How can I retrieve the DynamicConfiguration object without that class?
Thank you very much.Thank you Jin,
I knew that it had to be related with the Map object got in setParameter, but in this link:
http://help.sap.com/saphelp_nw04/helpdata/en/0f/80243b4a66ae0ce10000000a11402f/frameset.htm
you can't find the constant DYNAMIC_CONFIGURATION.
I think it's not up to date. -
Message Mapping, filling field with 0 (zeros) on left
I need to fill a field with values that has variable lenght adding 0 (zeros) on the left, how can I do it ?
I'm using the LENGHT in message mapping, with value returned by LENGHT I use FIXVALUES to map the quantity of 0 (zeros) that I need to add in the field.
Somebody can help me with this problem ?
Thank's.Hi Regis,
You can use the Arithmetic:FormatNum built-in function for this.
If you want to left-pad the number with zeros so that the length is always 10, then specify 10 zeros for the format, 0000000000.
This function takes formats based on java.text.DecimalFormat so you can see all of the possibilities at:
java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html
Thanks,
Jesse -
Changing the field name at runtime in rpt file
Hi everybody
I'm using C# and Crystal Report XI (Deverlop license) to develop windows application in VS.net 2003.
Please help me to change the field name of the bounded column of Crystal report file at the runtime.
(In some case client's database had changed the structure as fieldname, fieldtype. Then they request a utility to change the field names in the .rpt file programmatically )
Thanks
GiangSon
My email address: [email protected]user11200661 wrote:
That's fine but still i want to prefix the schema name within the .sql file. My .sql should contain the name of that parameter only as i want to get that parameter replaced by the schema name at runtime. Some other users are using the same .sql file and they have access to that specific schema only. i want to make the .sql file more general so that it can be used by everyone without altering it every time.Sorry, your requirement no longer makes sense.
If people have to access a specific schema because they need the script for general use, then you will have to hard code the schema name into it.
If the script is to prompt for the schema name and connect to that schema and then use that schema name inside the called sql script, then people would not be able to use it generically, as it would be reliant upon the schema name being passed in.
It sounds as if you're trying to write one generic thing that needs to do two different tasks.
Just have two scripts and make life simple. -
Filtering records in message mapping by field value
hi,
i have a source message:
record: 1..1
--row: 0..unbounded
type: 1..1
data: 1..1
i want to map to target message with the same structure only rows with type = x.
how do i do that in message mapping?
thanks
Tomerif u mean that the target message shud be generated only when type = x use the below mapping.
type------------->
equalsS----->createif--->row(tgt root)
Constant[x]--->
Map
type--->type
data--->data -
Hello,
i want to delete a field in the target structure.
Like you do it with disable.
for example
when in the source field the value is empty i want to disable the target field.
But when there is a value, i want to map this value into target field.
how i have to handle that?
regards,
robinHi,
Use Create If in mapping. i have documented for my requirement. and apply the same logic in your case also.
If the field CHARG is dont have any value in the source means , we shouldnt produce the Target Element . Then we used the Create If logic. If the Field have the value from the source means we have to produce it at target side , otherwise we have to collapse it.
See this Screenshot
http://img258.imageshack.us/img258/8830/createifjo4.jpg
Regards
Seshagiri -
Map Field names to target side
Hi Gurus,
I have a critical Requiremnet where in i need to map the field names from Source structute to the target structure..
For Example:
My Source structure:
<matnr> 123</matnr>
<maktn>XYZ</maktn>
Expected Target structure:
<Node>
<Fieldname>matnr </DFieldname>
<Fieldvalue>123</Fieldvalue>
</Node>
<Node>
<Fieldname>maktn </DFieldname>
<Fieldvalue>XYZ</Fieldvalue>
</Node>
Any Blog on this is highly Appreciated.
Best regards,
Sainath Chutke
Edited by: Sainath Chutke on Feb 23, 2009 8:42 PMHi Sainath,
This is possible using graphical mapping with the help of UDF.
A simplified mapping will look like this:
For Fieldname
constant: MATNR --> useOneAsMany --> 1. UDF -
> Fieldname
MATNR --> removeContext --> /
MATNR --> removeContext --> /
constant: MAKTN --> useOneAsMany --> 2.
MATNR --> removeContext --> /
MATNR --> removeContext --> /
where 1 and 2 are the inputs to the UDF.
For Fieldvalue
MATNR --> removeContext --> 1. UDF --> Fieldvalue
MAKTN --> removeContext --> 2.
Note that you can eliminate the node removeContext just make sure that you set the context to the topmost level of the hierarchy.
The UDF that will be used is of context type: There are two input arguments, input1 and input2:
Here is the code:
StringBuffer e = new StringBuffer();
String b = null;
for (int a = 0; a<input1.length; a++){ e = e.append( "/" + input1[a]);}
for (int a = 0; a<input2.length; a++){ e = e.append( "/" + input2[a]);}
e = new StringBuffer(e.substring(1,e.length())); b = e.toString();
String c[] = b.split("/");
for (int a = 0; a<c.length; a++){result.addValue(c[a]);}
What this UDF does is to add the contexts of the input, it is also taken into consideration multiple occurrences of the MATNR and MAKTN e.g.
MATNR = 12,1234
MAKTN = XYW,XYZ
The output for Fieldname is MATNR,MATNR,MAKTN,MAKTN
The output for Fieldvalue is 12, 1234, XYW, XYZ
Hope this helps, -
Count-Function in Message Mapping
Hey, trying to map following structures:
message
-m1
--m11
-m2
--m22
-m3
--m33
to
message
-m1
--m11
-m2
--m22
-m3
--m33
-f1
--countItems
The nodes m1,m2 and m3 can appear 1..unbounded. In target structure I would
like to have the numbers of all nodes (m1,m2,m3).
For example: In this source structure m1,m2,m3 appear only one time. In the
field countItems I would like to have the number 3.
I tried the count function, but it could only count the structure where I used it (in
this case: f1).
How can I count the above-mentioned nodes?
thanks
chrisHey,
thanks for your answers.
But I still couldn't understand how to do this. I open the message mapping for field f1, but the count function could only be set on an target-element, so where to set the counters for m1,m2,m3? Do I have to insert extra fields under m1..m3?
If I do the counter would increment with every node, so if I have two times m1, in second tree of m1 a two will be insert. If I use the add function, only for these two tree the result would be three!
@Gangisetty Vijaya Bhaskarudu
Is this just one UDF? From where he knows, which nodes he have to count, if I have more than m1..m3, but only want to count this three?
@ sasitharan
same problem as mentioned above:
this doesn't work:
m1--count---\
I can't use m1 as input for count! Or do I have a wrong count function?
<b>....au damm, answered my own question. Of course. I use COUNTER and you use
COUNT!!!!!!!!!!!! I will try this with COUNT!!</b>
thanks
chris -
Need help on message mapping screen
Hi folks,
I am working on file to idoc scenario. I Imported the IDOC to my scenario. In Messaga Mapping IDOC structure displaying fields as a documention. but i need techincal names of those fields.
for Example: In my IDOC 1 field is showing companycode but I want to see that field as a BUKRS.
How to see the technical names of IDOC fields in Message Mapping.
Your help is highly appreciaHi,
I dont think we would be able to see the data element names of the IDOC in XI. Even the imported XSD of Idoc doesnot contain data element name.
We would be only dealing with the field names/ structure of the IDOC for field message mappings. The field names are internally mapped to the data element names in SAP R3 system.
To view the internal mapping between field names and data element names of the Idoc fields, you can go to the transaction 'WE30'. Give the basic type of the Idoc and go to the segment editor. You can find the data element names for each field name there.
Thank you.
Regards,
Subbu -
This field name is not known error
We are repeatedly getting the following error for some of our users .We are unable to trace it.Your inputs would be highly appreciable. We are using dot net 2.0 & visual studio 2005 for development & Crystal Reports 10.2.
error message appearing -u201CThis field name is not known. Error in File C:\WINDOWS\TEMP\DNIReport {61006661-3C45-4100-88AD-09C3D7839CF5}.rpt: Error in formula . 'if({DNIBE.ParentStoreId}= "" or {DNIBE.ChildStoreId} = "") then ' This field name is not known.u201D
Thanks in advanceHello, Janmejaya;
This error occurs when the application is not correctly logged on to the database.
Because we are a two pass reporting system and the first pass looks at the formulas, you get a formula error when data is missing instead of the expected Database logon error.
Confirm that your data is visible to your reports at runtime.
Elaine -
Setting aplicattion name in .pll
Dear proffesionals,
what's the best way to set Aplication name at runtime - what is the practice which is use in your team ?
I tried to create procedure in pll as follows (username and conn string are useful when users sent etc. print screen):
PROCEDURE set_app_name IS
vc_conn_string VARCHAR2(1000); -- used for creating parameter form
vc_conn_user VARCHAR2(100); -- used for creating parameter form
vc_conn_user_string VARCHAR2(100); -- used for creating parameter form
curform VARCHAR2(40);
blkname VARCHAR2(40);
begin
curform := :System.Current_Form; --cannot use :system variables !!!
blkname := Get_Form_Property(curform,FIRST_BLOCK);
vc_conn_string:=get_application_property(connect_string);
vc_conn_user:=get_application_property(username);
vc_conn_user_string:=vc_conn_user||'@'||vc_conn_string;
set_window_property ('window0',Title,vc_conn_user_string);
set_window_property (forms_mdi_window,title,'My application');
--set_window_property (forms_mdi_window,title,'My application name ');
END;When try to compile, i got this error:
PL/SQL ERROR 49 at line 8, column 13
bad bind variable.... ''So, how to find out current form name ?
Thanks in advance,
Adnan
AS: 10.1.3
Forms&Rep: 10.1.2.3.0
DB: 10.2.0.1.0adnanBIH wrote:
Sorry, i don't understand how that function could help me - as i said before, i couldn't use global or system variables in .pll functions or procedures....Of course you can...with the help of the name_in built in:
curform := name_in('System.Current_Form'); -
File to IDOC Senario (Message Mapping)
Hi Experts,
I am a fresher.
This is " File to IDOC Senario ".
I have Doubt on this: ( In Message Mapping)
Source field : MSG
Length : 1/264
Taget field : E1EDKT2 - TDLINE
Legth : CHAR/70
Mapping Condition :
Note: TDFORMAT = ‘=’ (Long Line), until next line of MSG. When new line occurs in MSG, then use TDFORMAT = ‘/’
How to Make the Mapping for this?
Anyone Can help me to get it Quickly.
give your Suggestions and Show some Example Mappings......Hi ,
Below is the generic sol for your problem .Graphical mappings wont workout for your problem while using sub string .
Input -->Input string
Length -->length of TDLINE
MESSAGE_V1,V2,V3,V4....depends on how many TDLINES you expect .Here I have taken 4 .
public void SplitbyLength(String[] Input, String[] Length, ResultList MESSAGE_V1, ResultList MESSAGE_V2, ResultList MESSAGE_V3, ResultList MESSAGE_V4, Container container) throws StreamTransformationException{
int lengthVal = Integer.parseInt(Length[0]);
int InpLenVal ;
for(int i=0;i<Input.length;i++)
InpLenVal =Input[i].length() ;
if (InpLenVal<=lengthVal)
MESSAGE_V1.addValue(Input[i].substring(0));
MESSAGE_V2.addValue(ResultList.SUPPRESS);
MESSAGE_V3.addValue(ResultList.SUPPRESS);
MESSAGE_V4.addValue(ResultList.SUPPRESS);
else if ((InpLenVal>lengthVal) && (InpLenVal <= (lengthVal*2)))
MESSAGE_V1.addValue(Input[i].substring(0,lengthVal));
MESSAGE_V2.addValue(Input[i].substring(lengthVal,InpLenVal));
MESSAGE_V3.addValue(ResultList.SUPPRESS);
MESSAGE_V4.addValue(ResultList.SUPPRESS);
else if ((InpLenVal>(lengthVal*2)) && (InpLenVal <= (lengthVal*3)))
MESSAGE_V1.addValue(Input[i].substring(0,lengthVal));
MESSAGE_V2.addValue(Input[i].substring(lengthVal,(lengthVal*2)));
MESSAGE_V3.addValue(Input[i].substring((lengthVal*2),InpLenVal));
MESSAGE_V4.addValue(ResultList.SUPPRESS);
else if (Input[i].length()>(lengthVal*3) && (InpLenVal <= (lengthVal*4)))
MESSAGE_V1.addValue(Input[i].substring(0,lengthVal));
MESSAGE_V2.addValue(Input[i].substring(lengthVal,(lengthVal*2)));
MESSAGE_V3.addValue(Input[i].substring((lengthVal*2),(lengthVal*3)));
MESSAGE_V4.addValue(Input[i].substring((lengthVal*3),InpLenVal));
else if (Input[i].length()>(lengthVal*4) )
MESSAGE_V1.addValue(Input[i].substring(0,lengthVal));
MESSAGE_V2.addValue(Input[i].substring(lengthVal,(lengthVal*2)));
MESSAGE_V3.addValue(Input[i].substring((lengthVal*2),(lengthVal*3)));
MESSAGE_V4.addValue(Input[i].substring((lengthVal*3),(lengthVal*4)));
Regards
Venkat -
How to know if Message mapping failed?
Hi gurus,
do anyone know how to determine in clean up method if a message mapping failed? i just want to know the status of the message mapping to put it in the trace.
RegardsThanks for your reply Abhishek,
but this is not exactly what i need.
Suppose following Graphical message mapping: two number A and B need to be divided, A/B. If B equal 0 (zero), this will throw Runtime Exception. In some point of my mapping (maybe at the end of it) i need to catch this Exception, or at least i need to know exception happened. I need to know it to update a table with message mapping status, eg succesfully executed, runtime error, etc.
Regards. -
How to dynamic set table names
In our application, the table name can be set at runtime by the customer. So is there a way in Toplink JPA to set table name at runtime (thru annotation or orm.xml) or programatically? Thanks.
Our application will host several domains at once. Each domain will get its own set of database tables for each module it uses. We keep them seperate by using a unique prefix. An example would be domainA.com's blog post table would be called domainA_blogPost, while domainB.com's will be domainB_blogPost. Both tables are the same, except for the name. The name needs to be specified at runtime since the central service controller tells the rest of the application which domain it is servicing and thus which set of tables to use. We will be adding domains dynamically all the time and we can't afford to create new entity sets and recompile the back end for every domain we add. I have been looking at the API and wonder if this is as simple as implementing a solution in our application, or am I going to have to tweek the implementation of toplink?
Maybe you are looking for
-
Unaccurate file properties (size, weight)
Hello, Bridge displays unaccurate properties of files. When I compare the same picture in Bridge and Apple Finder, the same file has different properties, such as size (Bridge seems to show an older version of the file?) ,weight and resolution. I've
-
Installing 8iR2 on Red Hat Linux 6.1
Hi, there, I am trying to instaling 8iR2 on Red Hat 6.1 and get the following messege: Xlib: connection to ":0.0" refused by server Xlib: Client is not authorized to connect to Server java.lang.InternalError: Can't connect to X11 window server using
-
Screen Capture goes where?
I've found a few threads discussing this topic, none of which help me. I installed Leopard through a clean install. Actually, first I upgraded then I archived and installed, lastly I formated and started fresh. That, however, outside of the scope of
-
I am using Image Picker as an addon. Initially it worked fine but not anymore. I follow all the instruction - choosing tab, show all images, select few or all, then Save. An alert appears saying it is saving the selected no. of images, opens the targ
-
ERS Invoice - Invoice done manually, Still it is coming in MRRL
Hi Experts, I have a PO with all prerequisites of ERS. I have done Goods Receipt also. Instead of running MRRL for Automatic settlement, i have done Invoice for the entire quantity manually. Query: But while running MRRL, these PO's are also coming i