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

Button in Table view

Hi Gurus,

I have two columns(date and status) in table view in WDP for Abap application. In the corresponding source table, if date is 00/00/0000, then I need to populate an approve button in the status column of table view, otherwise the actual date has to be populated from the table. After populating the approve button, if its clicked the system date should be displayed in the date column and the approve button should be disappeared.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 04:18 PM

    You have not mentioned what you want in the button column when the date is some valid date. I assume you dont want anything in that case. Do some minor changes if that is not the case.

    In your context node, have two attributes, date of type DATS and visible type char01. With the help of your API, get the node data in an internal table. Loop through this, and when date = 00/00/0000, set the visible attribute to true, else set it to false. So your button will be visible only if the date is initial.

    In your UI, create a table with the date column bound to the date attribute. Create another column with the button as cell editor, and bind the 'visible' property of the button to the Visible context attribute. Statically define the button text as 'Approve'. In the onClick event of the button, use the following code:

    data: lr_element type ref to if_wd_context_element.

    lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

    lr_element->set_attribute( name = 'DATE' value = sy-datum ).

    lr_element->set_attribute( name = 'DATE' value = abap_false ).

    This will set the date field to the current date and also make the button invisible.

    Hope this helps.



    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.