‎2012 Feb 20 2:56 PM
Friends,
I am intrigued with the following date comparison logic. This is a small snippet that I cut&paste from SAP code and modified to check whether the logic is correct.
the logic below writes STATUS 68. From SAP point of view and I agree, that it should not write 68.
Can you please elaborate the problem here.
Thanks in advance.
William
DATA: i_aedat type sy-datum, " Equipment Change date in the decentral
l_aedat type sy-datum. " Equipment Change date in the central.
I_aedat = '20120119'. "From deployed
L_aedat = '20120118'. "In central
* posting in Central
if l_aedat is not initial.
*...change mode
if I_aedat < L_aedat.
*.....existing entry is the actual one,
*.....we don't won't overtake old data
write: / 'status 68'.
endif.
endif.Moderator message: please choose more descriptive titles for your posts, everybody here has ABAP questions...
Edited by: Thomas Zloch on Feb 20, 2012
‎2012 Feb 20 3:03 PM
Hi
The given code will not Write 68. Can you kindly elaborate more on your issue?
Regards
Vijay V
‎2012 Feb 20 3:03 PM
Hi
The given code will not Write 68. Can you kindly elaborate more on your issue?
Regards
Vijay V
‎2012 Feb 20 3:05 PM
I copy pasted the logic and its not writing 68 too. Where exactly are you getting the problem??
‎2012 Feb 20 3:17 PM
Thanks to everybody.
Please I was not testing anybodys' ABAP skill, niether mine.
Here is a business process.
We have several decentrla systems. The information from the decentrla server is distirbuted to the central via ALE/IDOC mechanism and processed in the central daily. Before processing, the dates of the technical reference object is checked to determine whether the decentral date is greater than the central date and if so the deployed overwrites the central data.
In the snippet, that I have forwarded, SAP simply compare the incoming date (decentrla) with the existing date (in central) and if the date is greater than the existing date then updates the idoc to the central.
In the example that I forwarded, the code writes status 68 and the one friend replied that it should not write 68. Both SAP and I concur with the reply.
Can you please cut&paste on your computer and see whether the result is not 68.
Much appreciate for your reply.
Regards
William
‎2012 Feb 20 3:25 PM
HI
I did try your code in my system and it didn't return me 68.
Regards,
Vijay V
‎2012 Feb 20 3:30 PM
Where - which program - do you see this logic in SAP?
Regards,
Naimesh Patel
‎2012 Feb 20 3:40 PM
Ok, here is the function module
Please note i_aedat is the change date in the decentral and l_aedat is the changed date in the central
The function module determine whether the existing central date is before the Decentrla date.
If so it would update the central data with decentral data.
Code below produce 68 at our installation and it does not with Vijaj and Patrick. I concur with their reply.
The code that I have provided is how the function module behaves.
So is it a kernel issue?
Any help is much appreciated.
Thanks
William
function /isdfps/etups_maintain_chk.
*"----
""Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(I_EQUNR) TYPE EQUNR
*" REFERENCE(I_AEDAT) TYPE AEDAT
*" EXCEPTIONS
*" NOT_ALLOWED
*"----
data: l_aedat like equi-aedat.
*----
select single aedat into l_aedat
from equi
where equnr = i_equnr.
if sy-subrc is initial and
l_aedat is not initial.
*...change mode
if i_aedat < l_aedat.
*.....existing entry is the actual one,
*.....we don't won't overtake old data
raise not_allowed.
endif.
endif.
endfunction.
‎2012 Feb 20 3:50 PM
Hi
This code is working as desired. I don't find anything wrong in this code in my system.
Regards,
Vijay V