Skip to Content
author's profile photo Former Member
Former Member

Check box value

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2012 at 11:40 AM

    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 ).


    checkbox.JPG (75.6 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 01, 2012 at 04:44 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2012 at 11:51 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.