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

Can we synchronize products via groovy/impex script ?

bidyadhar_tripathy
Participant
0 Likes
1,258

Hi All,

I want to synchronize 50 products from a product catalog. As we know, we can run synchronize job which will sync entire catalog products which I don't want or we can do sync individual products in backoffice.

So is there any way to sync only 50 products via groovy or impex script ?

Note : I have product codes of 50 products.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

sduvvuri
Explorer
0 Likes

Hello ,

Yes, you can synchronize those through a groovy script.

  • Put those codes in a list.

  • Loop over them and for each code get their model

  • Synchronize using performItemSynchronization(...) method from DefaultItemSynchronizationService class

You can as well export all those products by writing an export script using exportItemsFlexibleSearch( String query ) method and import them using the target catalog version. Check https://help.sap.com/viewer/50c996852b32456c96d3161a95544cdb/6.6.0.0/en-US/8361ab18bb434ba3abbac01e3... for more information on Export API.

Hope it helps.

Thanks, .

bidyadhar_tripathy
Participant
0 Likes

Thanks you subash for your response. Do you have a code sample for performItemSynchronization() method.

sduvvuri
Explorer
0 Likes

On how to set up the data and call the method, you can find that out in DefaultItemSynchronizationServiceTest class. You could replicate the same in your project as well.

You are welcome.