cancel
Showing results for 
Search instead for 
Did you mean: 

Modify database table

former_member300754
Participant
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member300754
Participant
0 Kudos

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

Former Member
0 Kudos

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

Answers (4)

Answers (4)

former_member300754
Participant
0 Kudos

hi Suman,

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

Thanks again,

Peerasit

former_member300754
Participant
0 Kudos

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

Former Member
0 Kudos

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

former_member300754
Participant
0 Kudos

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

thanks in advance : )

Peerasit

Former Member
0 Kudos

Already you have a key fields in your Internal table.so it will modify accrodingly..

Thanks

Suman

Former Member
0 Kudos

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.