Skip to Content

Hou to bind a char value of bapi to check box of a UItableelement

Hi all,

I have a bapi which returns a table where one of the field is char(1), I should bind this field with a check box in the UItableelement. When i try to change the celleditor to check box it raises an error as select an attribute of type boolean. how to solve it.

Also if we can change the char data type to boolean in the bapi table my problem is solved.

Thanks in advance.

problem solving reply is awarded.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 06:07 PM

    Sai,

    you should select boolean only for checkbox. so you can pass only boolean value for check box. Change the field to boolean on the backend.

    /Raj.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Raj,

      As I said I have 19 rows in the backend(Ztable) where 4 rows values vill be "X", in the view(2 columns checkbox, text view) I could get all the 19 rows the textview is displayed well but the check box are all unchecked.

      when I select a particular row then the value is displayed as checked if it is "X" at backend and viceversa. i.e., the 4 rows values are displayed checked only when we select them.

      Regards ,

      Sai

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 06:12 PM

    Add a (calculated, readOnly=false, boolean) attribute "Checked" to the context node.

    Assuming the char(1) attribute is named "X", implement the get and set methods like

    boolean getChecked(I<Node>Element element)
    {
      return "x".equalsIgnoreCase( element.getX() );
    }
    
    void setChecked(I<Node>Element element, boolean value)
    {
      element.setX(value ? "x" : " ");
    }
    

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Armin,

      I didn't get what you are saying, See my requirement is,

      1) I would get a table with 2 columns from bapi.

      2) 1st field is fname which is binded to textview.

      3) 2nd field is check(char 1) which should be a check box.

      4) I should display the table contents for editing, i.e., user should allowed to select the required "fname" with the corresponding "check" field checked.

      5) finally these updated values are to be stored back again.

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.