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: 

Needs to add DateTime Stamp in my table records

Former Member
0 Kudos

Hi SAP Gurus

I wanted to add a field in my table that will capture DateTime stamp for records creation. Could u pls let me know how can i do that.

Thanks....

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Please add fields Created On, Time Created of type data element ERFDATE (Created On) and ERFTIME (Time Created) in your table. Pass sy-datum to ERFDATE when you are creating the record and SY-UZEIT to ERFTIME field.

5 REPLIES 5

Former Member
0 Kudos

Please add fields Created On, Time Created of type data element ERFDATE (Created On) and ERFTIME (Time Created) in your table. Pass sy-datum to ERFDATE when you are creating the record and SY-UZEIT to ERFTIME field.

0 Kudos

Thanks for all for helping me in resolving the issue. I gave the points accordingly to all.

Just wanted to let u know that i found Chandravadan's solution coz it looksed easier for me as Non-abaper.

Thanks...

Former Member
0 Kudos

You need a field of type ICL_TIMESTAMP.

Convert date sy-datum
            time sy-uzeit
            into time stamp <new field>
            time zone sy-zonlo. 

Former Member
0 Kudos

capture the time just before the insert:

DATA: BEGIN OF wa, 
        ... 
        time_stamp TYPE timestampl, 
        ... 
      END OF wa. 
... 
GET TIME STAMP FIELD wa-time_stamp. 
INSERT dbtab FROM wa.

Former Member
0 Kudos

Add a field to your table with a domain of TIMESTAMP. Use a FM like NBWD_TIMESTAMP_GENERATE to populate it.

Rob