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

Impex - use non unique key to update Product

Former Member
0 Likes
854

I'm looking at updating a Flag of all products in a warehouse, warehouseId is a non unique key field, I tried
# Looking to update all products display flags of warehouse 231 to false
# Query where clause equivalent - where warehouseId = 231

UPDATE Product[batchmode=true];itemType(code)[unique=true];warehouseId;displayFlag[default='false'] ;Product;231;

The above impex updates all products to warehouseId 231, how can I update the displayFlag of all products belonging to a particular warehouseId?

PS: In my project, there is only online product catalog, no staging.

View Entire Topic
0 Likes

I'd try adding the unique qualifier to the warehouseId as well, like so:

 UPDATE Product[batchmode=true;itemType(code)[unique=true];warehouseId[unique=true];displayFlag
 ;Product;231;


essentially any attributes that form the "where" part of your query need to be identified as unique when updating in batch mode.

Nice explainer here: https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/1811/en-US/1c8f5bebdc6e434782ff0cfdb0ca...

In theory - as implemented above the impex would have set all warehouseIds to 231 AND set displayFlag to false since batchmode will update all non-unique fields

Former Member
0 Likes

That worked . Thanks.