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: 

Trafic Light at the header of ALV

Former Member
0 Kudos

Dear All,

Can we add traffic light (Symbol) at the header of the window? I want the header of ALV GRID to show traffic light and corresponding description.

Please can you suggest anything on this?

Thanks and regards,

Atanu

4 REPLIES 4

Former Member
0 Kudos

Hi

Use Include <symbols> to get the traffic light symbol.

Regards,

Vishwa.

Former Member
0 Kudos

Hi Atanu

Chk below link.

http://saptechnical.com/Tutorials/ALV/Lights/ALV.htm

Regards,

Syf

0 Kudos

Dear Syf,

Thanks for your suggestion. The objective is to write traffic light at the header, not at the detailed report.

Thanks and regards,

Atanu

Former Member
0 Kudos

Hi,

This functionality can be possible by defining two containers one docking container and another one custom container.

In first docking container we need to implement the traffic lights as a top of page.

and List we need to call in custom container down the docking container.

Like the below

*create a docking container and dock the control at the botton
  CREATE OBJECT g_cont_dock
      EXPORTING
       dynnr     = c_9000
       extension = 260
       side      = cl_gui_docking_container=>dock_at_bottom.
*
* Call the Custom Container in ALVGRID
  CREATE OBJECT g_alvgrid
    EXPORTING
      i_parent          = g_cont_dock
    EXCEPTIONS
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      others            = 5.
  IF sy-subrc <> 0.
*    MESSAGE ID '00' TYPE 'E' NUMBER '208'
*              WITH 'Error While Preparing Alv Grid'(t03).
  ENDIF.
*
* Defining Container for Custom Controls in the Screen Area
  CREATE OBJECT g_custom_cont
    EXPORTING
      container_name              = c_cont
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5
      others                      = 6.
  IF sy-subrc <> 0.
*    MESSAGE ID '00' TYPE 'E' NUMBER '208'
*              WITH 'Error While Defining Container'(t02).
  ENDIF.
*
* Call the Custom Container in ALVGRID
  CREATE OBJECT g_alvgrid1
    EXPORTING
      i_parent          = g_custom_cont
    EXCEPTIONS
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      others            = 5.
  IF sy-subrc <> 0.
*    MESSAGE ID '00' TYPE 'E' NUMBER '208'
*              WITH 'Error While Preparing Alv Grid'(t03).
  ENDIF.

and Traffic light variable needs to be included in final structure like below

BEGIN OF t_log,
         ebeln      TYPE ekko-ebeln,        " Contract
         ebelp      TYPE ekpo-ebelp,        " Line Item
         msgtyp     TYPE bdcmsgcoll-msgtyp, " Message Type
         messg      TYPE mcmailobj-objline, " Message
         *light(04) TYPE c,                  " Traffic Light*
        END OF t_log.

Light values needs to be changed like below while populating the final table

c_0a(04)    TYPE c VALUE '@0A@', " Red
            c_09(04)    TYPE c VALUE '@09@', " Green
            c_08(04)    TYPE c VALUE '@08@', " Yellow

It will work fine.

Regards,

Nandha