Skip to Content
avatar image
Former Member

How to calculate the total sum value of a particular field that repeats

Hi All,

I have the following Req...File----Idoc Scenario

In the Inbound xml file i will get the Sales Order details with suppose 10 line items( 10 Orders)

Each line item represents one one SO. So totally i wil have 10 Sales Orders in this file.

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_Sales_Order xmlns:ns0="http://sap/Sales_Order">













In the above structure Item Segment will repeats as many no. of Sales Orders comes in a file.

In a file if there are 10 Orders means the Item segment wil repeats 10 times.

I have the Amount field in the Item Segment, each and every time that needs to be added to next Amount value that presents in the next Line Item.

Finally i will have the Another separate field caled Grand Total, and i have to get the total summation of the 10 values of the Amount field at last.

Can we achieve this using UDF or is there any way to do this


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 26, 2008 at 09:34 AM

    Check with below mapping

                                    AMOUNT ----->/then

    Change the context of DISCOUNT and AMOUNT to higher level

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 25, 2008 at 07:17 AM


    Use statistics function SUM, set the proper context or use

    Amount ->removeContext->SUM--->GrandTotal


    Add comment
    10|10000 characters needed characters exceeded