How to add the Total Cost of Sales, Gross Profit, Other Income and Total Revenue in Profit and Loss?

I create a new customize profit and loss and I just want to display the totals after the Cost of Sales indent how can I do it? I’ve tried it many time but It doesn’t append into the list of dictionary. Can someone help me? Thank you