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: 

Wrong posting date in bkpf table

Former Member
0 Kudos

Hi I am facing a problem in account document post using FB01.I have created exit in GET_EXIT_TITLES with exit U100. in U100 i have added check that posting date should not less then last posting date. these all post in stored in table BKPF.its working fine when i run manully if i run using batch job then in some document its going wrong. means some document posting date is lower then last posting in BKPF. its happen sometime like 4-5 wrong form 100 document

Please suggest

6 REPLIES 6

ThomasZloch
Active Contributor
0 Kudos

What exactly is "last posting date"? It sounds like you are reading previous BKPF entries when posting a new document, so you are maybe running into a typical problem with asynchronous updates during mass processing.

Please explain much more about the underlying logic here.

Thomas

0 Kudos

Dear Thomas first of all thanks for quick and logical reply.

My fico person has already add a logic for posting date rule (posting date < last posting date) in OB28 exit U100.

in U100 i have define following code

******************************************************************************************

SELECT SINGLE * FROM T003 WHERE BLART = BKPF-BLART.

SELECT SINGLE * FROM NRIV WHERE OBJECT = 'RF_BELEG' AND

SUBOBJECT = BKPF-BUKRS AND

NRRANGENR = T003-NUMKR AND

TOYEAR >= BKPF-GJAHR.

SELECT SINGLE * FROM BKPF INTO COM-BKPF WHERE

BUKRS = BKPF-BUKRS AND

GJAHR = BKPF-GJAHR AND

BELNR = NRIV-NRLEVEL+10(10).

IF SY-SUBRC EQ 0 AND

COM-BKPF-BUDAT > BKPF-BUDAT.

B_RESULT = B_FALSE.

ENDIF.

***************************************************************************************

after executing FB01 its working fine and BKPF table entry will like this

MANDT BUKRS BELNR BUDAT

020 Abc 123 13.04.2010

020 CDF

0 Kudos

Dear Thomas first of all thanks for quick and logical reply.

My fico person has already add a logic for posting date rule (posting date < last posting date) in OB28 exit U100.

in U100 i have define following code

******************************************************************************************

SELECT SINGLE * FROM T003 WHERE BLART = BKPF-BLART.
  SELECT SINGLE * FROM NRIV WHERE OBJECT = 'RF_BELEG' AND
        SUBOBJECT = BKPF-BUKRS AND
        NRRANGENR = T003-NUMKR AND
        TOYEAR >= BKPF-GJAHR.
  SELECT SINGLE * FROM BKPF INTO COM-BKPF WHERE
        BUKRS = BKPF-BUKRS AND
        GJAHR = BKPF-GJAHR AND
        BELNR = NRIV-NRLEVEL+10(10).
  IF SY-SUBRC EQ 0 AND
  COM-BKPF-BUDAT > BKPF-BUDAT.
    B_RESULT = B_FALSE.
  ENDIF.

***************************************************************************************

after executing FB01 its working fine and BKPF table entry will like this

MANDT BUKRS BELNR BUDAT

020 Abc 123 13.04.2010

020 CDF 234 14.04.2010

but in some cases its going to wrong like please check third row its should not post the document according U100 check.because last posting date is grater then current document date

MANDT BUKRS BELNR BUDAT

020 Abc 123 13.04.2010

020 CDF 234 14.04.2010

020 aaa 333 12.02.2010

I check many time but i think error when we are processing maas document using idoc.

Please let me know

0 Kudos

Hi

According to the logic, it should not fail.

Debug it carefully & check the fetch on the select query


SELECT SINGLE * FROM BKPF INTO COM-BKPF WHERE
BUKRS = BKPF-BUKRS AND
GJAHR = BKPF-GJAHR AND
BELNR = NRIV-NRLEVEL+10(10).

check the values of condition COM-BKPF-BUDAT > BKPF-BUDAT. , carefully in debugging.

Regards

Abhii

0 Kudos

hi abhi

its fail sometime when its betch processing. so at that time i am not able to debug. for single idoc i can debug.

0 Kudos

Hi Thomas Zloch .... any update?