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

regarding control break event

Former Member
0 Likes
822

Hi Gurus,

Iam working on a requirement

Requirement: Displaying Quantity from EKET . It is having matnr and lifnr

but i want to display quntity in Output based on matnr only

So iam Looping the internal table and doing some calculations.

Here i have to use control break events.

What i want is to add all Quantities of lifnr and display Matnr wise

loop at i_eket into wa_eket.

at end of matnr.

if some condition.

i_poqty-totpo = i_eket-menge - i_ekpo-wmeng.

endif.

collect wa_eket into i_eket.

endat.

Is it right or wrong .

Please give your valuble suggessitions.

regards,

endloop.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
792

See this code.

Here we have to calculate the total on job days and ready days depending on the Equipment number.

I think u can add some condition before claculating the amount.

SORT int_cycle_time_alv BY equnr.

LOOP AT int_cycle_time_alv.

wf_on_job = wf_on_job + int_cycle_time_alv-on_job.

wf_ready = wf_ready + int_cycle_time_alv-ready.

AT END OF equnr.

wg_end_flag = 'X'.

ENDAT.

IF wg_end_flag = 'X'.

int_cycle_time_alv-on_job = wf_on_job.

int_cycle_time_alv-ready = wf_ready.

MODIFY int_cycle_time_alv TRANSPORTING on_job ready w_utilisation.

CLEAR: wf_on_job,

wf_ready,

wg_end_flag.

ENDIF.

ENDLOOP.

Hope this helps.

4 REPLIES 4
Read only

Former Member
0 Likes
792

hi can you provide some example data and output how yu required....

Read only

0 Likes
792

Hi,

I want the output to be

material vendor PastDueQty

mat-1 Vendor1 Total of (V1 + V2 + V3)

Vendor2

Vendor3

V1, V2, V3 -


vendor1, vendor2, Vendor3

Qty of V1 = menge - wenge.

So here

loop

endloop.

Qty by vendor wise we to display by material wise.

Read only

former_member206439
Contributor
0 Likes
792

Hi

see this sample program you can understand it very well

how we can write the control break events.

* Using AT FIRST , AT NEW, AT THE END OF , AT LAST.

DATA: BEGIN OF ITAB OCCURS 0,
      F1 TYPE I,
      F2(6) TYPE C,
      F3(10) TYPE N,
      F4(16) TYPE P DECIMALS  2,

      END OF ITAB.


DATA: SUB_TOT(10) TYPE P DECIMALS 3.

**--1

ITAB-F1 = 1.
ITAB-F2 = 'ONE'.
ITAB-F3 = 10.
ITAB-F4 = '1000.00'.

APPEND ITAB.
CLEAR ITAB.

ITAB-F1 = 1.
ITAB-F2 = 'ONE'.
ITAB-F3 = 20.
ITAB-F4 = '2000.00'.


APPEND ITAB.
CLEAR ITAB.


ITAB-F1 = 1.
ITAB-F2 = 'ONE'.
ITAB-F3 = 30.
ITAB-F4 = '3000.00'.


APPEND ITAB.
CLEAR ITAB.

*--2

ITAB-F1 = 2.
ITAB-F2 = 'TWO'.
ITAB-F3 = 10.
ITAB-F4 = '1000.00'.

APPEND ITAB.
CLEAR ITAB.


ITAB-F1 = 2.
ITAB-F2 = 'TWO'.
ITAB-F3 = 20.
ITAB-F4 = '2000.00'.


APPEND ITAB.
CLEAR ITAB.

*-- 3

ITAB-F1 = 3.
ITAB-F2 = 'THREE'.
ITAB-F3 = 10.
ITAB-F4 = '1000.00'.


APPEND ITAB.
CLEAR ITAB.



ITAB-F1 = 3.
ITAB-F2 = 'THREE'.
ITAB-F3 = 20.
ITAB-F4 = '2000.00'.

APPEND ITAB.
CLEAR ITAB.


SORT ITAB BY F1.

LOOP AT ITAB.

AT FIRST.
WRITE: /35 ' MATERIAL DETAILS:'.
ULINE.
ENDAT.

AT NEW F1.
WRITE: / 'DETAILS OF MATERIAL:' COLOR 7  , ITAB-F1.
ULINE.
ENDAT.

WRITE: / ITAB-F1, ITAB-F2, ITAB-F3, ITAB-F4.

SUB_TOT = SUB_TOT + ITAB-F4.

AT END OF F1.
ULINE.
WRITE: / 'SUB TOTAL :'  COLOR 3 INVERSE ON, SUB_TOT COLOR 3 INVERSE ON.
CLEAR SUB_TOT.
ENDAT.

AT LAST.
SUM.
ULINE.
WRITE: 'SUM:', ITAB-F4.
ULINE.
ENDAT.

ENDLOOP.

Read only

Former Member
0 Likes
793

See this code.

Here we have to calculate the total on job days and ready days depending on the Equipment number.

I think u can add some condition before claculating the amount.

SORT int_cycle_time_alv BY equnr.

LOOP AT int_cycle_time_alv.

wf_on_job = wf_on_job + int_cycle_time_alv-on_job.

wf_ready = wf_ready + int_cycle_time_alv-ready.

AT END OF equnr.

wg_end_flag = 'X'.

ENDAT.

IF wg_end_flag = 'X'.

int_cycle_time_alv-on_job = wf_on_job.

int_cycle_time_alv-ready = wf_ready.

MODIFY int_cycle_time_alv TRANSPORTING on_job ready w_utilisation.

CLEAR: wf_on_job,

wf_ready,

wg_end_flag.

ENDIF.

ENDLOOP.

Hope this helps.