Skip to Content
avatar image
Former Member

Modify database table

Hi all,

Pls give me advise. i'm just working on and new to WebDynpro. i want to modify the database table which allows user to change or insert the value from UI screen.

In case the program allows user to select the multiple lines on the table by tick on the check boxes in front of the line then the program will store the check box value on the table. The table contains one more field which data type is 1 character. I want the program to store 'X' value on this field.

On Layout tab, I've binded the element with selected table which let the first field as a check box. And i provide a button for receiving the parameters from user. Pls advise me on this.

Thanks for your effort.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 08, 2008 at 09:18 AM

    hi Suman,

    thanks for response. pls clarify a little.

     modify table <table name> from itab. 

    how can i refer to the using element? on layout tab, it has shown as VIEWNAME.NODENAME.FIELDNAME on a table's field but it cannot be refer to the using table, right?

    so pls advise me that how can i know the name of the itab/refer to itab which receive the data on the screen then i would place the name of the itab on the code.

    Thank you so much : )

    Peerasit

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      check this code...

      data:
            node_sflight           type ref to if_wd_context_node,
            elem_sflight           type ref to if_wd_context_element,
            lt_elements            type WDR_CONTEXT_ELEMENT_SET,
            stru_sflight           type if_main=>element_sflight_node,
            it_flights             type if_main=>elements_sflight_node.
      
      *   navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
          node_sflight_node = wd_context->get_child_node( name = if_main=>wdctx_sflight_node ).
      
      *   get element via lead selection
      *    elem_sflight_node = node_sflight_node->get_element(  ).
           lt_elements = node_sflight->get_elements( ). 
           
      *   get all declared attributes
          loop at lt_elements into elem_sflight.
          elem_sflight->get_static_attributes(
            importing
              static_attributes = stru_sflight ).
              
          append stru_sflight to it_flights.
          endloop.
          
          modify ZSFLIGHT99 from table it_flights.
          if sy-subrc eq 0.
          
          endif.

      thanks,

      suman

  • avatar image
    Former Member
    Sep 08, 2008 at 06:42 AM

    Hi,

    Populate an internal table with data and then call a BAPI to update the data base table. if you are updating standard tables.

    Else create a RFC function module and write the Update/Change to the Table logic then call this Function module in your application.

    Thanks

    suman.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 08, 2008 at 06:52 AM

    so, how i know which line of the table been selected?

    thanks in advance : )

    Peerasit

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 08, 2008 at 08:52 AM

    hi there,

    can i modify the table's data directly without BAPI/RFC?

    if the system allows, pls advise how to do it.

    Thanks in advance,

    Peerasit

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      for standard tables you have to modify using BAPI's.Because you have to update to update the data of fields in other tables too.

      If it is a custom table no need to write any RFC's in your application itself you can write the logic to updates the table.

      modify table <table name> from itab.

      Thanks

      Suman

  • avatar image
    Former Member
    Sep 08, 2008 at 04:06 PM

    hi Suman,

    it works mann!! thank you so much for your effort. : )

    Thanks again,

    Peerasit

    Add comment
    10|10000 characters needed characters exceeded