06-29-2006 7:52 AM
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
06-29-2006 8:45 AM
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
06-29-2006 7:58 AM
try like this
<b>xlikp-zzdnstatdate = sy-datum.
xlikp-zzdnstattime = sy-uzeit.</b>
Regards
Prabhu
06-29-2006 8:06 AM
Prabhu..
I tried your suggestion but still not working but i can see the change in debugging mode.Please asdvise..
Regards
Praneeth
06-29-2006 8:07 AM
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
06-29-2006 8:22 AM
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
06-29-2006 8:45 AM
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
06-29-2006 9:03 AM
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
06-29-2006 9:21 AM
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
06-29-2006 10:00 AM
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