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: 

dump in block alv

Former Member
0 Kudos
338

hi experts,

i have made an block alv, it gettimg shortdump, showing

'The ABAP program lines are wider than the internal table.'

how to resolve it?

my code is:



*&---------------------------------------------------------------------*
*& Report  ZGATEPASS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zgatepass.
***********************************************
*************tables declaration****************
TABLES: likp.
***********************************************
***************type groups declaration*********
TYPE-POOLS: slis.

*********************************************************
**************INTERNAL TABLE DECLARATION*****************
DATA: BEGIN OF it_likp_lips OCCURS 0,
        vbeln TYPE likp-vbeln," do no
        erdat TYPE likp-erdat," date
        kunnr TYPE likp-kunnr,"Ship-to party
        traid TYPE likp-traid,"Transport ID
        vbtyp TYPE likp-vbtyp,
        matnr TYPE lips-matnr,"item
        vrkme TYPE lips-vrkme,"UOM
        charg TYPE lips-charg," batch
        lfimg TYPE lips-lfimg," quantity
        arktx TYPE lips-arktx,"sku CODE
      END OF it_likp_lips.


DATA: BEGIN OF it_kna1 OCCURS 0,
          kunnr TYPE kna1-kunnr,
          name1 TYPE kna1-name1,"party name
      END OF it_kna1.


DATA: BEGIN OF itab1 OCCURS 0,
       vbeln TYPE likp-vbeln," do no
       erdat TYPE likp-erdat," date
       kunnr TYPE likp-kunnr,"Ship-to party
       traid TYPE likp-traid,"Transport ID
       text TYPE string,
       vbtyp TYPE likp-vbtyp,
       matnr TYPE lips-matnr,"item
       vrkme TYPE lips-vrkme,"UOM
       charg TYPE lips-charg," batch
       lfimg TYPE lips-lfimg," quantity
       quantity TYPE char15,"lips-lfimg,

       arktx TYPE lips-arktx,"sku
       name1 TYPE kna1-name1,"party name
       END OF itab1.
DATA:itab2 LIKE TABLE OF itab1 WITH HEADER LINE.
*---Reference table
DATA: BEGIN OF itab1_ref OCCURS 0,
       arktx TYPE lips-arktx,"sku
       name1 TYPE kna1-name1,"party name
       vbeln TYPE likp-vbeln," do no
       erdat TYPE likp-erdat," date
       kunnr TYPE likp-kunnr,"Ship-to party
       traid TYPE likp-traid,"Transport ID
       text TYPE string,
       vbtyp TYPE likp-vbtyp,
       matnr TYPE lips-matnr,"item
       vrkme TYPE lips-vrkme,"UOM
       charg TYPE lips-charg," batch
*       lfimg TYPE char15,"lips-lfimg," quantity
       lfimg TYPE lips-lfimg," quantity
       quantity TYPE char15,"lips-lfimg,
        END OF itab1_ref.

DATA: BEGIN OF itab1_ref1 OCCURS 0,
       arktx TYPE lips-arktx,"sku
       name1 TYPE kna1-name1,"party name
       vbeln TYPE likp-vbeln," do no
       erdat TYPE likp-erdat," date
       kunnr TYPE likp-kunnr,"Ship-to party
       traid TYPE likp-traid,"Transport ID
       text TYPE string,
       vbtyp TYPE likp-vbtyp,
       matnr TYPE lips-matnr,"item
       vrkme TYPE lips-vrkme,"UOM
       charg TYPE lips-charg," batch
       lfimg TYPE lips-lfimg," quantity
       quantity TYPE char15,"lips-lfimg,
       END OF itab1_ref1.


******************for 2nd block****************
DATA: BEGIN OF itab OCCURS 0,
         text TYPE string,
         arktx TYPE lips-arktx,
         lfimg TYPE lips-lfimg,
         vrkme TYPE lips-vrkme,
         sum TYPE lips-lfimg,
         END OF itab.


DATA: BEGIN OF itab3 OCCURS 0,
    arktx TYPE lips-arktx,"sku
*    traid TYPE likp-traid,"Transport ID
    text TYPE string,
    lfimg TYPE lips-lfimg," quantity
    vrkme TYPE lips-vrkme,"UOM
    sum TYPE lips-lfimg,
    matnr TYPE lips-matnr,
    END OF itab3.
*--add truck wise material sum
DATA: BEGIN OF itab3_ref OCCURS 0,
     text TYPE string,
    arktx TYPE lips-arktx,"sku
*    traid TYPE likp-traid,"Transport ID
    lfimg TYPE lips-lfimg," quantity
    vrkme TYPE lips-vrkme,"UOM
    sum TYPE lips-lfimg,
    matnr TYPE lips-matnr,
    END OF itab3_ref.
DATA: BEGIN OF itab3_ref1 OCCURS 0,
      matnr TYPE lips-matnr,
     text TYPE string,
    arktx TYPE lips-arktx,"sku
*    traid TYPE likp-traid,"Transport ID
    lfimg TYPE lips-lfimg," quantity
    vrkme TYPE lips-vrkme,"UOM
    sum TYPE lips-lfimg,

    END OF itab3_ref1.


*---end  of truck wise material sum

*****************************************************
**************************ALV DATA DECLARATION********************
DATA:  it_fcat TYPE slis_t_fieldcat_alv,   " FIELDCAT DECLARATION
       wa_fcat TYPE  slis_fieldcat_alv,

**local work area of event catalog********
 it_event TYPE slis_t_event,
 wa_event TYPE slis_alv_event,


****************STRUCTURE FOR LAYOUT****
 is_layout TYPE slis_layout_alv,"LAYOUT
 is1_layout TYPE slis_layout_alv,"LAYOUT


************ALV SORTING******************
it_sort TYPE slis_t_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv,

    repid TYPE sy-repid.
DATA  idx TYPE sy-tabix.
repid = sy-repid." PROGRAM  NAME


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

SELECT-OPTIONS: date  FOR likp-erdat ,
                truck_no FOR likp-traid OBLIGATORY." truck no
SELECTION-SCREEN END OF BLOCK b1.

*************************************************************************
************************START-OF-SELECTION**************************
*******************************************************************
START-OF-SELECTION.
  PERFORM get_likp_lips_data.

  IF NOT it_likp_lips[] IS INITIAL.
    PERFORM get_kna1_data.
  ENDIF.

  PERFORM get_itab1.

  PERFORM get_itab3.
************************************************************
*********************SUBROUTINE FOR ALV LAYOUT***********
  PERFORM build_layout_alv.

************************************************************
************************ SUBROUTINE FOR ALV EVENT **********

  PERFORM build_events.


************************************************************
*****************subroutine for fieldcatalog**********
  PERFORM build_fcat1.


************************************************************
******************ALV SORTING*******************************

  PERFORM alv_sort_info.

END-OF-SELECTION.
  PERFORM alv_grid_display.

*&---------------------------------------------------------------------*
*&      Form  GET_LIKP_LIPS_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM get_likp_lips_data .
  SELECT likp~vbeln likp~erdat likp~kunnr likp~traid likp~vbtyp lips~matnr lips~vrkme lips~charg lips~lfimg lips~arktx
    INTO CORRESPONDING FIELDS OF TABLE it_likp_lips
    FROM likp JOIN lips
    ON likp~vbeln EQ lips~vbeln
    WHERE
    likp~traid IN truck_no AND
    likp~erdat IN date AND likp~vbtyp = 'J'.

  IF sy-subrc <> 0.
*    MESSAGE 'NO DATA IN IT_LIKP_LIPS..' TYPE 'E'.
  ELSE.
    SORT it_likp_lips BY vbeln.
    DELETE it_likp_lips WHERE lfimg  EQ '0.0'.

*    DELETE ADJACENT DUPLICATES FROM IT_LIKP_LIPS.
  ENDIF.


ENDFORM.                    " GET_LIKP_LIPS_DATA
*&---------------------------------------------------------------------*
*&      Form  GET_KNA1_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM get_kna1_data .
  SELECT
         kunnr
         name1
         INTO CORRESPONDING FIELDS OF TABLE it_kna1
         FROM kna1
         FOR ALL ENTRIES IN it_likp_lips
         WHERE kunnr = it_likp_lips-kunnr.

  IF sy-subrc <> 0.
* MESSAGE 'NO DATA IN IT_KNA1.' TYPE 'E'.
  ELSE.
    SORT it_kna1 BY kunnr.


*    DELETE ADJACENT DUPLICATES FROM IT_LIKP_LIPS.
  ENDIF.




ENDFORM.                    " GET_KNA1_DATA
*&---------------------------------------------------------------------*
*&      Form  GET_ITAB1
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM get_itab1 .

*---ADD CODE
  LOOP AT it_likp_lips.
    itab1-vbeln = it_likp_lips-vbeln.
    PERFORM delete_leading_zeros USING itab1-vbeln .

    itab1-erdat = it_likp_lips-erdat.
    itab1-kunnr = it_likp_lips-kunnr.
    itab1-traid = it_likp_lips-traid.
    itab1-text  = itab1-traid.
    itab1-matnr = it_likp_lips-matnr.
    itab1-vrkme = it_likp_lips-vrkme.


    itab1-lfimg = it_likp_lips-lfimg.
*    ITAB1-quantity = it_likp_lips-lfimg.

    itab1-arktx = it_likp_lips-arktx.


    READ TABLE it_kna1 WITH KEY kunnr = it_likp_lips-kunnr BINARY SEARCH.
    IF sy-subrc = 0.
      itab1-name1 = it_kna1-name1.
    ENDIF.
    APPEND itab1.
  ENDLOOP.



  LOOP AT itab1.

    MOVE-CORRESPONDING :itab1 TO itab1_ref1.
    APPEND :itab1_ref1.
  ENDLOOP.

  DELETE ADJACENT DUPLICATES FROM itab1 COMPARING vbeln.
  LOOP AT itab1.

    LOOP AT itab1_ref1 WHERE vbeln EQ itab1-vbeln.

      MOVE-CORRESPONDING  itab1_ref1 TO itab1_ref.
      APPEND itab1_ref.

      LOOP AT itab1_ref  WHERE vbeln EQ itab1-vbeln AND matnr EQ itab1_ref1-matnr.
        idx = sy-tabix.
        AT END OF  arktx.
*        MOVE-CORRESPONDING  itab2 TO itab1_ref1.

          DO 5 TIMES.

            itab1_ref-text        =  ' '.
            itab1_ref-vbeln        = ' '.
            itab1_ref-name1        = ' '.
            itab1_ref-arktx        = ' '.
            itab1_ref-lfimg        = ' '.
            itab1_ref-vrkme        = ' '.
            itab1_ref-charg        = ' '.
            itab1_ref-quantity     = ' '.

            APPEND itab1_ref.
            CLEAR :itab1_ref.
*            MODIFY itab1_ref INDEX idx TRANSPORTING text vbeln name1 arktx lfimg vrkme charg quantity.
          ENDDO.

        ENDAT.
      ENDLOOP.
    ENDLOOP.

  ENDLOOP.

  REFRESH itab1.

  LOOP AT itab1_ref.
    MOVE-CORRESPONDING itab1_ref TO itab1.
    APPEND itab1.
  ENDLOOP.

ENDFORM.                                                    " GET_ITAB1

*&---------------------------------------------------------------------*
*&      Form  GET_ITAB3
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM get_itab3 .
  DATA: sum TYPE lips-lfimg.
  SORT itab1_ref BY text.
  LOOP AT itab1_ref.
    MOVE-CORRESPONDING itab1_ref TO itab3.
*    MOVE itab1_ref-matnr TO itab3-matnr.
    APPEND itab3.
    CLEAR itab3.
    DELETE itab3 WHERE text = ''.
  ENDLOOP.


  SORT itab3 BY matnr arktx text .
*  LOOP AT itab3.
*       sum = sum + itab3-lfimg.
*    AT END OF arktx.
*
*      itab-text = itab3-text.
*      itab-arktx = itab3-arktx.
**      itab-lfimg = itab3-lfimg.
*      itab-sum = sum.
*      itab-vrkme = itab3-vrkme.
*      APPEND itab.
*      CLEAR itab.
*    ENDAT.
*  ENDLOOP.

  LOOP AT  itab3.
    MOVE-CORRESPONDING itab3 TO itab3_ref.
    APPEND itab3_ref.

    MOVE-CORRESPONDING itab3 TO itab3_ref1.
    APPEND itab3_ref1.
  ENDLOOP.

*---sort required for truck wise material qty
  SORT itab3_ref BY text.
  DELETE ADJACENT DUPLICATES FROM itab3_ref COMPARING  text.

  SORT itab3_ref1 BY matnr text.


  LOOP AT itab3_ref .

    LOOP AT itab3_ref1 WHERE text EQ itab3_ref-text.

      sum = sum + itab3_ref1-lfimg.
      AT END OF arktx.

        itab-text = itab3_ref1-text.
        itab-arktx = itab3_ref1-arktx.
*      itab-lfimg = itab3-lfimg.
        itab-sum = sum.
        itab-vrkme = itab3_ref1-vrkme.
        APPEND itab.
        CLEAR :itab,sum.
      ENDAT.

    ENDLOOP.
  ENDLOOP.
ENDFORM.                    " GET_ITAB12

*&---------------------------------------------------------------------*
*&      Form  BUILD_LAYOUT_ALV
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM build_layout_alv .
  is_layout-colwidth_optimize = 'X'.

ENDFORM.                    " BUILD_LAYOUT_ALV
*&---------------------------------------------------------------------*
*&      Form  BUILD_EVENTS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM build_events .
*  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
*    EXPORTING
*      i_list_type     = 0
*    IMPORTING
*      et_events       = it_event
*    EXCEPTIONS
*      list_type_wrong = 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.
*
*  READ TABLE it_event INTO wa_event WITH KEY name =
*  slis_ev_top_of_page.
*  IF sy-subrc EQ 0.
*    wa_event-form = 'TOP'.
*    MODIFY it_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
*  ENDIF.




ENDFORM.                    " BUILD_EVENTS


*&---------------------------------------------------------------------*
*&      Form  TOP
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM top.

**Alv list header decleration
*  DATA: it_header TYPE STANDARD TABLE OF slis_listheader,
*        wa_header TYPE slis_listheader.
*
**Title
*  wa_header-typ = 'H'.
*  wa_header-info = 'GATEPASS'.
*  APPEND wa_header TO it_header.
*
**Date
*  wa_header-typ = 'S'.
*  wa_header-key = 'Date:'.
*  CONCATENATE sy-datum+6(2) '.'
*              sy-datum+4(2) '.'
*              sy-datum(4)
*        INTO  wa_header-info.
*  APPEND wa_header TO it_header.
*
**Username
*  wa_header-typ = 'S'.
*  wa_header-key = 'User:'.
*  wa_header-info = sy-uname.
*  APPEND wa_header TO it_header.
*
**Time
*  wa_header-typ = 'S'.
*  wa_header-key = 'Time:'.
*  CONCATENATE sy-uzeit(2)':'
*              sy-uzeit+2(2)':'
*              sy-uzeit+4(2)'.'
*        INTO  wa_header-info.
*
**  LWA_HEADER-INFO = SY-UZEIT.
*  APPEND wa_header TO it_header.
*
*
*  wa_header-typ = 'A'.
*  APPEND wa_header TO it_header.
*
*  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
*    EXPORTING
*      it_list_commentary = it_header
*      i_logo             = 'KAL_LOGO'.
**   I_END_OF_LIST_GRID       =
*  .


ENDFORM.                    "top

*&---------------------------------------------------------------------*
*&      Form  BUILD_FCAT1
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_0215   text
*      -->P_0216   text
*      -->P_0217   text
*      -->P_0218   text
*----------------------------------------------------------------------*
FORM build_fcat1  .

  wa_fcat-col_pos = 1.
  wa_fcat-tabname = 'ITAB1'.
  wa_fcat-fieldname = 'TEXT'.
  wa_fcat-emphasize = 'C701'.
*WA_FCAT-key = 'X'.
  wa_fcat-seltext_m = 'TRUCKNO'.
  APPEND wa_fcat TO it_fcat.
  CLEAR wa_fcat.




  wa_fcat-col_pos = 2.
  wa_fcat-tabname = 'ITAB1'.
  wa_fcat-fieldname = 'VBELN'.
  wa_fcat-emphasize = 'C501'.
  wa_fcat-key = 'X'.
  wa_fcat-seltext_m = 'DONO'.
  APPEND wa_fcat TO it_fcat.
  CLEAR wa_fcat.

  wa_fcat-col_pos = 3.
  wa_fcat-tabname = 'ITAB1'.
  wa_fcat-fieldname = 'NAME1'.
  wa_fcat-emphasize = 'C401'.
*WA_FCAT-key = 'X'.
  wa_fcat-seltext_m = 'PARTY NAME'.
  APPEND wa_fcat TO it_fcat.
  CLEAR wa_fcat.

  wa_fcat-col_pos = 4.
  wa_fcat-tabname = 'ITAB1'.
  wa_fcat-fieldname = 'ARKTX'.
  wa_fcat-emphasize = 'C301'.
*WA_FCAT-key = 'X'.
  wa_fcat-seltext_m = 'SKUCODE'.
  APPEND wa_fcat TO it_fcat.
  CLEAR wa_fcat.

  wa_fcat-col_pos = 5.
  wa_fcat-tabname = 'ITAB1'.
  wa_fcat-fieldname = 'LFIMG'.
  wa_fcat-emphasize = 'C701'.
*WA_FCAT-key = 'X'.
*  wa_fcat-do_sum = 'X'.
  wa_fcat-seltext_m = 'QUANTITY'.
  APPEND wa_fcat TO it_fcat.
  CLEAR wa_fcat.


  wa_fcat-col_pos = 6.
  wa_fcat-tabname = 'ITAB1'.
  wa_fcat-fieldname = 'VRKME'.
  wa_fcat-emphasize = 'C401'.
*WA_FCAT-key = 'X'.
  wa_fcat-seltext_m = 'UOM'.
  APPEND wa_fcat TO it_fcat.
  CLEAR wa_fcat.


  wa_fcat-col_pos = 7.
  wa_fcat-tabname = 'ITAB1'.
  wa_fcat-fieldname = 'CHARG'.
  wa_fcat-emphasize = 'C601'.
*WA_FCAT-key = 'X'.
  wa_fcat-seltext_m = 'BATCH'.
  APPEND wa_fcat TO it_fcat.
  CLEAR wa_fcat.

  wa_fcat-col_pos = 8.
  wa_fcat-tabname = 'ITAB1'.
  wa_fcat-fieldname = 'QUANTITY'.
  wa_fcat-emphasize = 'C701'.
*WA_FCAT-key = 'X'.
  wa_fcat-seltext_m = 'QUANTITY'.
  APPEND wa_fcat TO it_fcat.
  CLEAR wa_fcat.

ENDFORM.                    " BUILD_FCAT1
*&---------------------------------------------------------------------*
*&      Form  ALV_SORT_INFO
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM alv_sort_info .

**  wa_sort-spos = 1.
**  wa_sort-fieldname = 'TEXT'.
**  wa_sort-tabname = 'ITAB1'.
**  wa_sort-down = 'X'.
**  APPEND wa_sort TO it_sort.
**  CLEAR wa_sort.
**
**
**
**  wa_sort-spos = 2.
**  wa_sort-fieldname = 'VBELN'.
**  wa_sort-tabname = 'ITAB1'.
**  wa_sort-up = 'X'.
**  APPEND wa_sort TO it_sort.
**  CLEAR wa_sort.
**
**
**  wa_sort-spos = 4.
**  wa_sort-fieldname = 'ARKTX'.
**  wa_sort-tabname = 'ITAB1'.
**  wa_sort-down = 'X'.
**  APPEND wa_sort TO it_sort.
**  CLEAR wa_sort.
**
***
**
**  wa_sort-spos = 5.
**  wa_sort-fieldname = 'LFIMG'.
**  wa_sort-tabname = 'ITAB1'.
**  wa_sort-down = 'X'.
**
**  APPEND wa_sort TO it_sort.
**  CLEAR wa_sort.
**lw_sort-fieldname = 'CONNID'. "sort depending on which field
**  lw_sort-subtot = 'X'. "sub calculate depending on this field
**  lw_sort-up = 'X'. "ascending sequence
**  APPEND lw_sort TO pi_sort.
**  CLEAR lw_sort.
*
*
*
*  wa_sort-spos = 5.
*  wa_sort-fieldname = 'LFIMG'.
*  wa_sort-tabname = 'ITAB1'.
*  wa_sort-down = 'X'.
*  WA_SORT-SUBTOT = 'X'.
*
*  APPEND wa_sort TO it_sort.
*  CLEAR wa_sort.
***
**  wa_sort-spos = 7.
**  wa_sort-fieldname = 'CHARG'.
**  wa_sort-tabname = 'ITAB1'.
**  wa_sort-down = 'X'.
**  APPEND wa_sort TO it_sort.
**  CLEAR wa_sort.
**
*


ENDFORM.                    " ALV_SORT_INFO
*&---------------------------------------------------------------------*
*&      Form  ALV_GRID_DISPLAY
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM alv_grid_display .
  DATA:repid TYPE sy-repid VALUE sy-repid.
  repid = sy-repid." PROGRAM  NAME
*--------------- ADD INTERNAL TABLE ITAB1
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
     i_program_name               = sy-repid
     i_internal_tabname           = 'ITAB1'
*   I_STRUCTURE_NAME             =
*   I_CLIENT_NEVER_DISPLAY       = 'X'
     i_inclname                   = sy-repid
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = it_fcat
   EXCEPTIONS
     inconsistent_interface       = 1
     program_error                = 2
     OTHERS                       = 3
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
      is_layout                  = is_layout
      it_fieldcat                = it_fcat
      i_tabname                  = 'ITAB1'
      it_events                  = it_event
    TABLES
      t_outtab                   = itab1
    EXCEPTIONS
      program_error              = 1
      maximum_of_appends_reached = 2
      OTHERS                     = 3.


*------------------- ADD INTERNAL TABLE ITAB

  REFRESH it_fcat[].

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name     = sy-repid
      i_internal_tabname = 'ITAB'
      i_inclname         = sy-repid
    CHANGING
      ct_fieldcat        = it_fcat.

  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
      is_layout                  = is_layout
      it_fieldcat                = it_fcat
      i_tabname                  = 'ITAB'
      it_events                  = it_event
    TABLES
      t_outtab                   = itab
    EXCEPTIONS
      program_error              = 1
      maximum_of_appends_reached = 2
      OTHERS                     = 3.


  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    EXCEPTIONS
      program_error = 1
      OTHERS        = 2.


*  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
*   EXPORTING
**   I_INTERFACE_CHECK                 = ' '
**   I_BYPASSING_BUFFER                = ' '
**   I_BUFFER_ACTIVE                   = ' '
*     i_callback_program                = 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                         = is_layout
*     it_fieldcat                       = it_fcat
**   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
**   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                          = itab1
*   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.                    " ALV_GRID_DISPLAY
*&---------------------------------------------------------------------*
*&      Form  DELETE_LEADING_ZEROS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_ITAB1_VBELN  text
*----------------------------------------------------------------------*
FORM delete_leading_zeros  USING    p_var.
  SHIFT p_var LEFT DELETING LEADING '0' .

ENDFORM.                    " DELETE_LEADING_ZEROS

7 REPLIES 7

GauthamV
Active Contributor
0 Kudos
72

Hi,

In se38 goto menu, utilities - settings uncheck the checkbox for

download- compat line length (72).

Former Member
0 Kudos
72

hey it would be better if u paste the dump message

here you will know wer exactly in the code ur getting the erro i mean which fn module

then make sure that you pass the variables correctly to the FM

make sure ITAB assignment is right

shiva

0 Kudos
72

this was the content of short dump

The ABAP program lines are wider than the internal table.

What happened?

Error in the ABAP Application Program

The current ABAP program "SAPLSKBH" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_READ_SRC_LINE_TOO_LONG', was

not caught in

procedure "K_KKB_FIELDCAT_MERGE" "(FUNCTION)", nor was it propagated by a

RAISING clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

There was an attempt to read program "ZGATEPASS" from the database.

The READ REPORT statement allows you to copy a program text into an

internal table. The occupied line length in the program text must not

exceed the width of the internal table.

The internal table "FUNCTION=K_KKB_FIELDCAT_MERGEDATA=L_ABAP_SOURCE[]" is 72

characters wide. The program line is

118 characters wide.

Missing RAISING Clause in Interface

Program SAPLSKBH

Include LSKBHU12

Row 1

Module type (FUNCTION)

Module Name K_KKB_FIELDCAT_MERGE

Trigger Location of Exception

Program SAPLSKBH

Include LSKBHU12

Row 365

Module type (FUNCTION)

Module Name K_KKB_FIELDCAT_MERGE

Source Code Extract

Line SourceCde

335 l_word_len = strlen( l_prog_tab_local ).

336 l_wordx_len = strlen( i_callback_program ).

337 l_word_len = l_word_len - 3. "Includekörper

338 l_wordy_len = l_wordx_len - l_word_len.

339

340 * TOP as last string of include name

341 assign l_prog_tab_local+l_word_len(3) to ."letztes Inlcude noch kein

355 exit. " -TOP Inlcude

356 endif.

357 endif.

358 if i_inclname ne space.

359 l_prog_tab_local = i_inclname .

360 endif.

361

  • class cx_sy_read_src_line_too_long definition load.

  • data: ex_too_long type ref to cx_sy_read_src_line_too_long.

  • try.

read report l_prog_tab_local into l_abap_source.

  • catch cx_sy_read_src_line_too_long into ex_too_long.

  • endtry.

check sy-subrc eq 0.

  • scan abap source for ddic references of fields

l_tabname = i_tabname. " FGS

call function 'ABAP_SCAN_DATA_DESCRIPTION'

exporting

structure_name = l_tabname " FGS

main_program_name = i_callback_program

i_context = 'X'

tables

abap_source = l_abap_source

ddic_fieldinfo = l_fieldinfo_old

ddic_fieldinfo2 = l_fieldinfo

exceptions

source_not_accepted = 0

others = 0.

Former Member
0 Kudos
72

Hi ,

Think there is problem of your editor do one thing .

se38(progrm name)->utilities->settings->screen will display

On that screen open editor tab and select check box Downwards-Comp.Line Lngth (72) .

Regards ,

Nilesh Jain .

0 Kudos
72

hello niles,

i check that what u said, but it was uncheck actually.

thnx

Former Member
0 Kudos
72

Hi, we had the same dump a couple of days ago. We checked and unchecked the box Downwards-Comp.Line Lngth (72) but we didn't solve the dump.

We reached our goal just checking all the programs line and reducing the ones that exceeded 72 digit.

Hope this will help you.

Fuffo.

Former Member
0 Kudos
72

SEE THE FOLLOWING EXAMPLE:



REPORT ZBLOCK_ALV.



CONSTANTS :
  c_x VALUE 'X'.
*---------------------------------------------------------------------*
* Macro definition
DEFINE m_fieldcat.
  ls_fieldcat-fieldname = &1.
  ls_fieldcat-ref_tabname = &2.
  ls_fieldcat-tabname = &3.
  append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.

DEFINE m_sort.
  ls_sort-fieldname = &1.
  ls_sort-up        = c_x.
  append ls_sort to lt_sort.
END-OF-DEFINITION.
*---------------------------------------------------------------------*
TYPE-POOLS: slis.                      " ALV Global types

TYPES:
* 1st Table
  BEGIN OF ty_kna1,
    kunnr TYPE kna1-kunnr,             " Customer number
    ernam TYPE kna1-ernam,             " Name of Person who Created
    erdat TYPE kna1-erdat,             " Creation date
    name1 TYPE kna1-name1,             " Name 1                    .
  END OF ty_kna1,

* 2nd Table
  BEGIN OF ty_mara,
    matnr TYPE mara-matnr,             " Material number
    ernam TYPE mara-ernam,             " Name of Person who Created
    ersda TYPE mara-ersda,             " Creation date
    mtart TYPE mara-mtart,             " Material type
    matkl TYPE mara-matkl,             " Material group
  END OF ty_mara,

* 3rd Table
  BEGIN OF ty_vbak,
    vbeln TYPE vbak-vbeln,             " Sales document
    vkorg TYPE vbak-vkorg,             " Sales organization
    vtweg TYPE vbak-vtweg,             " Distribution channel
    kunnr TYPE vbak-kunnr,             " Sold-to party
    erdat TYPE vbak-erdat,             " Creation date
  END OF ty_vbak.

*---------------------------------------------------------------------*
DATA:
  gs_layout TYPE slis_layout_alv,
  gt_kna1 TYPE TABLE OF ty_kna1,
  gt_mara TYPE TABLE OF ty_mara,
  gt_vbak TYPE TABLE OF ty_vbak.

*---------------------------------------------------------------------*
SELECTION-SCREEN :
  SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED
PARAMETERS p_max(2) TYPE n DEFAULT '02' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
*---------------------------------------------------------------------*
INITIALIZATION.

  v_1 = 'Maximum of records to read'.

*---------------------------------------------------------------------*
START-OF-SELECTION.

* Read data
  SELECT kunnr ernam erdat name1
    FROM kna1
   UP TO p_max ROWS
    INTO TABLE gt_kna1.

  SELECT matnr ernam ersda mtart matkl
    FROM mara
   UP TO p_max ROWS
    INTO TABLE gt_mara.

  SELECT vbeln vkorg vtweg kunnr erdat
    FROM vbak
   UP TO p_max ROWS
    INTO TABLE gt_vbak.

*---------------------------------------------------------------------*
END-OF-SELECTION.

  PERFORM f_display_data.

*---------------------------------------------------------------------*
*       FORM USER_COMMAND                                             *
*---------------------------------------------------------------------*
FORM user_command USING u_ucomm     TYPE sy-ucomm
                        us_selfield TYPE slis_selfield.     "#EC CALLED

  DATA:
    ls_vbak TYPE ty_vbak.

  CASE u_ucomm.
    WHEN '&IC1'.                       " Pick
      CASE us_selfield-tabname.
        WHEN 'GT_MARA'.
        WHEN 'GT_KNA1'.
        WHEN 'GT_VBAK'.
          READ TABLE gt_vbak INDEX us_selfield-tabindex INTO ls_vbak.
          IF sy-subrc EQ 0.
            SET PARAMETER ID 'AUN' FIELD ls_vbak-vbeln.
            CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
  ENDCASE.

ENDFORM.                               " USER_COMMAND
*---------------------------------------------------------------------*
*       Form  f_display_data
*---------------------------------------------------------------------*
FORM f_display_data.

  DATA :
    ls_fieldcat TYPE slis_fieldcat_alv,
    lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
    ls_sort     TYPE slis_sortinfo_alv,
    lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
    lt_events   TYPE slis_t_event,
    ls_event    TYPE slis_alv_event.

  gs_layout-group_change_edit = c_x.
  gs_layout-colwidth_optimize = c_x.
  gs_layout-zebra             = c_x.
  gs_layout-detail_popup      = c_x.
  gs_layout-get_selinfos      = c_x.

* Build field catalog and sort table
  m_fieldcat  'KUNNR' 'KNA1' 'GT_KNA1'.
  m_fieldcat  'ERNAM' 'KNA1' 'GT_KNA1'.
  m_fieldcat  'ERDAT' 'KNA1' 'GT_KNA1'.
  m_fieldcat  'NAME1' 'KNA1' 'GT_KNA1'.
  m_sort  'KUNNR'.

* Build Event Table
  MOVE        'TOP_OF_PAGE'        TO ls_event-name.
  MOVE        'TOP_OF_PAGE'        TO ls_event-form.
  APPEND ls_event TO lt_events.
  MOVE        'END_OF_LIST'        TO ls_event-name.
  MOVE        'END_OF_LIST'        TO ls_event-form.
  APPEND ls_event TO lt_events.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program      = sy-cprog
      i_callback_user_command = 'USER_COMMAND'
      it_fieldcat             = lt_fieldcat
      is_layout               = gs_layout
      it_events               = lt_events
      it_sort                 = lt_sort
      i_save                  = 'A'
    TABLES
      t_outtab                = gt_kna1.

ENDFORM.                               " F_DISPLAY_DATA
*---------------------------------------------------------------------*
*       FORM top_of_page                                              *
*---------------------------------------------------------------------*
FORM top_of_page.                                           "#EC CALLED

  ULINE.
  WRITE : sy-uname, sy-title(56) CENTERED, sy-datum.
  ULINE.

ENDFORM.                               " TOP_OF_PAGE
*---------------------------------------------------------------------*
*       FORM End_of_list                                              *
*---------------------------------------------------------------------*
FORM end_of_list.                                           "#EC CALLED

  DATA :
    ls_fieldcat TYPE slis_fieldcat_alv,
    lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
    ls_sort     TYPE slis_sortinfo_alv,
    lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
    lt_events   TYPE slis_t_event,
    ls_event    TYPE slis_alv_event.

* Build field catalog and sort table
  m_fieldcat 'MATNR' 'MARA' 'GT_MARA'.
  m_fieldcat 'ERNAM' 'MARA' 'GT_MARA'.
  m_fieldcat 'ERSDA' 'MARA' 'GT_MARA'.
  m_fieldcat 'MTART' 'MARA' 'GT_MARA'.
  m_fieldcat 'MATKL' 'MARA' 'GT_MARA'.
  m_sort 'MATNR'.

* Build Event Table
  MOVE 'END_OF_LIST'   TO ls_event-name.
  MOVE 'END_OF_LIST_2' TO ls_event-form.
  APPEND ls_event TO lt_events.

  gs_layout-list_append = c_x.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program = sy-cprog
      it_fieldcat        = lt_fieldcat
      is_layout          = gs_layout
      it_sort            = lt_sort
      it_events          = lt_events
      i_save             = 'A'
    TABLES
      t_outtab           = gt_mara.

ENDFORM.                               " END_OF_LIST
*---------------------------------------------------------------------*
*       FORM End_of_list_2                                            *
*---------------------------------------------------------------------*
FORM end_of_list_2.                                         "#EC CALLED

  DATA :
    ls_fieldcat TYPE slis_fieldcat_alv,
    lt_fieldcat TYPE slis_t_fieldcat_alv, " Field catalog
    ls_sort     TYPE slis_sortinfo_alv,
    lt_sort     TYPE slis_t_sortinfo_alv, " Sort table
    lt_events   TYPE slis_t_event,
    ls_event    TYPE slis_alv_event.

* Build field catalog and sort table
  m_fieldcat 'VBELN' 'VBAK' 'GT_VBAK'.
  m_fieldcat 'VKORG' 'VBAK' 'GT_VBAK'.
  m_fieldcat 'VTWEG' 'VBAK' 'GT_VBAK'.
  m_fieldcat 'KUNNR' 'VBAK' 'GT_VBAK'.
  m_fieldcat 'ERDAT' 'VBAK' 'GT_VBAK'.
  m_sort 'VBELN'.

* Build Event Table
  MOVE 'TOP_OF_PAGE' TO ls_event-name.
  MOVE 'TOP_OF_PAGE' TO ls_event-form.
  APPEND ls_event TO lt_events.

  gs_layout-list_append = c_x.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program = sy-cprog
      it_fieldcat        = lt_fieldcat
      is_layout          = gs_layout
      it_sort            = lt_sort
      it_events          = lt_events
      i_save             = 'A'
    TABLES
      t_outtab           = gt_vbak.

ENDFORM.                               " END_OF_LIST_2