Skip to Content

Making a custom field as mandatory in billing document cancellation

Dear experts,

How can I make a custom field as mandatory in billing document cancellation (transaction, VF11)?

I have implemented the BAdI, SD_CIN_LV60AU02 - and in there, I have added a statement issuing an error message if a certain condition is met, as follows:-

MESSAGE text-e01 TYPE 'E'.

However, when I tested this out in the transaction, VF11, the billing document items disappear at one point -- this is not expected. I think it's because the MESSAGE statement is not anticipated / expected in the BAdI, SD_CIN_LV60AU02 framework.

How can I implement a better solution for such a requirement?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    Jan 10 at 04:36 AM

    Hi Raymond,

    Just a quick update - I finally found an answer within the include program, RV60AFZZ - subroutine, USEREXIT_NUMBER_RANGE. Thanks for your input, anyhow~

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 16, 2017 at 08:59 AM

    in screen attributes declare the input field as required.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 21, 2017 at 07:17 AM

    Check for other enhancement option..

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05 at 11:12 AM

    Did you consider the good old user exit (include RV60AFZC) provided by SAP for years?

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Raymond,

      Thanks for this, but I have tried looking into USEREXIT_NUMBER_RANGE_INV_DATE as well.. Unfortunately, it does not work perfectly for the scenario I'm working on -- to make sure that the custom field is entered upon saving the billing document in VF11.

      My codes:-

      FIELD-SYMBOLS: <lwa_vbrk> TYPE vbrkvb.
      
      * Cancellation code must be mandatory when cancelling an invoice
      IF sy-tcode = 'VF11'.
        LOOP AT xvbrk ASSIGNING <lwa_vbrk>
          WHERE zzcancel IS INITIAL.
          MESSAGE 'Please specify a Cancellation Code for this billing document.' TYPE 'E'.
          EXIT.
        ENDLOOP.
      ENDIF.

      When I implemented my codes in this user exit, here's what happens:-

      1) Go to transaction, VF11 and specify the desired billing document number

      2) Hit the Enter key

      3) Error message from the user exit is shown

      4) I am already unable to key in the cancellation code for the cancellation invoice - this should not happen

      Alternatively:-

      1) Go to transaction, VF11 and specify the desired billing document number

      2) Immediately click on Save

      3) Error message from the user exit is shown

      4) I am already unable to key in the cancellation code for the cancellation invoice - this should not happen

      Any further ideas?

  • Jan 09 at 08:58 AM

    Dear experts,

    Any further ideas on this issue?

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 10 at 04:37 AM

    RV60AFZZ - subroutine, USEREXIT_NUMBER_RANGE

    Add comment
    10|10000 characters needed characters exceeded