Skip to Content

webdynpro - not displaying when table is empty

hi

i am creating a webdynpro which contains a table - i did it in the component controller

i want this table to be displayed only if its not initial

is it possible ?

thanks

Ami

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 21, 2009 at 12:47 PM

    Hi,

    You can create a context attribute (type com.sap.tc.webdynpro.progmodel.api.WDVisibility) and bind it to the "visible" property of the table. Then you just have to set this variable to WDVisibility.NONE if the table is empty.

    EDIT : sorry, didn't realize you use WD ABAP. Here's a tutorial for WD ABAP : http://wiki.sdn.sap.com/wiki/display/WDABAP/SimpleapplicationtochangepropertiesofUIElementsduringruntimeinWebDynpro+ABAP

    Regards,

    Pierre

    Edited by: Pierre DOMINIQUE on Jul 21, 2009 3:00 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 21, 2009 at 12:53 PM

    Hi,

    Have a context attribute DISPLAY_TABLE type WD_BOOLEAN and map this to the table property VISIBLE.

    Now just change the context attribute DISPLAY_TABLE value to X or SPACE based on the number of records in the table. Sample code is below.

    if table_data is not initial.
      node_ref->set_attribute( name = 'DISPLAY_TABLE' value = 'X').
    endif.

    Regards,

    Manne.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 21, 2009 at 12:58 PM

    Hi,

    Under Context,create attribute VISIBILE of type wdui_visibility.

    Bind the context attribute to the table visible property.

    • navigate from <CONTEXT> to <ND_nodename> via lead selection

    lo_nd_nd_nodename = wd_context->get_child_node( name =

    wd_this->wdctx_nd_nodename ).

    • get element via lead selection

    lo_el_nd_nodename = lo_nd_nd_nodename->get_element( ).

    • get all declared attributes

    lo_nd_nd_nodename->get_static_attributes_table(

    IMPORTING

    table = lt_nd_nodename ).

    Now set the visibility as

    if lt_nd_nodename is not initial.

    • set single attribute

    lo_el_nd_<visibilitynode>->set_attribute(

    EXPORTING

    name = `VISIBLE`

    value = '02' ). "visible

    else.

    • set single attribute

    lo_el_nd_<visibilitynode>->set_attribute(

    EXPORTING

    name = `VISIBLE`

    value = '01' ). "Invisible

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 22, 2009 at 06:26 AM

    Hi..

    Follow this step to display the table only if it has values....

    1) You will have table context which will be binded to your table.. get the table vaules using....

    • get all declared attributes

    lo_nd_table->get_static_attributes_table(

    IMPORTING

    table = lt_nd_table ).

    2) Now create a attribute called table_visible and type is WDUI_VISIBILITY.

    Bind that attribute with the table visible property.

    Now check the condition.

    if lt_nd_table is inital.

    lo_el_nd_table-table_visible = if_wdl_core=>visibility_none.

    else.

    lo_el_nd_table-table_visible = if_wdl_core=>visibility_visible.

    • Bind the Table Values

    lo_nd_table->bind_table( lt_nd_table ).

    endif.

    Hope this will help you.

    Regards

    Raja

    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.