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: 

reuse_alv_grid_display dump

Former Member
0 Kudos

Hi Experts,

I am using FM "reuse_alv_grid_display", when I am executing with a my report in output the fieldcat values are not displaying, I checked with debugger,fieldcat values are coming properly but in output I am not getting column header.

When I am executing the report in testing system it giving dump "Field symbol not yet been assigned".

Please check the screenshots and help me to get out of this.

Header values are not displayed in Dev system but debugger mode it is showing

Debugging mode:

Same report dump in testing system

Code:

PERFORM build_fieldcat USING: 'Shipping Plant'     1  4  '' 'M',

                               'Receiving Plant'    2  8  '' 'M',

                               'Shipment Date'      3  10 '' 'M',

                               'Shipment Time'      4  6  '' 'M',

                               'Shipment No'        5  10 '' 'M',

                               'Truck No'           6  20 '' 'M',

                               'Transporter Name'   7  20 '' 'M',

                               'Delivery No'        8  10 '' 'M',

                               'Invoice No'         9  10 '' 'M',

                               'LR No'              10 20 '' 'M',

                               'LR Date'            11 10 '' 'M',

                               'LR Time'            12 6  '' 'M',

                               'LR Amount'          13 16 '' 'M',

                               'LR Weight'          14 18 '' 'M',

                               'Depot in date'      15 10 '' 'M',

                               'Depot in time'      16 6  '' 'M',

                               'No of packs taken'  17 10 '' 'M'.

FORM build_fieldcat USING field_name TYPE slis_fieldname

                           col_pos    TYPE sy-cucol

                           outputlen  TYPE dd03p-outputlen

                           edit       TYPE c

                           ddictxt    TYPE c.

wa_fieldcat-fieldname = field_name.

wa_fieldcat-col_pos   = col_pos.

wa_fieldcat-outputlen = outputlen.

wa_fieldcat-edit      = edit.

wa_fieldcat-ddictxt   = ddictxt.

APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.

ENDFORM.                    " BUILD_FIELDCAT

-----------------------------------------------------------------------

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

  EXPORTING

    i_callback_program                = sy-cprog

    i_callback_user_command           = 'USER_COMMAND'

    i_callback_top_of_page            = 'TITLE'

    is_layout                         = gd_layout

    it_fieldcat                       = it_fieldcat

    i_save                            = ' '

   TABLES

     t_outtab                          = it_final

  EXCEPTIONS

    program_error                     = 1

    OTHERS                            = 2.

IF sy-subrc = 1.

* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

*         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   MESSAGE 'Program Error' TYPE 'E'.

   ELSEIF sy-subrc = 2.

     MESSAGE 'Others' TYPE 'E'.

ENDIF.


1 ACCEPTED SOLUTION

Former Member
0 Kudos

Thanks Experts,

It is working fine now....

but I am not getting the Logo now

in SE78 I have imported the BMP image and i am using that name in my report but sttill I am not getting the logo in header..

Code:

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

     EXPORTING

      it_list_commentary       = it_header

      i_logo                   = 'NEROLAC'.

Please help me with that

8 REPLIES 8

nabheetscn
Active Contributor
0 Kudos

Your field catalog is incorrect. You need to pass the fieldname not the description.

wa_fieldcat-fieldname = field_name.---> FIELDNAME line BUKRS etc

wa_fieldccat-coltext_s,coltext_m etc will contain label

wa_fieldcat-col_pos   = col_pos.

wa_fieldcat-outputlen = outputlen.

wa_fieldcat-edit      = edit.

wa_fieldcat-ddictxt   = ddictxt.

APPEND wa_fieldcat TO it_fieldcat.

venkat_aileni
Contributor
0 Kudos

Hi-

wa_fieldcat-fieldname = field_name. -> Here pass field name like MATNR

Add another field:

wa_fieldcat-seltext_l/seltext_s/seltext_m = 'Material Number'. -> This will add field description.

-Venkat

Former Member
0 Kudos

wa_fieldcat-fieldname = field_name.

wa_fieldcat-col_pos   = col_pos.

wa_fieldcat-outputlen = outputlen.

wa_fieldcat-edit      = edit.

wa_fieldcat-ddictxt   = ddictxt.

This is wrong, pass the values.

Example

FIELDCATALOG-FIELDNAME   = 'CARRID'.
  FIELDCATALOG-SELTEXT_M   = 'Airline Code'.
  FIELDCATALOG-COL_POS     = 0.
  APPEND FIELDCATALOG TO FIELDCATALOG.
  CLEAR  FIELDCATALOG.

Former Member
0 Kudos

Thanks Experts,

It is working fine now....

but I am not getting the Logo now

in SE78 I have imported the BMP image and i am using that name in my report but sttill I am not getting the logo in header..

Code:

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

     EXPORTING

      it_list_commentary       = it_header

      i_logo                   = 'NEROLAC'.

Please help me with that

0 Kudos

Are you calling this code in subroutine TITLE( the top of page one or not). If not move it there it will write

0 Kudos

Logo should be uploaded into application server using transaction 'OAER'.

  1. Go to Transaction OAER,
  2. Give Class Name as PICTURES
  3. Class type as OT
  4. Object Key as the name of the Object u want to specify
  5. Upon execution you would be prompted to give the file path details. Just upload which ever logo u want to display
  6. Now you can use the same name in your ALV FM

In your ALV program, you need to have event for TOP_OF_PAGE, and also this works only in case of Grid not in ALV LIST.

Look at the sample code to display LOGO.

**********************

call function 'REUSE_ALV_GRID_DISPLAY'
exporting
  i_callback_program = i_repid
  it_fieldcat = header
  is_layout = gt_layout
  i_callback_top_of_page = 'TOP-OF-PAGE1'
  i_grid_title = xyz
  it_sort = gt_sort[]
  i_default = 'X'
  i_save = 'U'
  is_variant = gt_variant
  it_events = gt_events
tables
  t_outtab = t_output.

*****************

*-------------------------------------------------------------------*

* Form TOP-OF-PAGE1

*-------------------------------------------------------------------*

form top-of-page1.

data: header type slis_t_listheader,
      wa     type slis_listheader.

* TITLE AREA

wa-typ = 'S'.
wa-info = text-h04.
append wa to header.

wa-typ = 'S'.
write sy-datum to wa-info mm/dd/yyyy.

concatenate text-h03 wa-info into wa-info separated by space.
append wa to header.

wa-typ = 'S'.
concatenate text-h02 sy-uname into wa-info separated by space.
append wa to header.

wa-typ = 'S'.
concatenate text-h01 sy-repid into wa-info separated by space.
append wa to header.

********" LOGO

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = header

i_logo = 'ENJOYSAP_LOGO'.

*********" LOGO

endform.

Here in TOP-OF-PAGE form it will show you the Prog name,Date, User Name.

0 Kudos

Yes I am calling this code in TITLE (top of page one). even it is not showing in output

Please check the se78 attributes .... its ok or not.....

0 Kudos

It is working fine

But still I am getting same dump in quality system