cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Update all Payment Modes

rbespalovnc
Participant
0 Kudos
241

I need to update all Paymentmodes and set a specific boolean flag on them. Let's say, the "active" flag

I looked at the solution here: https://answers.sap.com/questions/12761423/how-to-update-approval-status-for-all-products.html and came up with:

 UPDATE PaymentMode[batchmode = true]; itemtype(code)[unique = true]; active
                                     ; PaymentMode                  ; true


Running it in hac results in an error:

 ,,,,no existing item found for update;PaymentMode;true

I'm surely have some PaymentModes, what can be the reason for this error?

Update it turned out all our Payment modes were of type "StandardPaymentMode". Changing the value worked.

But supposing we had several different subtypes of paymentmodes, is there a way to update them all at once without enumerating every single subtype?

Accepted Solutions (0)

Answers (1)

Answers (1)

mpern
Product and Topic Expert
Product and Topic Expert
0 Kudos

If you don't want to deal with different subtypes you could write a groovy script that uses a flexible search to fetch all payment modes and then updates them.

Don't forget to modelService.save(...) your changes and change the commit mode in the groovy console to commit.