Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8338

Webdynpro ALV UI element property binding to context attribute property

$
0
0


Hi Experts,

 

     I have this requirement to create a webdynpro applicaiton with more than 40 fields which are editable or read-only based on the data it contains.

The usual method of having attribute of type wdy_boolean isnt applicable as i would need to create attributes for each field (40 more attributes).

 

i read from the SAP site but dint understand it completely.

 

in my wddoinit, i have written the below code

  lo_column = lo_column_settings->get_column('/BIC/GBRECCOM').

  CREATE OBJECT lo_input_field
    EXPORTING
      value_fieldname = '/BIC/GBRECCOM'.

  lo_input_field->set_read_only_fieldname( value = '/BIC/GBRECCOM:READ_ONLY' ).
  lo_column->set_cell_editor( lo_input_field ).

 

after that in my Search event method ( method which populates my alv with data):

 

Internal table lt_tab1 contains the data from the database

 

loop at lt_tab1

     into ls_tab1.

  lo_nd_dashboard->bind_structure(
    EXPORTING
      new_item = ls_tab1
      set_initial_elements = abap_false
   RECEIVING
     element = lo_el_dashboard ).

 

  ls_attribute_properties-attribute_name = '/BIC/GBRECCOM'.
      ls_attribute_properties-visible = abap_true.
      ls_attribute_properties-enabled = abap_true.

      IF open_flag EQ 'X'.
       ls_attribute_properties-read_only = abap_false.
      ELSE.
        ls_attribute_properties-read_only = abap_true.
      ENDIF.

      INSERT ls_attribute_properties
        INTO TABLE lt_attribute_properties.

    lo_el_dashboard->set_attribute_props_for_elem(
    EXPORTING
      properties = lt_attribute_properties ).

    lo_el_dashboard->set_attribute_property(
    EXPORTING
    attribute_name = '/BIC/GBRECCOM'
    property = lo_el_dashboard->e_property-read_only
    value          = 'X' ).

 

i am not sure how do i do this. please help .. its very urgent and important.

 

i found this link.. but dint understand it completely.

 

http://wiki.scn.sap.com/wiki/display/WDABAP/SAP+List+Viewer+-+ALV

 

REgards,

Tashi

 


Viewing all articles
Browse latest Browse all 8338

Trending Articles



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