Skip to Content
0

Making a custom field as mandatory in billing document cancellation

Nov 16, 2017 at 03:43 AM

120

avatar image
Former Member

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Best Answer
avatar image
Former Member Jan 10 at 04:36 AM
0

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~

Show 1 Share
10 |10000 characters needed characters left characters exceeded

If this has been answered kindly close the question - see this blog.

0
Venkatramesh V Nov 16, 2017 at 08:59 AM
0

in screen attributes declare the input field as required.


scn6.jpg (67.0 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Venkat,

Thanks for the input, but the custom field must only be mandatory in billing document cancellation - tcode, VF11.

If I follow your suggestion, the field will be mandatory even in VF01 and VF02 - this should not happen.

Any other ideas?

0

Then why not LOOP AT SCREEN and set screen-required based on conditioning the objects/transaction (sy-tcode/SY-CYPROG/sy-repid etc.)?

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

Check for other enhancement option..

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Rama,

Do you have any other suggestions? I have looked into this, but found nothing so far...

0
Raymond Giuseppi
Jan 05 at 11:12 AM
0

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

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Raymond,

I've tried this as well. The exits won't be triggered upon 'Save' in the transaction, VF11, so it will not be applicable for the scenario that I'm working on. :(

0

A form like USEREXIT_NUMBER_RANGE_INV_DATE is executed, so could you look again?

0
Former Member

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?

0
avatar image
Former Member Jan 09 at 08:58 AM
0

Dear experts,

Any further ideas on this issue?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 10 at 04:37 AM
0

RV60AFZZ - subroutine, USEREXIT_NUMBER_RANGE

Share
10 |10000 characters needed characters left characters exceeded