cancel
Showing results for 
Search instead for 
Did you mean: 

Making a custom field as mandatory in billing document cancellation

former_member367551
Participant
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

former_member367551
Participant
0 Kudos

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~

Jelena
Active Contributor
0 Kudos

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

Answers (5)

Answers (5)

former_member367551
Participant
0 Kudos

RV60AFZZ - subroutine, USEREXIT_NUMBER_RANGE

former_member367551
Participant
0 Kudos

Dear experts,

Any further ideas on this issue?

raymond_giuseppi
Active Contributor
0 Kudos

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

former_member367551
Participant
0 Kudos

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. 😞

raymond_giuseppi
Active Contributor
0 Kudos

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

former_member367551
Participant
0 Kudos

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 Kudos

Check for other enhancement option..

former_member367551
Participant
0 Kudos

Hi Rama,

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

VenkatRamesh_V
Active Contributor
0 Kudos

in screen attributes declare the input field as required.

former_member367551
Participant
0 Kudos

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?

iftah_peretz
Active Contributor
0 Kudos

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