Sequence Number in XI Mapping
Hi All,
I have scenario where a sequence number when mapping is done. Consider the example:
In the source message I have one header and 10 line items in the message. The line item in the target message has a field called sequence number. When i map the source message to the target message each of the target line items hould have a sequence number in the order 1, 2, 3..10.
How can this be done? Is there a feature in XI which lets us have a global variable which can be incremented for each line item or a java class which can generate new sequence number for each line item or something.
I'm using message mapping. Java mapping is not used.
Could you please help me?
Thanks,
Sandeep
Hi Sandeep,
u can follow these steps to generate a sequence no using global container.
-> define a global variable by clicking the JAVA_SECTION_TOOLTIP icon on the design tab of source message type of ur message mapping.
enter the following in the GlobalVariables Section
Integer counter =0;
-> define a user defined function (<b>SeqGen</b> let's say)
write the following code in it.
Integer seq = 0;
GlobalContainer globalContainer = container.getGlobalContainer();
a = globalContainer.getParameter("counter");
seq = globalContainer.getParameter("counter");
seq = seq + 1;
globalContainer.setParameter("counter",seq);
return a;
now use this user defined function (SeqGen)in all ur mappings to the sequence no of ur line items.
Hope this helps.
Anil
Similar Messages
-
Route Map - Delete Sequence Number
Hi All,
Taking the cisco example below, which demos how to PBR.
access-list 1 permit 209.165.200.225
access-list 2 permit 209.165.200.226
interface ethernet 1
ip policy route-map Texas
route-map Texas permit 10
match ip address 1
set ip precedence priority
set ip next-hop 209.165.200.227
route-map Texas permit 20
match ip address 2
set ip precedence critical
set ip next-hop 209.165.200.228
How would i safely remove sequence number 20 from the above?
Many thanks.Hi John,
no route-map Texas 20 worked good.
thanks -
File sequence number in a Flat file
Hi,
I am working on Idoc to file scenario wherein my output file will have a sequence number assigned to each level.
there are 4 levels and hence 4 sequence number to be genearted and its values should also have the same sequence number.
i am doing this just by using Counter function.
But when i am getting a multiple detail records, for each detail record(0040) level its keep incrementing.but it should have the same value what its level has.
for ex:
ALPHAMER AS2 E5 710 20114806124829 01.00
0000 00000000 20100102 V3.0 SORD CZ1
0010 00000001 76767 123 100 WER Constant BNG 560011 RAJ WERR 560011 BTM X EN RT
0020 00000001 TYUIOP
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000002 8765 6532 200 45 10 WE 20 AG
0040 00000003 8765 6532 200 45 10 WE 20 AG
0040 00000004 8765 6532 200 45 10 WE 20 AG
9999 99999999
It has to be like this.
ALPHAMER AS2 E5 710 20114806124829 01.00
0000 00000000 20100102 V3.0 SORD CZ1
0010 00000001 76767 123 100 WER Constant BNG 560011 RAJ WERR 560011 BTM X EN RT
0020 00000001 TYUIOP
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000001 8765 6532 200 45 10 WE 20 AG
9999 99999999
Can someone help me in achieving this.
RegardsHi there,
Just to try out from a different view, the following case could be implemented if the pre-requiisites are satisfied:
Pre-requisites:
1) The element that carries a primary factor, let us say, '8765' from your example.
2) Functionally there is an element in your header item that relates the line items under it.
My understanding of your example:
1) Line items present for 00, 10, 40
2) Line item 30 absent in the series
Proposal:
Map source field (the one that is arelating factor, here the one that carries '8765') -> INDEX (start by 0, increment by 1) -> multiply by one.
INDEX standard function property: Donot Reset for every context;
Srikanth Srinivasan
Edited by: Srikanth Srinivasan on Jan 10, 2011 11:02 AM -
Connecting the Sequence Operator to the Mapping Output Parameter?
my OWB Client: 10.2.0.2.8
my OWB Repository: 10.2.0.2.0
I need to obtain a sequence number (from the Sequence Operator), then output it
using the Mapping Output Parameter, if possible.
I have tried two things:
1. Connect Sequence Operator nextval variable to the Mapping Output Parameter.
This generates error:
"Table,View Or Sequence reference 'xx_SEQ.NEXTVAL' not allowed in this
context"
2. Join the Sequence Operator nextval variable with a source table, then
connect a port from the dataflow to Mapping Output Parameter.
This generates error:
"Mapping Input Parameter and Mapping Output Parameter are intended to be
executed before and after the data flow of the mapping and cannot accept
inputs from any part of the data flow."
From what I have seen so far, it appears it may not be possible to use the
Sequence Operator along with the Mapping Output Parameter. If Im wrong, please
let me know of an example of how the Sequence Operator and Mapping Output
Parameter can be connected.
ThanksUser -
Look at adding a Post-Mapping Process to your mapping, there you have a choice of built in functions or custom ones that could return a sequence value for you. You may have to create the sequence outside of OWB ...
TXB -
Sequence number in ADF FORM.
hi All,
I have a table with ID as primary key and have a sequence created for this primary key and have a trigger for generating sequence number while inserting the record in table.
How can i map this Sequence in ADF so while inserting record from Form i can skip the ID column.
Regards,
Suresh kumarI am using MySQL and primary key is auto incremented in my table. Therefore I have selected
SQL Plateform : SQL92
Data Type Map : Java
When I am trying to create entiry object, I do not get option of selecting DBSequence. I did some documents reading, I found out that DBSequence is part of "*Java Extended for Oracle*" Data type Map.
While creating the EO , in the Attribute Settings, I click the Browse and search for DBSequence. I found out oracle.jbo.domain.DBSeqence.
Can someone please let me know that I am going to face any problem in future by using DBSequence in his manner?
Thanks in Advance. -
Hi All,
I have a requirment where the Output file name should be appeneded with a sequence number which needs to be in sync with the number of records processed.
Each time this sequence has to be started from the previous number where it ended.
The soultion at the moment we have used it to store each time this counter in a file and read is back and update when done. Other solution is to meke use of the Tabe on ECC side
Is there any solution with in the map it self to maintain this number.
Any help will be appreciated.
Thanks
-KulwantHi Kulwant,
Within Mapping you cannot save the counter as container and even global variables are flushed once the mapping is executed for the message, so i think we cannot do it using mapping.
Also, dont know if you have tried OS commands feature provided by SAP for file adapter explained in link below:
[/people/santhosh.kumarv/blog/2008/07/27/glimpse-at-os-command-yet-another-scenario]
We can first create the file on some temporary location of the application server and then execute a batch file which would contain the code to fetch previous count(variables in OS commands can hold this value) and increment the same and copy the flie thus created by communication channel by appending the count to file name and also delete the file created by communication channel.
Hope this helps !
Regards,
Amit -
File name generation with sequence number
Hi All,
My scenario is, File to File. I need to generate the filenames at the target side like File1.xml, File2.xml..File9999.xml for each file triggered from source system. The interface tiggesrs multiple times in a day.
For example, for the first time, 5 files triggered, need to generate File1.xml,File2.xml..File5.xml. After some time the interface might trigger with 10 files, then need to generate files as File6.xml,File7.xml....File15.xml . Once the file count reaches 9999 then need to generate the files from 1 (File1.xml)again.
Could you please suggest me the possible solutions. For this any Lookups required?
Regards,
Praveen KumarHi Praveen,
Case 1: If a field in source data carries the information regarding the sequence.
You can map this value ( Directly .. or using some transformation ) in some temporary field in the target and then use a Variable substitution at the receiver communication channel.
Case 2. If the source file name carries the sequence information. then you can enable the Adapter specific settings in the Sender communication channel , and then get the information of the source file name using the Container object in the mapping. Then assign the sequence number to a field in the target , use a Variable substitution at the receiver communication channel.
Case 3 : If Case 1 and Case 2 are not applicable ... then you have to use a Ztable to store the sequence number , a function module to fetch the number , and then use a UDF in which you will implement the RFC call logic.Then the same process .... assign the sequence number to a field in the target , use a Variable substitution at the receiver communication channel.
BR,
Sushil. -
Sequence number/counter in File name using FTP
Hi
I have to add sequence number in the file name. How can i do that? everytime file generates it should pick up the latest file number.
Example File1 File2 File3. 1,2 and 3 are the sequnce number.
RegardsHi ria,
You can do this by dynamic file creation. Use this following code and cretate an UDF. The map the required file format to the target header structure as below;
UDF
sequence number:
IDENTIFIER is the parameter
Import com.bp.xi.util.*;
Code:
return ServiceUtil.getSequenceValue( IDENTIFIER, container, false );
Dynamic file:
Key & Value is the parameter
Code:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get( StreamTransformationConstants.DYNAMIC_CONFIGURATION );
DynamicConfigurationKey confkey = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", Key );
conf.put( confkey, Value );
return "";
Input parameter "Key" is given a constant value"FileName"
Second parameter "Value" is the file pattern
Mapping
Constant(File)concat function sequence numberUDF ==> Dynami File udf ==>target header record.
In the receiver communication channel check the adapter specific function, filename
points if useful
regards,
Murugavel -
Hi,
I need to implement a sequence number in the target structure for each time a message mapping is executed.
As far as i can see on this forum and on sap.help.com it can be easily done with RFClookup inside the message mapping, and best implement something on abap-stack.
I need to decide on using either a z-table or a number range and i need to decide whether to use PI abap stack or ECC abap stack.
Any comments are useful.
kr
RobertHi Bhavesh,
I get interesting considerations on my question.
It will be sequentially, almost for sure, because i get this message via flatfile.
Your second consideration is also interesting. Maybe the source can provide, maybe not (i'm not sure)
Even more interesting if it is really necessary at the receiver side. This i actually asked the business, but still waiting for an answer. Meanwhile i just started looking around for the correct solution.
kr
Robert
On second thought. It will be unique if i use number ranges with RFC lookup, because each number can only be used once.
Edited by: R. den Hoedt on Mar 16, 2011 4:37 PM -
The sequence number of message
Hello Experts,
On the target message we have a field where the message sequence number have to be saved.
So the question is how we can do that?
Is there is some global storage to save the counter?
I guess JAVA-sections and GlobalContainer will not work here as I need some storage which we be global to all instances of the mapping.
Thanks for your responses.
Best Regards,
Artsiom AnichenkaYou can follow these steps to generate a sequence no using global container.
1) Define a global variable by clicking the JAVA_SECTION_TOOLTIP icon on the design tab of source message type of ur message mapping.
2) Enter the following in the GlobalVariables Section
Integer counter =0;
3) Define a user defined function
function myudf(Container container)
Integer seq = 0;
GlobalContainer globalContainer = container.getGlobalContainer();
a = globalContainer.getParameter("counter");
seq = globalContainer.getParameter("counter");
seq = seq + 1;
globalContainer.setParameter("counter",seq);
return a;
4) use myudf to your target field
myudf--->target sequence no field
XI: New features in SP14 -
Help me in sequence number generation
hi
i had written a JSP which reads and displays the all the directories in that pertucular folder
when i click on a perticular folder it should read each and every file in that folder and it should rename it with a sequence number
i.e file0001,file0002,file0003 etc....
the sequence should be reset for each folder and if i add some new files in to diretory it should remember last sequence number and it should assign next number onwards to those files.
at any point of time i may move or deete any file
but each and every foler i should keep track of last sequence number assigned so that next onwards i can reame new files from that number
another constraint is i may delete the files in that directory
i am new to java
so PLZ help me how effeciantly i can write a program
if so PLZ provide me an example
thanks in advancewhen i click on a perticular folder it should read
each and every file in that folder and it should
rename it with a sequence numberShould the files in the underlying file system be renamed or is this "renaming" just an abstraction layer you maintain yourself? In that case you can use JTree of Swing to maintain an own file structure on top of the OS. You just map "your" filenames to the real file names underneath. -
Migration of Sequence of Activities ODS - mapping & aggregation by periods?
Sequence of Activities ODS Migration via text upload/ODS Copy
As part of our data migation, we are considering migrating the ODSs (as per SEM-245 document info and also on help.sap.com)
Fields of some concern to me for this ODS;
0BCS_COIFU Execute Previous Activities - this is blank source system, so I do not need to worry in migration, any concerns?
0CS_COIAC C/I Activity - this is the same in source and target, but I'm concerned about losing initial activities due to having a different starting date (see TIME fields below)
0BCS_SEQNU Sequence Number - this appears to be a sequential number (but there is not a starting point of 0001 in the source system), can I map this as is, or should I re-number from 0001?
0CS_COINR Activity Number - this is just a number range, so I need to ensure that either the target system includes the numbers or I convert to suitable number range for the target - any pitfalls here?
INVESTEE UNIT
Z_xxx Investee Unit
For Investee unit we will be mapping from many to one and some divested units will not be relevant in our migration periods, what problems would occurr if I excluded redundnat records that do not exist in the new system?
- eg if we cut out the ODS records for unit divested in 2006, will the sequence numbers etc, above, be out of synch?
- conversely, if we migrate all of the ODS records but the divested units do not exist in the target system, what will we face?
TIME fields
0FISCPER3 Posting Period
0FISCYEAR Fiscal Year
We are aggregating data for our initial periods (eg source system starts in 2006 but target system starts in 2009), can we aggregate postings to the next period in the target system?
(eg Activity is 1 first consolidation in p12, 2006 and 2 subsequent consolidation in p6, 2007 but we aggregate this into the target ODS as Activity 1 = p12, 2009 and Activity 2 = p12, 2009)
I hope this question isn't too large, no need to answer everything, please let me have any feedback on any of the fields.
Thanks,0BCS_COIFU - I agree that there is probably nothing to worry about for this
0CS_COIAC - have to think a bit on this one, no suggestions at this time
0BCS_SEQNU -not quite sure, but I would map as-is
0CS_COINR - I agree with your assessment and do not see any pitfalls
Excluding redundant Investee unit records is necessary isn't it? I am not certain, but do not think the activity numbers necessarily have to be in synch or chronological. It might be worth askling SAP though. For the alternative of migrating all of the ODS records but the divested units do not exist in the target system, couldn't you create the master data for these and simply exclude them from the hierarchy? -
How to pass the sequence number of current loop in a for loop in FPGA vi to the host
PCI-7830R
LV 8.2
What I was trying to do is to use multiple DIO to generate pulse at different sequence. Mode one is to automatically sweep from DIO1 to DIO20; mode 2 is several DIOs generate pulse simoutaneously. So I use a case structure to make the selection, in the mean time, I set up two for loop in each case so that I can use multiple pulse generations. For example, in scanning mode, if I set 2 exposures, it sweeps from 1 to 20 then do it again.
Then I need to get the loop sequence number, i of each scenario. So I put an indicator within the first loop, and create a local variable of it and put in the second one. Running the FPGA vi alone, I can see the indicator change in each case from 0 to N-1, N being the for loop time.But in the host vi, I tried to add this indicator as an element in the read/write invoke method, in the debugging mode, I could only see it directly jump to N-1 without all the changes I saw in FPGA vi.
Is it possible to get this number passed correctly from FPGA vi to the host vi? ThanksThanks for the reply Jared.
Excuse me if it looks incorrect, but I'm new to FPGA programming, so I would have to look into the FIFO you referred to. I used local variables because for one thing I have several different cases containing for loop in each of them, and I only want one indicator for the "i". If I put the indicator out of any for loop, it's only gonna show the last number which is N-1. For the other thing, it seems like property nodes are not allowed in FPGA vi. And by doing this, I can see the i number changing from 0 to N-1 in each case, well, in FPGA vi's front panel. But while I ran the host vi with everything, the indicator in host vi's front panel only showed the last number N-1. It may be the reason you said, it happened too fast before the indicator in host vi can catch it.
What I want to realize is to group the data I collect in host vi, for example, when I choose multiple exposure in each mode, and the FPGA runs 1 through 20 then do it again, I want the data stored in two groups using the loop sequence number as the seperator in file name. So it goes like 1-1, 2-1.......20-1; then 1-2, 2-2,.....20-2. -
Need to query the database to get the last sequence number
Hi all
I am trying to get the last sequence number of the last row inserted into my Oracle database. Please could someone give me the SQL which would allow me to do this - using Oracle SQL Explorer I have confirmed that there is a sequence on the table which is called: XYZ_SEQ and the code for this is:
CREATE SEQUENCE "MY_USER_NAME"."XYZ_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE ;
My Java application is inserting a row into my table and to insert a new row I need to have the last sequence inserted +1 so the new row can be added.
Any help would be much appreciated.Hi,
Welcome to the forum!
If you are using a sequence just do (example):
INSERT INTO TABLE_NAME
(COL1,
COL2)
VALUES
(SEQUENCE_NAME.NEXTVAL,
OTHER_VALUE);to obtain (and use) the next number in the sequence when you are inserting.
If you have a sequence to use for a specific table, you should use it when your insert new data (no matter your are doing that: java application, procedure, etc). Doing this you avoid some problems when you have the sequence 'out of date' about the associated data.
Regards,
Edited by: Walter Fernández on Sep 19, 2009 10:08 AM
Edited by: Walter Fernández on Sep 19, 2009 10:10 AM -
Portal Master-detail form how to auto assign detail record sequence number
Portal Master-detail form how to auto assign detail record sequence number.Please help me?
You can just read the following section
Can I specify a sequence number generator as the default value for a form column?
Yes. Enter the following in the "default value" field for the column:
#<schema name>.<sequence name>.nextval
where <schema name> is the name of the schema containing the sequence, and <sequence name> is the name of the sequence. The entry is preceded by a "#".
For example, if the schema name is "SCOTT", and the sequence name is "CUSTOMER_SEQ", the default value entry is:
#SCOTT.CUSTOMER_SEQ.NEXTVAL
same way you can do for master - detail form.
for more information on forms please refer the following URL.
http://otn.oracle.com/products/iportal/htdocs/portal_faq.htm#BuildingApplications
hope it helps.
Maybe you are looking for
-
I have an old PC running Vista. On that machine, in iTunes, I copied ALL my CD's. I now have a new machine running windows 8.1. I would like to transfer that music on to the new machine in iTunes. Please help.
-
About every 1 1/2 hours, it automatically shuts down to cool off. Is there any way to manually turn it on? Or, do they have to be replaced?
-
Updating a application question
Ok so I have the game "NFS Shift" and it is 178MB. my ipod touch now has 6gb. There was a update available and when I click on download it is 170mb. does that mean when I finish downloading and syncing to my ipod touch, my ipod touch will have 5.8GB?
-
Vendor Currency & Configaration Document
Hi From where the currecny will come in P.O ?? is from Vendor master or company code?/ Please tell me wat is configaration document?? if you have any pls send to mial id. <b><REMOVED BY MODERATOR></b> Thanks
-
How to have a SFC active but not record labour??
My latest challenge from the shop floor is how to have an SFC still be active without anybody being laboured onto it (Visiprise 4.2) We have several processes that require product to be placed in an oven for a long period of time, sometimes several d