Application Development and Automation 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: 
Read only

ALV GRID Display function module giving Run time error

Former Member
0 Likes
1,891

Hello Experts,

I have ALV report, In which I am using ALV grid dispaly FM to display the report.

But when my out table which I am passing to FM is empty that time ALV grid display shows blank ALV report. but when out table is not empty that time I am getting the Run time error, which shows message "Field symbol has not yet been assigned".

Can any one please help me out in this.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,719

Hi Chetan,

Make sure that all the letters are in caps:

''REUSE_ALV_GRID_DISPLAY'.

if not ,

DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE ,

PERFORM FIELD_CATALOG TABLES IT_FIELDCAT
USING: 'ITAB' 'WERKS' ' ' 'PLANT' 'X',
            'ITAB' 'MATNR' 'X' 'MATERIAL NO:' 'X',
             'ITAB' 'MAKTX' ' ' 'MATERIAL DESCRIPTION' 'X'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     I_CALLBACK_PROGRAM                = SY-CPROG  
 *    IS_LAYOUT                         = S_LAYOUT
     IT_FIELDCAT                       = IT_FIELDCAT[]
     IT_SORT                           = TB_SORT[]
*   IT_EVENTS                         =
    TABLES
      T_OUTTAB                         = ITAB[]

            .

FORM FIELD_CATALOG  TABLES   T_FIELD_CATALOG STRUCTURE IT_FIELDCAT
USING FP_TABNAME TYPE ANY
  FP_FIELDNAME TYPE ANY
  FP_KEY TYPE ANY
  FP_TEXT TYPE ANY
  FP_DO_SUM TYPE ANY.

  T_FIELD_CATALOG-TABNAME = FP_TABNAME.
  T_FIELD_CATALOG-FIELDNAME = FP_FIELDNAME.
  T_FIELD_CATALOG-KEY = FP_KEY.
  T_FIELD_CATALOG-SELTEXT_L = FP_TEXT.
  T_FIELD_CATALOG-DO_SUM = FP_DO_SUM .

  APPEND IT_FIELDCAT.
  CLEAR IT_FIELDCAT.
ENDFORM.

Thanks

Karthik

Edited by: Karthik R on Jul 16, 2009 5:09 PM

15 REPLIES 15
Read only

venkat_o
Active Contributor
0 Likes
1,719

Hi Chetan,

Check fieldcatalog internal table whether it is empty or has values.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
  EXPORTING
    i_callback_program = 'ZTEST_NOTEPAD'
    it_fieldcat        = it_fields  "Check this table.
  TABLES
    t_outtab           = it_data.

Thanks

Venkat.

Read only

Former Member
0 Likes
1,719

hi,

there is a mismatch between table data and the fields of the fieldcat.

regards,

venkat.

Read only

Former Member
0 Likes
1,719

Please recheck ur field catalogue. This error used to come when there is a mistake in field name declared in field catalogue with respect to the output table.

Regards

Sathar

Read only

former_member209217
Active Contributor
0 Likes
1,719

Hi,

Its the problem with the field symbol. Assign some value to field symbol and try again.

There shuld be mismatch with the parameters passed to the FM .chk it once.

Regards,

Lakshman.

Read only

0 Likes
1,719

Hello Chetan ,

Can u provide me the code ???

I will solve this with in minutes ...

Read only

0 Likes
1,719

hello Chetan ,

Can u provide me the code?

I will solve this with in minutes.

Regards,

apoorv

Read only

0 Likes
1,719

TYPES: BEGIN OF type_out,

col00 TYPE ytlet-rzzyyproduct,

col01 TYPE ytlet-kslvt,

col02 TYPE ytlet-kslvt,

col03 TYPE ytlet-kslvt,

col04 TYPE ytlet-kslvt,

col05 TYPE ytlet-kslvt,

col06 TYPE ytlet-kslvt,

col07 TYPE ytlet-kslvt,

col08 TYPE ytlet-kslvt,

col09 TYPE ytlet-kslvt,

col10 TYPE ytlet-kslvt,

col11 TYPE ytlet-kslvt,

col12 TYPE ytlet-kslvt,

col13 TYPE ytlet-kslvt,

col14 TYPE ytlet-kslvt,

col15 TYPE ytlet-kslvt,

col16 TYPE ytlet-kslvt,

col17 TYPE ytlet-kslvt,

col18 TYPE ytlet-kslvt,

col19 TYPE ytlet-kslvt,

col20 TYPE ytlet-kslvt,

col21 TYPE ytlet-kslvt,

col22 TYPE ytlet-kslvt,

col23 TYPE ytlet-kslvt,

col24 TYPE ytlet-kslvt,

col25 TYPE ytlet-kslvt,

col26 TYPE ytlet-kslvt,

col27 TYPE ytlet-kslvt,

col28 TYPE ytlet-kslvt,

col29 TYPE ytlet-kslvt,

col30 TYPE ytlet-kslvt,

col31 TYPE ytlet-kslvt,

col32 TYPE ytlet-kslvt,

col33 TYPE ytlet-kslvt,

col34 TYPE ytlet-kslvt,

col35 TYPE ytlet-kslvt,

col36 TYPE ytlet-kslvt,

col37 TYPE ytlet-kslvt,

col38 TYPE ytlet-kslvt,

col39 TYPE ytlet-kslvt,

col40 TYPE ytlet-kslvt,

col41 TYPE ytlet-kslvt,

col42 TYPE ytlet-kslvt,

col43 TYPE ytlet-kslvt,

col44 TYPE ytlet-kslvt,

END OF type_out.

DATA: t_fieldcat TYPE slis_t_fieldcat_alv, "Field catelog table

w_fieldcat TYPE slis_fieldcat_alv, "Field catelog Work area

w_layout TYPE slis_layout_alv, "Layout structure

w_event TYPE slis_alv_event, "Event structure

t_event TYPE slis_t_event, "Event structure

t_sort TYPE STANDARD TABLE OF slis_sortinfo_alv,

t_callback_main_user_command TYPE slis_formname,

v_selfield TYPE slis_selfield.

FIELD-SYMBOLS: <ksl>.

FORM DISPLAY_REPORT .

*Prepare Field Catlog

PERFORM creat_field_catlog.

*Set layout

PERFORM set_layout.

*Get Event

PERFORM get_event.

*Display Report

PERFORM display_alv_report.

ENDFORM. " DISPLAY_REPORT

FORM creat_field_catlog .

PERFORM add_fields_catlog USING:

'01' 'RZZYYPRODUCT' 'IT_OUT' 'MPMs' ' ',

'02' 'KSLVT' 'IT_OUT' 'License Fee' ' ',

'03' 'KSLVT' 'IT_OUT' 'Ad Sales' ' ',

'04' 'KSLVT' 'IT_OUT' 'Promo Fees' ' ',

'05' 'KSLVT' 'IT_OUT' 'Total Ad Sales/Promo' ' ',

'06' 'KSLVT' 'IT_OUT' 'Other' ' ',

'07' 'KSLVT' 'IT_OUT' 'Total' ' ',

'08' 'KSLVT' 'IT_OUT' 'Dom Station' ' ',

'09' 'KSLVT' 'IT_OUT' 'Basic Cable/Free VOD' ' ',

'10' 'KSLVT' 'IT_OUT' 'License Fee' ' ',

'11' 'KSLVT' 'IT_OUT' 'Ad Sales (incl Internet)' ' ',

'12' 'KSLVT' 'IT_OUT' 'Promo Fees' ' ',

'13' 'KSLVT' 'IT_OUT' 'Ad Sales & Promo Fees' ' ',

'14' 'KSLVT' 'IT_OUT' 'Foreign' ' ',

'15' 'KSLVT' 'IT_OUT' 'Pay TV' ' ',

'16' 'KSLVT' 'IT_OUT' 'Other' ' ',

'17' 'KSLVT' 'IT_OUT' 'Total' ' ',

'18' 'KSLVT' 'IT_OUT' 'Home Entertainment' ' ',

'19' 'KSLVT' 'IT_OUT' 'SPTI' ' ',

'20' 'KSLVT' 'IT_OUT' 'All Other Divisions' ' ',

'21' 'KSLVT' 'IT_OUT' 'Total' ' ',

'22' 'KSLVT' 'IT_OUT' 'Total Revenue' ' ',

'23' 'KSLVT' 'IT_OUT' 'PV Net Down & Producers Share' '',

'24' 'KSLVT' 'IT_OUT' 'Total Net Revenue' ' ',

'25' 'KSLVT' 'IT_OUT' 'Development Expense' ' ',

'26' 'KSLVT' 'IT_OUT' 'SOP Deficits' ' ',

'27' 'KSLVT' 'IT_OUT' 'Amortization' ' ',

'28' 'KSLVT' 'IT_OUT' 'Other COS ' ' ',

'29' 'KSLVT' 'IT_OUT' 'Total COS' ' ',

'30' 'KSLVT' 'IT_OUT' 'Profit Before Releasing' ' ',

'31' 'KSLVT' 'IT_OUT' 'Gross Profit %' ' ',

'32' 'KSLVT' 'IT_OUT' 'SPT' ' ',

'33' 'KSLVT' 'IT_OUT' 'Home Entertainment' ' ',

'34' 'KSLVT' 'IT_OUT' 'SPTI' ' ',

'35' 'KSLVT' 'IT_OUT' 'All Other Divisions' ' ',

'36' 'KSLVT' 'IT_OUT' 'Other' ' ',

'37' 'KSLVT' 'IT_OUT' 'Total' ' ',

'38' 'KSLVT' 'IT_OUT' 'Gross Profit' ' ',

'39' 'KSLVT' 'IT_OUT' 'SPT' ' ',

'40' 'KSLVT' 'IT_OUT' 'Home Entertainment' ' ',

'41' 'KSLVT' 'IT_OUT' 'SPTI' ' ',

'42' 'KSLVT' 'IT_OUT' 'All Other Divisions' ' ',

'43' 'KSLVT' 'IT_OUT' 'Other' ' ',

'44' 'KSLVT' 'IT_OUT' 'Total' ' ',

'45' 'KSLVT' 'IT_OUT' 'Net Margin' ' '.

ENDFORM. " CREAT_FIELD_CATLOG

&----


*& Form ADD_FIELDS_CATLOG

&----


  • Filling of field Catlog

----


FORM add_fields_catlog USING p_colpos

p_fildname

p_tabname

p_fildtext

p_ndisplay.

w_fieldcat-row_pos = '1'.

w_fieldcat-col_pos = p_colpos.

w_fieldcat-fieldname = p_fildname.

w_fieldcat-tabname = p_tabname.

w_fieldcat-reptext_ddic = p_fildtext.

w_fieldcat-no_out = p_ndisplay.

APPEND w_fieldcat TO t_fieldcat.

CLEAR: w_fieldcat.

ENDFORM. " ADD_FIELDS_CATLOG

&----


*& Form SET_LAYOUT

&----


  • Set Layout

----


FORM set_layout .

w_layout-colwidth_optimize = 'X'.

ENDFORM. " SET_LAYOUT

&----


*& Form GET_EVENT

&----


  • text

----


FORM get_event .

w_event-name = 'TOP-OF-PAGE'.

w_event-form = 'F_TOP-OF_PAGE'.

APPEND w_event TO t_event.

ENDFORM. " GET_EVENT

&----


*& Form TOP-OF-PAGE

&----


  • Top of Page

----


FORM top-of-page.

DATA : t_list_commentry TYPE slis_t_listheader,

w_header TYPE slis_listheader,

lv_text(90) TYPE c,

l_text(90) TYPE c,

lv_rundate(10) TYPE c,

lv_runtime(10) TYPE c.

CONSTANTS: c_space(2) TYPE c VALUE ' ',

c_space2(6) TYPE c VALUE ' '.

w_header-typ = 'S'.

w_header-key = 'Program:'.

w_header-info = sy-repid.

APPEND w_header TO t_list_commentry.

WRITE: sy-datum TO lv_rundate MM/DD/YYYY.

WRITE: sy-uzeit TO lv_runtime USING EDIT MASK '__:__:__'.

  • CLEAR w_header.

  • w_header-typ = 'S'.

  • w_header-key = text-021.

  • w_header-info = lv_rundate.

  • APPEND w_header TO t_list_commentry.

CLEAR: w_header.

w_header-typ = 'S'.

w_header-key = 'User Id'.

w_header-info = sy-uname.

APPEND w_header TO t_list_commentry.

CLEAR: w_header.

w_header-typ = 'S'.

w_header-key = 'Run Date'.

w_header-info = lv_rundate.

APPEND w_header TO t_list_commentry.

CLEAR: w_header.

w_header-typ = 'S'.

w_header-key = 'Run Time'.

w_header-info = lv_runtime.

APPEND w_header TO t_list_commentry.

CLEAR: w_header.

w_header-typ = 'H'.

w_header-key = 'order'.

w_header-info = 'MCR Report'.

APPEND w_header TO t_list_commentry.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = t_list_commentry.

ENDFORM. "TOP-OF-PAGE

FORM display_alv_report .

CONSTANTS : gc_save TYPE c VALUE 'A'. "Save Layout

  • t_callback_main_user_command = c_user_command.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = sy-repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • i_callback_user_command = t_callback_main_user_command

i_callback_top_of_page = '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 = w_layout

it_fieldcat = t_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

i_save = gc_save

  • IS_VARIANT =

  • IT_EVENTS =

  • 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 = it_out

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

ENDIF.

Read only

0 Likes
1,719

Hi chetan,

put body for fieldcat and internal table in the Fm.

e.g.

it_fieldcat = t_fieldcat[]

TABLES

t_outtab = it_out[]

Regards,

Vijay

Read only

0 Likes
1,719

<pre> PERFORM add_fields_catlog USING:

'01' 'RZZYYPRODUCT' 'IT_OUT' 'MPMs' ' ',

'02' 'KSLVT' 'IT_OUT' 'License Fee' ' ',

'03' 'KSLVT' 'IT_OUT' 'Ad Sales' ' ',

'04' 'KSLVT' 'IT_OUT' 'Promo Fees' ' ',

'05' 'KSLVT' 'IT_OUT' 'Total Ad Sales/Promo' ' ',

'06' 'KSLVT' 'IT_OUT' 'Other' ' ',

'07' 'KSLVT' 'IT_OUT' 'Total' ' ',

'08' 'KSLVT' 'IT_OUT' 'Dom Station' ' ',

'09' 'KSLVT' 'IT_OUT' 'Basic Cable/Free VOD' ' ',

'10' 'KSLVT' 'IT_OUT' 'License Fee' ' ',

'11' 'KSLVT' 'IT_OUT' 'Ad Sales (incl Internet)' ' ',

'12' 'KSLVT' 'IT_OUT' 'Promo Fees' ' ',

'13' 'KSLVT' 'IT_OUT' 'Ad Sales & Promo Fees' ' ',

'14' 'KSLVT' 'IT_OUT' 'Foreign' ' ',

'15' 'KSLVT' 'IT_OUT' 'Pay TV' ' ',

'16' 'KSLVT' 'IT_OUT' 'Other' ' ',

'17' 'KSLVT' 'IT_OUT' 'Total' ' ',

'18' 'KSLVT' 'IT_OUT' 'Home Entertainment' ' ',

'19' 'KSLVT' 'IT_OUT' 'SPTI' ' ',

'20' 'KSLVT' 'IT_OUT' 'All Other Divisions' ' ',

'21' 'KSLVT' 'IT_OUT' 'Total' ' ',

'22' 'KSLVT' 'IT_OUT' 'Total Revenue' ' ',

'23' 'KSLVT' 'IT_OUT' 'PV Net Down & Producers Share' '',

'24' 'KSLVT' 'IT_OUT' 'Total Net Revenue' ' ',

'25' 'KSLVT' 'IT_OUT' 'Development Expense' ' ',

'26' 'KSLVT' 'IT_OUT' 'SOP Deficits' ' ',

'27' 'KSLVT' 'IT_OUT' 'Amortization' ' ',

'28' 'KSLVT' 'IT_OUT' 'Other COS ' ' ',

'29' 'KSLVT' 'IT_OUT' 'Total COS' ' ',

'30' 'KSLVT' 'IT_OUT' 'Profit Before Releasing' ' ',

'31' 'KSLVT' 'IT_OUT' 'Gross Profit %' ' ',

'32' 'KSLVT' 'IT_OUT' 'SPT' ' ',

'33' 'KSLVT' 'IT_OUT' 'Home Entertainment' ' ',

'34' 'KSLVT' 'IT_OUT' 'SPTI' ' ',

'35' 'KSLVT' 'IT_OUT' 'All Other Divisions' ' ',

'36' 'KSLVT' 'IT_OUT' 'Other' ' ',

'37' 'KSLVT' 'IT_OUT' 'Total' ' ',

'38' 'KSLVT' 'IT_OUT' 'Gross Profit' ' ',

'39' 'KSLVT' 'IT_OUT' 'SPT' ' ',

'40' 'KSLVT' 'IT_OUT' 'Home Entertainment' ' ',

'41' 'KSLVT' 'IT_OUT' 'SPTI' ' ',

'42' 'KSLVT' 'IT_OUT' 'All Other Divisions' ' ',

'43' 'KSLVT' 'IT_OUT' 'Other' ' ',

'44' 'KSLVT' 'IT_OUT' 'Total' ' ',

'45' 'KSLVT' 'IT_OUT' 'Net Margin' ' '.</pre>

<font color=red>If you see above code, Instead of writing column name, you have used , KSLVT and RZZYYPRODUCT. Please Change to COL00 to COL44. Then it works.</font>

Thanks

Venkat.O

Read only

0 Likes
1,719

Hi,

This problem is due to passing Data Element in Fieldcatlog for a field.

for Eg.

*fieldcatalog-ref_fieldname = 'EBELN'.

  • fieldcatalog-ref_tabname = 'EKKO'

Remove above code for the field you are geting error.

Thanks & regards,

ShreeMohan

Read only

Former Member
0 Likes
1,720

Hi Chetan,

Make sure that all the letters are in caps:

''REUSE_ALV_GRID_DISPLAY'.

if not ,

DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE ,

PERFORM FIELD_CATALOG TABLES IT_FIELDCAT
USING: 'ITAB' 'WERKS' ' ' 'PLANT' 'X',
            'ITAB' 'MATNR' 'X' 'MATERIAL NO:' 'X',
             'ITAB' 'MAKTX' ' ' 'MATERIAL DESCRIPTION' 'X'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     I_CALLBACK_PROGRAM                = SY-CPROG  
 *    IS_LAYOUT                         = S_LAYOUT
     IT_FIELDCAT                       = IT_FIELDCAT[]
     IT_SORT                           = TB_SORT[]
*   IT_EVENTS                         =
    TABLES
      T_OUTTAB                         = ITAB[]

            .

FORM FIELD_CATALOG  TABLES   T_FIELD_CATALOG STRUCTURE IT_FIELDCAT
USING FP_TABNAME TYPE ANY
  FP_FIELDNAME TYPE ANY
  FP_KEY TYPE ANY
  FP_TEXT TYPE ANY
  FP_DO_SUM TYPE ANY.

  T_FIELD_CATALOG-TABNAME = FP_TABNAME.
  T_FIELD_CATALOG-FIELDNAME = FP_FIELDNAME.
  T_FIELD_CATALOG-KEY = FP_KEY.
  T_FIELD_CATALOG-SELTEXT_L = FP_TEXT.
  T_FIELD_CATALOG-DO_SUM = FP_DO_SUM .

  APPEND IT_FIELDCAT.
  CLEAR IT_FIELDCAT.
ENDFORM.

Thanks

Karthik

Edited by: Karthik R on Jul 16, 2009 5:09 PM

Read only

Former Member
0 Likes
1,719

Hi,

The problem could be any of these.

If you have used the FM 'REUSE_ALV_FIELDCATALOG_MERGE' and not manually merged the field catalog, then in your internal table declarations you are supposed to be using 'LIKE' and not 'TYPE'.


DATA: BEGIN OF t_materialdetails OCCURS 0,
           matnr LIKE mara-matnr,
           END OF t_materialdetails.

When you are passing the name of the internal table to your internal table in the FM 'REUSE_ALV_FIELDCATALOG_MERGE', use Caps enclosed in quotes. If you are manually merging then again the name of the internal table and the field names should be in caps enclosed in quotes.

In the FM 'REUSE_ALV_LIST_DISPLAY', if you are passing the name of the program directly in the field i_callback_program, the you gotto do so in caps enclosed between quotes or best you gotto pass the sy-repid.

Read only

Former Member
0 Likes
1,719

HI,

The problem is your fieldcatalog which you have created.

Check in your fieldcatalog the name of teh fields is same as the fieldname in your internal table.

Probably you might have mistyped some field name.

This results into this kind of problem and dump.

Regards,

Ankur Parab

Read only

venkat_o
Active Contributor
0 Likes
1,719

Hi Chetan, Possibilities <li>problem with fieldcatalog. <li>Check fieldcatalog internal table and output table whether both have the same fields. <li>Check fieldcatalog internal table whether field names and internal table names are in Capital letters. Thanks Venkat.O

Read only

Former Member
0 Likes
1,719

HI Chetan,

Since u r getting clear message in the Dump that Field Symbol is not assigned.

Please check where ver u r using FieldSymbol that is not initial for further data process.

In ur dump check at which point (line of source code)error happening and rectify it .

Hope this help.

If possible share ur Dump Message with us.

Thanks

Praveen