Skip to Content
avatar image
Former Member

Copy routine

Hi All,

We have requirement that when User is creating credit memo request document with referenc to invoice, he should not be allowed to create an item in create memo other than the old invoice.. System should throw error message.


Old invoice item 10 X 10 qty

item 20 Y 20 qty.

Credit memo request with reference to above invoice should allow

item 10 X 10 qty

item 20 Y 20 qty.

If user tries insert addtional item in same create mode

Item 30 Z for any qty..

System should throw error message.

Any pointers for achieving above functionality, through standard copy routine / Customizing would be really helpful

Thanks in advance for your answers.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 03, 2009 at 10:24 AM


    In my humble opinion, you can do this by copy routine, because entry of additional items is being made after document is copied.

    Maybe you should use standard customer user exit for implementing the checks you need?

    Here, you can check for example if:

    1. all items are in reference to previous document and if this is the same document?

    2. the number of items in SO is equal to the reference document.

    3. any other you need.

    Try following (se38) -> respecitve form.:



    Hope it helps.



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 03, 2009 at 12:13 PM

    Hi Abhijeet

    There are 2 alternatives available but both are not in standard configuration.

    Please do both inconsultation with ABAP Consultant as well as If possible Take Help of SAP.

    1.IN PBO module which is triggered just when u enter sales document (credit memo) identify function code and after copying is complete before screen is displayed enhance the screen to make screen-active =0.( no input possible) so system wont allow any further inputs. here in Credit memo no further changes are possible.

    in this case u have to identify Fcode for entry ,tcode i.e. VA01,or VA02 etc and sales document category along with document type.

    Sothat other document processing is not affected.

    Disadv : Standard program modification

    This will slow down ur program .

    2. Use the user exit in MV45AFZZ

    Save document prepare

    Here after user has entered any thing before saving u can check the inputs comparing with posnr in VBFA table or refrence document and throw a custom error message.

    In this case also u need to identify sale doc type ,and t.code etc. before applying exit.

    adv.: std exit given by SAP.

    disadv : user entry is completed and then error is thrown.

    I have used the option for orders whose status is completely processed. they can't be opened with VA02.

    Please do convey me if u find any other alternative.



    Add comment
    10|10000 characters needed characters exceeded