cancel
Showing results for 
Search instead for 
Did you mean: 

Control of duplicate invoice posting at T.Code FB70

Former Member
0 Kudos

Dear Experts

As per clients need to we need to control with error message when user trying post duplicate customer invoice at T.Code FB70.

we request your help on how do we can meet this requirement.

if any body know the relevant application areas for message control, pleas let me know.

I tried with application area F5, but it is not working for customer postings.

Thanks in advance.

Best regards,

S. Habib Pasha.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

I have a solution to this problem.

Though SAP doesn't provide any standard way to check duplicate cusomter number, we can still have control on ducplicate invoice by using reference field of document and through Validation.

What needs to be done is first, you need to make reference field as mandatory. Secondly, write a validation and put following in pre-requisite-

( Document Number = '' OR Document Number = '$$1' ) AND

Reference <> '' AND Posting key = '01'

Now, in Check, you need to use user exit and write suitable coding for checking if there is already some document created with the data in reference field already used.

Hope, you all got a solution now.

In case you require further information, write back.

Wish you all the Best !!!

Regards

K Khatri

Former Member
0 Kudos

Hi Khatri,

Thank you so much for your answer

I already use BTE process 100001110. Unfortunately this is working only for vendors not for customers.

Now, I want to implement your solution through the Validation.

Please help me with more information about check and user-exit you used for this.

Thank you in advance for your answer!

Best regards,

Bretfe.

Former Member
0 Kudos

Hello Khatri,

I am also interested in your idea for solving this issue.

But I do not understand the pre-requisite. Can you please explain in words the logic?

What is document number = '$$1'?

And about the check part: how it should look like?

Do you have a sample code for this check maybe?

Have you implemented the solution and it works or do you know anybody who did it?

Thanks a lot for all your answers!

Daniel.

Former Member
0 Kudos

Hi,

I used this validation for vendor invoice.

$$1 is the document number, which is about to be generated after passing through this validation.

So far as the check part is concerned, I used user exit form and coding in program ZRGGBR000, which is a copy of standard program RGGBR000. The coding is as follows-

exits-name = 'U300'.

exits-param = c_exit_param_none. "AP Duplicate Invoice Check.

exits-title = text-104. "Posting check

APPEND exits.

FORM u300 USING b_result.

*****Local Variables

DATA: l_bukrs LIKE bkpf-bukrs, "Company Code

l_belnr LIKE bkpf-belnr, "Doucment Number

l_gjahr LIKE bkpf-gjahr, "Fiscal Year

l_buzei LIKE bseg-buzei. "Number of Line Item

b_result = b_true.

SELECT bukrs

belnr

gjahr

FROM bkpf

INTO (l_bukrs, l_belnr, l_gjahr)

WHERE bstat = bkpf-bstat

AND xblnr = bkpf-xblnr

AND stblg = ' '.

IF sy-subrc = 0 .

SELECT buzei

FROM bseg

INTO l_buzei

UP TO 1 ROWS

WHERE belnr = l_belnr

AND gjahr = l_gjahr

AND bschl = '31'

AND lifnr = bseg-lifnr.

IF sy-subrc = 0.

b_result = b_false.

bkpf-belnr = l_belnr.

ENDIF.

ENDSELECT.

ENDIF. "closed for SY-SUBRC

ENDSELECT.

ENDFORM. " U300

Regards

K Khatri

Former Member
0 Kudos

Dear all

Thank you vey much for all your inputs.

This issue was solved by our team itself. Our ABAPer has identified a Z functional module which triggers while posting documents and inserted validation code for Reference feild to through error message if reference field value is repeated.

This is working successfully and Productive.

For your information please.

Best regards,

S. Habib Pasha.

Former Member
0 Kudos

Hello,

Can you share your solution with us? Which exactly function module and how the validation logic looks like.

Thanks.

Former Member
0 Kudos

Hello Khatri,

Thanks for sharing your solution. We will try to implement and adapt it for customer documents.

Daniel.

Former Member
0 Kudos

Dear D. Nicula

Fucntiona manudule used is a Z one (name not be disclosed due to security reasons).

Below is the code used to control duplicate customer invoices.

DATA : BEGIN OF WA_BKPF,

BELNR TYPE BKPF-BELNR,

GJAHR TYPE BKPF-GJAHR,

END OF WA_BKPF.

TABLES : SETLEAF.

DATA : L_BELNR TYPE BKPF-BELNR.

SELECT SINGLE * FROM SETLEAF

WHERE SETCLASS = '0000'

AND SETNAME = 'ZFI_CC_REF_CHECK_DT'

AND VALFROM = T_BKPF-BUKRS.

IF SY-SUBRC EQ 0.

IF T_BKPF-BLART EQ 'DR' AND T_BKPF-XBLNR NE ' '.

CLEAR : WA_BKPF.

SELECT SINGLE BELNR GJAHR INTO WA_BKPF FROM BKPF

WHERE BUKRS = T_BKPF-BUKRS AND

BLART = 'DR' AND

XBLNR = T_BKPF-XBLNR.

IF SY-SUBRC EQ 0. " same reference no found in BKPF throw error message

MESSAGE ID 'ZFI' TYPE 'E' NUMBER '004' WITH T_BKPF-BUKRS WA_BKPF-BELNR WA_BKPF-GJAHR .

ENDIF.

ENDIF.

ENDIF.

Above function module get triggers when ever any transaction entered in SAP system in FI through relevant BTE. please search at available BTE for FI postings, it is a standard one.

I hope this information will be helpful for you.

Best regards,

S. Habib Pasha.

Former Member
0 Kudos

Ok, I understand.

Thanks a lot.

Former Member
0 Kudos

Hello again Khatri,

We started testing the idea that you have proposed.

We created the user-exit for the validation, but the prerequisite is not working.

First of all, I do not understand the logic (if you can please explain it in words) and second, the field Posting Key is not available in the structure BKPF for validation at header document level, so I get an error in the formula builder.

And one more thing: do you have internal or external document numbers in FI configured?

Thanks for support!

Daniel.

Former Member
0 Kudos

Dear all,

I have the same requirment for check duplicate customer invoice

Please let me know if you solve this problem.

Thanks

Bretfe.

ravi_nagh
Active Contributor
0 Kudos

HI

The check for duplicate invoices is only for vendors. The functionality to check for duplicate invoices in accounts receivables is not available in the standard SAP system.

The reason behind Why not Duplicate invoice check in AR :

=========================================================

There is no similar check in AR. In AP, the reference number of a document is used to check to make sure you are not paying a vendor twice. WHEN YOU ARE SENDING OUT AN INVOICE TO A CUSTOMER, THERE IS NOTHING TO PLACE IN THE REFERENCE FIELD TO CHECK EACH INVOICE AGAINST EACH OTHER.

Regards

Ravinagh Boni

Former Member
0 Kudos

Thanks for your fast answer,

I found some post about resolving this issue using BTE process100001110 (Check on invoice duplication)

If anybody use this, and it is working please let me know.

Thanks a lot.

Former Member
0 Kudos

Duplicated invoices are only checked in vendor's invoices not customers.

You can (should) set Reference and/or Header text as mandatory, but this will not avoid the possibility to post duplicated invoices, just will allow you to check it easily.

You will try to develop a user exit validation... but I do no think it worth it...

Former Member
0 Kudos

Hi,

There is a duplication check in the vendor master to avoid double entry but in standard SAP there is no check for customers,

Since customers only pay to company.

i will give the other option as let them use the header text or reference on the first screen of any transaction.

so when ever they enter the same reference number then system will through the error as double entry.

for this you need to go to oba7 and document type of invoice DR or which ever you are using

there you can see Requied during document entry there you can see two options

1) Reference number

2) Document header text

so tick which ever is required then while posting that particular transaction FB70 then system will through the error, if the reference number is same, there will also be control of duplicate invoices.

Former Member
0 Kudos

Dear Padma

Thank you for the inputs.

I tried as per your specifications, but it didn't work. system allowing me to post duplicate invoices.

Kindly let me know, if you have more inputs for our requirement.

Thanks a lot.

Best regards,

S. Habib Pasha.