Skip to Content
avatar image
Former Member

I am using the "slis_t_sortinfo_alv" for sorting the two fileds STAT2 and PERSK from my internal table. But i am getting the dump error as below

hi,

I am using the "slis_t_sortinfo_alv" for sorting the two fileds STAT2 and PERSK from my internal table. But i am getting the dump error as below.

Please help me to rectify it by pointing the mistake i had made in the program.

main part of the program is below.

TYPES:  BEGIN  OF final,

         pernr TYPE string ,"PA0000-PERNR

         stat2 TYPE string ,"PA0000-STAT2

         werks TYPE string, "PA0001-WERKS,

         btrtl TYPE string,  "PA0001-BTRTL,

         persg TYPE string, "PA0001-PERSG,

         persk TYPE string,"PA0001-PERSK

         plans TYPE p0001-plans,

         vorna TYPE p0002-vorna,

         nachn TYPE p0002-nachn,

         date TYPE budat,

         date1 TYPE string,

         END OF final.

DATA : itabfinal TYPE STANDARD TABLE OF final ,

         wa_itabfinal LIKE LINE OF  itabfinal.

DATA:   fcat TYPE slis_t_fieldcat_alv,

         fwa  TYPE slis_fieldcat_alv.

CLEAR fwa.

fwa-fieldname = 'PERNR'.

fwa-seltext_l = 'PERSONAL ID '.

APPEND fwa TO fcat.

CLEAR fwa.

fwa-fieldname = 'VORNA'.

fwa-seltext_l = 'FIRST NAME'.

APPEND fwa TO fcat.

CLEAR fwa.

fwa-fieldname = 'NACHN'.

fwa-seltext_l = 'LAST NAME'.

APPEND fwa TO fcat.

CLEAR fwa.

fwa-fieldname = 'STAT2'.

fwa-seltext_l = 'STATUS'.

APPEND fwa TO fcat.

CLEAR fwa.

fwa-fieldname = 'WERKS'.

fwa-seltext_l = 'PERSONAL AREA'.

APPEND fwa TO fcat.

CLEAR fwa.

fwa-fieldname = 'BTRTL'.

fwa-seltext_l = 'PERSONAL SUBAREA'.

APPEND fwa TO fcat.

CLEAR fwa.

fwa-fieldname = 'PERSG'.

fwa-seltext_l ='EMPLOYEE GROUP'.

APPEND fwa TO fcat.

CLEAR fwa.

fwa-fieldname = 'PERSK'.

fwa-seltext_l = 'EMPLOYEE SUBGROUP'.

APPEND fwa TO fcat.

CLEAR fwa.

fwa-fieldname = 'PLANS'.

fwa-seltext_l = 'POSITION'.

APPEND fwa TO fcat.

CLEAR fwa.

fwa-fieldname = 'DATE1'.

fwa-seltext_l = 'DATE TYPES'.

APPEND fwa TO fcat.

DATA: i_sort  type slis_t_sortinfo_alv,

       wa_sort TYPE slis_sortinfo_alv.

CLEAR wa_sort.

wa_sort-fieldname = 'stat2'.

wa_sort-up      = 'X'.

wa_sort-subtot = 'X'.

wa_sort-tabname = 'ITABfinal'.

append wa_sort to i_sort.

CLEAR wa_sort.

wa_sort-fieldname = 'persk'.

wa_sort-up      = 'X'.

wa_sort-subtot = 'X'.

wa_sort-tabname = 'ITABfinal'.

append wa_sort to i_sort.

Capture.PNG (24.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 05, 2015 at 04:09 PM

    Make sure all your field and table names are in UPPER CASE.

    Rob

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 05, 2015 at 03:20 PM

    it showing the error in the funtion module"LVC_SORT_COMPLETE" i had given boldness for the place of error

    FUNCTION LVC_SORT_COMPLETE.

    *"----------------------------------------------------------------------

    *"*"Lokale Schnittstelle:

    *"       IMPORTING

    *"             VALUE(IT_FIELDCAT) TYPE  LVC_T_FCAT

    *"       CHANGING

    *"             VALUE(CT_SORT) TYPE  LVC_T_SORT

    *"----------------------------------------------------------------------

       FIELD-SYMBOLS: <LS_FIELDCAT> TYPE LVC_S_FCAT.

       DATA: LS_SORT     TYPE LVC_S_SORT.

       DATA: LFLG_MODIFY(1) TYPE C.

       DATA: LFLG_EXPA_DEFAULT_SET(1) TYPE C.

       DATA: L_COUNT LIKE SY-TABIX.

       SORT IT_FIELDCAT BY FIELDNAME.

       SORT CT_SORT STABLE BY SPOS ASCENDING.

       LOOP AT CT_SORT INTO LS_SORT.

         LS_SORT-SPOS = SY-TABIX.

         MODIFY CT_SORT FROM LS_SORT.

       ENDLOOP.

       SORT CT_SORT BY SPOS DESCENDING.

    * Default settings for subtotals

       READ TABLE CT_SORT WITH KEY COMP = 'X' TRANSPORTING NO FIELDS.

       IF SY-SUBRC NE 0.

         LFLG_MODIFY = 'X'.

       ENDIF.

       LOOP AT CT_SORT INTO LS_SORT.

         READ TABLE IT_FIELDCAT ASSIGNING <LS_FIELDCAT>

              WITH KEY FIELDNAME = LS_SORT-FIELDNAME BINARY SEARCH.

         IF SY-SUBRC NE 0.

          MESSAGE X000 (0K).

         ENDIF.

         LS_SORT-SELTEXT = <LS_FIELDCAT>-SELTEXT.

    *     Zwischensummenstufen ermitteln

         IF NOT LS_SORT-SUBTOT IS INITIAL.

           L_COUNT = L_COUNT + 1.

         ENDIF.

         IF L_COUNT = 1 AND LFLG_EXPA_DEFAULT_SET = 'X'.

           LS_SORT-EXPA = 'X'.

         ENDIF.

    *     Default setzten (s.o.)

         IF LFLG_MODIFY = 'X'.

           LS_SORT-COMP = 'X'.

         ENDIF.

         MODIFY CT_SORT FROM LS_SORT.

       ENDLOOP.

    ENDFUNCTION.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Please don't post the full source code yet. Try what I suggested first. It was incorrect in the code you already posted.

      Rob

  • avatar image
    Former Member
    Jan 05, 2015 at 04:16 PM
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Glad to help, but next time be sure to search before posting. This has come up many times before.

      Rob