Use Case : Amazon Shipment Events to Journal Entry in SAP B1
While working with integration projects, it is not always true that we will find all the projects having same kind of requirement. Sometimes the requirements are quite straight forward while sometimes the requirements are completely different from what people do. Here is an example of an use case where the customer wanted to create a Journal Entry with all the shipment events generated in Amazon.
Create a Journal Entry with all the Shipments successfully made in Amazon.
To create a Journal Entry in SAP B1, we will use the oJournalEntry object. This object will allow us to create a journal entry. So to create a Post node in ProcessFlow, we will just
- Open ProcessFlow
- Create a Start Node by dragging from the Toolbar.
- Create a SAP B1 Post node with oJournalEntry in Schema.
Here we have chosen the oJournalEntry in Schema and “to add the journal entry”, in Action node, which is the post action for SAP B1’s Journal Entry.
- As we have created the SAP B1 post node, we would also want to get the data from Amazon. To do this, we drag an Amazon Prepackaged node from the toolbar and configure it for ShipmentEventList. The ShipmentEventList is the schema which will allow you to map shipment event objects.
Now here the Shipment list will be retrieved from the Amazon Finance API.
- To retrieve the data, we call ListFinancialEvents with PostedAfter date, and also passing the NextToken. If you know how to retrieve differential data, you might already know how to use it in Action filter.
Now here you can see the variable cdate is used to get differential data and NextToken is used to get data from next token passed.
- Now this will get us the data only once. But for Journal, the customer asked for all the data present in Amazon. To do such an operation, we need a self loop.
- But self loop will post multiple Journal entries, which we do not want. To merge all the data coming from Self loop, we also need a merger.
So here in the ProcessFlow, we have used a Self Loop on Amazon node and a Merger to merge all the data coming from Amazon. Then the Mapper will ensure we map all the values to finally post it to SAP B1.
This way the ProcessFlow processes all the entries of Shipment and post only one Journal Entry in SAP B1.
With ProcessFlow we give a bunch of data manipulation nodes which helps in manipulation of data and orchestration of data transfer over the processflow pipeline. In the above case, we have shown an uncommon requirement, which might help you to implement your own use case based on the example.
I hope this will help. Feel free to comment.