cancel
Showing results for 
Search instead for 
Did you mean: 

Script/Event doesn't get triggered when uploading Material with PI

Former Member
0 Kudos

Hello everyone,

I'm encountering a problem when uploading Materials to C4C using SAP PI.

The Materials are coming from an ERP system.

However, this load doesn't seem to trigger any scripts/events...

I've tried the root node before save and after modify, common node before save and after modify, quantity conversion node before save and after modify... None of the events seem to be triggered when doing a PI load.

Is there something special that needs to be done with the script?

Or is this simply normal behavior? And has anyone else ever encountered this problem?

Thanks & Regards,

Glenn

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Everyone, many thanks for the quick and useful replies!

Me and my colleagues  appreciate it very much.

It seems to be working now. However, we still don't fully understand why it wasn't working at first...

Thanks & Regards,

Glenn

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Glenn,

It does not matter who or what is changing the BO instance.

If there is a change the save for this BO is called. If you have BeforeSave or AfterModify snippets defined for the Material they should be called.

How do you determine that these snippets are not called?

Bye,

   Horst

Former Member
0 Kudos

Hello Horst,

Thanks for the reply.

Well Horst, in the snippets we are trying to fill 3 extension fields.

These are calculated fields and the data for the calculation has to come from the Quantity Conversion-node. So we thought that maybe the Quantity Conversion-node doesn't contain any data at time the script is called which would explain why the extension fields aren't filled.

So we wrote some code to put some hard values into extension fields, but even then the fields remain blank. That's why we now think the event/script/snippet doesn't get triggered at all...

Regards,

Glenn

Former Member
0 Kudos

Hi, in order to trigger the aftermodify or the beforesave, you must modify some value in the instance of the modified BO.

If you are not passing any parameter to the webservice (via pi) the events will not run.

Former Member
0 Kudos

Alessandro,

What if there isn't an instance created yet?

Meaning the PI creates the instance.

Regards,

Glenn

Former Member
0 Kudos

HI Glenn

in that case the event before save must be called ( if the instance has been created successfully).

is that your case? Can you post your absl code?

chandansb
Active Contributor
0 Kudos

Hello Glenn,

If these extension fields are supposed to be filled with the value which would be calculated from the values on ERP system, why don't you try to calculate the values in the PI system and simply map the results to the extension fields that you have created in C4C. This will involve the custom integration using the extended Web Service from C4C.

Regards,

Chandan

Former Member
0 Kudos

Hello Chandan,

We also thought about this...

But this was the last option we wanted to go too.

Regards,

Glenn

Former Member
0 Kudos

Well, Alessandro,

Most of the time this will be the case, but not always however...

Do you suggest we replicate the code in both events?

Thanks & Regards,

Glenn