Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error handling transaction manager

frankmueller9
Participant
0 Likes
1,638

Dear BOPF experts,

I want to develop an interface to create a mass of SAP TM Forwarding Orders.  

  

I learned that BOPF is designed to handle mass data. All validations, determinations, actions and so on have a table of keys as importing parameter to do something for a mass of data. 


I want to use this performance advantage in the interface. I want to pass the modify method of the service manager a package of forwarding orders to create them and call then the save method of the transaction manager. This seems to work fine, but I’m facing issues with the error handling. The transaction manager saves by default nothing if an error occurs during the consistence validation. 


I need another error handling:

When the service manager creates the nodes then errors can occur based on validations. In this case I want to protocol the errors and remove these corrupted forwarding orders from the transactional changes, but the correct forwarding orders shall be created. When I call the save method of the transaction manager then it executes the consistence validation again. If errors occur at this time then I want to save the correct forwarding orders, protocol the errors and discard the corrupt ones.


Is there a way to do this with BOPF, or do I have to create all forwarding orders one by one? 

  

Best regards 

Frank 

1 ACCEPTED SOLUTION
Read only

former_member190794
Active Participant
0 Likes
1,395

Hello Frank,

transactions are stored in the one-or-nothing principle, that means you can't save only a part of the instances modified during the same transaction. However you do not have to single process your instances. I recommend to package your workload - e.g. take packages of 100 instances depending on the size of a BO instance - and create those in a transaction and save. In case of error messages returned, retry the package again without the instances having caused the errors. Otherwise continue with the next package. To filter out instances causing issues check the message's origin location to identify the failing instance. Processing your workload in that way is usually quite fast especially if errors are not occur frequently.

Best regards

Tilmann

3 REPLIES 3
Read only

former_member190794
Active Participant
0 Likes
1,396

Hello Frank,

transactions are stored in the one-or-nothing principle, that means you can't save only a part of the instances modified during the same transaction. However you do not have to single process your instances. I recommend to package your workload - e.g. take packages of 100 instances depending on the size of a BO instance - and create those in a transaction and save. In case of error messages returned, retry the package again without the instances having caused the errors. Otherwise continue with the next package. To filter out instances causing issues check the message's origin location to identify the failing instance. Processing your workload in that way is usually quite fast especially if errors are not occur frequently.

Best regards

Tilmann

Read only

0 Likes
1,395

Hello Tilmann,

thank you very much for your support.

I will do it this way.

Best regards

Frank

Read only

0 Likes
1,395

Hello Tilmann,

one thing is not optimal on this approach.

It is not ensured that all messages have an origin location. So I can only try to find for all error messages the root node based on the origin location filter then the correct forwarding orders and do a mass creation again.

If there is at least one error message where I can’t find the root node, then I have to do a sequential creation to find the error.

Is there any other way to find the incorrect root nodes?

Best regards

Frank