cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Notification

former_member329434
Participant
0 Kudos

Hi Friends,

I have a requirement to create notification from a database source when ever any of production unit gets "0". Could  able to do this with a query and map the same in MII using a BAPI and able to post successfully at the backend.

Requirement demands to check the data source for every 10 seconds for a notification and run the transaction with a scheduler.

for ex; if  unit10 becomes zero on an specfic day.. the entry will keep on updating until the unit becomes operational......

I want to know how to put a logical break to terminate the transaction to trigger only once when a unit gets tripped. After unit gets tripped, only one notification has to be created at the backend and relevant notification number has to be taken back and update back in the database server.

once unit gets into operational, I have to update ECC again using the timestamp from the query  by using the same notification number for closing the notification.

clarifications:

1) If  I schedule transaction every second ,how  should I restrict the transaction to trigger only once .( normally, if we schedule in this particular scenario, I will end up with continous notification at the backend.)

2) Datasource doesn't have the option of flags to control..

3) As long as scheduler runs, transaction will query the datasource every second  and updates ECC.

4) Some times unit may comes into operational after two or three days, till that time i have to check at every second for a value and update.

Can anyone guide me on this..

Regards,

Suman

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Suman,

   If I understood correctly, you have 1. Datasource for which a table fields needs to be checked. 2. Have to post data incase of failure only once. 3. Stop the scheduling once unit is operational and create notification again. .

I would do something like this,  something similar to your earlier logic,

1. Use a query to check if the unit is operational or not.

Condition::If not operational,

2. Check if notification is sent, for this use a flag. You can either create a MDO or better create a shared property.

3. Use a conditional action block.. If flag is true, terminate the transaction. Below actions will not be processed. For logging, you can use event logger action block before terminating to print your message. Use transaction terminate action block.

4. If flag is false, Use JCo to update ECC by calling a BAPI.

5. Get the notification number from response. Store it in a shared property.

6. Map this transaction with a scheduler. Schedule it for 10 seconds.

If the unit is operational

1. Get the timestamp from the query.

2. Get notification number from shared property

3.Use JCo to call a BAPI and map the data.

The only issue is you cannot help the query from hitting the database every 10 seconds. If that's the requirement, then I guess there is no other way too. You have to query the database every 10 seconds.

Also, Shared memory variables are accessible across the project and can be used as flags. The same can be used to store the notification number. They are easy to handle too.

For more info on Shared properties check Shared Properties (SAP Library - SAP Manufacturing Integration and Intelligence)

Regards

Tufale Ashai.

former_member329434
Participant
0 Kudos

Hi Rohit / Tufale,

Thank you for providing your valuable inputs and I shall explore both the options suggested by you.

We are not using PC0 in our scenarios. As suggested ,It would have been easily handled using PC0.  I don't have any experience on  MDO concept. I will be thankful , If you could let me know with a small example on MDO or a Shared property concept on a similar line.

we are using MII 12.2.

Thank you once again for your valuable time and suggestions. I would let you know the outcome in a day or two.

Thanks,

Suman

former_member211944
Active Participant
0 Kudos

Hi Suman,

First try the Shared Property instead of MDO for storing the flag as mentioned by Tufale as that would much more easy and would have better performance.

Regards,

Rohit Negi.

Former Member
0 Kudos

For a detailed explanation on Shared property's usage check Sam's reply in

Former Member
0 Kudos

Hi

   Were you able to get the scenario working?

--Tufale Ashai.

former_member329434
Participant
0 Kudos

Hi Tufale

Issue got resolved. Thank you for providing your valuable inputs.

Regards,

Sum

Former Member
0 Kudos

Glad to be of help

Answers (1)

Answers (1)

former_member211944
Active Participant
0 Kudos

Hi Suman,

Best way would be using PCo as kind of middle layer to the data source and then configuring this eventing you need in the PCo.

PCo has this notification functionality where you can send messages to MII transaction and then have this logic to send the data to ECC in this MII transaction.

Do you have PCo?

If not then you could use this approach:

Basically you have keep a flag which stores whether the notification is already sent or not.

You can use MDO for this.

Create a persistent MDO and store this flag in this MDO.

When you query the datasource and get the value which shows that the unit is unoperational, then check the flag in the MDO(using MDO query) whether the notification is already sent to ECC or not and then only decide whether to sent the notification to ECC.

When you get the correct value for the unit then update the flag in the MDO(using MDO Query) to false so that the next time value is 0 , the notification is sent to ECC.

Clarifications:

1)  Using this MDO approach you could set the flag so that the message is sent only once.

2)  I am not sure whether data sources have control flag. But using PCo would solve this problem.

3)  Though the scheduler will run everytime but this MDO flag approach would not sent notification to ECC each and every time.

4) Yes, if you use this MII pull approach then you would have to query the data source each and every time.

     that is why using PCo would be good solution as then it would be a push from PCo side.

Regards,

Rohit Negi.