Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8540

reuse_alv_grid_display particular rows must be disable while displaying

$
0
0

Hi Experts,

 

I have a requirement for displaying alv with some rows in disabled mode.

 

I am displaying many line items with some columns editable for create button based on some inputs. once the record has been created. if the user provides the same input again I need to show that line items in disable mode.

 

I have used the below coding, but it is not working for me. Please check and provide me solution and it is bit urgent.

 

TYPE-POOLS: slis.

 

DATA: it_sort TYPE  slis_t_sortinfo_alv,

       wa_sort LIKELINEOF it_sort.

 

DATA: it_fieldcat TYPE slis_t_fieldcat_alv,

       wa_fcat LIKELINEOF it_fieldcat.

 

DATA: BEGINOF it_flight OCCURS0,

       carrid LIKE sflight-carrid,

       connid LIKE sflight-connid,

       style TYPE lvc_t_styl, "FOR DISABLE

      ENDOF it_flight.

DATA: wa_flight LIKELINEOF it_flight.

DATA: layout TYPE lvc_s_layo.

DATA: o_grid TYPEREFTO cl_gui_alv_grid.

 

START-OF-SELECTION.

 

   SELECT carrid connid FROM sflight

   INTO CORRESPONDING FIELDSOFTABLE it_flight

   UPTO20ROWS.

 

"{ FOR DISABLE

   DATA: ls_edit TYPE lvc_s_styl,

         lt_edit TYPE lvc_t_styl.

   "} FOR DISABLE

 

wa_fcat-seltext_l = 'CARRID'.

   wa_fcat-fieldname = 'CARRID'.

   wa_fcat-tabname = 'IT_FLIGHT'.

   wa_fcat-edit = 'X'.

   wa_fcat-outputlen = '10'.

   APPEND wa_fcat TO it_fieldcat.

   CLEAR wa_fcat.

 

   wa_fcat-seltext_l = 'CONNID'.

   wa_fcat-fieldname = 'CONNID'.

   wa_fcat-tabname = 'IT_FLIGHT'.

   wa_fcat-edit = 'X'.

   wa_fcat-outputlen = '10'.

   APPEND wa_fcat TO it_fieldcat.

   CLEAR wa_fcat.

 

LOOPAT it_flight INTO wa_flight.

     IF wa_flight-connid = '17'. "AND wa_flight-connid = '17'.

       ls_edit-fieldname = 'CONNID'.

       ls_edit-style = cl_gui_alv_grid=>mc_style_disabled.

APPEND ls_edit TO wa_flight-style.

     MODIFY it_flight FROM wa_flight TRANSPORTING style.

ENDLOOP.

 

CALLFUNCTION'REUSE_ALV_GRID_DISPLAY'

     EXPORTING

       i_callback_program          = sy-repid

*      i_callback_html_top_of_page = 'TOP_OF_PAGE'

       it_fieldcat                 = it_fieldcat

     TABLES

       t_outtab                    = it_flight

     EXCEPTIONS

       program_error               = 1

       OTHERS                      = 2.

   IF sy-subrc NE0.

     MESSAGEID sy-msgid TYPE sy-msgty NUMBER sy-msgno

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

   ENDIF.

 

I am getting the output in enable mode only

 

enable row.JPG

Thanks & Regards

Venkat


Viewing all articles
Browse latest Browse all 8540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>