Application Development 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: 

can we display row in alv

Former Member
0 Kudos

Hi friends,

I want to give total field in ALV and without using subtot and sorting and do_sum in fieldcat.

I want to give a horizontal data with name 'Total for quantity' and total of the quantity field without using sort.

Help me out.

5 REPLIES 5

former_member188685
Active Contributor
0 Kudos

Hi Abhay,

i found the solution to your problem , but unable to post the same in the thread of your previous post.

Just look for Bold code.

REPORT zcmsr047 MESSAGE-ID zz

NO STANDARD PAGE HEADING

LINE-SIZE 350.

TABLES: likp,

lips,

vbak,

vbpa,

vbuk,

vbrk,

vbrp,

vttk,

vttp,

vbfa,

stxh, "pmp 13.01.01

t001k, "pmp 13.01.01

j_1iexchdr,

j_1iexcdtl,

adrc,

  • ZTRMT,

kna1.

  • <zraildet. "AA 100501

type-pools : slis.

DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "mara

WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

DATA : IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV, "makt

WA_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV.

DATA : IT_FIELDCAT2 TYPE SLIS_T_FIELDCAT_ALV, "marc

WA_FIELDCAT2 TYPE SLIS_FIELDCAT_ALV.

DATA : IT_FIELDCAT3 TYPE SLIS_T_FIELDCAT_ALV, "marc

WA_FIELDCAT3 TYPE SLIS_FIELDCAT_ALV.

DATA: GT_PRINT TYPE SLIS_PRINT_ALV,

WA_LAYOUT TYPE SLIS_LAYOUT_ALV,

XS_EVENT TYPE SLIS_ALV_EVENT,

GT_XEVENTS TYPE SLIS_T_EVENT,

GT_YEVENTS TYPE SLIS_T_EVENT,

GT_ZEVENTS TYPE SLIS_T_EVENT,

WA_SORT TYPE SLIS_SORTINFO_ALV,

IT_SORT TYPE SLIS_T_SORTINFO_ALV.

*----

-


*PARAMETERS : a TYPE c.

DATA: ship_doc LIKE vttk-tknum,

bill LIKE vbrp-vbeln,

c_vbeln LIKE likp-vbeln,

s_vbeln LIKE vbfa-vbeln.

DATA: BEGIN OF itab1 OCCURS 0,

vbeln LIKE likp-vbeln,

wadat_ist LIKE likp-wadat_ist,

erdat LIKE likp-erdat,

kunag LIKE likp-kunag,

lfart LIKE likp-lfart,

kunnr LIKE likp-kunnr,

werks LIKE likp-werks,

vstel LIKE likp-vstel,

bolnr LIKE likp-bolnr, "Added by AA 27/04/01.

exti1 LIKE vttk-exti1,

tdlnr LIKE vttk-tdlnr,

vtweg LIKE vbak-vtweg, "AA 100501.

vgbel LIKE lips-vgbel, "AA 100501

kzwi6 LIKE vbrp-kzwi6. " R002 added

  • OWNCAT LIKE .

DATA: END OF itab1.

DATA : BEGIN OF it_vbfa1 OCCURS 0,

vbeln LIKE vbfa-vbeln,

vbelv LIKE vbfa-vbeln,

END OF it_vbfa1.

DATA : BEGIN OF it_vbfa2 OCCURS 0,

vbeln LIKE vbfa-vbeln,

vbelv LIKE vbfa-vbeln,

posnv LIKE vbfa-posnv,

END OF it_vbfa2.

DATA : BEGIN OF it_vbrp OCCURS 0,

vbeln LIKE vbrp-vbeln,

kzwi6 LIKE vbrp-kzwi6,

posnr LIKE vbrp-posnr,

END OF it_vbrp.

DATA : BEGIN OF it_vbak OCCURS 0,

vbeln LIKE vbfa-vbeln,

vtweg LIKE vbak-vtweg,

auart LIKE vbak-auart,

END OF it_vbak.

DATA : BEGIN OF it_vttp OCCURS 0,

vbeln LIKE vttp-vbeln,

tknum LIKE vttp-tknum,

END OF it_vttp.

DATA : BEGIN OF it_vttk OCCURS 0,

tknum LIKE vttk-tknum,

exti1 LIKE vttk-exti1,

tdlnr LIKE vttk-tdlnr,

END OF it_vttk.

DATA : BEGIN OF it_vbuk OCCURS 0,

vbeln LIKE vbuk-vbeln,

wbstk LIKE vbuk-wbstk,

END OF it_vbuk.

*DATA : BEGIN OF it_zrail OCCURS 0,

  • zzdelivery LIKE zraildet-zzdelivery,

  • zzwagon LIKE zraildet-zzwagon,

  • END OF it_zrail.

DATA: BEGIN OF itab2 OCCURS 0,

vbeln LIKE likp-vbeln,

wadat_ist LIKE likp-wadat_ist,

erdat LIKE likp-erdat,

lfart LIKE likp-lfart,

kunag LIKE likp-kunag,

kunnr LIKE likp-kunnr,

r_plant LIKE likp-werks,

vstel LIKE likp-vstel,

vkgrp LIKE lips-vkgrp,

auart LIKE vbak-auart,

matnr LIKE lips-matnr,

lfimg LIKE lips-lfimg,

werks LIKE lips-werks,

name1 LIKE adrc-name1,

city1 LIKE adrc-city1,

preprn LIKE j_1iexchdr-preprn,

vgbel LIKE lips-vgbel, " Order No. SC

exti1 LIKE vttk-exti1, "Truck Number

exti2 LIKE vttk-exti2, "LR Number

tdlnr LIKE vttk-tdlnr, "Transporter

exbed LIKE j_1iexchdr-exbed,

    • R004

ecs LIKE j_1iexchdr-ecs,

totexcamt LIKE j_1iexchdr-exbed,

    • end R004

exnum LIKE j_1iexchdr-exnum,

exdat LIKE j_1iexchdr-exdat,

status LIKE j_1iexchdr-status,

sales_ord LIKE vbak-vbeln,

wpreprn(10), "pmp 020401

kname1 LIKE kna1-name1, "AA 100501.

vtweg LIKE vbak-vtweg, "AA 100501

kzwi6 LIKE vbrp-kzwi6, " R002 added

          • CHANGE ON 07-07-06

  • OWNCAT LIKE ZTRMT-OWNCAT,

  • CAPITN LIKE ZTRMT-CAPITN,

slno type i,

rnew(18),

END OF itab2.

*data:begin of it_ztrmt occurs 0,

  • truckno like ztrmt-truckno,

  • OWNCAT LIKE ZTRMT-OWNCAT,

  • CAPITN LIKE ZTRMT-CAPITN,

  • end of it_ztrmt.

DATA: BEGIN OF itab3 OCCURS 0,

bukrs LIKE t001k-bukrs, "pmp 13.01.01

matnr LIKE lips-matnr,

werks LIKE lips-werks, "pmp 13.01.01

lfimg LIKE lips-lfimg,

exbed LIKE j_1iexchdr-exbed,

    • R004

totexcamt LIKE j_1iexchdr-exbed,

ecs LIKE j_1iexchdr-ecs.

    • end R004

DATA : END OF itab3.

DATA: BEGIN OF itab4 OCCURS 0, "pmp 13.01.01

matnr LIKE lips-matnr,

lfimg LIKE lips-lfimg,

exbed LIKE j_1iexchdr-exbed,

    • R004

totexcamt LIKE j_1iexchdr-exbed,

ecs LIKE j_1iexchdr-ecs.

    • end R004

DATA: END OF itab4.

DATA: BEGIN OF itab7 OCCURS 0, "pmp 13.01.01

matnr LIKE lips-matnr,

lfimg LIKE lips-lfimg,

exbed LIKE j_1iexchdr-exbed,

    • R004

totexcamt LIKE j_1iexchdr-exbed,

ecs LIKE j_1iexchdr-ecs.

    • end R004

DATA: END OF itab7.

DATA : BEGIN OF itab5 OCCURS 0,

kunnr LIKE kna1-kunnr,

name1 LIKE kna1-name1,

END OF itab5. " +R007

DATA: wtline LIKE tline OCCURS 0 WITH HEADER LINE. "PMP 13.01.01

DATA: wname LIKE thead-tdname. "PMP 13.01.01

DATA slno TYPE i.

        • change/002 by rs on 08.10.2002

DATA: BEGIN OF iexcdtl OCCURS 0,

docno LIKE j_1iexcdtl-docno,

docno1 LIKE j_1iexcdtl-docno,

rdoc1 LIKE j_1iexcdtl-rdoc1,

exnum LIKE j_1iexcdtl-exnum,

exnum1 LIKE j_1iexcdtl-exnum,

werks LIKE j_1iexcdtl-werks,

docyr LIKE j_1iexcdtl-docyr,

END OF iexcdtl.

DATA: BEGIN OF iexchdr OCCURS 0,

bukrs LIKE j_1iexchdr-bukrs,

werks LIKE j_1iexchdr-werks, " VBK 090402

docyr LIKE j_1iexchdr-docyr,

preprn LIKE j_1iexchdr-preprn,

exnum LIKE j_1iexchdr-exnum,

exdat LIKE j_1iexchdr-exdat,

status LIKE j_1iexchdr-status,

exbed LIKE j_1iexchdr-exbed,

totexcamt LIKE j_1iexchdr-exbed,

ecs LIKE j_1iexchdr-ecs,

END OF iexchdr.

DATA n TYPE i.

DATA : w_kzwi6 LIKE vbrp-kzwi6.

" R002 added

*-- +R009 --*

DATA v_diff TYPE i.

*-- +R009 --*

DATA: BEGIN OF itab6 OCCURS 0,

bukrs LIKE t001k-bukrs, "pmp 13.01.01

matnr LIKE lips-matnr,

werks LIKE lips-werks, "pmp 13.01.01

lfimg LIKE lips-lfimg,

exbed LIKE j_1iexchdr-exbed,

    • R004

totexcamt LIKE j_1iexchdr-exbed,

ecs LIKE j_1iexchdr-ecs.

    • end R004

DATA : END OF itab6.

***----


***

***----


***

SELECTION-SCREEN : BEGIN OF BLOCK abc WITH FRAME TITLE text-001.

SELECT-OPTIONS:

vstel FOR likp-vstel OBLIGATORY, " NO INTERVALS ,

date FOR likp-wadat_ist OBLIGATORY,

erdat FOR likp-erdat,

kunag FOR likp-kunag NO INTERVALS,

smatnr FOR lips-matnr,

werks FOR likp-werks NO INTERVALS NO-EXTENSION,

pvtweg FOR lips-vtweg .

PARAMETERS: PFSTATUS TYPE SLIS_FORMNAME DEFAULT 'PF_STATUS_SET'.

SELECTION-SCREEN : END OF BLOCK abc.

SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.

SELECT-OPTIONS: ptdlnr FOR vttk-tdlnr NO INTERVALS,

pexti1 FOR vttk-exti1 NO INTERVALS,

pkunnr FOR likp-kunnr NO INTERVALS.

SELECTION-SCREEN END OF BLOCK b.

SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-003.

PARAMETERS : sorticdn RADIOBUTTON GROUP b1 DEFAULT 'X',

sortdelv RADIOBUTTON GROUP b1,

sortstat RADIOBUTTON GROUP b1,

sortamt RADIOBUTTON GROUP b1,

sortdest RADIOBUTTON GROUP b1.

SELECTION-SCREEN END OF BLOCK c.

***----


***

***----


***

AT SELECTION-SCREEN.

IF vstel CA '*'.

MESSAGE e034 WITH 'Give specific value!!'.

ENDIF.

v_diff = date-high - date-low .

IF v_diff GT 31.

MESSAGE e034 WITH 'Kindly Run This Report For 31 days or less!!'.

ENDIF.

***----


***

***----


***

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

percentage = 100

text = 'Wait, Your Job Is Under Progress!!!'.

***----


***

***----


***

START-OF-SELECTION.

CLEAR : it_vbfa1, it_vbfa1[],

it_vbak, it_vbak[],

it_vbfa2, it_vbfa2[],

it_vbrp, it_vbrp[],

it_vttp, it_vttp[],

it_vttk, it_vttk[],

it_vbuk, it_vbuk[].

  • it_zrail, it_zrail[].

**-- Initial population of data from LIKP --**

  • Population of ITAB1

IF NOT kunag IS INITIAL AND

NOT pkunnr IS INITIAL AND

NOT werks IS INITIAL AND

NOT erdat IS INITIAL.

SELECT vbeln wadat_ist erdat kunag lfart kunnr werks vstel bolnr

INTO TABLE itab1 FROM likp

WHERE wadat_ist IN date

AND vstel IN vstel

AND kunnr IN pkunnr

AND werks IN werks

AND erdat IN erdat

AND kunag IN kunag

%_HINTS ORACLE 'INDEX("LIKP" "LIKP~Z3")'.

ELSEIF

kunag IS INITIAL AND

pkunnr IS INITIAL AND

werks IS INITIAL AND

erdat IS INITIAL.

SELECT vbeln wadat_ist erdat kunag lfart kunnr werks vstel bolnr

INTO TABLE itab1 FROM likp

WHERE

vstel IN vstel

AND wadat_ist IN date

%_HINTS ORACLE 'INDEX("LIKP" "LIKP~Z4")'.

ELSEIF

kunag IS INITIAL AND

erdat IS INITIAL.

SELECT vbeln wadat_ist erdat kunag lfart kunnr werks vstel bolnr

INTO TABLE itab1 FROM likp

WHERE wadat_ist IN date

AND vstel IN vstel

AND kunnr IN pkunnr

AND werks IN werks

%_HINTS ORACLE 'INDEX("LIKP" "LIKP~Z3")'.

ELSE.

SELECT vbeln wadat_ist erdat kunag lfart kunnr werks vstel bolnr

INTO TABLE itab1 FROM likp

WHERE wadat_ist IN date

AND vstel IN vstel

AND kunnr IN pkunnr

AND werks IN werks

AND erdat IN erdat

AND kunag IN kunag

%_HINTS ORACLE 'INDEX("LIKP" "LIKP~Z3")'.

ENDIF.

- very important condition was missing -

IF itab1[] IS INITIAL.

MESSAGE e034 WITH 'No suitable records found!!'.

ENDIF.

PDS_OPT

**-- Fetching data from VBFA --*

*-- Distribution Channel --*

break abap.

SELECT vbeln vbelv FROM vbfa INTO TABLE it_vbfa1 "OK Z11

FOR ALL ENTRIES IN itab1

WHERE

vbeln EQ itab1-vbeln AND

vbtyp_n EQ 'J' AND

vbtyp_v EQ 'C'.

IF NOT it_vbfa1[] IS INITIAL.

**-- Fetching data from VBAK --*

SELECT vbeln vtweg FROM vbak INTO TABLE it_vbak

FOR ALL ENTRIES IN it_vbfa1

WHERE

vbeln EQ it_vbfa1-vbelv

AND

vtweg IN pvtweg.

ENDIF.

*-- if shipping point eq ÁCW --*

**-- Fetching data from VBFA --*

*-- Subtotal 6 from pricing procedure KZWI6 --*

IF vstel-low EQ 'ACW'.

SELECT vbeln vbelv posnv FROM vbfa INTO TABLE it_vbfa2 "OK Z3

FOR ALL ENTRIES IN itab1

WHERE

vbelv EQ itab1-vbeln AND

vbtyp_n EQ 'M' AND

vbtyp_v EQ 'J'.

IF NOT it_vbfa2[] IS INITIAL.

SELECT vbeln kzwi6 posnr FROM vbrp INTO TABLE it_vbrp "OK Z1

FOR ALL ENTRIES IN it_vbfa2

WHERE

vbeln EQ it_vbfa2-vbeln

%_HINTS ORACLE 'index("VBRP" "VBRP~Z1")'.

ENDIF.

ELSE.

*-- if shipping point ne ÁCW --*

SELECT vbeln vbelv posnv FROM vbfa INTO TABLE it_vbfa2 "OK Z3

FOR ALL ENTRIES IN itab1

WHERE

vbelv EQ itab1-vbeln AND

vbtyp_n EQ 'U' AND

vbtyp_v EQ 'J'.

IF NOT it_vbfa2[] IS INITIAL.

SELECT vbeln kzwi6 posnr FROM vbrp INTO TABLE it_vbrp "OK Z1

FOR ALL ENTRIES IN it_vbfa2

WHERE

vbeln EQ it_vbfa2-vbeln

%_HINTS ORACLE 'index("VBRP" "VBRP~Z1")'.

ENDIF.

ENDIF.

*-- External ID --*

*-- no. of forwarding agent --*

**-- Fetching data from VTTP --*

SELECT vbeln tknum FROM vttp INTO TABLE it_vttp "OK VBL

FOR ALL ENTRIES IN itab1

WHERE

vbeln EQ itab1-vbeln.

IF sy-dbcnt NE 0.

**-- Fetching data from VTTK --*

*- 16/05/2006 -*

SELECT tknum exti1 tdlnr FROM vttk INTO TABLE it_vttk "OK PRIMARY

FOR ALL ENTRIES IN it_vttp

WHERE

tknum EQ it_vttp-tknum

AND

tdlnr IN ptdlnr AND

exti1 IN pexti1.

ENDIF.

**********************************CHANGE ON 07-07-06

  • SELECT * FROM ZTRMT INTO corresponding fields of

  • TABLE IT_ztrmt .

**-- Fetching data from VBUK --*

*-- Total goods movement status --*

SELECT vbeln wbstk FROM vbuk INTO TABLE it_vbuk "OK Z1

FOR ALL ENTRIES IN itab1

WHERE

vbeln EQ itab1-vbeln AND

wbstk EQ 'C'.

**-- Moving required flds to ITAB1 --*

- ITAB1 processing -

SORT itab1 BY vbeln.

SORT it_vbfa1 BY vbeln.

SORT it_vbak BY vbeln.

SORT it_vttp BY vbeln.

SORT it_vttk BY tknum.

SORT it_vbuk BY vbeln.

SORT PTDLNR BY LOW.

SORT PEXTI1 BY LOW.

LOOP AT itab1.

**----


**

  • condition problem

**----


**

  • moving VTWEG to itab1.

READ TABLE it_vbfa1 WITH KEY vbeln = itab1-vbeln BINARY SEARCH.

IF sy-subrc EQ 0.

READ TABLE it_vbak WITH KEY vbeln = it_vbfa1-vbelv BINARY SEARCH.

IF sy-subrc EQ 0.

MOVE it_vbak-vtweg TO itab1-vtweg.

MODIFY itab1 TRANSPORTING vtweg.

ELSE.

  • problem *

DELETE itab1.

CONTINUE.

ENDIF.

ENDIF.

  • moving KZWI6 to itab1.

LOOP AT it_vbfa2 WHERE vbelv EQ itab1-vbeln.

CLEAR w_kzwi6. "20042006

LOOP AT it_vbrp WHERE vbeln = it_vbfa2-vbeln.

w_kzwi6 = w_kzwi6 + it_vbrp-kzwi6.

ENDLOOP.

EXIT.

ENDLOOP.

MOVE w_kzwi6 TO itab1-kzwi6.

MODIFY itab1 TRANSPORTING kzwi6.

  • moving EXTI1 TDLNR to itab1

READ TABLE it_vttp WITH KEY vbeln = itab1-vbeln BINARY SEARCH.

IF sy-subrc EQ 0.

READ TABLE it_vttk WITH KEY tknum = it_vttp-tknum BINARY SEARCH.

*******************************************CHANGE ON 07-07-06.

IF sy-subrc EQ 0.

MOVE it_vttk-tdlnr TO itab1-tdlnr.

MOVE it_vttk-exti1 TO itab1-exti1.

MODIFY itab1 TRANSPORTING tdlnr exti1.

ENDIF.

ENDIF.

  • checking for goods movement status

READ TABLE it_vbuk WITH KEY vbeln = itab1-vbeln BINARY SEARCH.

IF sy-subrc NE 0.

DELETE itab1.

CONTINUE. "16052006

ENDIF.

IF ptdlnr NE space. "16052006

READ TABLE ptdlnr WITH KEY low = itab1-tdlnr BINARY SEARCH.

IF sy-subrc NE 0.

DELETE itab1.

continue.

ENDIF.

ENDIF.

IF pexti1 NE space . "16052006

  • ENDIF. "-16052006

  • ELSE. "-16052006

READ TABLE pexti1 WITH KEY low = itab1-exti1 BINARY SEARCH.

IF sy-subrc NE 0.

DELETE itab1.

ENDIF.

ENDIF.

  • ENDIF. "-16052006

  • ENDIF. "-16052006

  • ENDIF. "-16052006

ENDLOOP.

PDS_OPT

  • releasing memory occupied by these tables

FREE : it_vbfa1,

it_vbak,

it_vbfa2,

it_vbrp,

it_vttp,

it_vttk,

it_vbuk.

  • it_zrail.

**-- fetching from KNA1 --**

  • Population of ITAB5

*- very important condition was missing -*

*- 24042006 -*

IF itab1[] IS INITIAL.

MESSAGE e034 WITH 'No suitable records found!!'.

ENDIF.

SELECT kunnr name1 FROM kna1

INTO TABLE itab5

FOR ALL ENTRIES IN itab1

WHERE kunnr = itab1-kunag

%_HINTS ORACLE 'INDEX("KNA1" "KNA1~0")'.

DELETE ADJACENT DUPLICATES FROM itab5.

**-- fetching from LIPS --**

  • Population of ITAB2

SELECT vbeln vkgrp matnr lfimg werks vgbel FROM lips

INTO CORRESPONDING FIELDS OF TABLE itab2

FOR ALL ENTRIES IN itab1

WHERE vbeln = itab1-vbeln

AND pstyv NE 'ZREC'

AND matnr IN smatnr

%_HINTS ORACLE 'INDEX("LIPS" "LIPS~Z14")'.

***-- fetching from ZRAILDET --**

  • SELECT zzdelivery zzwagon FROM zraildet INTO TABLE it_zrail"OK Z1

  • FOR ALL ENTRIES IN itab1

  • WHERE

  • zzdelivery = itab1-vbeln.

*-- 20042006 --*

SORT itab1 BY vbeln.

SORT itab5 BY kunnr.

  • SORT it_zrail BY zzdelivery.

*-- 20042006 --*

LOOP AT itab2.

READ TABLE itab1 WITH KEY vbeln = itab2-vbeln BINARY SEARCH.

IF sy-subrc = 0.

MOVE itab1-wadat_ist TO itab2-wadat_ist.

MOVE itab1-erdat TO itab2-erdat.

MOVE itab1-kunag TO itab2-kunag.

MOVE itab1-lfart TO itab2-lfart.

MOVE itab1-kunnr TO itab2-kunnr.

MOVE itab1-vstel TO itab2-vstel.

MOVE itab1-werks TO itab2-r_plant.

MOVE itab1-vtweg TO itab2-vtweg.

MOVE itab1-kzwi6 TO itab2-kzwi6.

MOVE itab1-tdlnr TO itab2-tdlnr.

MOVE itab1-exti1 TO itab2-exti1.

  • ************************* change on 07-07-06

  • IF itab2-tdlnr IS INITIAL.

  • READ TABLE it_zrail WITH KEY zzdelivery = itab1-vbeln BINARY

  • SEARCH.

  • IF sy-subrc = 0.

  • itab2-tdlnr = 'RAILWAY'.

  • itab2-exti1 = zraildet-zzwagon.

  • ENDIF.

  • ENDIF.

*

  • READ TABLE IT_ZTRMT WITH KEY TRUCKNO = itab1-exti1 .

  • IF SY-SUBRC = 0.

  • MOVE IT_ZTRMT-OWNCAT TO ITAB2-OWNCAT.

  • MOVE IT_ZTRMT-CAPITN TO ITAB2-CAPITN.

  • MODIFY itab2 TRANSPORTING OWNCAT CAPITN.

*

  • ENDIF.

*

  • clear it_ztrmt.

READ TABLE itab5 WITH KEY kunnr = itab1-kunag BINARY SEARCH

TRANSPORTING name1 .

MOVE itab5-name1 TO itab2-kname1.

ELSE.

CONTINUE.

ENDIF.

MODIFY itab2 .

CLEAR : itab1,itab2,itab5.

ENDLOOP.

DESCRIBE TABLE itab2 LINES n .

IF n = 0.

MESSAGE e034 WITH 'No records found for the selection'.

ENDIF.

SELECT docno "OK Z2

rdoc1

exnum

docyr

werks INTO CORRESPONDING

FIELDS OF TABLE iexcdtl FROM j_1iexcdtl

FOR ALL ENTRIES IN itab2

WHERE rdoc1 = itab2-vbeln AND

trntyp = 'DLFC' AND

werks IN vstel AND

status NE 'R' "+R007

*-- +R009 --*

%_HINTS ORACLE 'INDEX("J_1IEXCDTL" "J_1IEXCDTL~Z2")'. " +R009

*-- +R009 --*

  • IF NOT iexcdtl[] IS INITIAL.

LOOP AT iexcdtl.

UNPACK iexcdtl-docno TO iexcdtl-docno1.

UNPACK iexcdtl-exnum TO iexcdtl-exnum1.

MODIFY iexcdtl.

ENDLOOP.

IF NOT iexcdtl[] IS INITIAL.

SELECT docyr "OK Z05

bukrs

werks

preprn

exnum

exdat

status

exbed

ecs

INTO CORRESPONDING FIELDS OF TABLE iexchdr FROM

j_1iexchdr FOR ALL ENTRIES IN iexcdtl

WHERE

docno = iexcdtl-docno1

AND trntyp = 'DLFC'

AND docyr = iexcdtl-docyr

AND exnum = iexcdtl-exnum1

AND werks = iexcdtl-werks

AND status NE 'R'

*-- +R009 --*

%_HINTS ORACLE 'INDEX("J_1IEXCHDR" "J_1IEXCHDR~Z05")'. " +R009

*-- +R009 --*

ENDIF.

  • DATA : BEGIN OF a_itab OCCURS 0,

  • vbeln LIKE vbfa-vbelv,

  • END OF a_itab.

done-

SELECT vbeln auart "OK PRIMARY

INTO CORRESPONDING FIELDS OF TABLE it_vbak

FROM vbak

FOR ALL ENTRIES IN itab2

WHERE

vbeln EQ itab2-vgbel.

SORT iexcdtl BY rdoc1.

SORT iexchdr BY exnum werks.

SORT it_vbak BY vbeln.

LOOP AT itab2.

READ TABLE iexcdtl WITH KEY rdoc1 = itab2-vbeln BINARY SEARCH.

IF sy-subrc = 0.

READ TABLE iexchdr WITH KEY exnum = iexcdtl-exnum

werks = itab2-werks

BINARY SEARCH.

IF sy-subrc = 0.

itab2-preprn = iexchdr-preprn.

itab2-exnum = iexchdr-exnum.

itab2-exdat = iexchdr-exdat.

itab2-status = iexchdr-status.

itab2-exbed = iexchdr-exbed.

itab2-ecs = iexchdr-ecs.

ENDIF.

ENDIF.

IF itab2-preprn EQ space.

MOVE itab2-vbeln TO wname.

SELECT SINGLE * FROM stxh CLIENT SPECIFIED

WHERE mandt = sy-mandt

AND tdobject = 'VBBK'

AND tdname = wname

AND tdid = 'Z805'

AND tdspras = sy-langu.

IF sy-subrc EQ 0.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = 'Z805'

language = sy-langu

name = wname

object = 'VBBK'

TABLES

lines = wtline.

READ TABLE wtline INDEX 1.

itab2-preprn = wtline-tdline+0(12) .

ENDIF.

ENDIF.

READ TABLE it_vbak WITH KEY vbeln = itab2-vgbel BINARY SEARCH.

IF sy-subrc IS INITIAL.

MOVE it_vbak-auart TO itab2-auart.

ENDIF.

WRITE: itab2-preprn TO itab2-wpreprn RIGHT-JUSTIFIED.

CLEAR itab2-totexcamt.

itab2-totexcamt = itab2-exbed + itab2-ecs.

CALL FUNCTION 'J_1I6_ROUND_TO_NEAREST_AMT'

EXPORTING

i_amount = itab2-totexcamt

  • I_AMOUNT1 =

  • I_AMOUNT2 =

  • I_AMOUNT3 =

  • I_AMOUNT5 =

IMPORTING

e_amount = itab2-totexcamt

  • E_AMOUNT1 =

  • E_AMOUNT2 =

  • E_AMOUNT3 =

  • E_AMOUNT5 =

.

    • End R005

MODIFY itab2.

ENDLOOP.

END-OF-SELECTION.

IF sortdelv EQ 'X'.

SORT itab2 BY vbeln.

ELSEIF sorticdn EQ 'X'.

SORT itab2 BY wpreprn. "preprn. "pmp 020401

ELSEIF sortamt EQ 'X'.

SORT itab2 BY exbed .

ELSEIF sortstat EQ 'X'.

SORT itab2 BY status.

ELSEIF sortdest EQ 'X'.

SORT itab2 BY kunnr.

ENDIF.

CLEAR slno.

FORMAT INTENSIFIED OFF.

LOOP AT itab2.

slno = slno + 1.

itab2-slno = slno.

IF itab2-preprn EQ space.

READ TABLE itab1 WITH KEY vbeln = itab2-vbeln BINARY SEARCH.

IF sy-subrc = 0.

itab2-preprn = itab1-bolnr.

ENDIF.

modify itab2 transporting preprn where vbeln = itab2-vbeln.

ENDIF.

IF itab2-lfart EQ 'NL'.

itab2-rnew = itab2-r_plant.

ELSE.

itab2-rnew = itab2-kunag.

ENDIF.

modify itab2 .

ENDLOOP.

  • loop at itab2.

  • select single OWNCAT CAPITN into (itab2-OWNCAT, ITAB2-CAPITN) from

*ztrmt where truckno = itab2-exti1.

*if sy-subrc = 0.

*modify itab2 index sy-tabix.

*endif.

*endloop.

LOOP AT itab2.

CLEAR itab3. "pmp 13.01.01

MOVE-CORRESPONDING itab2 TO itab3.

**pmp 13.01.01

MOVE-CORRESPONDING itab2 TO itab4.

APPEND itab4.

SELECT SINGLE * FROM t001k WHERE bwkey = itab2-werks.

IF sy-subrc EQ 0.

MOVE t001k-bukrs TO itab3-bukrs.

ENDIF.

APPEND itab3.

ENDLOOP.

SORT itab3 BY bukrs matnr. "pmp 13.01.01

CLEAR: itab3. "pmp 13.01.01

LOOP AT itab3.

AT NEW bukrs.

itab6-bukrs = itab3-bukrs.

ENDAT.

AT END OF matnr.

SUM.

itab6-matnr = itab3-matnr.

itab6-lfimg = itab3-lfimg.

  • 52 itab3-exbed color 3.

    • R004

itab6-totexcamt = itab3-totexcamt.

    • end R004

ENDAT.

append itab6.

ENDLOOP.

delete itab6 where matnr = ''.

delete adjacent duplicates from itab6.

LOOP AT itab4.

AT END OF matnr.

SUM.

itab7-matnr = itab4-matnr .

itab7-lfimg = itab4-lfimg .

  • 52 itab4-exbed color 3.

**R004

itab7-totexcamt = itab4-totexcamt .

**end R004

collect itab7.

ENDAT.

ENDLOOP.

delete adjacent duplicates from itab7.

delete adjacent duplicates from itab6.

perform sort_list.

perform modify_fieldcat.

PERFORM EVENT_LIST.

*PERFORM BLOCK_LIST.

perform display_alv.

*&----


*

*& Form GET_CANCEL_DOC

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM get_cancel_doc.

IF itab2-status = 'R'.

SELECT SINGLE * FROM j_1iexchdr

WHERE

rdoc EQ bill

AND exnum NE space AND status EQ 'C'.

IF sy-subrc EQ 0.

MOVE-CORRESPONDING j_1iexchdr TO itab2.

ENDIF.

ENDIF.

ENDFORM. " GET_CANCEL_DOC

*&----


*

*& Form GET_KUNAG_NAME

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM get_kunag_name.

CLEAR itab2-kname1.

SELECT SINGLE name1 INTO itab2-kname1

FROM kna1

WHERE kunnr = itab1-kunag

*-- +R009 --*

%_HINTS ORACLE 'INDEX("KNA1" "KNA1~0")'.

*-- +R009 --*

.

ENDFORM. " GET_KUNAG_NAME

*&----


*

*& Form display_alv

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM display_alv .

CLEAR WA_LAYOUT.

WA_LAYOUT-ZEBRA = 'X'.

WA_LAYOUT-TOTALS_TEXT = 'TOTAL'.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

EXPORTING

I_CALLBACK_PROGRAM = sy-repid

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

  • I_CALLBACK_PF_STATUS_SET = PFSTATUS.

.

*CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

  • EXPORTING

  • I_PROGRAM_NAME = SY-REPID

  • I_INTERNAL_TABNAME = 'ITAB2'

  • I_INCLNAME = SY-REPID

  • CHANGING

  • CT_FIELDCAT = ALVFC.

DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV, "


X_SORT TYPE SLIS_SORTINFO_ALV.
X_SORT-FIELDNAME = 'MATNR'.
X_SORT-TABNAME = 'ITAB2'.

X_SORT-UP = 'X'.
X_SORT-SUBTOT = 'X'.
APPEND X_SORT TO IT_SORT. "

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = WA_LAYOUT

it_fieldcat = it_fieldcat1

i_tabname = 'ITAB2'

IT_SORT = IT_SORT

it_events = GT_XEVENTS

  • IT_SAVE = 'A'

TABLES

t_outtab = ITAB2

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = WA_LAYOUT

it_fieldcat = it_fieldcat2

i_tabname = 'ITAB6'

it_events = GT_YEVENTS

  • IT_SORT = IT_SORT

  • IT_SAVE = 'A'

TABLES

t_outtab = itab6

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

*----

-


ADD INTERNAL TABLE PTAB

  • REFRESH ALVFC[].

*

  • CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

  • EXPORTING

  • I_PROGRAM_NAME = SY-REPID

  • I_INTERNAL_TABNAME = 'ITAB6'

  • I_INCLNAME = SY-REPID

  • CHANGING

  • CT_FIELDCAT = ALVFC.

*----

-


ADD INTERNAL TABLE PTAB

  • REFRESH ALVFC[].

*

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

is_layout = WA_LAYOUT

it_fieldcat = IT_FIELDCAT3

i_tabname = 'ITAB7'

it_events = GT_ZEVENTS

  • IT_SORT = IT_SORT

  • IT_SAVE = 'X'

TABLES

t_outtab = itab7

EXCEPTIONS

program_error = 1

maximum_of_appends_reached = 2

OTHERS = 3.

*----

-


DISPLAY

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'

EXCEPTIONS

program_error = 1

OTHERS = 2.

ENDFORM. " display_alv

*&----


*

*& Form sort_list

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM sort_list .

  • CLEAR WA_SORT.

  • WA_SORT-FIELDNAME = 'MATNR'.

  • WA_SORT-SUBTOT = 'X'.

  • WA_SORT-SPOS = 1.

  • APPEND WA_SORT TO IT_SORT.

ENDFORM. " sort_list

*&----


*

*& Form modify_fieldcat

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM modify_fieldcat .

wa_fieldcat-fieldname = 'MATNR'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '1'.

wa_fieldcat-key = 'X'.

wa_fieldcat-seltext_l = 'MATERIAL'.

wa_fieldcat-emphasize = 'X'.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'SLNO'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '2'.

wa_fieldcat-seltext_l = 'Sr No'.

wa_fieldcat-emphasize = 'X'.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'WADAT_IST'.

wa_fieldcat-tabname = 'IATB2'.

wa_fieldcat-col_pos = '3'.

wa_fieldcat-seltext_l = 'G.I.DATE'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'PREPRN'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '4'.

wa_fieldcat-seltext_l = 'ICDN/DC NO.'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'VBELN'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '5'.

wa_fieldcat-seltext_l = 'dELIVERY NO.'.

wa_fieldcat-emphasize = 'X'.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'AUART'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '6'.

wa_fieldcat-seltext_l = 'ORDER TYPE'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

*wa_fieldcat-fieldname = 'MATNR'.

*wa_fieldcat-tabname = 'ITAB2'.

*wa_fieldcat-col_pos = '6'.

*wa_fieldcat-seltext_l = 'MATERIAL'.

*wa_fieldcat-emphasize = 'X'.

*append wa_fieldcat to it_fieldcat1.

*clear wa_fieldcat.

wa_fieldcat-fieldname = 'LFIMG'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '7'.

wa_fieldcat-seltext_l = 'QUANTITY'.

wa_fieldcat-inttype = 'P'.


wa_fieldcat-DO_SUM = 'X'.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.

wa_fieldcat-fieldname = 'RNEW'.
wa_fieldcat-tabname = 'ITAB2'.
wa_fieldcat-col_pos = '8'.
wa_fieldcat-seltext_l = 'CUSTOMER'.
wa_fieldcat-emphasize = 'X'.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.

wa_fieldcat-fieldname = 'KUNNR'.
wa_fieldcat-tabname = 'ITAB2'.
wa_fieldcat-col_pos = '9'.
wa_fieldcat-seltext_l = 'DESTINATION'.
*wa_fieldcat-emphasize = ''.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.

wa_fieldcat-fieldname = 'EXNUM'.
wa_fieldcat-tabname = 'ITAB2'.
wa_fieldcat-col_pos = '10'.
wa_fieldcat-seltext_l = 'EXCISE NO'.
*wa_fieldcat-emphasize = ''.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.

wa_fieldcat-fieldname = 'EXDAT'.
wa_fieldcat-tabname = 'ITAB2'.
wa_fieldcat-col_pos = '11'.
wa_fieldcat-seltext_l = 'EXCISE DATE'.
*wa_fieldcat-emphasize = ''.
append wa_fieldcat to it_fieldcat1.
clear wa_fieldcat.

wa_fieldcat-fieldname = 'TOTEXCAMT'.
wa_fieldcat-tabname = 'ITAB2'.
wa_fieldcat-col_pos = '12'.

wa_fieldcat-inttype = 'P'.

wa_fieldcat-seltext_l = 'EXCISE AMOUNT'.

wa_fieldcat-DO_SUM = 'X'.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'STATUS'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '13'.

wa_fieldcat-seltext_l = 'EXCISE STATUS'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'TDLNR'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '14'.

wa_fieldcat-seltext_l = 'TRANSPORTER'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'EXTI1'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '15'.

wa_fieldcat-seltext_l = 'TRUCK NO'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'OWNCAT'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '16'.

wa_fieldcat-seltext_l = 'TRUCK CATEGORY'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'CAPITN'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '17'.

wa_fieldcat-seltext_l = 'TRUCK TYPE'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'WERKS'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '18'.

wa_fieldcat-seltext_l = 'PLANT'.

wa_fieldcat-emphasize = 'X'.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'KNAME1'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '19'.

wa_fieldcat-seltext_l = 'SOLD TO PARTY'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'VTWEG'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '20'.

wa_fieldcat-seltext_l = 'DISTRIBUTION CHANNEL'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'KZWI6'.

wa_fieldcat-tabname = 'ITAB2'.

wa_fieldcat-col_pos = '21'.

wa_fieldcat-seltext_l = 'INVOICE VALUE'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat1.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'BUKRS'.

wa_fieldcat-tabname = 'ITAB6'.

wa_fieldcat-col_pos = '1'.

wa_fieldcat-seltext_l = 'COMPANY CODE'.

wa_fieldcat-emphasize = 'X'.

append wa_fieldcat to it_fieldcat2.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'MATNR'.

wa_fieldcat-tabname = 'ITAB6'.

wa_fieldcat-col_pos = '2'.

wa_fieldcat-seltext_l = 'MATERIAL'.

wa_fieldcat-emphasize = 'X'.

append wa_fieldcat to it_fieldcat2.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'LFIMG'.

wa_fieldcat-tabname = 'ITAB6'.

wa_fieldcat-col_pos = '3'.

wa_fieldcat-seltext_l = 'QUANTITY'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat2.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'TOTEXCAMT'.

wa_fieldcat-tabname = 'ITAB6'.

wa_fieldcat-col_pos = '4'.

wa_fieldcat-seltext_l = 'EXCISE VALUE'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat2.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'MATNR'.

wa_fieldcat-tabname = 'ITAB7'.

wa_fieldcat-col_pos = '1'.

wa_fieldcat-seltext_l = 'MATERIAL'.

wa_fieldcat-emphasize = 'X'.

append wa_fieldcat to it_fieldcat3.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'LFIMG'.

wa_fieldcat-tabname = 'ITAB7'.

wa_fieldcat-col_pos = '2'.

wa_fieldcat-seltext_l = 'QUANTITY'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat3.

clear wa_fieldcat.

wa_fieldcat-fieldname = 'TOTEXCAMT'.

wa_fieldcat-tabname = 'ITAB7'.

wa_fieldcat-col_pos = '3'.

wa_fieldcat-seltext_l = 'EXCISE VALUE'.

*wa_fieldcat-emphasize = ''.

append wa_fieldcat to it_fieldcat3.

clear wa_fieldcat.

ENDFORM. " modify_fieldcat

*&----


*

*& Form EVENT_LIST

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM EVENT_LIST .

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.

XS_EVENT-FORM = 'XTOP_OF_PAGE'.

APPEND XS_EVENT TO GT_XEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.

XS_EVENT-FORM = 'XEND_OF_PAGE'.

APPEND XS_EVENT TO GT_XEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.

XS_EVENT-FORM = 'XTOP_OF_LIST'.

APPEND XS_EVENT TO GT_XEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_END_OF_LIST.

XS_EVENT-FORM = 'XEND_OF_LIST'.

APPEND XS_EVENT TO GT_XEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.

XS_EVENT-FORM = 'YEND_OF_PAGE'.

APPEND XS_EVENT TO GT_YEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.

XS_EVENT-FORM = 'YTOP_OF_PAGE'.

APPEND XS_EVENT TO GT_YEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.

XS_EVENT-FORM = 'YTOP_OF_LIST'.

APPEND XS_EVENT TO GT_YEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_END_OF_LIST.

XS_EVENT-FORM = 'YEND_OF_LIST'.

APPEND XS_EVENT TO GT_YEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.

XS_EVENT-FORM = 'ZEND_OF_PAGE'.

APPEND XS_EVENT TO GT_ZEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.

XS_EVENT-FORM = 'ZTOP_OF_PAGE'.

APPEND XS_EVENT TO GT_ZEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.

XS_EVENT-FORM = 'ZTOP_OF_LIST'.

APPEND XS_EVENT TO GT_ZEVENTS.

CLEAR XS_EVENT.

XS_EVENT-NAME = SLIS_EV_END_OF_LIST.

XS_EVENT-FORM = 'ZEND_OF_LIST'.

APPEND XS_EVENT TO GT_ZEVENTS.

CLEAR XS_EVENT.

ENDFORM. " EVENT_LIST

FORM XTOP_OF_PAGE.

WRITE:/15(30) 'ICDN / DC wise Dispatch Report For The Period' COLOR 3,

47 DATE-LOW , 58 'TO', 62 DATE-HIGH.

ENDFORM.

FORM YTOP_OF_PAGE.

WRITE:/ 'TOTAL BY COMPANY CODE' COLOR 3.

ENDFORM.

FORM ZTOP_OF_PAGE.

WRITE:/ 'TOTAL BY MATERIAL' COLOR 3.

ENDFORM.

FORM XEND_OF_PAGE.

*WRITE:/ 'END OF PAGE FOR MARA'.

ENDFORM.

FORM YEND_OF_PAGE.

*WRITE:/ 'END OF PAGE FOR MAKT'.

ENDFORM.

FORM ZEND_OF_PAGE.

*WRITE:/ 'END OF PAGE FOR MARC'.

ENDFORM.

FORM XTOP_OF_LIST.

WRITE:/40(30) 'ULTRATECH CEMENT LTD.' COLOR 6 INTENSIFIED OFF.

SKIP 1.

ENDFORM.

FORM YTOP_OF_LIST.

*WRITE:/ 'TOP OF LIST FOR MAKT'.

ENDFORM.

FORM ZTOP_OF_LIST.

*WRITE:/ 'TOP OF LIST FOR MARC'.

ENDFORM.

FORM XEND_OF_LIST.

*WRITE:/ 'END OF LIST FOR MARA'.

ENDFORM.

FORM YEND_OF_LIST.

*WRITE:/ 'END OF LIST FOR MAKT'.

ENDFORM.

FORM ZEND_OF_LIST.

*WRITE:/ 'END OF LIST FOR MARC'.

ENDFORM. " EVENT_LIST

.

The missing thing is

wa_fieldcat-inttype = 'P'.

now it is working fine. just check it.

Please reward points for helpful answers.

Regards

vijay

0 Kudos

Can you solve my problem regarding showing total directly by calculating by our report

0 Kudos

Yes you can do that...

but why do you need to go for that.., if you have standard functionalities with sort.

if you want to do manually then it is little complex and to populate that sum under the quantity field then you have to use control break statements,populate new final table, for each change in matnr find the sum and populate the sum under quantity field alone and rest of the fields will be blank for that record.append this record to final table.

this is how you have to do manually show the data in alv.

Regards

vijay

0 Kudos

I wanted to learn it, cz earlier I had report where I had to display report woth diffrent datas.

So if you can give me the code for the same It would be lot helpful.

Thnaks A lot

0 Kudos

Hi,

if you can give me some time , i will get back to you.

with the example...

Regards

vijay