on 01-04-2010 4:20 AM
Hi all,
I have a problem regarding Real time counter. I have a field in the output structure that have unique values. The name of the field is unique document name.
For example I sent a message today with a unique doc name of test-00001. How can I send another message so that its unique doc name would be test-00002? The message could be sent anytime (right after test-00001 or tomorrow).
I understand that we can set counters for messages that are passed from 1 source. What if there are multiple sources?
Regards,
IX
Hi,
if the name of document name in message is unique ,not a constant value then you can pass this value using Dynamic configuration UDF.
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the option 1 mentioned in this blog: /people/shabarish.vijayakumar/blog/2009/10/05/pixi-maintaining-sequence-numbers-in-file-name-scheme
From what I understand docName is the name of a node in your target structure and not the name of your target file....if this is the case you dont need Dynamic Configuration.
Regards,
Abhishek.
Hi ,
send the document name in inoput message as orgument to UDF,
here str1 is the argument i used.use same logic..
i hope it will work finr
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
// change to new file name
conf.put(key, STR1);
return "";
Regards,
Raj
Hi, the unique doc name that I'm talking about is a field in the output. not the filename. How can I output a value that has a counter in an output field in the output message. For example, in field unique_doc_name, the 1st message passed should have the value test-00001. In the second message, field unique_doc_name should have a value test-00002. The third message, test-00003.. and so on.. How can I do this in the mapping? Thanks everyone!
Hi,
Since you need the unique name in the target & the message coming to XI are indepenedent of eachother. You need to relay on any external DB for acheving this..
Maintain a variable in any external DB and try to reterive it and increment the value and pass the value to output using a lookup from the XI mapping.
You can use RFC, SOAP or JDBC adapters for this lookup based on the DB you wish to use.
this feature will be similar to the functionality provided by seeburger variables in EDI integration.
Regards,
Sunil.
Hi Igantius,
>>I'm not an expert in DB but I believe I can use your suggestion. Is it okay if I use an ABAP table?
Yes you can maintain the counter in a z table and then access it in message mapping (using the standard RFC lookup function). The functionality of this look up RFC will be to take the previous value and update the z table with an incremented value..
Regards
Suraj
Hi, I have read this blog:
/people/shabarish.vijayakumar/blog/2009/10/05/pixi-maintaining-sequence-numbers-in-file-name-scheme
Number 1 states that, "1. Maintain a table in SAP. Use/Code a RFC call to lookup the sequence number from this table, incrementing the value after it is read. " How can I increment the value in the table? I have searched SDN and found codes on how to read from a table, not to write in a table. Can anyone provide me with a sample UDF on how to write in a table (like RFC lookup). Thanks so much!!!
HI,
Just red these comments from the same blogs. See if it helps you in your case otherwise you have to go for creation of custom z-table.
Why ot just use the built in counter for the file name? In the receiver File communication channel, Processing tab,
set the file construction mode to Add Counter, and then set the counter parameters accordingly.
This is a standard feature and requires no workaround...
Why not use the built-in counter?
2009-10-06 06:17:01 Shabarish Vijayakumar Business Card
the limitations of that would be my point 5;
5. Counter option in the adapter - Only helps if you are using the NFS protocol
and also only if the counter is needed at the end of the file name (before the file name extension)
Regards,
Sarvesh
Ok, so my advise is, first you go through this link and understand the concept of RFCLookup along with creating a Z-FM as mentioned in this document then you can simulate your solutions with this one.
If you are not very much comfortable in ABAP then take help from any of your ABAP colleague.
Hi Ignatius,
If you are in PI7.1, then you can make use of the standard RFC lookup function in graphical mapping (under conversions)
Else take the code from this documents:
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
Regards
Suraj
better option is to add datetime with filename
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.