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: 

asterisk in alv output

Former Member
0 Kudos
1,283

hi experts,

i have written alv report with summing up quantity and currency fields. but in the ouput of the alv asterisk are displayed at the bottom of subtotals and grand total. Please let me how to solve this problem.

and also i wanna include text subtotal and grand total.

Thanks in advance.

Regards,

alson.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
258

output column is shorter than your value it will NOT appear. If it is shorter then make sure you set the outputlen in the fieldcat for the first column to be long enough(24?). set outputen length of field in field catalogue.

2)

9 REPLIES 9

Former Member
0 Kudos
259

output column is shorter than your value it will NOT appear. If it is shorter then make sure you set the outputlen in the fieldcat for the first column to be long enough(24?). set outputen length of field in field catalogue.

2)

Former Member
0 Kudos
258

Hi,

You can give text in the layout structure..

LAYOUT-subtotals_text = 'Sub total text'.

LAYOUT-totals_text = 'Total text'.

Pass the layout structure to the alv Fm ..

Thanks,

Naren

Former Member
0 Kudos
258

Hello,

Jus pass the subtotal text and total text to the parameters SUBTOTAL_TEXT and TOTAL_TEXT of the layout before you call the display function module of the ALV.

This may result in the printing of your texts and discard the asterisk..

Hope this works fine.

Regards,

Former Member
0 Kudos
258

Hi alson,

check this code,execute it

&----


*& Report ZKEERTHI_ALV2 *

*& *

&----


*& *

*& *

&----


report zkeerthi_alv2 .

tables: vbak.

type-pools : slis.

data: begin of it_vbak occurs 0,

icon type icon-id,

vbeln like vbak-vbeln,

audat like vbak-audat,

vbtyp like vbak-vbtyp,

auart like vbak-auart,

augru like vbak-augru,

netwr like vbak-netwr,

waerk like vbak-waerk,

end of it_vbak.

data: g_repid like sy-repid,

wa_sort type slis_sortinfo_alv,

it_sort type slis_t_sortinfo_alv,

wa_layout type slis_layout_alv,

it_fieldtab type slis_t_fieldcat_alv,

wa_fieldcat type slis_fieldcat_alv.

selection-screen begin of block b1 with frame.

select-options:s_vbeln for vbak-vbeln,

s_vbtyp for vbak-vbtyp default 'C'.

selection-screen end of block b1 .

selection-screen begin of block b2 with frame.

parameters: list radiobutton group rad1,

grid radiobutton group rad1.

selection-screen end of block b2.

initialization.

g_repid = sy-repid.

start-of-selection.

select vbeln

audat

vbtyp

auart

augru

netwr

waerk into corresponding fields of table it_vbak

from vbak where audat > '01/01/2004' and

netwr > 0 and

vbeln in s_vbeln and

vbtyp in s_vbtyp.

loop at it_vbak.

if it_vbak-netwr < 10000.

it_vbak-icon = '@08@'.

elseif it_vbak-netwr > 10000 and it_vbak-netwr < 100000.

it_vbak-icon = '@09@'.

elseif it_vbak-netwr > 100000.

it_vbak-icon = '@0A@'.

endif.

modify it_vbak index sy-tabix.

endloop.

end-of-selection.

perform sort_list.

perform modify_fieldcat.

perform layout_list.

&----


*& Form sort_list

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form sort_list .

clear wa_sort.

wa_sort-fieldname = 'AUART'.

wa_sort-spos = '1'.

wa_sort-up = 'X'.

append wa_sort to it_sort.

clear wa_sort.

wa_sort-fieldname = 'VBTYP'.

wa_sort-spos = '2'.

wa_sort-up = 'X'.

append wa_sort to it_sort.

clear wa_sort.

wa_sort-fieldname = 'WAERK'.

wa_sort-spos = '3'.

wa_sort-up = 'X'.

wa_sort-subtot = 'X'.

append wa_sort to it_sort.

endform. " sort_list

&----


*& Form layout_list

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form layout_list .

clear wa_layout.

if list = 'X'.

wa_layout-zebra = 'X'.

wa_layout-window_titlebar = 'LIST DISPLAY'.

wa_layout-subtotals_text = 'SUBTOTAL'.

wa_layout-totals_text = 'TOTAL'.

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

i_callback_program = g_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_STRUCTURE_NAME =

is_layout = wa_layout

it_fieldcat = it_fieldtab[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

it_sort = it_sort[]

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_vbak

  • 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.

elseif grid = 'X'.

wa_layout-zebra = 'X'.

wa_layout-window_titlebar = 'GRID DISPLAY'.

wa_layout-subtotals_text = 'SUBTOTAL'.

wa_layout-totals_text = 'TOTAL'.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = g_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

is_layout = wa_layout

it_fieldcat = it_fieldtab

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

it_sort = it_sort

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_vbak

  • 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.

endif.

endform. " layout_list

&----


*& Form modify_fieldcat

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form modify_fieldcat .

clear wa_fieldcat.

wa_fieldcat-tabname = 'IT_VBAK'.

wa_fieldcat-fieldname = 'ICON'.

wa_fieldcat-seltext_l = 'LIGHTS'.

wa_fieldcat-icon = 'X'.

  • WA_FIELDCAT-ddictxt = 'l'.

wa_fieldcat-col_pos = 1.

wa_fieldcat-outputlen = 10.

append wa_fieldcat to it_fieldtab.

clear wa_fieldcat .

wa_fieldcat-tabname = 'IT_VBAK'.

wa_fieldcat-fieldname = 'VBELN'.

wa_fieldcat-seltext_l = 'SALES DOCUMENT'.

  • WA_FIELDCAT-ddictxt = 'l'.

wa_fieldcat-col_pos = 2.

wa_fieldcat-outputlen = 10.

append wa_fieldcat to it_fieldtab.

clear wa_fieldcat .

  • when 'maktx'.

wa_fieldcat-tabname = 'IT_VBAK'.

wa_fieldcat-fieldname = 'AUDAT'.

wa_fieldcat-seltext_l = 'DATE'.

  • WA_FIELDCAT-ddictxt = 'l'.

wa_fieldcat-col_pos = 3.

wa_fieldcat-outputlen = 15.

append wa_fieldcat to it_fieldtab.

clear wa_fieldcat .

wa_fieldcat-tabname = 'IT_VBAK'.

wa_fieldcat-fieldname = 'VBTYP'.

wa_fieldcat-seltext_l = 'SALES CATEGORY'.

wa_fieldcat-col_pos = 4.

wa_fieldcat-outputlen = 10.

append wa_fieldcat to it_fieldtab.

clear wa_fieldcat .

wa_fieldcat-tabname = 'IT_VBAK'.

wa_fieldcat-fieldname = 'AUART'.

wa_fieldcat-seltext_l = 'SALES DOCUMENT TYPE'.

wa_fieldcat-col_pos = 5.

wa_fieldcat-outputlen = 10.

append wa_fieldcat to it_fieldtab.

clear wa_fieldcat .

wa_fieldcat-tabname = 'IT_VBAK'.

wa_fieldcat-fieldname = 'AUGRU'.

wa_fieldcat-seltext_l = 'ORDER REASON'.

  • WA_FIELDCAT-ddictxt = 'l'.

wa_fieldcat-col_pos = 6.

wa_fieldcat-outputlen = 10.

append wa_fieldcat to it_fieldtab.

clear wa_fieldcat .

wa_fieldcat-tabname = 'IT_VBAK'.

wa_fieldcat-fieldname = 'NETWR'.

wa_fieldcat-seltext_l = 'QUANTITY'.

wa_fieldcat-do_sum = 'X'.

  • WA_FIELDCAT-ddictxt = 'l'.

wa_fieldcat-col_pos = 7.

wa_fieldcat-outputlen = 25.

append wa_fieldcat to it_fieldtab.

clear wa_fieldcat .

wa_fieldcat-tabname = 'IT_VBAK'.

wa_fieldcat-fieldname = 'WAERK'.

wa_fieldcat-seltext_l = 'CURRENCY'.

  • WA_FIELDCAT-ddictxt = 'l'.

wa_fieldcat-col_pos = 8.

wa_fieldcat-outputlen = 10.

append wa_fieldcat to it_fieldtab.

clear wa_fieldcat .

endform. " modify_fieldcat

regards,

keerthi

Former Member
0 Kudos
258

hi all,

this is my code. please go thru it. iam doing the same but i am unable t understand want's . please go thru it and help me out.

REPORT ymm_srvpos NO STANDARD PAGE HEADING LINE-SIZE 220 LINE-COUNT 65.

$$********************************************************************

  • Request Number : D70K908163 *

  • Program : YMM_SRVPOS *

  • Creation Date : 19.02.2007 *

  • Application : MM *

  • Author : Vinay Dasari *

  • Consultant : Srinvas M *

  • Description : Report for Department wise Man Days *

  • *

  • References : *

  • Type : 1 - Report program *

  • Inputs : User Selection *

  • Outputs : *

  • External Routines : None *

  • Called by : None *

  • Transaction : YMSRV *

  • *

$$********************************************************************

*********************TABLES DECLARATION******************************

TABLES: prps,esll,eskn,essr,csks,lfa1,aufk,cobrb,proj,t001w,ymmessr,

ymmlfa1.

*****************TYPE GROUP DECLARATION******************************

TYPE-POOLS : slis.

****************SELECTION SCREEN DECLARATION*************************

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

SELECT-OPTIONS: s_werks FOR t001w-werks OBLIGATORY NO INTERVALS,

s_date FOR essr-budat OBLIGATORY.

SELECTION-SCREEN: END OF BLOCK b1.

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

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: p_rad1 RADIOBUTTON GROUP rept.

SELECTION-SCREEN COMMENT 3(10) text-003.

PARAMETERS: p_rad2 RADIOBUTTON GROUP rept.

SELECTION-SCREEN COMMENT 16(10) text-004.

PARAMETERS: p_rad3 RADIOBUTTON GROUP rept.

SELECTION-SCREEN COMMENT 30(10) text-005.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN: END OF BLOCK b2.

************************VARIABLE DECLARATIONS***********************

DATA: g_repid LIKE sy-repid.

*********************FIELD CATALOG DECLARATION***********************

DATA: ls_fieldcat TYPE slis_fieldcat_alv.

DATA: layout_wa TYPE slis_layout_alv.

DATA: p_it_st_fieldcat TYPE slis_fieldcat_alv OCCURS 0.

DATA: ls_sort TYPE slis_sortinfo_alv,

it_sort TYPE slis_t_sortinfo_alv.

********************ALV HEADING**************************************

DATA: v_plant(40),

v_date(40),

v_capex(10),

v_rd(10),

v_rm(10),

v_packno LIKE eslh-ebeln,

count LIKE sy-tabix.

DATA: shed TYPE slis_listheader. "For Feild Cat.

DATA: ithed TYPE slis_t_listheader. "For Feild Cat.

********************INTERNAL TABLE DECLARATION************************

DATA:BEGIN OF it_esll OCCURS 0,

introw LIKE esll-introw,

netwr LIKE esll-netwr,

menge LIKE esll-menge,

packno LIKE esll-packno,

END OF it_esll.

DATA:BEGIN OF it_essr OCCURS 0,

lblni LIKE essr-lblni,

packno LIKE essr-packno,

kzabn LIKE essr-kzabn,

knttp LIKE essr-knttp,

introw LIKE it_esll-introw,

END OF it_essr.

DATA:BEGIN OF it_eskn OCCURS 0,

kostl LIKE eskn-kostl,

aufnr LIKE eskn-aufnr,

knttp LIKE essr-knttp,

END OF it_eskn.

DATA:BEGIN OF it_ymmlfa1 OCCURS 0,

lifnr LIKE lfa1-lifnr,

END OF it_ymmlfa1.

DATA:BEGIN OF it_csks OCCURS 0,

khinr LIKE csks-khinr,

kostl LIKE csks-kostl,

END OF it_csks.

DATA:BEGIN OF it_cskt OCCURS 0,

ltext LIKE cskt-ltext,

kostl LIKE cskt-kostl,

END OF it_cskt.

DATA:BEGIN OF it_prps OCCURS 0,

vernr LIKE prps-vernr,

END OF it_prps.

DATA:BEGIN OF it_ymmessr OCCURS 0,

srvpos LIKE esll-srvpos,

END OF it_ymmessr.

DATA:BEGIN OF it_aufk OCCURS 0,

objnr LIKE aufk-objnr,

aufnr LIKE aufk-aufnr,

END OF it_aufk.

DATA:BEGIN OF it_cobrb OCCURS 0,

kostl LIKE cobrb-kostl,

END OF it_cobrb.

DATA:BEGIN OF it_final OCCURS 0,

kzabn LIKE it_essr-kzabn,

knttp LIKE it_essr-knttp,

kostl LIKE it_eskn-kostl,

aufnr LIKE it_eskn-aufnr,

khinr LIKE it_csks-khinr,

kostl1 LIKE it_csks-kostl,

vernr LIKE it_prps-vernr,

kostl2 LIKE it_cobrb-kostl,

objnr LIKE it_aufk-objnr,

aufnr1 LIKE it_aufk-aufnr,

srvpos LIKE it_ymmessr-srvpos,

ltext LIKE it_cskt-ltext,

kostl3 LIKE it_cskt-kostl,

lifnr LIKE it_ymmlfa1-lifnr,

menge LIKE it_esll-menge,

netwr LIKE it_esll-netwr,

END OF it_final.

************************INITIALIZATION*************************

INITIALIZATION.

g_repid = sy-repid .

************************START OF SELECTION************************

START-OF-SELECTION.

************************SELECTING DATA****************************

IF p_rad3 = 'X'.

PERFORM select_data.

PERFORM fieldcatalog.

PERFORM sort.

PERFORM layout.

PERFORM display.

ENDIF.

&----


*& Form SELECT_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM select_data.

SELECT * FROM ymmessr

INTO CORRESPONDING FIELDS OF TABLE it_ymmessr.

IF sy-subrc = 0.

SELECT netwr menge packno introw

FROM esll

INTO CORRESPONDING FIELDS OF TABLE it_esll.

ENDIF.

IF NOT it_esll[] IS INITIAL.

SELECT lblni packno

FROM essr

INTO CORRESPONDING FIELDS OF TABLE it_essr

WHERE kzabn = 'X'

AND ( knttp = 'K' ) OR ( knttp = 'F' )

AND packno = it_esll-packno.

ENDIF.

IF NOT it_essr[] IS INITIAL.

LOOP AT it_essr.

CALL FUNCTION 'MS_GET_EXTERNAL_ROW'

EXPORTING

i_packno = it_essr-packno

i_introw = '0000000000'

IMPORTING

e_ebeln = v_packno.

MOVE v_packno TO it_essr-packno.

MODIFY it_essr INDEX sy-tabix TRANSPORTING packno.

ENDLOOP.

ENDIF.

SELECT kostl

FROM eskn

INTO CORRESPONDING FIELDS OF TABLE it_eskn

FOR ALL ENTRIES IN it_essr

WHERE packno = it_essr-packno.

IF sy-subrc = 0..

SELECT khinr

FROM csks

INTO CORRESPONDING FIELDS OF TABLE it_csks

FOR ALL ENTRIES IN it_eskn

WHERE kostl = it_eskn-kostl.

ENDIF.

IF NOT it_csks[] IS INITIAL.

SELECT ltext

FROM cskt

INTO CORRESPONDING FIELDS OF TABLE it_cskt

FOR ALL ENTRIES IN it_eskn

WHERE kostl = it_eskn-kostl.

ENDIF.

SELECT aufnr

FROM eskn

INTO CORRESPONDING FIELDS OF TABLE it_eskn

FOR ALL ENTRIES IN it_essr

WHERE packno = it_essr-packno.

IF NOT it_eskn[] IS INITIAL.

SELECT objnr

FROM aufk

INTO CORRESPONDING FIELDS OF TABLE it_aufk

FOR ALL ENTRIES IN it_eskn

WHERE aufnr = it_eskn-aufnr.

ENDIF.

IF NOT it_aufk[] IS INITIAL.

SELECT kostl

FROM cobrb

INTO CORRESPONDING FIELDS OF TABLE it_cobrb

FOR ALL ENTRIES IN it_aufk

WHERE objnr = it_aufk-objnr.

ENDIF.

IF NOT it_ymmessr[] IS INITIAL.

SORT it_ymmessr.

LOOP AT it_ymmessr.

it_final-srvpos = it_ymmessr-srvpos.

APPEND it_final.

CLEAR it_final.

ENDLOOP.

ENDIF.

IF NOT it_csks[] IS INITIAL.

count = 1.

LOOP AT it_csks.

it_final-khinr = it_csks-khinr.

MODIFY it_final INDEX count TRANSPORTING khinr.

count = count + 1.

CLEAR it_final.

ENDLOOP.

ENDIF.

IF NOT it_eskn[] IS INITIAL.

LOOP AT it_eskn.

count = 1.

it_final-kostl = it_eskn-kostl.

MODIFY it_final INDEX count TRANSPORTING kostl.

count = count + 1.

CLEAR it_final.

ENDLOOP.

ENDIF.

IF NOT it_cskt[] IS INITIAL.

count = 1.

LOOP AT it_cskt.

it_final-ltext = it_cskt-ltext.

MODIFY it_final INDEX count TRANSPORTING ltext.

count = count + 1.

CLEAR it_final.

ENDLOOP.

ENDIF.

IF NOT it_esll[] IS INITIAL.

count = 1.

LOOP AT it_esll.

it_final-menge = it_esll-menge.

it_final-netwr = it_esll-netwr.

MODIFY it_final INDEX count TRANSPORTING menge netwr.

count = count + 1.

CLEAR it_final.

ENDLOOP.

ENDIF.

ENDFORM. " SELECT_DATA

&----


*& Form FIELDCATALOG

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM fieldcatalog.

g_repid = sy-repid.

ls_fieldcat-fieldname = 'SRVPOS'.

ls_fieldcat-tabname = 'IT_FINAL'.

ls_fieldcat-outputlen = 15.

  • ls_fieldcat-col_pos = 1.

ls_fieldcat-seltext_m = 'Service Code'.

ls_fieldcat-hotspot = 'X'.

ls_fieldcat-key = ''.

APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.

ls_fieldcat-fieldname = 'KHINR'.

ls_fieldcat-tabname = 'IT_FINAL' .

ls_fieldcat-outputlen = 10.

  • ls_fieldcat-col_pos = 2.

ls_fieldcat-seltext_m = 'Division'.

ls_fieldcat-key = ''.

ls_fieldcat-do_sum = 'X'.

  • ls_fieldcat-SORT = 'X'.

APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.

ls_fieldcat-fieldname = 'KOSTL'.

ls_fieldcat-tabname = 'IT_FINAL'.

ls_fieldcat-outputlen = 10.

ls_fieldcat-seltext_m = 'Department'.

ls_fieldcat-key = ''.

  • APPEND ls_sort TO it_sort .

APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.

ls_fieldcat-fieldname = 'LTEXT'.

ls_fieldcat-tabname = 'IT_FINAL'.

ls_fieldcat-outputlen = 10.

ls_fieldcat-seltext_m = 'Department Text'.

ls_fieldcat-key = ''.

  • APPEND ls_sort TO it_sort .

APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.

ls_fieldcat-fieldname = 'MENGE'.

ls_fieldcat-tabname = 'IT_FINAL'.

ls_fieldcat-outputlen = 24.

ls_fieldcat-seltext_m = 'Man days'.

ls_fieldcat-datatype = 'QUAN'.

ls_fieldcat-key = ''.

ls_fieldcat-do_sum = 'X'.

  • ls_fieldcat-SORT = 'X'.

APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.

ls_fieldcat-fieldname = 'NETWR'.

ls_fieldcat-tabname = 'IT_FINAL'.

ls_fieldcat-outputlen = 24.

ls_fieldcat-seltext_m = 'Amount'.

  • ls_fieldcat-hotspot = 'X'.

ls_fieldcat-key = ''.

ls_fieldcat-datatype = 'CURR'.

ls_fieldcat-do_sum = 'X'.

  • ls_fieldcat-SORT = 'X'.

APPEND ls_fieldcat TO p_it_st_fieldcat.

CLEAR ls_fieldcat.

ENDFORM. " FIELDCATALOG

&----


*& Form DISPLAY

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = g_repid

i_callback_top_of_page = 'TOP_OF_PAGE'

is_layout = layout_wa

it_fieldcat = p_it_st_fieldcat

it_sort = it_sort[]

  • i_save = 'A'

TABLES

t_outtab = it_final[].

  • 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

&----


*& Form TOP_OF_PAGE

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM top_of_page.

CONCATENATE 'Plant :' s_werks-low INTO v_plant SEPARATED BY space.

v_date = 'Date:'.

CONCATENATE v_date sy-datum6(2) '.' sy-datum4(2) '.' sy-datum(4)

INTO v_date .

v_rm = 'R&M'.

CLEAR ithed.

REFRESH ithed.

CLEAR shed.

shed-typ = 'H'.

shed-info = 'Report to display Man days per department'.

APPEND shed TO ithed.

CLEAR shed.

CLEAR shed.

shed-typ = 'A'.

shed-info = v_plant.

APPEND shed TO ithed.

CLEAR shed.

CLEAR shed.

shed-typ = 'A'.

shed-info = v_date.

APPEND shed TO ithed.

CLEAR shed.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = ithed.

  • I_LOGO =

  • I_END_OF_LIST_GRID =

ENDFORM. " TOP_OF_PAGE

&----


*& Form SORT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM sort.

CLEAR it_sort.

REFRESH it_sort.

ls_sort-spos = 1.

ls_sort-fieldname = 'SRVPOS'.

ls_sort-tabname = 'IT_FINAL'.

ls_sort-up = 'X'.

ls_sort-subtot = 'X'.

FREE it_sort.

APPEND ls_sort TO it_sort.

CLEAR ls_sort.

ls_sort-spos = 2.

ls_sort-fieldname = 'KHINR'.

ls_sort-tabname = 'IT_FINAL'.

ls_sort-up = 'X'.

  • ls_sort-subtot = 'X'.

APPEND ls_sort TO it_sort.

CLEAR ls_sort.

ENDFORM. " SORT

*

&----


*& Form LAYOUT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM layout.

layout_wa-zebra = 'X'.

layout_wa-totals_only = 'X'.

layout_wa-totals_text = 'Total'.

layout_wa-subtotals_text = 'Sub Total'.

layout_wa-confirmation_prompt = 'X'.

layout_wa-colwidth_optimize = 'X'.

ENDFORM. " LAYOUT

Thanks in advance.

regards,

vinay

0 Kudos
258

Hi,

U r summing a <b>CHAR 12</b> field then absolutely it will bring * only.

See the table CSKS 'KHINR' is a CHAR 12 field.

0 Kudos
258

in ur layout remove this and checkout

<b>wa_layout-colwidth_optimize = 'X'.</b>

0 Kudos
258

Hi,,

Try this code

ls_fieldcat-fieldname = 'SRVPOS'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-outputlen = 15.
* ls_fieldcat-col_pos = 1.
ls_fieldcat-seltext_m = 'Service Code'.
ls_fieldcat-hotspot = 'X'.
ls_fieldcat-key = ''.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.

ls_fieldcat-fieldname = 'KHINR'.
ls_fieldcat-tabname = 'IT_FINAL' .
ls_fieldcat-outputlen = 10.
* ls_fieldcat-col_pos = 2.
ls_fieldcat-seltext_m = 'Division'.
ls_fieldcat-key = ''. (Removed sum)
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.


ls_fieldcat-fieldname = 'KOSTL'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = 'Department'.
ls_fieldcat-key = ''.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.

ls_fieldcat-fieldname = 'LTEXT'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-outputlen = 10.
ls_fieldcat-seltext_m = 'Department Text'.
ls_fieldcat-key = ''.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.


ls_fieldcat-fieldname = 'MENGE'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-outputlen = 24.
ls_fieldcat-seltext_m = 'Man days'.
ls_fieldcat-datatype = 'QUAN'.
ls_fieldcat-key = ''.
ls_fieldcat-do_sum = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.

ls_fieldcat-fieldname = 'NETWR'.
ls_fieldcat-tabname = 'IT_FINAL'.
ls_fieldcat-outputlen = 24.
ls_fieldcat-seltext_m = 'Amount'.
* ls_fieldcat-hotspot = 'X'.
ls_fieldcat-key = ''.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-do_sum = 'X'.
APPEND ls_fieldcat TO p_it_st_fieldcat.
CLEAR ls_fieldcat.

FORM sort.
CLEAR it_sort.
REFRESH it_sort.

ls_sort-spos = 1.
ls_sort-fieldname = 'SRVPOS'.
ls_sort-tabname = 'IT_FINAL'.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
FREE it_sort.
APPEND ls_sort TO it_sort.
CLEAR ls_sort.


ENDFORM. " SORT

Let me know based on which fields u want sub total.

Former Member
0 Kudos
258

hi judith,

i have commented the char field KHINR for summation but still i am facing the same problem.

can u help me out by going thru the code again.

regards,

vinay