Application Development 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: 

VOFM Requirements output control for VF02

former_member588480
Participant
0 Kudos

I have written a small piece of code to stop the invoice to print the smartform. Here is the code which I maintained under requirement output control.

FORM KOBED_919.
SY-SUBRC = 4.
CHECK KOMKBV3-RFBSK = 'C'.
SY-SUBRC = 0.
*} INSERT
ENDFORM.
FORM KOBEV_919.
ENDFORM.

When I do repeat output type in VF02 , the routine KOBED_919 is getting called and sy-subrc = 4 but still output type is getting triggered and smartform is printing .

Rotine is maintained properly under control of procedure as shown below .

Please let me know even though routine is getting called and sy-subrc = 4 still then why smartform is print is getting trigger for invoice .

I have gone though all sap community discussion but did not able to find any solution.

I am facing this problem first time so please advice me.

Thanks

Prabin

1 ACCEPTED SOLUTION

former_member588480
Participant
0 Kudos

Yes, output type was maintained previously in VF02 so that's why repeat output was possible.

As you suggested when I created a new invoice,

Yes, Invoice did not trigger output type automatically.

So I can say routine condition is working fine , if new invoice will be created then routine condition is checked and output is blocked .

Thank you for this clarification.

As you mentioned to to prevent the users from adding manually a certain output in the document , need to set "Cannot be changed" (T685-NBEAR) to be 'X' . Can you please explain this process . I am not aware of this.


Prabin

13 REPLIES 13

SimoneMilesi
Active Contributor
0 Kudos

Did you check if KOBEV_919 is called too and with which value in SY-SUBRC?

former_member588480
Participant
0 Kudos

Yes , I checked the form KOBEV_919 is getting called when we trigger the invoice from VF02 and also sy-subrc = 4 because condition CHECK KOMKBV3-RFBSK ='C' is not statisfied.

But Still I can see smartform is getting triger with spool number.


Anything else i can check ?


Thanks

Prabin


0 Kudos

Hi Prabin Pradhan,

In my opinion, I think you should copy your code to subroutine KOBEV_919 as well.
Since the one end of V is the logic for the header level, on the counterpart is simply for item level.
Just Let me know if there is something I miss, thanks~
Have a nice day~

0 Kudos

Hi Frank ,

Thanks for the response.

I have put the same code inside subriutine inside the form KOBEV_919 but still the smart form gets trigger with spool no in VF02 for the output type .

Please let me know if anythingelse have to check .

FORM KOBED_919.
SY-SUBRC = 4.
CHECK KOMKBV3-RFBSK = 'C'.
SY-SUBRC = 0.
*} INSERT
ENDFORM.
FORM KOBEV_919.
*{   INSERT 
SY-SUBRC = 4.
CHECK KOMKBV3-RFBSK = 'C'.
SY-SUBRC = 0.
*} INSERT
ENDFORM.<br>

jack_graus2
Active Contributor

Hello

Requirement is only checked for automatic output determination. Requirement is nog checked when you manually set an output. That is the case when you repeat an output. You could achieve the same by doing the check in the output routine. Or by calling the requirement in the output routine. And issue an error is the requirement is not fulfilled.

Regards Jack

0 Kudos

Thanks for the response.

So Do you mean there is no way we can stop the output type to trigger from VOFM requirement->output control routine ?

Only after triggering the output type we have to trigger an error message inside routine of output type ?

But actually requirement is to stop triggering the output type. So is there another way to stop output type trigger ?

I am a bit confused - you mentioned that you used 'repeat processing' to add the output. But to use 'repeat' you need to have the same output somehow added or determined in the document. Considering that you just check for RFBSK = 'C' - how did this initial output appear in the document? Was it added manually or it was determined and processed to error before you added the code in the routine and adjusted configuration? What is the current posting status of the billing document?

If you wish to prevent the users from adding manually a certain output in the document and by this - bypass the check in the routine: did you not set "Cannot be changed" (T685-NBEAR) to be 'X' and force the output type to be determined only via condition records?

Except in some exptic cases the best way to prevent an output to be issued is not to have it in the document at all.

Jelena
Active Contributor

Requirements are not checked when output is processed manually. There should be a message issued to that effect, unless SAP change it.

VOFM routines can be used to stop the output from being proposed automatically. You'll see in the output determination analysis whether the requirement is checked and passed or not.

Testing this by adding an output manually won't work. As Veselina noted, there are some ways to disallow even manual output but, in my experience too, this is not needed. The users learn very quickly that they should not "force" output manually.

Cancel the document and create a new one, then it'll be a valid test.

0 Kudos

As you suggested when I created a new invoice,

Yes, Invoice did not trigger output type automatically.

So I can say routine condition is working fine , if new invoice will be created then routine condition is checked and output is blocked .

Thank you for this clarification.

Now I am looking for a way to prevent user from triggering output type manually in VF02.

Prabin

former_member588480
Participant
0 Kudos

Yes, output type was maintained previously in VF02 so that's why repeat output was possible.

As you suggested when I created a new invoice,

Yes, Invoice did not trigger output type automatically.

So I can say routine condition is working fine , if new invoice will be created then routine condition is checked and output is blocked .

Thank you for this clarification.

As you mentioned to to prevent the users from adding manually a certain output in the document , need to set "Cannot be changed" (T685-NBEAR) to be 'X' . Can you please explain this process . I am not aware of this.


Prabin

There is nothing really special about it - here is a screenshot from NACE (output type detail):

Set this indicator for the desired output type and test the outcome with new documents by trying to add the output manually.

0 Kudos

Thanks foe your answaer.

0 Kudos

Hi did you find the solution how to control it from VF02 , It is urgent could you suggest