cancel
Showing results for 
Search instead for 
Did you mean: 

How to commit an insert in Web Dynpro

Former Member
0 Kudos

Hi.

I can get the data from the view, i.e., wa_flight is filled correctly, but the new line is not inserted in the sflight table.

  

method ONACTIONCADASTRAR_VOO .

  data: datanode type ref to if_wd_context_node,
        flighttab type standard table of sflight,
        wa_flight type line of flighttab.


  datanode = wd_context->get_child_node( 'FLIGHTDATA' ).


  datanode->get_attribute( exporting name = 'CARRID'
    importing value = wa_flight-carrid ).
  datanode->get_attribute( exporting name = 'CONNID'
    importing value = wa_flight-connid ).
  datanode->get_attribute( exporting name = 'FLDATE'
    importing value = wa_flight-fldate ).
  datanode->get_attribute( exporting name = 'PRICE'
    importing value = wa_flight-price ).


  insert into sflight values wa_flight.

  commit work.

endmethod.

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sorry folks.

This code is actually working. I don't know if I were checking at the wrong table or client.

These two lines:

flighttab type standard table of sflight,

wa_flight type line of flighttab.

can be replaced by:

wa_flight type sflight.

Regards,

Leandro.

Answers (0)