2009 Sep 03 4:33 PM
Hello,
I have been working on BAPI_ACC_DOCUMENT_POST bapi to create a WD application for creating an invoice similar to Tcode FB10. My issue is:-
The BAPI_ACC_DOCUMENT_POST" bapi is allowing the end user to make duplicate invoice payments which is not acceptable. We need the BAPI to return an error message if a duplicate entry exists. For eg:- If we enter a duplicate entry in FB10 it throws an error message telling the user that a duplicate entry exists. But, this is not happening in the case of the BAPI.
Could anyone help me in finding a way to check for duplicate invoice entries and throw an error message. I would greately appreciate your help.
Regards,
Gopal Yarlagadda.
......Step 2
CALL FUNCTION 'FI_DUPLICATE_INVOICE_CHECK'
EXPORTING
I_BUKRS = IT_ACCIT-BUKRS
I_LIFNR = IT_ACCIT-LIFNR
I_WAERS = IT_ACCCR-WAERS
I_BLDAT = IT_ACCIT-BLDAT
I_XBLNR = IT_ACCIT-XBLNR
I_WRBTR = IT_ACCCR-WRBTR
I_KOART = 'K'
I_REPRF = _REPRF
I_SHKZG = IT_ACCIT-SHKZG
I_XUMSW = IT_ACCIT-XUMSW
I_BSTAT = IT_ACCIT-BSTAT
I_BLART = IT_ACCIT-BLART
EXCEPTIONS
MISSING_DATA = 1
ERROR_MESSAGE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
TYPE = SY-MSGTY
CL = SY-MSGID
NUMBER = SY-MSGNO
PAR1 = SY-MSGV1
PAR2 = SY-MSGV2
PAR3 = SY-MSGV3
PAR4 = SY-MSGV4
IMPORTING
RETURN = RETURN.
APPEND RETURN.
ENDIF.
ENDLOOP.
ENDFUNCTION.Max
2009 Sep 04 5:22 PM
That's good
You're right: when I post my code I forgot this little line:
IT_ACCIT-XUMSW = 'X'.
But you've found out it by yourself....good work
Max
P.s.: I believe u should keep that flag in IT_ACCIT table too.
2010 Jul 08 9:54 AM
Hi Max,
I have the similar problem. I am posting invoice using IDOC. is it possible to do the same in 4.6c system also? I don't see 'ACC_DOCUMENT' Badi in 4.6c. If I do implement the same functionality using BTE then the event is not getting triggered because EXTENSION1 table is blank as we are not populating it. Can you please help me here?
Regards
Amit
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |