cancel
Showing results for 
Search instead for 
Did you mean: 

How to add the quantities in a certain column?

Former Member
0 Kudos

Hi All,

I am extracting data from an SAP table. One of the columns in the output is 'Confirmed Quantities'. I would like to sum up these individual confirmation quantities and display the 'Total'. Could somebody tell me the best way and how to do it? Thanks.

Regards,

V M.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

SAP has the required aggregate quantities. No need to do calculations in the BLT.

Former Member
0 Kudos

V M,

if you only want to know how to simply sum up the values of 'Confirmed Quantities' that are returned from your query you might use an XPATH expression. With this you can spare out the actionblock and use a very fast transformation instead.

All you have to do is a expression like:

YourDataSource.XmlContent{ sum( /Rowsets/Rowset/Row/ConfirmedQuantities ) }

I hope this might help you out.

Kind Regards

Sebastian

agentry_src
Active Contributor
0 Kudos

If you are only looking at a single production order you should probably use BAPI_PRODORD_GET_DETAILS which will return a total confirmation and total scrap quantity rather than multiple individual confirmations.

Mike

Former Member
0 Kudos

VM,

Looking at your previous posts, I guess you are trying to add up all confirmed quantities and you are doing this by querying the table using RFC_READ_TABLE, which is Ok. But there is a better and easy way to do this by using BAPI_PRODORDCONF_GETLIST and BAPI_PRODORDCONF_GETDETAIL bapis - they are standard bapis in SAP. You might also need to consider if there is a confirmation that is reversed. You don't have to add the quantity of reversed confirmations.

I would suggest you to execute these BAPIs from SAP (SE37 transaction) and see the results.

-John

Former Member
0 Kudos

John,

Thats right. You expalined it clearly. I am looking for 'Operation Qty', 'Confirmed Yield', 'Confirmed Scrap' and 'Confirmed Rework' values. The 'Operaiton Qty', 'Confirmed Yield' and Confirmed Scrap' values are available in S022 table. But I don't see the 'Confirmed Rework' field; for which I might have to look at a different table. Do you know of any table that contains all these fields? The BAPI 'bapi_prodordconf_getdetail' works only for a combination of confirmation and a counter. But I am looking for aggregate values at operation level. Thanks.

Regards,

V M.

Former Member
0 Kudos

Ok Guys,

I figured a way to get the required quantities from a SAP table. I do not have to do any calculations in the BLT. Thanks for your ideas.

Regards,

V M.

Former Member
0 Kudos

In the Aggregate Statistics Action block goto Configure option and in the XPath Expression select the column which in the output is 'Confirmed Quantities'.

It will give you the 'Total' of that column.

Thanks,

Manisha

Former Member
0 Kudos

Use the aggregate statistics action bock.

See xMII help for more info: http://help.sap.com/saphelp_xmii115/helpdata/en/index.htm