Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ABAP error

Hello friends,

I have a simple ALV program. Everything works fine but after i execute the program and after I see the results and when I hit the back green arrow (F3) it goes to a short dump.

Here is the program.

I am unable to figure the cause of this short dump.

Any suggestions.

Thanks,

Shejal

************************************************************************
REPORT  ZCR00     NO STANDARD PAGE HEADING
                  LINE-SIZE  80
                  LINE-COUNT 65(0)
                  MESSAGE-ID ZZ.


*Tables declaration
************************************************************************

TABLES : MARC, "	Plant Data for Material
         MAKT,
         MARA. "	Material Descriptions

TYPE-POOLS: KKBLO,
            SLIS.

DATA:       DISVARIANT   LIKE DISVARIANT,
            EVENTCAT     TYPE SLIS_T_EVENT,
            EVENTCAT_LN  LIKE LINE OF EVENTCAT,
            FIELDCAT     TYPE SLIS_T_FIELDCAT_ALV,
            FIELDCAT_KKB TYPE KKBLO_T_FIELDCAT,
            FIELDCAT_LN  LIKE LINE OF FIELDCAT,
            KEYINFO      TYPE SLIS_KEYINFO_ALV,
            LAYOUT       TYPE SLIS_LAYOUT_ALV,
            LAYOUT_KKB   TYPE KKBLO_LAYOUT,
            PGM          LIKE SY-REPID,
            PRINTCAT     TYPE SLIS_PRINT_ALV,
            SORTCAT      TYPE SLIS_T_SORTINFO_ALV,
            SORTCAT_LN   LIKE LINE OF SORTCAT,

            BEGIN OF COLTAB OCCURS 50,
              FIELDNAME LIKE FIELDCAT_LN-FIELDNAME,
            END OF COLTAB.

**************************************************************************
*Types Declaration
**************************************************************************
TYPES :

 BEGIN OF S_MARC_MAKT,
     MATNR LIKE MARC-MATNR,
     WERKS LIKE MARC-WERKS,
     MMSTA LIKE MARC-MMSTA,
     MAKTX LIKE MAKT-MAKTX,
 END OF S_MARC_MAKT,

 BEGIN OF S_MARA,
     MATNR LIKE MARA-MATNR,
     MTARE LIKE MARA-MTART,
 END OF S_MARA.

**************************************************************************
*Internal table declaration
**************************************************************************
DATA :

   BEGIN OF T_OUTPUT OCCURS 0,
     CHECKBOX(1),
     MATNR LIKE MARC-MATNR,
     WERKS LIKE MARC-WERKS,
     MAKTX LIKE MAKT-MAKTX,
     MMSTA LIKE MARC-MMSTA,		
   END OF T_OUTPUT.

DATA : T_MARC_MAKT   TYPE TABLE OF S_MARC_MAKT,
       T_MARA        TYPE TABLE OF S_MARA.

DATA : T_STPOV TYPE STANDARD TABLE OF STPOV.


***************************************************************************
**Work Area Declaration
***************************************************************************
DATA : W_MARC_MAKT LIKE LINE OF T_MARC_MAKT,
       W_MARA      LIKE LINE OF T_MARA.

DATA : W_STPOV     LIKE LINE OF T_STPOV.

**************************************************************************
*Variable Declaration
**************************************************************************
DATA: V_DATUV LIKE SY-DATUM,
      V_DATUB LIKE SY-DATUM VALUE '99990101',
      V_REPID TYPE SYREPID,
      V_TABIX LIKE SY-TABIX,
      V_FLG(1).

* Declarations for ALV grid

**************************************************************************
*SELECTION-SCREEN
**************************************************************************
SELECTION-SCREEN : BEGIN OF BLOCK 1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_MATNR FOR MAKT-MATNR OBLIGATORY,
                 P_MAKTX FOR MAKT-MAKTX NO INTERVALS ,
                 P_WERKS FOR MARC-WERKS NO INTERVALS OBLIGATORY,
                 P_MMSTA FOR MARC-MMSTA NO INTERVALS .
SELECTION-SCREEN : END OF BLOCK 1.

* Parameter for list viewer display variant
*
PARAMETERS:    VARIANT  LIKE DISVARIANT-VARIANT.

DATA: PRINT          TYPE SLIS_PRINT_ALV.
**********************************************************************************

INITIALIZATION.
  V_REPID = SY-REPID.
  V_DATUV = SY-DATUM.
*----------------------------------------------------------------------*
* Set up constants and selection criteria                              *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN.

AT SELECTION-SCREEN ON VARIANT.
  CHECK NOT VARIANT IS INITIAL.
  PERFORM CHECK_VARIANT_EXISTENCE USING VARIANT 'U'.
*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR VARIANT.
  PERFORM F4_DISPLAY_VARIANT USING VARIANT 'U'.

START-OF-SELECTION.
  PERFORM EXTRACT_EXTRACT_DATA.
  PERFORM DATA_PROCESSING.

**************************************************************************
*END-OF-SELECTION
**************************************************************************
END-OF-SELECTION.
  IF NOT T_OUTPUT[] IS INITIAL.
    PERFORM OUTPUT_SCREEN1.
  ELSE.
    MESSAGE I999 WITH 'No Records Selected'.
  ENDIF.








*&---------------------------------------------------------------------*
*&      Form  EXTRACT_EXTRACT_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM EXTRACT_EXTRACT_DATA .
  SELECT MARC~MATNR
         MARC~WERKS
         MARC~MMSTA
         MAKT~MAKTX
    INTO TABLE T_MARC_MAKT
    FROM MARC
   INNER JOIN MAKT
      ON MARC~MATNR = MAKT~MATNR
   WHERE MAKT~MATNR IN S_MATNR
     AND MAKT~MAKTX IN P_MAKTX
     AND MARC~WERKS IN P_WERKS
     AND MARC~MMSTA IN P_MMSTA.
ENDFORM.                    " EXTRACT_EXTRACT_DATA
*&---------------------------------------------------------------------*
*&      Form  DATA_PROCESSING
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM DATA_PROCESSING .
  LOOP AT T_MARC_MAKT INTO W_MARC_MAKT.

    T_OUTPUT-MATNR = W_MARC_MAKT-MATNR.
    T_OUTPUT-WERKS = W_MARC_MAKT-WERKS.
    T_OUTPUT-MAKTX = W_MARC_MAKT-MAKTX.
    T_OUTPUT-MMSTA = W_MARC_MAKT-MMSTA.

    APPEND T_OUTPUT.

  ENDLOOP.
ENDFORM.                    " DATA_PROCESSING
*&---------------------------------------------------------------------*
*&      Form  OUTPUT_SCREEN1
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM OUTPUT_SCREEN1 .

  PERFORM CALL_LIST_VIEWER.

ENDFORM.                    " OUTPUT_SCREEN1

*&---------------------------------------------------------------------*
*&      Form  CALL_LIST_VIEWER
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*

FORM CALL_LIST_VIEWER .

  CLEAR: T_OUTPUT.
  PERFORM BUILD_FIELDCAT USING:
         'CHKBOX' 'T_OUTPUT'
          TEXT-001 'CHAR'       3 ' ' ' ' ' ' ' ' ' ' 'X' ' ' 'X',
         'MATNR' 'T_OUTPUT'
          TEXT-002 'CHAR'      18 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
         'WERKS' 'T_OUTPUT'
          TEXT-003 'CHAR'       5 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
         'MAKTX' 'T_OUTPUT'
          TEXT-004 'CHAR'      40 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ',
         'MMSTA' 'T_OUTPUT'
          TEXT-005 'CHAR'      12 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '.


  PERFORM BUILD_EVENTCAT USING: 'TOP_OF_LIST',
                                'USER_COMMAND'.

  PERFORM LIST_DISPLAY TABLES T_OUTPUT.

ENDFORM.                    "call_list_viewer




*----------------------------------------------------------------------*
* build field catalog entry                                            *
*----------------------------------------------------------------------*
FORM BUILD_FIELDCAT USING A_FIELDNAME
                          A_TABNAME
                          A_HEADING
                          A_DATATYPE
                          A_OUTPUTLEN
                          A_KEY
                          A_NO_OUT
                          A_NO_SUM
                          A_DO_SUM
                          A_NO_ZERO
                          A_INPUT
                          A_SUM
                          A_CHECKBOX.

  CLEAR FIELDCAT_LN.
  FIELDCAT_LN-FIELDNAME = A_FIELDNAME.
  FIELDCAT_LN-TABNAME  = A_TABNAME.
  FIELDCAT_LN-OUTPUTLEN = A_OUTPUTLEN.
  FIELDCAT_LN-DATATYPE = A_DATATYPE.
  FIELDCAT_LN-REPTEXT_DDIC = A_HEADING.
  FIELDCAT_LN-KEY = A_KEY.
  FIELDCAT_LN-NO_OUT = A_NO_OUT.
  FIELDCAT_LN-NO_SUM = A_NO_SUM.
  FIELDCAT_LN-DO_SUM = A_DO_SUM.
  FIELDCAT_LN-NO_ZERO = A_NO_ZERO.
  FIELDCAT_LN-INPUT = A_INPUT.
  FIELDCAT_LN-DO_SUM = A_SUM.
  FIELDCAT_LN-CHECKBOX = A_CHECKBOX.
  APPEND FIELDCAT_LN TO FIELDCAT.

ENDFORM.                    "BUILD_FIELDCAT

*----------------------------------------------------------------------*
*       FORM BUILD_EVENTCAT
*----------------------------------------------------------------------*
FORM BUILD_EVENTCAT USING A_EVENT.

  EVENTCAT_LN-NAME = EVENTCAT_LN-FORM = A_EVENT.
  APPEND EVENTCAT_LN TO EVENTCAT.

ENDFORM.                    "BUILD_EVENTCAT

*----------------------------------------------------------------------*
* call the ABAP list viewer                                            *
*----------------------------------------------------------------------*
FORM LIST_DISPLAY TABLES A_OUTPUT.

  PGM = DISVARIANT-REPORT = SY-REPID.
  DISVARIANT-VARIANT = VARIANT.
* call list viewer
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM      = PGM
      IT_FIELDCAT             = FIELDCAT
      IS_VARIANT              = DISVARIANT
      IS_LAYOUT               = LAYOUT
      IS_PRINT                = PRINT
      I_SAVE                  = 'A'
      IT_EVENTS               = EVENTCAT
      IT_SORT                 = SORTCAT
      I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    TABLES
      T_OUTTAB                = A_OUTPUT
    EXCEPTIONS
      PROGRAM_ERROR           = 1
      OTHERS                  = 2.

ENDFORM.                    "LIST_DISPLAY

**---------------------------------------------------------------------*
** FORM USER_COMMAND *
**---------------------------------------------------------------------*

FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.

  CASE UCOMM.

    WHEN '&IC1'.
      READ TABLE T_OUTPUT INDEX SELFIELD-TABINDEX.

  ENDCASE.
  SELFIELD-REFRESH = 'X'.

ENDFORM.                    " CALL_LIST_VIEWER


*----------------------------------------------------------------------*
*       FORM CHECK_VARIANT_EXISTENCE
*----------------------------------------------------------------------*
*       Verify that a variant on the selection screen exists
*----------------------------------------------------------------------*
FORM CHECK_VARIANT_EXISTENCE USING VARNAME LIKE DISVARIANT-VARIANT
                                   SAVE   TYPE C.

  DATA: XDISVAR LIKE DISVARIANT.

  XDISVAR-REPORT  = SY-REPID.
  XDISVAR-VARIANT = VARNAME.

  CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
    EXPORTING
      I_SAVE        = SAVE
    CHANGING
      CS_VARIANT    = XDISVAR
    EXCEPTIONS
      WRONG_INPUT   = 1
      NOT_FOUND     = 2
      PROGRAM_ERROR = 3
      OTHERS        = 4.

  IF SY-SUBRC <> 0.
    MESSAGE E256(56) WITH VARNAME.
*   Anzeigevariante &1 nicht gefunden
  ENDIF.

  DISVARIANT-REPORT  = SY-REPID.
  DISVARIANT-VARIANT = VARNAME.

ENDFORM.                    "check_variant_existence

*----------------------------------------------------------------------*
*       Form  F4_DISPLAY_VARIANT
*----------------------------------------------------------------------*
*       F4 help to find a display variant
*       varname = name of the dynpro field for which f4 is requested
*       save    = type of list variant saving
*                 ' ' = no saving allowed
*                 'A' = standard & user specific variants can be saved
*                 'U' = only user specific variants can be saved
*                 'X' = only standard variants can be saved
*----------------------------------------------------------------------*
FORM F4_DISPLAY_VARIANT USING VARNAME LIKE DISVARIANT-VARIANT
                              SAVE    TYPE C.

  DISVARIANT-REPORT = SY-REPID.

  CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
      IS_VARIANT    = DISVARIANT
      I_SAVE        = SAVE
    IMPORTING
      ES_VARIANT    = DISVARIANT
    EXCEPTIONS
      NOT_FOUND     = 1
      PROGRAM_ERROR = 2
      OTHERS        = 3.

  IF SY-SUBRC = 0.
    VARNAME = DISVARIANT-VARIANT.
  ELSE.
    MESSAGE S245(56).
*   Keine Anzeigevariante(n) vorhanden
  ENDIF.
ENDFORM.                               " F4_DISPLAY_VARIANT

Tags:
Former Member
replied

The reason why it is dumping is because you have your internal table defintiion with a field called CHECKBOX, but when filling the field catalog, you are filling as CHKBOX. This is the reason for the error, these names need to be the same, change eithe the name in the internal table or the field cat.

REgards,

Rich heilman

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question