Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV output

Former Member
0 Likes
678

Hai Friends,

The following is my output

Material          Description        Qty        DeviceID

1                          A                 40            11
1                          A                 40            12
1                          A                 40            13
1                          A                 40            14

For material "1" the quantity is 40. I dont want the quantity to be repeated. I have used SET_SORTS and SET_AGGREGATIONS also. I can i ignore this. i want to show the output for each and every material now the qty is showing as '160' instead of 40.

Hai Friends,

The following is my output

Material          Description        Qty        DeviceID

1                          A                 40            11
1                          A                 40            12
1                          A                 40            13
1                          A                 40            14

For material "1" the quantity is 40. I dont want the quantity to be repeated. I have used SET_SORTS and SET_AGGREGATIONS also. I can i ignore this. i want to show the output for each and every material now the qty is showing as '160' instead of 40.

5 REPLIES 5
Read only

Former Member
0 Likes
644

Are you using the Object Model, Any Don't opt for Totals((SET_AGGREGATIONS )) on the Qty. and Don't use Subtotal option on Material also.

Read only

0 Likes
644

I am not using object model.

Read only

0 Likes
644

But your terminology you are using is almost the same. Don't use SUBTOT = 'X' option. and Also Don't use DO_SUM option on the QTY column. Populate the sort option on the QTY and Material also.

Then only you can get the required output.

if you still have the issue let me know..

Read only

0 Likes
644

Hai Vijay,

I want to show the total for each materials. So i have used the SET_SORTS for material. i want the aggregations for around 14 columns. So i have given the SET_AGGREGATIONS for all the 14 columns.

I have two internal tables:

I_TAB1 and I_TAB2.

I_TAB1 has material and quantity

I_TAB2 has material and all other 14 columns.

So i have looped the I_TAB2 and read the table I_TAB1.

When i pass the matnr in the I_TAB1 i am getting only one line item. Whereas when i pass matnr in I_TAB2 i am getting four line items because one matnr can have many notification numbers (table VIQMEL).

Read only

Former Member
0 Likes
644

Hi,

Try to use this code where you can display only once with the total value.

W_SORTINFO-FIELDNAME = 'MATERIAL'.

W_SORTINFO-SUBTOT = 'X'.

APPEND W_SORTINFO TO T_SORTINFO.

CLEAR W_SORTINFO.

W_SORTINFO-FIELDNAME = 'QTY'.

W_SORTINFO-SUBTOT = 'X'.

APPEND W_SORTINFO TO T_SORTINFO.

CLEAR W_SORTINFO.

I have tried and it is working fine.

Hope this helps you.

Cheers!!