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

Problem in ALV report

Former Member
0 Likes
408

Hi ,

I have created Alv report . Its working fine. But grouping syblos its not coming . I given below code . Plz help m to get that report with grouping .

TABLES: vbap, vbak , vbpa2 ,vbuk ,vapma ,kna1 ,pa0002.

type-pools: slis. "ALV Declarations

*Data Declaration

*----


TYPES: BEGIN OF t_vbmtv,

  • arktx TYPE vbap-arktx,

  • kunnr TYPE vbak-kunnr,

  • name1 TYPE vbsec-name1,

  • audat TYPE vbak-audat,

  • datab TYPE vapma-datab,

  • ernam TYPE vbap-ernam,

    • kwmeng TYPE vbap-kwmeng,

    • vrkme TYPE vbap-vrkme,

    • kpein TYPE vbap-kpein,

  • netwr TYPE vbap-netwr,

  • partner TYPE vbpa2-partner,

    • gbstk TYPE vbuk-gbstk,

  • kunnr TYPE vbak-kunnr,

vbeln LIKE vbap-vbeln,

  • name1 LIKE vbap-aedat,

arktx LIKE vbap-arktx,

  • kunnr LIKE vbak-kunnr,

posnr LIKE vbap-posnr,

netwr LIKE vbap-netwr,

gbstk LIKE vbuk-gbstk,

datab LIKE vapma-datab,

kunnr LIKE kna1-kunnr,

audat LIKE vbak-audat,

name1 LIKE kna1-name1,

pernr TyPE vbpa-pernr,

ST1(50) TYPE C,

END OF t_vbmtv.

data : ST1(50) TYPE C.

DATA: it_vbmtv TYPE STANDARD TABLE OF t_vbmtv INITIAL SIZE 0 with

header line,

wa_vbmtv TYPE t_vbmtv.

*ALV data declarations

data: fieldcatalog type slis_t_fieldcat_alv with header line,

gd_tab_group type slis_t_sp_group_alv,

gd_layout type slis_layout_alv,

gd_repid like sy-repid,

gt_events type slis_t_event,

gt_sort type slis_sortinfo_alv occurs 0 with header line,

gd_prntparams type slis_print_alv.

data : wa_group type slis_sp_group_alv,

i_group type slis_t_sp_group_alv.

*data : it_sort type slis_sortinfo_alv

*select-options s_vbeln for vbap-vbeln.

parameters : i_kunnr like vbak-kunnr,

i_matnr like vbap-matnr.

*SELECT-OPTIONS :i_datab FOR vapma-datab .

selection-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-t01.

SELECT-OPTIONS : i_datab FOR sy-datum .

SELECT-OPTIONS i_audat FOR vbak-audat .

selection-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK 2 WITH FRAME TITLE text-t02.

parameters: Openorde radiobutton group grp1,

Allorder radiobutton group grp1.

  • Hier radiobutton group grp1.

SELECTION-SCREEN: END OF BLOCK 2.

************************************************************************

*Start-of-selection.

START-OF-SELECTION.

perform data_retrieval.

perform build_fieldcatalog.

perform build_layout.

perform build_events.

perform build_sort.

perform build_group.

perform build_print_params.

perform display_alv_report.

&----


*& Form BUILD_FIELDCATALOG

&----


  • Build Fieldcatalog for ALV Report

----


form build_fieldcatalog.

fieldcatalog-fieldname = 'KUNNR'.

fieldcatalog-seltext_m = 'Sold-to-party '.

fieldcatalog-col_pos = 1.

  • fieldcatalog-outputlen = 10.

  • fieldcatalog-emphasize = 'X'.

fieldcatalog-key = 'X'.

  • fieldcatalog-do_sum = 'X'.

  • fieldcatalog-no_zero = 'X'.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'NAME1'.

fieldcatalog-seltext_m = 'Name1'.

fieldcatalog-col_pos = 2.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'ARKTX'.

fieldcatalog-seltext_m = 'Description'.

fieldcatalog-col_pos = 3.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'AUDAT'.

fieldcatalog-seltext_m = 'Document date'.

fieldcatalog-col_pos = 4.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'POSNR'.

fieldcatalog-seltext_m = 'Net Value'.

fieldcatalog-col_pos = 5.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'NETWR'.

fieldcatalog-seltext_m = 'Net Value'.

fieldcatalog-col_pos = 6.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'GBSTK'.

fieldcatalog-seltext_m = 'Status'.

fieldcatalog-col_pos = 7.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'ST1'.

fieldcatalog-seltext_m = 'Sales employee'.

fieldcatalog-col_pos = 8.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

endform. " BUILD_FIELDCATALOG

&----


*& Form BUILD_LAYOUT

&----


  • Build layout for ALV grid report

----


form build_layout.

  • gd_layout-no_input = 'X'.

gd_layout-colwidth_optimize = 'X'.

  • gd_layout-totals_text = 'Totals'(201).

  • gd_layout-totals_only = 'X'.

  • gd_layout-f2code = 'DISP'. "Sets fcode for when double

  • "click(press f2)

gd_layout-zebra = 'X'.

  • gd_layout-group_change_edit = 'X'.

  • gd_layout-header_text = 'helllllo'.

  • gd_layout-subtotals_text = 'Sub Totals'(202).

gd_layout-info_fieldname = 'COLOR'(203).

endform. " BUILD_LAYOUT

&----


*& Form DISPLAY_ALV_REPORT

&----


  • Display report using ALV grid

----


form display_alv_report.

gd_repid = sy-repid.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

  • i_callback_user_command = 'USER_COMMAND'

i_grid_title = 'uttext'

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

it_special_groups = i_group

it_sort = gt_sort[]

it_events = gt_events

is_print = gd_prntparams

i_save = 'X'

  • is_variant = z_template

tables

t_outtab = it_vbmtv

exceptions

program_error = 1

others = 2.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endform. " DISPLAY_ALV_REPORT

&----


*& Form DATA_RETRIEVAL

&----


  • Retrieve data form EKPO table and populate itab it_ekko

----


form data_retrieval.

Select t1~arktx

t1~netwr

t1~netwr

t1~posnr

t2~kunnr

t2~audat

t2~vbeln

t4~gbstk

  • t3~datab

t5~kunnr

t5~name1

t6~pernr

into corresponding fields of table it_vbmtv

from vbap as t1

inner join vbak as t2 on t2~vbeln = t1~vbeln

Inner join Vapma as t3 on t3~matnr = t1~matnr

inner join kna1 as t5 on t5~kunnr = t2~kunnr

Inner join vbuk as t4 on t4~vbeln = t1~vbeln

  • Inner join kna1 as t3 on t3vbeln = t4vbeln.

Inner join Vbpa as t6 on t6~vbeln = t4~vbeln

WHERE t6~parvw = 'AF'.

loop at it_vbmtv into WA_vbmtv.

select SINGLE * FROM pa0002 where pernr = WA_vbmtv-pernr.

CONCATENATE PA0002-VORNA pa0002-NACHN INTO ST1 SEPARATED BY SPACE.

WA_VBMTV-ST1 = ST1.

modify it_vbmtv from wa_vbmtv.

endloop.

  • where t3~datab in i_datab.

endform. " DATA_RETRIEVAL

&----


*& Form BUILD_SORT

&----


  • Build Sort for ALV Report

----


form build_sort.

gt_sort-fieldname = 'KUNNR'.

gt_sort-tabname = 'IT_VBMTV'.

gt_sort-up = 'X'.

gt_sort-subtot = 'X'.

append gt_sort .

endform.

&----


*& Form BUILD_GROUP

&----


  • Build Group for ALV Report

----


form build_group.

clear i_group.

wa_group-sp_group = 'A'.

wa_group-text = 'KUNNR'.

append wa_group to i_group .

endform.

----


  • Form TOP-OF-PAGE *

----


  • ALV Report Header *

----


Form top-of-page.

*ALV Header declarations

data: t_header type slis_t_listheader,

wa_header type slis_listheader,

t_line like wa_header-info,

ld_lines type i,

ld_linesc(10) type c.

  • Title

wa_header-typ = 'H'.

wa_header-info = 'Open Inquiries'.

append wa_header to t_header.

clear wa_header.

  • Date

wa_header-typ = 'S'.

wa_header-key = 'Valid Period: '.

  • wa_header-info = sy-datum.

CONCATENATE sy-datum+6(2) '.'

sy-datum+4(2) '.'

sy-datum(4) INTO wa_header-info. "todays date

append wa_header to t_header.

clear: wa_header.

    • Total No. of Records Selected

  • describe table it_vbmtv lines ld_lines.

  • ld_linesc = ld_lines.

  • concatenate 'Total No. of Records Selected: ' ld_linesc

  • into t_line separated by space.

  • wa_header-typ = 'A'.

  • wa_header-info = t_line.

  • append wa_header to t_header.

  • clear: wa_header, t_line.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = t_header.

  • i_logo = 'Z_LOGO'.

endform.

----


  • FORM USER_COMMAND *

----


  • --> R_UCOMM *

  • --> RS_SELFIELD *

----


*FORM user_command USING r_ucomm LIKE sy-ucomm

  • rs_selfield TYPE slis_selfield.

*

    • Check function code

  • CASE r_ucomm.

  • WHEN '&IC1'.

    • Check field clicked on within ALVgrid report

  • IF rs_selfield-fieldname = 'VBELN'.

    • Read data table, using index of row user clicked on

  • READ TABLE it_vbmtv INTO wa_vbmtv INDEX rs_selfield-tabindex.

    • Set parameter ID for transaction screen field

  • SET PARAMETER ID 'BES' FIELD wa_VBMTV-Vbeln.

    • Sxecute transaction ME23N, and skip initial data entry screen

  • CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

  • ENDIF.

  • ENDCASE.

*ENDFORM.

&----


*& Form BUILD_EVENTS

&----


  • Build events table

----


form build_events.

data: ls_event type slis_alv_event.

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = gt_events[].

read table gt_events with key name = slis_ev_end_of_page

into ls_event.

if sy-subrc = 0.

move 'END_OF_PAGE' to ls_event-form.

append ls_event to gt_events.

endif.

read table gt_events with key name = slis_ev_end_of_list

into ls_event.

if sy-subrc = 0.

move 'END_OF_LIST' to ls_event-form.

append ls_event to gt_events.

endif.

endform. " BUILD_EVENTS

&----


*& Form BUILD_PRINT_PARAMS

&----


  • Setup print parameters

----


form build_print_params.

gd_prntparams-reserve_lines = '3'. "Lines reserved for footer

gd_prntparams-no_coverpage = 'X'.

endform. " BUILD_PRINT_PARAMS

&----


*& Form END_OF_PAGE

&----


form END_OF_PAGE.

data: listwidth type i,

ld_pagepos(10) type c,

ld_page(10) type c.

write: sy-uline(50).

skip.

write:/40 'Page:', sy-pagno .

endform.

&----


*& Form END_OF_LIST

&----


form END_OF_LIST.

data: listwidth type i,

ld_pagepos(10) type c,

ld_page(10) type c.

skip.

write:/40 'Page:', sy-pagno .

endform.

Hi ,

I have created Alv report . Its working fine. But grouping syblos its not coming . I given below code . Plz help m to get that report with grouping .

TABLES: vbap, vbak , vbpa2 ,vbuk ,vapma ,kna1 ,pa0002.

type-pools: slis. "ALV Declarations

*Data Declaration

*----


TYPES: BEGIN OF t_vbmtv,

  • arktx TYPE vbap-arktx,

  • kunnr TYPE vbak-kunnr,

  • name1 TYPE vbsec-name1,

  • audat TYPE vbak-audat,

  • datab TYPE vapma-datab,

  • ernam TYPE vbap-ernam,

    • kwmeng TYPE vbap-kwmeng,

    • vrkme TYPE vbap-vrkme,

    • kpein TYPE vbap-kpein,

  • netwr TYPE vbap-netwr,

  • partner TYPE vbpa2-partner,

    • gbstk TYPE vbuk-gbstk,

  • kunnr TYPE vbak-kunnr,

vbeln LIKE vbap-vbeln,

  • name1 LIKE vbap-aedat,

arktx LIKE vbap-arktx,

  • kunnr LIKE vbak-kunnr,

posnr LIKE vbap-posnr,

netwr LIKE vbap-netwr,

gbstk LIKE vbuk-gbstk,

datab LIKE vapma-datab,

kunnr LIKE kna1-kunnr,

audat LIKE vbak-audat,

name1 LIKE kna1-name1,

pernr TyPE vbpa-pernr,

ST1(50) TYPE C,

END OF t_vbmtv.

data : ST1(50) TYPE C.

DATA: it_vbmtv TYPE STANDARD TABLE OF t_vbmtv INITIAL SIZE 0 with

header line,

wa_vbmtv TYPE t_vbmtv.

*ALV data declarations

data: fieldcatalog type slis_t_fieldcat_alv with header line,

gd_tab_group type slis_t_sp_group_alv,

gd_layout type slis_layout_alv,

gd_repid like sy-repid,

gt_events type slis_t_event,

gt_sort type slis_sortinfo_alv occurs 0 with header line,

gd_prntparams type slis_print_alv.

data : wa_group type slis_sp_group_alv,

i_group type slis_t_sp_group_alv.

*data : it_sort type slis_sortinfo_alv

*select-options s_vbeln for vbap-vbeln.

parameters : i_kunnr like vbak-kunnr,

i_matnr like vbap-matnr.

*SELECT-OPTIONS :i_datab FOR vapma-datab .

selection-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-t01.

SELECT-OPTIONS : i_datab FOR sy-datum .

SELECT-OPTIONS i_audat FOR vbak-audat .

selection-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK 2 WITH FRAME TITLE text-t02.

parameters: Openorde radiobutton group grp1,

Allorder radiobutton group grp1.

  • Hier radiobutton group grp1.

SELECTION-SCREEN: END OF BLOCK 2.

************************************************************************

*Start-of-selection.

START-OF-SELECTION.

perform data_retrieval.

perform build_fieldcatalog.

perform build_layout.

perform build_events.

perform build_sort.

perform build_group.

perform build_print_params.

perform display_alv_report.

&----


*& Form BUILD_FIELDCATALOG

&----


  • Build Fieldcatalog for ALV Report

----


form build_fieldcatalog.

fieldcatalog-fieldname = 'KUNNR'.

fieldcatalog-seltext_m = 'Sold-to-party '.

fieldcatalog-col_pos = 1.

  • fieldcatalog-outputlen = 10.

  • fieldcatalog-emphasize = 'X'.

fieldcatalog-key = 'X'.

  • fieldcatalog-do_sum = 'X'.

  • fieldcatalog-no_zero = 'X'.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'NAME1'.

fieldcatalog-seltext_m = 'Name1'.

fieldcatalog-col_pos = 2.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'ARKTX'.

fieldcatalog-seltext_m = 'Description'.

fieldcatalog-col_pos = 3.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'AUDAT'.

fieldcatalog-seltext_m = 'Document date'.

fieldcatalog-col_pos = 4.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'POSNR'.

fieldcatalog-seltext_m = 'Net Value'.

fieldcatalog-col_pos = 5.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'NETWR'.

fieldcatalog-seltext_m = 'Net Value'.

fieldcatalog-col_pos = 6.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'GBSTK'.

fieldcatalog-seltext_m = 'Status'.

fieldcatalog-col_pos = 7.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

fieldcatalog-fieldname = 'ST1'.

fieldcatalog-seltext_m = 'Sales employee'.

fieldcatalog-col_pos = 8.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

endform. " BUILD_FIELDCATALOG

&----


*& Form BUILD_LAYOUT

&----


  • Build layout for ALV grid report

----


form build_layout.

  • gd_layout-no_input = 'X'.

gd_layout-colwidth_optimize = 'X'.

  • gd_layout-totals_text = 'Totals'(201).

  • gd_layout-totals_only = 'X'.

  • gd_layout-f2code = 'DISP'. "Sets fcode for when double

  • "click(press f2)

gd_layout-zebra = 'X'.

  • gd_layout-group_change_edit = 'X'.

  • gd_layout-header_text = 'helllllo'.

  • gd_layout-subtotals_text = 'Sub Totals'(202).

gd_layout-info_fieldname = 'COLOR'(203).

endform. " BUILD_LAYOUT

&----


*& Form DISPLAY_ALV_REPORT

&----


  • Display report using ALV grid

----


form display_alv_report.

gd_repid = sy-repid.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

  • i_callback_user_command = 'USER_COMMAND'

i_grid_title = 'uttext'

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

it_special_groups = i_group

it_sort = gt_sort[]

it_events = gt_events

is_print = gd_prntparams

i_save = 'X'

  • is_variant = z_template

tables

t_outtab = it_vbmtv

exceptions

program_error = 1

others = 2.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endform. " DISPLAY_ALV_REPORT

&----


*& Form DATA_RETRIEVAL

&----


  • Retrieve data form EKPO table and populate itab it_ekko

----


form data_retrieval.

Select t1~arktx

t1~netwr

t1~netwr

t1~posnr

t2~kunnr

t2~audat

t2~vbeln

t4~gbstk

  • t3~datab

t5~kunnr

t5~name1

t6~pernr

into corresponding fields of table it_vbmtv

from vbap as t1

inner join vbak as t2 on t2~vbeln = t1~vbeln

Inner join Vapma as t3 on t3~matnr = t1~matnr

inner join kna1 as t5 on t5~kunnr = t2~kunnr

Inner join vbuk as t4 on t4~vbeln = t1~vbeln

  • Inner join kna1 as t3 on t3vbeln = t4vbeln.

Inner join Vbpa as t6 on t6~vbeln = t4~vbeln

WHERE t6~parvw = 'AF'.

loop at it_vbmtv into WA_vbmtv.

select SINGLE * FROM pa0002 where pernr = WA_vbmtv-pernr.

CONCATENATE PA0002-VORNA pa0002-NACHN INTO ST1 SEPARATED BY SPACE.

WA_VBMTV-ST1 = ST1.

modify it_vbmtv from wa_vbmtv.

endloop.

  • where t3~datab in i_datab.

endform. " DATA_RETRIEVAL

&----


*& Form BUILD_SORT

&----


  • Build Sort for ALV Report

----


form build_sort.

gt_sort-fieldname = 'KUNNR'.

gt_sort-tabname = 'IT_VBMTV'.

gt_sort-up = 'X'.

gt_sort-subtot = 'X'.

append gt_sort .

endform.

&----


*& Form BUILD_GROUP

&----


  • Build Group for ALV Report

----


form build_group.

clear i_group.

wa_group-sp_group = 'A'.

wa_group-text = 'KUNNR'.

append wa_group to i_group .

endform.

----


  • Form TOP-OF-PAGE *

----


  • ALV Report Header *

----


Form top-of-page.

*ALV Header declarations

data: t_header type slis_t_listheader,

wa_header type slis_listheader,

t_line like wa_header-info,

ld_lines type i,

ld_linesc(10) type c.

  • Title

wa_header-typ = 'H'.

wa_header-info = 'Open Inquiries'.

append wa_header to t_header.

clear wa_header.

  • Date

wa_header-typ = 'S'.

wa_header-key = 'Valid Period: '.

  • wa_header-info = sy-datum.

CONCATENATE sy-datum+6(2) '.'

sy-datum+4(2) '.'

sy-datum(4) INTO wa_header-info. "todays date

append wa_header to t_header.

clear: wa_header.

    • Total No. of Records Selected

  • describe table it_vbmtv lines ld_lines.

  • ld_linesc = ld_lines.

  • concatenate 'Total No. of Records Selected: ' ld_linesc

  • into t_line separated by space.

  • wa_header-typ = 'A'.

  • wa_header-info = t_line.

  • append wa_header to t_header.

  • clear: wa_header, t_line.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = t_header.

  • i_logo = 'Z_LOGO'.

endform.

----


  • FORM USER_COMMAND *

----


  • --> R_UCOMM *

  • --> RS_SELFIELD *

----


*FORM user_command USING r_ucomm LIKE sy-ucomm

  • rs_selfield TYPE slis_selfield.

*

    • Check function code

  • CASE r_ucomm.

  • WHEN '&IC1'.

    • Check field clicked on within ALVgrid report

  • IF rs_selfield-fieldname = 'VBELN'.

    • Read data table, using index of row user clicked on

  • READ TABLE it_vbmtv INTO wa_vbmtv INDEX rs_selfield-tabindex.

    • Set parameter ID for transaction screen field

  • SET PARAMETER ID 'BES' FIELD wa_VBMTV-Vbeln.

    • Sxecute transaction ME23N, and skip initial data entry screen

  • CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

  • ENDIF.

  • ENDCASE.

*ENDFORM.

&----


*& Form BUILD_EVENTS

&----


  • Build events table

----


form build_events.

data: ls_event type slis_alv_event.

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = gt_events[].

read table gt_events with key name = slis_ev_end_of_page

into ls_event.

if sy-subrc = 0.

move 'END_OF_PAGE' to ls_event-form.

append ls_event to gt_events.

endif.

read table gt_events with key name = slis_ev_end_of_list

into ls_event.

if sy-subrc = 0.

move 'END_OF_LIST' to ls_event-form.

append ls_event to gt_events.

endif.

endform. " BUILD_EVENTS

&----


*& Form BUILD_PRINT_PARAMS

&----


  • Setup print parameters

----


form build_print_params.

gd_prntparams-reserve_lines = '3'. "Lines reserved for footer

gd_prntparams-no_coverpage = 'X'.

endform. " BUILD_PRINT_PARAMS

&----


*& Form END_OF_PAGE

&----


form END_OF_PAGE.

data: listwidth type i,

ld_pagepos(10) type c,

ld_page(10) type c.

write: sy-uline(50).

skip.

write:/40 'Page:', sy-pagno .

endform.

&----


*& Form END_OF_LIST

&----


form END_OF_LIST.

data: listwidth type i,

ld_pagepos(10) type c,

ld_page(10) type c.

skip.

write:/40 'Page:', sy-pagno .

endform.

1 REPLY 1
Read only

Former Member
0 Likes
384

Hi Sheetal,

The problem in the subroutine BUILD_SORT. Here you want to group the entries depending on the KUNNR. So here you need to do like this.

I make the added code in Bold. so you can get the grouping depending on the KUNNR field values.

form build_sort.

gt_sort-fieldname = 'KUNNR'.

gt_sort-tabname = 'IT_VBMTV'.

gt_sort-up = 'X'.

gt_sort-subtot = 'X'.

<b>gt_sort-group = '*'.</b>

append gt_sort .

endform.