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

dynamic programming

Hi All,

I'd like to create a dynamic table in a View of a webdynpro

There will always be a table but the column will vary...

Could you please help me in the coding of the WDDOINIT method to add the column at runtime...

Thanks in advance!

Regards

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Oct 09, 2008 at 10:17 AM

    Hi Stephan,

    Just trying to take a guess at this... Are you trying to display different number of columns in the table so as to display 1 for each day of a month? Thought to ask so coz there have been many posts relating to this earlier where the developers wanted to create different columns (depending up on the month selected) representing each day of the month. Kindly go through [this|making-the-certain-columns-as-disable] thread to get an idea of the approaches they had followed.

    Kindly pay attention to what Thomas Jung has said at the end of this thread, "I don't see why you need dynamic logic at all. Why do the remove_column or add the columns dynamically? Just add all the columns at design time. Then use data binding on the columns' Visible property. Control which columns are visible by manipulating the context attribute and not the UI elements themselves. You should always strive to use context bindings for such dynamic manipulation first and only reserve the programatic approach as a last resort."

    Regards,

    Uday

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 09, 2008 at 11:27 AM

    If you table will be really dynamic - like totally different data dictionary objects as the source - then consider using the ALV instead of the table. The ALV already has all the logic to adjust its structure to match the context node it is bound to. You can use dynamic context creation and dynamic binding assignment to the ALV. That is how I did the SE16 WDA example - which naturally has to be really dynamic.

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bf20e84f-0901-0010-fe9e-91d100013a59

    But if you are just talking about hiding or showing a few columns with the same structure, then the adivce I had given and was quote on would be my suggestion. Just go with context attributes bound to the visible property of the column. The lowest cost approach (from resources, coding and maintenance standpoint) is to do such dynamic manipulation via context bindings rather than the WDDOMODIFYVIEW (which tends to be overused and abused in my opinion).

    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.