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

A simple ABAP question

0 Likes
977

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

1 ACCEPTED SOLUTION
Read only

vijaymanikandan
Contributor
0 Likes
931

Hi

The given code will not Write 68. Can you kindly elaborate more on your issue?

Regards

Vijay V

7 REPLIES 7
Read only

vijaymanikandan
Contributor
0 Likes
932

Hi

The given code will not Write 68. Can you kindly elaborate more on your issue?

Regards

Vijay V

Read only

Former Member
0 Likes
931

I copy pasted the logic and its not writing 68 too. Where exactly are you getting the problem??

Read only

0 Likes
931

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

Read only

0 Likes
931

HI

I did try your code in my system and it didn't return me 68.

Regards,

Vijay V

Read only

naimesh_patel
Active Contributor
0 Likes
931

Where - which program - do you see this logic in SAP?

Regards,

Naimesh Patel

Read only

0 Likes
931

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.

Read only

0 Likes
931

Hi

This code is working as desired. I don't find anything wrong in this code in my system.

Regards,

Vijay V