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: 

ALV short dump while clicking the hotspot

Former Member
0 Kudos

Hi all,

I get a short dump when I click on hotspot of an ALV report. I should goto me23n when I click on PO no. This is the short dump report.

Assignment error: Overwriting a protected field.

Error analysis

The program tried to assign a new value to a field even though

it is protected against changes.

The following objects are protected:

- Character or numeric literals,

- Constants (CONSTANTS),

- Function module and method parameters with the type IMPORTING

REFERENCE,

- Untyped field symbols to which a field has not yet been assigned

using ASSIGN,

- TABLES parameters, if the corresponding actual parameter is protected

against changes,

- USING reference parameters and CHANGING parameters in FORMS, if the

actual parameter is protected against changes,

- Field symbols, if the field assigned using ASSIGN is protected against

changes,

- External write access to attributes with the READ-ONLY property.

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

How to correct the error

The field you want to overwrite is a parameter or a field symbol:

Declare the parameter as a VALUE parameter or pass an auxiliary field

to which you assigned the value from the constant before the call.

Alternatively, you can assign the auxiliary field to the field symbol

instead of the constant.

If the error occurred in one of your own programs or in an SAP program

that you modified, try to correct it yourself.

If the error occurred in a non-modified SAP program, you may be

able to find a solution in the SAP note system.

If you have access to the note system yourself, use the following

search criteria:

"MOVE_TO_LIT_NOTALLOWED_NODATA"

"SAPLSLVC_FULLSCREEN " or "LSLVC_FULLSCREENF02 "

"MARKS_SAVE"

Source code extract: Short dump occurs at

<l_box> = ' ' in the below code of ALV standard code.

else.

describe table lt_rows lines l_sel_lines.

describe table t_outtab lines l_tab_lines.

if l_sel_lines = 0.

l_ucomm = '&SAL'.

endif.

if l_sel_lines = l_tab_lines.

l_ucomm = '&ALL'.

endif.

endif.

  • set/unset <box> of all items

if l_ucomm eq '&SAL' or l_ucomm eq '&ALL'.

if l_ucomm eq '&SAL'.

loop at t_outtab.

l_tabix = l_tabix + 1.

<l_box> = ' '.

modify t_outtab index l_tabix.

endloop.

endif.

if l_ucomm eq '&ALL'.

loop at t_outtab.

l_tabix = l_tabix + 1.

<l_box> = 'X'.

modify t_outtab index l_tabix.

endloop.

endif.

else.

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

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

These are the parameters I used in ALV FM

gd_repid = sy-repid.

gd_layout-box_fieldname = 'SELKZ'.

gd_layout-key_hotspot = 'X'.

MOVE 'X' TO GD_layout-zebra.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • i_callback_program = gd_repid

i_callback_program = 'ZIMRR00130_INTRANSIT_GL_REPORT'

i_callback_user_command = 'USER_COMMAND'

  • i_callback_top_of_page = 'TOP-OF-PAGE'

  • i_grid_title = outtext

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

  • it_special_groups = gd_tabgroup

  • IT_EVENTS = GT_XEVENTS

i_save = 'U'

  • is_variant = z_template

TABLES

t_outtab = i_intransit

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

Can u guys help me.....?

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Hi Shan,

can you show your full code.

REPORT  ZTEST_ALV_CHECK                         .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
      IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      L_LAYOUT type slis_layout_alv,
      x_events type slis_alv_event,
      it_events type SLIS_T_EVENT.

DATA: BEGIN OF ITAB OCCURS 0,
      VBELN LIKE VBAK-VBELN,
      POSNR LIKE VBAP-POSNR,
      CHK(1),
     END OF ITAB.

SELECT VBELN
       POSNR
       FROM VBAP
       UP TO 20 ROWS
       INTO TABLE ITAB.

X_FIELDCAT-FIELDNAME = 'CHK'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-INPUT = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-CHECKBOX = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_LAYOUT-window_titlebar = 'Popup window'.

  x_events-NAME = SLIS_EV_END_OF_PAGE.
  x_events-FORM = 'END_OF_PAGE'.
  APPEND x_events  TO iT_EVENTS.
  CLEAR x_events .
  x_events-NAME = SLIS_EV_TOP_OF_PAGE.
  x_events-FORM = 'TOP_OF_PAGE'.
  APPEND x_events  TO iT_EVENTS.
  CLEAR x_events .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM       = SY-REPID
    IS_LAYOUT                = L_LAYOUT
<b>    I_CALLBACK_PF_STATUS_SET = 'STATUS'
    I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'</b>
    IT_FIELDCAT              = IT_FIELDCAT
    it_events                = it_events
*    I_SCREEN_START_COLUMN    = 10
*    I_SCREEN_START_LINE      = 1
*    I_SCREEN_END_COLUMN      = 50
*    I_SCREEN_END_LINE        = 20
  TABLES
    T_OUTTAB                 = ITAB
  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.

FORM TOP_OF_PAGE.
* BREAK-POINT.
  WRITE: / 'TOP_OF_PAGE'.
ENDFORM.

FORM END_OF_PAGE.
* BREAK-POINT.
  WRITE: / 'END_OF_PAGE'.
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  STATUS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_EXTAB    text
*----------------------------------------------------------------------*
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
*- Pf status
  SET PF-STATUS 'STATUS'.
ENDFORM.                 " STATUS
*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
*----------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                               RS_SELFIELD TYPE SLIS_SELFIELD.

  case r_ucomm.
    when 'BACK' or 'CANC' or 'EXIT'.
      leave to screen 0.
    when '&IC1'.
      set parameter id 'AUN' field rs_selfield-value.
      call transaction 'VA03' and skip first screen.
  endcase.
ENDFORM.                    "USER_COMMAND

Regards

vijay

5 REPLIES 5

former_member188685
Active Contributor
0 Kudos

Hi Shan,

can you show your full code.

REPORT  ZTEST_ALV_CHECK                         .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
      IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      L_LAYOUT type slis_layout_alv,
      x_events type slis_alv_event,
      it_events type SLIS_T_EVENT.

DATA: BEGIN OF ITAB OCCURS 0,
      VBELN LIKE VBAK-VBELN,
      POSNR LIKE VBAP-POSNR,
      CHK(1),
     END OF ITAB.

SELECT VBELN
       POSNR
       FROM VBAP
       UP TO 20 ROWS
       INTO TABLE ITAB.

X_FIELDCAT-FIELDNAME = 'CHK'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-INPUT = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-CHECKBOX = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_LAYOUT-window_titlebar = 'Popup window'.

  x_events-NAME = SLIS_EV_END_OF_PAGE.
  x_events-FORM = 'END_OF_PAGE'.
  APPEND x_events  TO iT_EVENTS.
  CLEAR x_events .
  x_events-NAME = SLIS_EV_TOP_OF_PAGE.
  x_events-FORM = 'TOP_OF_PAGE'.
  APPEND x_events  TO iT_EVENTS.
  CLEAR x_events .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM       = SY-REPID
    IS_LAYOUT                = L_LAYOUT
<b>    I_CALLBACK_PF_STATUS_SET = 'STATUS'
    I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'</b>
    IT_FIELDCAT              = IT_FIELDCAT
    it_events                = it_events
*    I_SCREEN_START_COLUMN    = 10
*    I_SCREEN_START_LINE      = 1
*    I_SCREEN_END_COLUMN      = 50
*    I_SCREEN_END_LINE        = 20
  TABLES
    T_OUTTAB                 = ITAB
  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.

FORM TOP_OF_PAGE.
* BREAK-POINT.
  WRITE: / 'TOP_OF_PAGE'.
ENDFORM.

FORM END_OF_PAGE.
* BREAK-POINT.
  WRITE: / 'END_OF_PAGE'.
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  STATUS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_EXTAB    text
*----------------------------------------------------------------------*
FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
*- Pf status
  SET PF-STATUS 'STATUS'.
ENDFORM.                 " STATUS
*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
*----------------------------------------------------------------------*
FORM USER_COMMAND USING R_UCOMM     LIKE SY-UCOMM
                               RS_SELFIELD TYPE SLIS_SELFIELD.

  case r_ucomm.
    when 'BACK' or 'CANC' or 'EXIT'.
      leave to screen 0.
    when '&IC1'.
      set parameter id 'AUN' field rs_selfield-value.
      call transaction 'VA03' and skip first screen.
  endcase.
ENDFORM.                    "USER_COMMAND

Regards

vijay

Former Member
0 Kudos

Hi shan,

As vijay said, could you post the code completely ?

Also, as per the correction offered by the analysis, it seems you need to pass some value using an auxilary variable. one more thing i wanted to check is, did you keep a break point before <b><l_box> = ' '</b> and see what is going wrong?

Hope this will be of some help to you.

Regards,

Vicky

PS: Award points if helpful

Former Member
0 Kudos

Hi Vijay/Vicky,

I was able to solve the problem. Something was going wrong with ,

gd_layout-box_fieldname = 'SELKZ'.

I commented gd_layout-box_fieldname = 'SELKZ' and added MOVE 'X' TO GD_layout-zebra. Also commented

gd_layout-f2code = 'DISP'.

This worked. Thanks a lot guys . Hats off to Vijay and Vicky for their prompt response. If u need any more explanation , pls feel free to reply me.

0 Kudos

Hi SHAN,

change like this

gd_layout-box_fieldname = 'ITAB-SELKZ'

Former Member
0 Kudos

hi

same problem i faced once

after clicking any alv button pgm

was gng to dump ...

later o found tht some of my variables were declared locally instead of globally

u can check if any of ur variable which is being used inside perform is local