Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Custom Error message in VF11

Former Member
0 Likes
5,047

Hi All,

In the Tcode VF11 i would like to display an error message with some validations when user press enter after entered the value .

I have tried in some userexits and the log i got is from the standard errors. I think my custom error message interrupting the standard process.

Can you please tell me , if i need to display the error message , do i need to display by the LOG option and not directly in the screen?.

Please share your ideas!

Thanks,

Pradeep.

1 ACCEPTED SOLUTION
Read only

karthikeyan_p3
Contributor
0 Likes
3,356

Hi Pradeep,

It is better to display the error message in log, instead of triggering Error message from the user exit of Invoice creation.

We had earlier implemented the validation for VF01 in the user exit, but it had impacted the billing due list job. The job stopped without processing the other documents, when the error message was raised.

So we moved our logic to the VOFM requirement routine.For your scenario, you can try using the requirement routine which can be configured in VOFA.

In the tcode VOFA, the cancellation document type would be maintained for the source document (Check invoice type : FD, cancellation invoice type is S1). There you have a requirement routine which can be configured.

You need to create a custom VOFM routine and write your validation logic.

In the coding, you could set

IF condition IS TRUE.

    perform vbfs_hinzufuegen using '000000' '112' VAR1 VAR2 VAR3.

    sy-subrc = 4.

    exit.

ENDIF.

PS: Search SCN to more about VOFM routines.

Thanks,

Karthikeyan

Have you set the value sy-subrc = 4 in the requirement routine.

You can get that message if you set the vbfs values in requirement routine and sy-subrc = 4. Only then billing document will be stopped from creation.

10 REPLIES 10
Read only

karthikeyan_p3
Contributor
0 Likes
3,357

Hi Pradeep,

It is better to display the error message in log, instead of triggering Error message from the user exit of Invoice creation.

We had earlier implemented the validation for VF01 in the user exit, but it had impacted the billing due list job. The job stopped without processing the other documents, when the error message was raised.

So we moved our logic to the VOFM requirement routine.For your scenario, you can try using the requirement routine which can be configured in VOFA.

In the tcode VOFA, the cancellation document type would be maintained for the source document (Check invoice type : FD, cancellation invoice type is S1). There you have a requirement routine which can be configured.

You need to create a custom VOFM routine and write your validation logic.

In the coding, you could set

IF condition IS TRUE.

    perform vbfs_hinzufuegen using '000000' '112' VAR1 VAR2 VAR3.

    sy-subrc = 4.

    exit.

ENDIF.

PS: Search SCN to more about VOFM routines.

Thanks,

Karthikeyan

Read only

0 Likes
3,356

Hi Karthikeyan,

Thanks for your reply . Yes , i can do it in VOFM. But i think its better to do it in the userexits.

RV60AFZZ.

So if i populate my custom error message in perform vbfs_hinzufuegen using '000000' '112' VAR1 VAR2 VAR3. This will update in the LOG options right ?

Read only

0 Likes
3,356

And another issue is i am getting the following error log 73763739XX 000000 Document does not exist.

Read only

0 Likes
3,356

Hi Pradeep,

I think NO. Requirement routine is the ideal place to populate the error in VBFS internal table. If you populate the entry in RV60AFZZ userexits, it will have no impact. 

You can think of an alternate approach to raise the error message from user exits.

Thanks,

Karthikeyan

Read only

0 Likes
3,356

Hi Karthikeyan,

Thanks. With the  perform vbfs_hinzufuegen using '000000' '112' VAR1 VAR2 VAR3 i can able to

populate the custom message in log. But one problem i am missing the std message ' No billing documents were generated. See log' . which stops the transaction process.


I Need this message as well , so that i can stop the process when the log has my custom message,



regards,

Pradeep.

Read only

0 Likes
3,356

Have you set the value sy-subrc = 4 in the requirement routine.

You can get that message if you set the vbfs values in requirement routine and sy-subrc = 4. Only then billing document will be stopped from creation.

Read only

0 Likes
3,356

yes, in the include i have set sy-subrc = 4. after my custom message population. But i couln't get the VF 032 standard message in screen.

Read only

0 Likes
3,356

Can i give this error messages while saving in VF11?

Read only

0 Likes
3,356

After the code, Has the cancellation invoice creation being stopped now? If you need VF 032, along with the custom error message, you can include that as well.


Thanks,

Karthikeyan

Read only

0 Likes
3,356

Thanks for your help