cancel
Showing results for 
Search instead for 
Did you mean: 

Defaulting checkbox checked parameter

Former Member
0 Kudos

Hi Experts,

We have an WD ABAP application in which a check box is present which when checked stored some value 'CART' in the data base when unchecked store 'SLIP' in the data base.

Now we have to default the checkbox as checked on loading the view so now no manula checking of checkbox.

I have setted the node attribute binded with of checkbox checked event as 'X', now on loading the ckeckbox shows checked but the value in database is of unchecked value that is 'SLIP'

When we are again unchecking and checking it manually it is saving correct value in database that is 'CART'

Please let me know how to default the checked parameter of checkbox so that it is equal to manual checking.

Thanks!

Piyush

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member463524
Contributor
0 Kudos

Hi Piyush,

Please check before update in database what is the value in the check box.

Corresponding to the check box value update the database.

If it does not solves the issue, please post your database update code corresponding to check box value.

Regards,

Meera

gill367
Active Contributor
0 Kudos

Hi piyush,

I guess because you may be doing the update in the database in ontoggle event.

and by default it wont be triggered.

so you either have to manually to do it for the first time or you need to call the eventhandler in the init menthod.

to update the database.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi,

Thanks for reply!

There is nothing on toggle event, there is a button 'SAVE' which is in FPM when pressed SAVE the saving part done in data base.

So in this case what is the dofference between setting the value of checkbox as 'X" programatically and manualy checked the checkbox.

Thanks!

Piyush

gill367
Active Contributor
0 Kudos

Put a breakpoint and check the functionality of the save eventhandler.

see from where it is referring to the value of checkbox.

and wt is value in the initial case

thanks

sarbjeet singh

Former Member
0 Kudos

If anybody else can put some light on my question above?

Thanks!

Piyush

former_member184578
Active Contributor
0 Kudos

Hi.,

In WDDOINIT method., u can set the check box checked.. use set_attribute( ) method., and set it.,

*   set single attribute
    lo_el_context->set_attribute(
      name =  `CHECK`         " attribute name in context to which u binded the check box checked.
      value =  'X').

hope this helps .,

Thanks & Regards

Kiran

Former Member
0 Kudos

I already have done it and the on page load the checkbox is checked but the value which sould be strored in data base is not checked value it is associated with unchecked one.

Thanks!

Piyush

Former Member
0 Kudos

Hi,

You need to modify database table, simply by checking at webdynpro it wont update at table level.

Try to find any FM to update that table.

Thanks,

Venkat

Edited by: venkat1011 on May 16, 2011 9:51 AM

gill367
Active Contributor
0 Kudos

You need to dig into the method which updates the database table based on the checkbox status..

its all related to logic.

You need to find out the logic where the update is happening and check out its condition.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi,

Nothing has changed in the logic, the only difference is, previously user manually checked the checkbox and table entry was correct, now I programatically defaulted the checkbox checked but the table entry is not correct.

I manually set he context node attribute associated with the checkbox is 'X' so that on page the checkbox is coming checked but the value is not updated in database.

Thanks!

Piyush

Edited by: srivastavapk on May 18, 2011 6:36 AM

Former Member
0 Kudos

Hi Srinivas,

Are you updating database table??

If not update database related table then only it update.

Cheers,

Kris.