cancel
Showing results for 
Search instead for 
Did you mean: 

Check box value

Former Member
0 Kudos

Hi ,

I am working on Webdynpro application for Cpro.

I have one check box there , i need to save the  value'  X' if the checkbox is checked otherwise blank into the table.

I write the below code on the 'On toggle' even.

method ONACTIONENTER .

  DATA lr_change_mngr   TYPE REF TO cl_dpr_ui_change_manager.

  DATA lv_value  TYPE string.

  lv_value = wdevent->get_string( name = 'ID' ).

* trigger changemanager

  cl_dpr_ui_event_source=>start_report_change_events( ).

endmethod.

but the respective value based on the checkbox status not updating into the database.

Please help.

Thanks,

Akhilesh Bhagat.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member230486
Contributor
0 Kudos

Hi Akhilesh,

1) You have to take one attribute under the node for Checkbox which is of type ABAP_BOOL.

2) Then bind this attribute with your UI element which you took.

3) Read the value of the checkbox using Get_Attribute( ) method and write the modify statement to update into the data base.

Former Member
0 Kudos

Hi ,

create on attribute in context....

then follow below screen.

then follow bellow sample code.

*  DATA lo_el_context TYPE REF TO if_wd_context_element.

*  DATA ls_context TYPE wd_this->element_context.

   DATA lv_resub TYPE wd_this->element_context-resub.

* get element via lead selection

   lo_el_context = wd_context->get_element( ).

* @TODO handle not set lead selection

   IF lo_el_context IS INITIAL.

   ENDIF.

* get single attribute

   lo_el_context->get_attribute(

     EXPORTING

       name =  `RESUB`

     IMPORTING

       value = lv_resub ).

Former Member
0 Kudos

1. Your check box will be linked to a context attribute. You can get the value using GET_ATTRIBUTE method. ( Put a break point and check if the value is really coming to your variable )

2. How are you using this value in your change maker method? I don't see any parameters.