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

ALV Grid error

Former Member
0 Likes
1,225

hi,

iam doing ALV report... i want to subtotal by location.. but it is getting dump...pls rectify error..

code..

li_sortcat TYPE slis_t_sortinfo_alv ,

wa_sort TYPE slis_sortinfo_alv,

field catalog:

  • Period 1 amount

l_fieldcatalog-fieldname = 'ZZ_P1AMT'.

l_fieldcatalog-seltext_m = 'Period 1 Amount'.

l_fieldcatalog-tabname = 'LI_ZTFI_DEP_FORCAST'.

l_fieldcatalog-col_pos = 19.

l_fieldcatalog-outputlen = 15.

l_fieldcatalog-do_sum = 'X'.

APPEND l_fieldcatalog TO t_fieldcatalog.

CLEAR l_fieldcatalog.

sort:

wa_sort-spos = 2.

wa_sort-fieldname = 'STORT'.

wa_sort-tabname = 'LI_ZTFI_DEP_FORCAST'.

wa_sort-up = 'X'.

wa_sort-subtot = 'X'.

APPEND wa_sort TO li_sortcat.

CLEAR wa_sort.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = l_gdrepid " Program from which the function module is called

  • i_callback_pf_status_set = 'STATUS'

  • i_callback_user_command = 'USER_COMMAND' "ALV that the application wants to respond to certain function codes

  • i_callback_top_of_page = 'TOP-OF-PAGE' "This module is responsible for formatting the header information

  • 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 = l_layout

  • Field catalog containing the field descriptions of the fields to be considered for the list output

it_fieldcat = t_fieldcatalog

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • Using internal table IT_SORT, the caller determines the sort order and/or the subtotalling of the basic list.

it_sort = li_sortcat

  • IT_FILTER =

  • IS_SEL_HIDE =

  • i_default = 'X'

i_save = k_save

is_variant = g_variant

it_events = t_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

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = li_ztfi_dep_forcast[]

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

urgent..

chandu

11 REPLIES 11
Read only

Former Member
0 Likes
1,100

Babu ,

where u are getting the error , check ST22 search for -


> this mark in that short dump.

  fcat1-fieldname = 'WEMNG'.
  fcat1-key = ''.
  fcat1-outputlen = '13'.
  fcat1-just = 'R'.
  fcat1-seltext_m = 'CNF.QTY.'.
  fcat1-ddictxt = 'M'.
  fcat1-inttype = 'P'.
  fcat1-datatype = 'QUAN'.<b>---->to get sub total u have to pass data type of the field.</b>  fcat1-do_sum = 'X'.
  fcat1-no_zero = 'X'.
  append fcat1.
  clear fcat1.

regards

Prabhu

Read only

Former Member
0 Likes
1,100

hi,

can you show the analysis of the dump??

Read only

Former Member
0 Likes
1,100

Hi.

Your coding is not clear. But I think you get a dump because of the missing field STORT in your fieldcat. The field which you want to use for sorting has to be in the fieldcat. Try to build the fieldcat with the field STORT.

br

Michael

Read only

Former Member
0 Likes
1,100

hi,

i build the field catalog for STORT. but still iam getting dump..

this is the error

The current application program detected a situation which really

should not occur. Therefore, a termination with a short dump was

triggered on purpose by the key word MESSAGE (type X)

chandu.

Read only

0 Likes
1,100

in the dump it will point to the line of the code where the error had occured , can you paste that specific line

Read only

Former Member
0 Likes
1,100

this is error iam getting

  • Column per Fieldcat Entry

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

clear ls_lvc_data-style.

loop at it_fcat_local assigning <ls_fcat>

where tech ne 'X' and no_out ne 'X'.

if l_invisible eq 'X'.

clear l_invisible.

if <ls_fcat>-do_sum is initial.

continue.

else.

clear ls_lvc_data-col_pos.

endif.

endif.

add 1 to ls_lvc_data-col_pos.

assign component <ls_fcat>-fieldname

of structure <ls_data> to <l_fie

if sy-subrc ne 0.

message x000(0k).

endif.

*... work on average

if <ls_fcat>-do_sum eq 'C'.

clear l_entries.

assign space to <l_unit>.

if not <ls_fcat>-cfieldname is initial.

Read only

0 Likes
1,100

u had used message of type X which by its definition will exit and gives short dump

<b>X - Exit

: Transaction terminated with short dump</b>

use message of type I

if sy-subrc ne 0.
<b>message I000(0k).</b>
endif.

Read only

Former Member
0 Likes
1,100

pls reward and close if solved

Read only

Former Member
0 Likes
1,100

hi,

No , still getting error... aim trying ..

chandu.

Read only

Former Member
0 Likes
1,100

hi,

now i got solution.. thanks to every one..

it is working fine...

chandu

Read only

0 Likes
1,100

what was the error?

If none of the solutions helped then u can select the option 'solved on my own'