Skip to Content
avatar image
Former Member

Read data from local context and populate it into a Table

Hi,

I have created a small WDA that add/remove names, it reads the user input from a popup

box (when you click on ADD) and save it to my local context that is bounded to a table.

The data is gone every time I refresh the browser.

What are the options to populate my data from that local context into my table,

it would be helpful if you can show a sample code.

Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Mar 06, 2009 at 11:14 PM

    Data will be gone since its an internal table, that available only during the INSTANCE life time of your webdynpro component. Each time you refresh the browser new component gets instantiated.

    When you have data in the internal table, you can write it to DataBase table for persistence.

    within the webdynpro method ABAP statements can be free executed.

    all Insert update execute as usual, you can call Function Module that takes your internal table as input.

    these are few options available for persistence.

    Greetings

    Prashant

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 07, 2009 at 07:42 PM

    Hi Prashant

    I did create a function module and called it in my action, and now the data can be populated

    into the table. Do you know how can I store the data permanently in my context?

    as the data is gone every time i refresh the page

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Data in context cant be made permanant if you are going to refresh the browser, however what you can do is DECLARE

      1. a method in WD COMPONENT and call it within WDEXIT of the VIEW which will write all context data when applications view exits to some data base table in R/3.

      2. a method in WD COMPONENT and call it within WDDOINIT of you the VIEW,This method should initialize the context, from the previously stored data each time your component STARTS!!

      You can add little more logic to distinguish if WD Comp is INSTANTIATED for first time or its BEING REFRESH. But all this needs to be STORED in SOME R/3 Table where you can read and write to from your component.

      Greetings

      Prashant

  • avatar image
    Former Member
    Mar 09, 2009 at 07:15 PM

    Hi Prashant,

    Thanks for the useful information. I did create a BAPI service and then called it

    in my action after the user clicks ok and it worked just fine.

    Thanks a lot man

    Add comment
    10|10000 characters needed characters exceeded