cancel
Showing results for 
Search instead for 
Did you mean: 

help me on this business process and suggest the solution

Former Member
0 Kudos

Dear expert,

with hope i am putting this requirement so that i can get help from expert like you.

SD:

When doing returns sales order w.r.t billing doc, user should not be able to reference the quantity once it is referenced completely.

Example:

We sell an Item of Qty 10 pcs, But the customer returns all the Qty-10 pcs. So, the Billing doc is used as reference to create returns sales order.

Billing doc: Qty 10 Pcs

First Return Order is created w.r.t billing doc that has 10 pcs which is fine meaning all the qty -10 pcs sold is return to our warehouse.

But if the User tries to reference again using the same billing doc, Std SAP displays message there are returns item and credit memos but still allows to reference it, which is wrong and user can abuse the system. ( If we sell 10pc , we can take returns for 10pc only and not allow user to cheat and take qty in excess of what is sold )

We dont want the user to reference the same billing doc again and again. So let me know if you can handle it and really appreciate if you could solve it urgently.

thanks

zara

Accepted Solutions (0)

Answers (2)

Answers (2)

Jelena
Active Contributor
0 Kudos

This question has already been asked here before (at least once in the last month only). Please use Search or at least browse the last few pages before posting new questions. Also you might want to use a more descriptive subject to facilitate the search for others.

eduardo_hinojosa
Active Contributor
0 Kudos

Hi,

Manage it with the userexit_check_vbak in include MV45AFZB. Check VTAF, because I don't remember in that field store the number of invoice (VBAK-IHREZ OR VBAK-VGBEL). If the user tries to use newly the same number of invoice write an error message in the userexit.

An example (set a break-point and check it) and of course, be careful:

tables: *vbak.

CHECK vbak-auart = 'AG' "credit memos,...

SELECT SINGLE * FROM *vbak

WHERE vgbel = vbak-vgbel.

IF sy-subrc = 0.

MESSAGE exxx(zz) WITH....

ENDIF.

If you don't know ABAP, search an ABAPer and be careful with performance, perhaps you need add a secondary index.

I hope this helps you,

Regards,

Eduardo