cancel
Showing results for 
Search instead for 
Did you mean: 

Help Needed for avoiding file Duplication in XI

arkesh_sharma
Active Participant
0 Kudos

Hi Experts !

I am facing a problem with a scenario here.

In the Scenario, from the sender side an EDI XML file is being posted into XI. It is being mapped and then the data is being posted into a JDBC DataBase. The file is also archieved before the message mapping takes place in XI.

Suppose a file named F1.xml comes for the first time, it gets mapped and the contents gets posted in DataBase. If the file F1.xml comes again from the source then it again gets mapped and the contents gets posted again in the DB.

I need to avoid this duplication of files coming into XI so that my DataBase has unique values and entries. And the DB shud not get unnecessarily flooded with duplicate data. Kindly help me in this regard and suggest some feasible solution to this problem.

I had gone thru some of the blogs here but i was not fully satisfied with the search results. Maybe i am using a combination of wrong words for searching.

Kindly let me know what can i implement in a quick and faster manner ?

Accepted Solutions (1)

Accepted Solutions (1)

VijayKonam
Active Contributor
0 Kudos

Best practice to avoid this is creating primary key constraint at the DB level. You should be able to reject the data from the DB it self. Thats the easiest and the best method of achieveing it.

VJ

arkesh_sharma
Active Participant
0 Kudos

Hi,

It'll be of no use if i create a primary key contsraint in the DB coz of the structure in the DB.

For example, If i have a unique document number for each file coming into XI, there are lots of hexadecimal values stored in that file.

Say, if the file number is 12345 and there are five hexadecimal values in that file say A1111, B2222, C3333, D4444, E5555, then if a place a primary key on the document number and if the file is posted again with a new set of hexadecimal values(which was suppose to get a new file/ document number) then there will be errorneous data being posted in the DB which i do not want.

Could you please suggest a more feasible solution to this problem as i want to stop the file before coming into XI.

Former Member
0 Kudos

Hi Arkesh,

If you want to stop the files before they reach XI, then you have to create the custom adapter module.

Check out the blog link in my previous response.

Thanks,

Pooja Pandey

arkesh_sharma
Active Participant
0 Kudos

Hi Pooja,

Is it possible to create a UDF and deploy it in the messsage mapping which will take the input as the document number of the file and query the JDBC database to check if the same document number is already present there and take appropriate actions accordingly.

I am asking you this question coz in that blog that person is seperately maintaining a file for the names of all the files coming into XI and checking against that file if that file is present or not. I already have a DataBase so can i check the file name in the DB in place of looking against the "name.txt" maintained locally ? ?

Regards,

Arkesh

henrique_pinto
Active Contributor
0 Kudos

Yeah, it is possible.

But I'm not sure why you think lookup works but using the document number (or file name) as part of the primary key won't work.

Say, if the file number is 12345 and there are five hexadecimal values in that file say A1111, B2222, C3333, D4444, E5555, then if a place a primary key on the document number and if the file is posted again with a new set of hexadecimal values(which was suppose to get a new file/ document number) then there will be errorneous data being posted in the DB which i do not want.

So, you're saying that if it is possible that the same file name is used for other values?

And, in this case, what are you supposed to do? Import them (since they are new values) or ignore them?

Regards,

Henrique.

VijayKonam
Active Contributor
0 Kudos

If the answers to above questions is yes, then you might have to right lookup code in your mapping. Get the doc number from the file and check against DB.. if they are not already present in the DB.. send them.

VJ

arkesh_sharma
Active Participant
0 Kudos

Hi Henrique,

You got that right. I need to post the new set of values with a new file number. Suppose, the next file F2.xml should contain F6666 and G7777 then it should contain those values. These hexadecimal values should not go into File F1.xml and the old file should not get posted again. If the old file gets posted again then i need to stop that file in XI. That is what the requirement is.

Please suggest a suitable solution for this duplication of files.

Regards,

Arkesh

arkesh_sharma
Active Participant
0 Kudos

Hi VJ,

The answer to the above questions is "Yes".

If i need to have a lookup for it then can you tell me from where can i get a suitable code for this ? ?

Please suggest.

Regards,

Arkesh

Answers (4)

Answers (4)

arkesh_sharma
Active Participant
0 Kudos

The problem with the DB was resolved. There are two possible solutions to this problem:

1. Configure a DB lookup which will check the DB if the entry already exists in the DB. If Yes, It will supress the source data.

2. Create a Adapter Module which will handle the file name before picking up the file.

Former Member
0 Kudos

Duplicate Message Handling feature was introduced in 7.3. The following link might help you.

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c0718e90-93c9-2e10-528f-f4fdf2505092

Former Member
0 Kudos

Hi,

You can do a lookup into db to check whether their is an entry into database/or you can create a table in ABAP-maintain the filenames in ABAP db and make an RFC call to check whether an entry already exists or not.

Below links can drive you through the scenario of making a db/rfc lookup.

DB LookUp

/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

Lookup

Thanks

Nikhil

Former Member
0 Kudos

Arkesh,

If you want to send unique values then why don't u just name the file differently every time? just use a simple UDF to name the file and to check against previous values in JDBC.

I believe it is easier to write a UDF to name file dynamically rather than configuring lookup for mapping.

P.S: Award points if helpful

Thanks and Regards,

arkesh_sharma
Active Participant
0 Kudos

Hi Preeti,

My Bottom Line Requirement is that if a file F1.xml is coming into the XI for the first time then it shud be allowed to pass thru XI and if the same file comes again for the second time then it shud be stopped in XI and, if possible, an Alert shud be generated.

I can create Alerts. There is no problem about that but can you provide me a code to stop file Duplication in XI ? I need to lookup onto JDBC DB to chk whether the file exists on the DB or not ?

Can you provide me a UDF code for this ?

P.S. Point will be awarded for sure but i need a exact solution to this or a sample UDF code similar to my requirements.

Regards,

Arkesh Sharma

Former Member
0 Kudos

HI Arkesh,

You can create a custom adapter module to restrict processing duplicate files.

Check out this blog :

Thanks,

Pooja Pandey