Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete and write my Dtab with statement sy-datum and sy-zeit

Former Member
0 Kudos

Hi Experts,

I want to write on my Dtab "dtab1" the result of "itab1". "Itab1" is type table of dtab1.

1. How I can write on my dtab1?

2. How I can delete single rows from my dtab1, with statement dtab1-Field date less than sy-datum and dtab1-field time less than sy-zeit?

Regards,

Mike

4 REPLIES 4

Former Member
0 Kudos

1. modify dtab from itab.

2. delete dtab where date LT sy-datum

and time lt sy-uzeit.

Former Member
0 Kudos

hi mike

use commands like

INSERT dtab1 FROM TABLE itab1

for insert

DELETE FROM dtab1 WHERE KEY = your key field

for deelte

Regards

Deva

Former Member
0 Kudos

Hi Mike,

--> DELETE dtab1 from itab1.

--> DELETE FROM dbtab1

WHERE dtab1-date LT sy-datum

AND dbtab1-time LT sy-uzeit

Regards,

Chandra Sekhar

ingo_barschow
Explorer
0 Kudos

Hi Mike,

Dtab means database?

If there are records with the same key you have to use UPDATE instead of INSERT. If the records should be have new key-values, use INSERT.

MODIFY will do both: records with keys already there will be updated, new records will be inserted. But I dont like MODIFY, cause you dont know what really happens in the database. sy-dbcnt will also be set for udates and for inserts, so you dont know if the record is inserted or only updated.

Use DELETE similiar to SELECT:

DELETE dtab1 WHERE ( date LT sy-datum AND time LT sy-uzeit ).

Refer to online-syntax help by pressing F1 on UPDATE, INSERT, MODIFY, DELETE for details.

regards.