cancel
Showing results for 
Search instead for 
Did you mean: 

insert statement

Former Member
0 Kudos

Dear experts,

this is my code:

types: begin of it_worklist,

posid type prps-posid,

post1 type prps-post1,

disptextw1 type zca_ts_worklist-disptextw1,

disptextw2 type zca_ts_worklist-disptextw2,

neulstar type zca_ts_lstar_u-neulstar,

pspnr type prps-pspnr,

rproj type zca_ts_worklist-rproj,

lstar type zca_ts_worklist-lstar,

ktext type zca_ts_worklist-ktext,

endda type zca_ts_worklist-endda,

neuanlage type boolean,

end of it_worklist.

data it2_worklist type table of it_worklist.

data wa_worklist type table of it_worklist.

DATA lo_nd_tabelle_schreiben TYPE REF TO if_wd_context_node.

DATA lo_el_tabelle_schreiben TYPE REF TO if_wd_context_element.

DATA ls_tabelle_schreiben TYPE wd_this->element_tabelle_schreiben.

  • navigate from <CONTEXT> to <TABELLE_SCHREIBEN> via lead selection

lo_nd_tabelle_schreiben = wd_context->get_child_node( name = wd_this->wdctx_tabelle_schreiben ).

  • get element via lead selection

lo_el_tabelle_schreiben = lo_nd_tabelle_schreiben->get_element( ).

  • get all declared attributes

lo_nd_tabelle_schreiben->get_static_attributes_table( importing table = it2_worklist ).

Now i want to insert the lines from it_worklist into a db tab where it_worklist-neuanlage is abap_true.

Can you please help me with the Statement please ?

Thank you

Best regards

René

Edited by: René Hölterling on Oct 29, 2008 12:03 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

It is not appropriate to ask questions about how to structure your SQL statements in the WDA forums. I realize that this coding is inside a WDA, but it is still just normal ABAP stuff. This question belongs in one of the basic ABAP forums. I am locking this thread.

uday_gubbala2
Active Contributor
0 Kudos

Hello Rene,

First try to get all the records where it_worklist-neuanlage is abap_true into a final internal table and then you can try pass this table to a BAPI for updating the database. It is even possible to access the database via an ABAP SELECT. However, this leads to a mixing between flow logic and business logic and should therefore be omitted. But if you are however just trying out some tasks in your sandbox then you can use the below query:

modify dbtab from table it_final.

Regards,

Uday

Former Member
0 Kudos

Hi

Use the following piece of code

Delete it_worklist where neuanlage = 'X'.
modify dbtab from table it_worklist.

Hope this helps U

Regards

Tamil

Former Member
0 Kudos

Sorry but i want to insert the lines, not delete them.

best regards

René