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

sub total items

former_member329386
Participant
0 Likes
675

problem : to display all item data against header data.

and do subtotal for all item . & it shoud display same exnum only once.

{

LOOP AT I_JEXCHDR.

READ TABLE I_JEXCDTL With key

EXNUM = I_JEXCHDR-EXNUM

EXDAT = I_JEXCHDR-EXDAT

EXYEAR = I_JEXCHDR-EXYEAR.

ITAB-STATUS = I_JEXCHDR-STATUS.

ITAB-KUNAG = I_JEXCHDR-KUNAG.

ITAB-EXCCD = I_JEXCHDR-EXCCD.

ITAB-EXCRG = I_JEXCHDR-EXCRG.

ITAB-WERKS = I_JEXCDTL-WERKS.

ITAB-EXNUM = I_JEXCDTL-EXNUM.

ITAB-MENGE = I_JEXCDTL-MENGE.

ITAB-EXYEAR = I_JEXCDTL-EXYEAR.

ITAB-LGORT = I_JEXCDTL-LGORT.

ITAB-MATNR = I_JEXCDTL-MATNR.

ITAB-MAKTX = I_JEXCDTL-MAKTX.

ITAB-CHAPID = I_JEXCDTL-CHAPID.

ITAB-ECS = I_JEXCDTL-ECS.

itab-ecsrate = i_jexcdtl-ecsrate.

ITAB-EXADDTAX1 = i_jexcdtl-exaddtax1.

ITAB-exbas = I_JEXCDTL-exbas.

ITAB-exbed = I_JEXCDTL-EXbed.

ITAB-bedrate = I_JEXCDTL-bedrate.

itab-exdat = i_jexcdtl-exdat.

ITAB-TAX = I_VBRP-MWSBP.

READ TABLE I_VBRP WITH KEY}

5 REPLIES 5
Read only

Former Member
0 Likes
643

You have to use Control break events : 1. AT NEW

2. AT END OF

3. AT FIRST.

4. AT LAST.

Read only

0 Likes
643

ok . but it is showing only one item . i checked there are no of againt one.

where to use control break statements. ?

Read only

Former Member
0 Likes
643

HI ,

data : sum type dmbtr.

LOOP AT I_JEXCHDR.

sum = sum + (field name for sub totals)

at end of field name

append i_jexchdr

clear sum.

end at

endloop.

Regards,

Munibabu.K

Read only

Former Member
0 Likes
643

problem : to display all item data against header data.

and do subtotal for all item . & it shoud display same exnum only once.

{

LOOP AT I_JEXCHDR.

READ TABLE I_JEXCDTL With key

EXNUM = I_JEXCHDR-EXNUM

EXDAT = I_JEXCHDR-EXDAT

EXYEAR = I_JEXCHDR-EXYEAR.

ITAB-STATUS = I_JEXCHDR-STATUS.

ITAB-KUNAG = I_JEXCHDR-KUNAG.

ITAB-EXCCD = I_JEXCHDR-EXCCD.

ITAB-EXCRG = I_JEXCHDR-EXCRG.

ITAB-WERKS = I_JEXCDTL-WERKS.

ITAB-EXNUM = I_JEXCDTL-EXNUM.

ITAB-MENGE = I_JEXCDTL-MENGE.

ITAB-EXYEAR = I_JEXCDTL-EXYEAR.

ITAB-LGORT = I_JEXCDTL-LGORT.

ITAB-MATNR = I_JEXCDTL-MATNR.

ITAB-MAKTX = I_JEXCDTL-MAKTX.

ITAB-CHAPID = I_JEXCDTL-CHAPID.

ITAB-ECS = I_JEXCDTL-ECS.

itab-ecsrate = i_jexcdtl-ecsrate.

ITAB-EXADDTAX1 = i_jexcdtl-exaddtax1.

ITAB-exbas = I_JEXCDTL-exbas.

ITAB-exbed = I_JEXCDTL-EXbed.

ITAB-bedrate = I_JEXCDTL-bedrate.

itab-exdat = i_jexcdtl-exdat.

ITAB-TAX = I_VBRP-MWSBP.

READ TABLE I_VBRP WITH KEY}

Hi,

Can you use the below sample of code. When you are using control break statments i.e At end of ... you need to sort I_JEXCHDR.

DATA : SUM like I_JEXCHDR-EXNUM.

SORT I_JEXCHDR by field ( here you need to specify the fieldname)

LOOP AT I_JEXCHDR.

READ TABLE I_JEXCDTL With key

SUM = SUM + I_JEXCHDR-EXNUM.

Clear SUM.

Endloop.

Regards

Thiru

Read only

Former Member
0 Likes
643

Hi,

Can you use the below sample of code. When you are using control break statments i.e At end of ... you need to sort I_JEXCHDR.

DATA : SUM like I_JEXCHDR-EXNUM.

SORT I_JEXCHDR by field ( here you need to specify the fieldname)

LOOP AT I_JEXCHDR.

READ TABLE I_JEXCDTL With key

SUM = SUM + I_JEXCHDR-EXNUM.

At end of EXNUM.

Move Sum to I_I_JEXCHDR-SUM.

Clear SUM.

Endloop.

Regards

Thiru