My POC requirement was to bring the total number of sales, inquiry and quotation documents created during the SD life cycle in a system. When clicked on the particular document it takes you to a flavor which displays the number of documents created for the selected type on monthly basis, onclick of the chart it takes you to the flavor which displays the complete documents with recently created document on the top and on clicking the document it should display the details of the documents.

The first thing is to get the data needed to build the chart for that we can use RFC to get the data.

Create a RFC to get the Count of the documents created in the system and also get the table which will be used in final flavor for displaying the details.

Define parameters salesorder, quotation, inquiry as export parameters, which can be exported.

On the Import tab give parameter for getting the user id for selecting the documents he/she created.

Onsource code write the code to count the number of documents based on the type and store it in the export parameter.

We have to pass the data in form of JSON to the Chart, So build a JSON with the data to pass it to the chart.

var newContents = [

{“Document”: “Sales Order”, “Count”: sale},

{“Document”: “Inquiry Document”, “Count”: inquiry},

{“Document”: “Quotation”, “Count”: quotation},

];

Now Build the chart with the JSON model and Handle the click event on the chart and redirect it to the different flavor where we will show the chart on monthly basis based on the type of document clicked.

I have attached the completed coding and given the building of Donut Chart alone below.