Skip to Content
0
Former Member
Jun 06, 2008 at 06:26 AM

Dynamic ALV Problem

23 Views

I am getting the following short dump error : Program " " not found".The fieldcat is successfully built but when Iam trying to call the method "create_dynamic_table" it is showing the error.

I executed the following Dynamic ALV program without any error yesterday,I did slight modifications and it is started showing the error.See the below code :

Data : t_fieldcat TYPE lvc_t_fcat,
       wa_fieldcat TYPE lvc_s_fcat.

FIELD-SYMBOLS : <it_dyn> TYPE STANDARD TABLE,
                <wa_dyn>.

DATA : g_tdref TYPE REF TO data,
       g_wdref TYPE REF TO data,
       dats like vbbe-mbdat.


SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_mbdat FOR dats.
SELECTION-SCREEN : END OF BLOCK blk1.

wa_fieldcat-tabname = 'MSKA'.
wa_fieldcat-fieldname = 'WERKS'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-intlen = '10'.

APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.

wa_fieldcat-tabname = 'MSKA'.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-seltext = 'Material Number'.
wa_fieldcat-intlen = '18'.

APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.

  wa_fieldcat-tabname = 'MAKT'.
  wa_fieldcat-fieldname = 'MAKTX'.
  wa_fieldcat-datatype = 'CHAR'.
  wa_fieldcat-intlen = '10'.

  APPEND wa_fieldcat TO t_fieldcat.
  CLEAR : wa_fieldcat.

wa_fieldcat-tabname = 'VBBE'.
wa_fieldcat-fieldname = 'MBDAT'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-intlen = '10'.

APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.

DATA : d TYPE i,
       v(02) TYPE n VALUE '0',
       day(8) TYPE c.

d = s_mbdat-high - s_mbdat-low.

DO d TIMES.

  v = v + 1.

  CONCATENATE 'x Day' v INTO day.

  wa_fieldcat-tabname = 'VBBE'.
  wa_fieldcat-fieldname = day.
  wa_fieldcat-datatype = 'DATS'.
  wa_fieldcat-seltext = day.
  wa_fieldcat-intlen = '8'.

  APPEND wa_fieldcat TO t_fieldcat.
  CLEAR : wa_fieldcat.

ENDDO.
  CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
      it_fieldcatalog = t_fieldcat
    IMPORTING
      ep_table        = g_tdref.

  ASSIGN g_tdref->* TO <it_dyn>.
  CREATE DATA g_wdref LIKE LINE OF <it_dyn>.
  ASSIGN g_wdref->* TO <wa_dyn>.

What might be the problem?