cancel
Showing results for 
Search instead for 
Did you mean: 

Avoiding sending same data to IDOC

Former Member
0 Kudos

Hi

I require help in the following scenario , Blogs , Links or any development approach will be helpful

I have a scenario where PI will receive incoming XML messages in message queues and wil have a lot of filelds and has to be posted into IDOCS.

Now the requirement is to stop before posting ,the IDOC containing the same recods

i.e based on the combination of 3 or 4 fields a unique record is determined and if it has been posted before it shouldnt be allowed to create an IDOC

How can this be done ?

thanks

Rohan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi rohan,

Could you please clarify your need ? what's exactly the goal ? I explain me...

1. Inside ONE XML sending, do you have to "delete" the duplicate data according to your Key fields ?

if yes, ok a solution can be provided in PI... or eventually in ECC.

2. What's happen if your receive the same data but inside TWO or THREE sendings ?

for instance one sending today, and the same data (your key fields) next week.

Do you need to create an Idoc (in fact a data in ECC) ? or do you need to reject this info ?

Depending of your need, the solution can or cannot be done PI (easily).... but only in ECC because the data are inside ECC.

Think also to the question "what I have to do if the Idoc in ECC is in error ?"... because that means the data was not created in SAP with the FIRST sending.

Regards.

Mickael

Former Member
0 Kudos

Hi Michael

" 1. Inside ONE XML sending, do you have to "delete" the duplicate data according to your Key fields ?

if yes, ok a solution can be provided in PI... or eventually in ECC. "

No i have to prevent the IDOC for getting created if the duplicate data is found by PI in the incoming xml and not post it in ECC

it has to be checked and prevented before the IDOC creation .... can it be done in PI ?

" 2. What's happen if your receive the same data but inside TWO or THREE sendings ?

for instance one sending today, and the same data (your key fields) next week.

Do you need to create an Idoc (in fact a data in ECC) ? or do you need to reject this info ? "

Everytime the same dupilcate data is received the same day or on different days it has to be rejected and stopped at the mapping level , tech team here is of a strong opinion that they want middleware to stop the IDOC from getting created so dnt want to do it in ECC.

I was thinking on the lines of parsing the xml and reading those incoming nodes and checking if the data is duplicate but that is very complex, will i have to use Java mapping instead

Most important question : If this has to be dealt with in ECC , how can this be achieved .. i mena after PI has posted the IDOC in ECC with duplicate records how can it be stopped to be used as transactional data

I need some valid arguments to support it should be done in ECC

thanks

Rohan

Former Member
0 Kudos

Hi Rohan,

sorry to say that... but PI is not smart. PI cannot know what data have been correctly created in ECC since the beginning of a GoLive...

Don't forget that an Idoc can be in error in ECC, that means, for instance, that in PI you cannot stored all received messages to do your control.

There are only two ways:

1. The control is done in ECC by encapsulate the standard function module (linked to your IDoc) in a specific Function Mdule. Accordind to me, this the BEST solution. And especially for Performance.

2. The control is done in PI... but as PI does not know which data have been corectly created in ECC, PI has to ask to ECC the info. that's you have to develop such a flow.

a. Sender -> PI

b. via a RFC (for instance) defined in ECC... and so maybe to be developped... PI call this RFC to know if the data have bee, already created in ECC.

c. PI receive the RFC answer and then you have to take the decision: create the idoc or not. That, mean you have to develop a BPM in ECC.

Résumé:

1st solution: develop a FM in ECC to do the check.

2nd solution: develop a RFC in ECC plus develop a BPM in PI with at least two mapping (one for the RFC call and one for the creation of IDoc)... to have a complex solution... which can destroy your PI performance... if you have many entries to check.

Questions:

In which PI version are you. Remind in PI 7.0, the performance of Workflow (sorry BPM) are not like in PI 7.1...

How many data that you have to treat ? if it's huge, the 2nd solution is clearly bad for my eyes

When you develop, think always to the performance !!

That's just my point of view.... everybody can have another one...

Regards.

Mickael

Edited by: Mickael Huchet on Jul 22, 2009 10:00 AM

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>How can this be done ?

easily - in the receiver application (where the data from IDOcs will be stored)

implement a logic like this:

if the idoc contains the same set of data as in tables _ _ _

then don't do anything with this IDOC just set the status to processed

BTW

don't implement this logic on XI as XI is not a application server where data should be stored

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi Michal

The requirement is that the IDOC with the same record ( the once processed before ) ahould not be posted and PI should stop the posting in ECC before hand.

Which is why the tech team here insists that it should be done in the mapping in PI and not handled after the IDOC has been posted, since its a financial posting , and unfortunately after the IDOC is created by PI it will be transactional data by PI which can't be deleted by ECC.

so they want us to check in the incoming xml based on these 3 fields that if the record has been sent ,

Can you tell me the disadvantages of doing this in PI . because iam not able tofigure out how t o do this in PI in the first place

Thanks

Rohan

Former Member
0 Kudos

HI Michal

Can you please reply me on this ?

Thanks

Rohan

Former Member
0 Kudos

Guys

The only requirement here is to avoid unnecesary creation of hundreds of IDOCS in ECC

so to avoid that it has to be done in SAP PI

Can this be achieved .. the Pros and Cons of it ?

Thanks

former_member192295
Active Contributor
0 Kudos

Hi,

In PI we don't have any standard function to prevent duplicate records, better to develop UDF/module according to your requirement. Find below link for more help

/people/sandeep.jaiswal/blog/2008/05/13/adapter-module-to-stop-processing-of-duplicate-file-ftp-location

or

At R3 end in process code develop logic, if data exist in table leave idoc else update idoc data into tables.