Skip to Content
avatar image
Former Member

Hiding and Displaying ALV

Hi Experts,

I have a requirement to hide a ALV while in a display screen.

when i enter some data in search criteria, the Alv should be displayed with the data otherwise

it should be hidden...

Kindly suggest and help.

Thanks in advance.......

Best Regards,

Sahil

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Oct 16, 2008 at 05:46 AM

    put your alv (TABLE view of alv interface controller) in a viewcontainerUIelement and control the visibility of the viewcontainerUIelement on the action when you enter the search criteria

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 05:47 AM

    Hi,

    Depending on your condition .

    if search is sucessful

    Fire the plug to display the ALV in other view with the table contents

    Else

    Throw the message (Error/Sucess) and set the visiblity of the table to false ie not be shown/displayed

    Regards

    Lekha

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 07:15 AM

    Hi Sahil,

    Change the property visible of viewContainerElement dynamically that means when you press search button change the value of the property visible to visible.

    check the below code and procedure.

    First change the property visible of viewContainerElement to 'none'.

    Create a context attribute visible of type WDUI_VISIBILITY.

    populate this attribute in the eventhandler method of button with CL_WD_INPUT_FIELD=>E_VISIBLE-VISIBLE.Then bind this attribute to the visible property of your view container element in the layout.thats all you will the input fields with enable.

    check this code.

    DATA lo_el_context TYPE REF TO if_wd_context_element.

    DATA ls_context TYPE wd_this->element_context.

    DATA lv_visible LIKE ls_context-visible.

    • get element via lead selection

    lo_el_context = wd_context->get_element( ).

    lv_visible = CL_WD_INPUT_FIELD=>E_VISIBLE-VISIBLE.

    CALL METHOD LO_EL_CONTEXT->SET_ATTRIBUTE

    EXPORTING

    VALUE = lv_visible

    NAME = 'VISIBLE'

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 09:27 AM

    Hi experts,

    Thanks a ton for your help and support.

    its working now....:))

    Add comment
    10|10000 characters needed characters exceeded