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

control break query

Former Member
0 Likes
372

TYPES : BEGIN OF T_TAB,

VBELN TYPE VBEP-VBELN,

BMENG TYPE VBEP-BMENG,

END OF T_TAB.

DATA : SUM_TAB TYPE STANDARD TABLE OF T_TAB WITH HEADER LINE,

WA_SUM LIKE SUM_TAB.

DATA : TOTALCRD(8) TYPE N VALUE 0.

CLEAR : SUM, TOTALCRD.

SELECT VBELN BMENG INTO TABLE SUM_TAB FROM VBEP FOR ALL ENTRIES IN IT_DATA WHERE VBELN = IT_DATA-VBELN

AND POSNR = IT_DATA-POSNR.

internal table it getting

vbeln bmeng

00001 12

00002 13

00002 14

00002 11

00003 01

i need to sum 131411 for unique and to store internal table like this

00001 12

00002 38

00003 01

regarding anil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
355

Hi,

Follow the Code ,

data :  TOT_TAB  like SUM_TAB OCCURS 0 WITH HEADER LINE.


LOOP AT SUM_TAB.
MOVE-CORRESPONDING SUM_TAB TO TOT_TAB.
COLLECT TOT_TAB.CLEAR TOT_TAB.
ENDLOOP.

Now ur Final Internal Table will contain the Values as u asked.

Regards,

Morris Bond.

Reward Points if Helpful.

2 REPLIES 2
Read only

Former Member
0 Likes
355

Hi,

data bmeng like mseg-menge.
loop at t_tab.
sum.
bmeng = t_tab-bmeng.
endloop.

Regards,

V.Balaji

Reward if Usefull...

Read only

Former Member
0 Likes
356

Hi,

Follow the Code ,

data :  TOT_TAB  like SUM_TAB OCCURS 0 WITH HEADER LINE.


LOOP AT SUM_TAB.
MOVE-CORRESPONDING SUM_TAB TO TOT_TAB.
COLLECT TOT_TAB.CLEAR TOT_TAB.
ENDLOOP.

Now ur Final Internal Table will contain the Values as u asked.

Regards,

Morris Bond.

Reward Points if Helpful.