Application Development and Automation 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: 
Read only

Table not updated

Former Member
0 Likes
905

Hi All!

In an userexit i am writing the code as below :

likp-zzdnstatdate = sy-datum.

likp-zzdnstattime = sy-uzeit.

I am assigning the date and time to likp for a particular document.But the fields are not getting updated they are shomwing the old values.Interestingly in debugging mode i could see the change.Since I can't use commit in user exit how to solve this..

Please advise

Regards

Praneeth

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
862

Hi,

find a user exit processed <b>before</b> any changes are done, process command GET TIME there (because GET TIME will implicitly do COMMIT WORK). You should have the actual time available in the userexit you described.

The reason for correct function in debugger is that every screen display (=step in debugger) implicitly commits and will refresh the system variables.

Regards,

Clemens

8 REPLIES 8
Read only

Former Member
0 Likes
862

try like this

<b>xlikp-zzdnstatdate = sy-datum.

xlikp-zzdnstattime = sy-uzeit.</b>

Regards

Prabhu

Read only

0 Likes
862

Prabhu..

I tried your suggestion but still not working but i can see the change in debugging mode.Please asdvise..

Regards

Praneeth

Read only

Former Member
0 Likes
862

I think you should use this macro to put data into corresponding fields;

CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn

EXPORTING

prelp = p_prelp -> ixxxx (Structure of infotype you are using)

IMPORTING

pnnnn = p_innnn. -> innnn

Read only

Former Member
0 Likes
862

where you are doing this..., it should be under USEREXIT_SAVE_DOCUMENT_PREPARE <b>(include MV50AFZ1)</b>

<b>xlikp-zzdnstatdate = sy-datum.

xlikp-zzdnstattime = sy-uzeit.

modify xlikp.</b>

Regards

vijay

Read only

Clemenss
Active Contributor
0 Likes
863

Hi,

find a user exit processed <b>before</b> any changes are done, process command GET TIME there (because GET TIME will implicitly do COMMIT WORK). You should have the actual time available in the userexit you described.

The reason for correct function in debugger is that every screen display (=step in debugger) implicitly commits and will refresh the system variables.

Regards,

Clemens

Read only

Former Member
0 Likes
862

Clemens!

Can you please elaborate..

What I understand is that I have to use GET TIME command in the usersxit to get time and then assign it to my variable which will implicitly do commit.

please advise

Regards

Praneeth

Read only

Clemenss
Active Contributor
0 Likes
862

Praneeth,

not exactly, but:

As a GET TIME will fire an implicit COMMIT WORK this will commit all pending database updates. If you use the first available userexit to issue GET TIME you can make sure that the actual system time is present in SY-UZEIT. At this point, no database updates have occurred.

In the userexit you actually use to set the date/time in transactional data you can use this.

This should work.

It might help if you explain what you try to achieve by storing sy-uzeit.

Regards,

Clemens

Read only

Former Member
0 Likes
862

Clemens

My problem is the time is not getting updated into the field ZZDNSTATTIME of likp table if you can see my actual question.I am assigning sy-uzeit to the likp table field and my intention is to pass the value of sy-uzeit to this field.In debugging I could see the actual time but that time is not passed to the table and the table is retaining its previopus valus.

Please advise

Regards

Praneeth