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

Disabling spool request generation for a purchase order

Former Member
0 Likes
2,737

Hi,

I have a requirement as follows :

In ME22n, according to standard configuration for a purchase order whenever the indicators 'Deliv. compl' or 'invoice flag' is checked or unchecked and saved, a spool request is generated. This spool request can be viewed in messages tab of PO.

My requirement is to disable the spool request generation on change of the above mentioned indicators.

I have found a user exit 'EXIT_SAPMM06E_016' which is triggerred on clicking on 'SAVE' of PO.

I am unable to find the field or structure with which i can disable the generation of spool request.

Your help is much appreciated!

Thanks & Regards,

Richa Aggarwal

Hi,

I have a requirement as follows :

In ME22n, according to standard configuration for a purchase order whenever the indicators 'Deliv. compl' or 'invoice flag' is checked or unchecked and saved, a spool request is generated. This spool request can be viewed in messages tab of PO.

My requirement is to disable the spool request generation on change of the above mentioned indicators.

I have found a user exit 'EXIT_SAPMM06E_016' which is triggerred on clicking on 'SAVE' of PO.

I am unable to find the field or structure with which i can disable the generation of spool request.

Your help is much appreciated!

Thanks & Regards,

Richa Aggarwal

12 REPLIES 12
Read only

Former Member
0 Likes
2,049

Richa,

i think you should get in touch with you functional team first to understand how messages do trigger.

now, to control the messages you have two options.

1. create a VOFM routine, assign it to your output. write the code there to compare the changes and set sy-subrc = 4, when you need the output not to trigger.

2. a simple way but not very neat. in configuration of PO output messages you have something called print-relevant purchase document changes . if you mark fields unchecked in there, then though the messages will trigger, they will fail and wont create spool requests. this case no coding is needed, but in messages tab you will have red flagged message(messages which failed to create spool).

your wish

Read only

0 Likes
2,049

just to clarify, how a spool gets generated.

1. a output type is defined

2. a condition record is defined for that output (in which condition this output should trigger)

3. output procedures are defined (what to be called for print, for email etc)

4. NOW, when PO is saved/changed


     a. condition record is checked first, that a output is possible for this or not
     b. VOFM is checked to restrict the output at one more level
     c. if every thing is OK a output message is Created (not yet spooled)
     d. Print relevant changes configs are checked
     e- if all these passes, then your smartform or script gets processed and creates a spool.

so, you can stop at point B(in VOFM), point D(with Config) and even at point E( if you have a custom SF processing module then you can ignore if you dont want it to be spooled).

Hope this clarifies everything you need

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
2,049

While calling form check and skip in driver or use vodm as suggested by sowmya above..

Nabheet

Read only

0 Likes
2,049

Hello,

Thanks for the reply.

@soumya : The disabling of spool request is not dependent upon the output type but on the purchasing organisation.Is there any way to disable it for all the output types? Can we write a code in routine of VOFM.

@nabheet : i did not understand 'check and call driver'. Please explain.

Thanks & Regards,

Richa Aggarwal

Read only

0 Likes
2,049

yes, you need to create a VOFM routine for your usage(need access key) and write the code there.

But, if you are using the same smartform and driver program for all output types, you can do the code in driver program that only when your condition satisfies then only call the smartform FM. or are you using standard form and standard driver program?

Read only

0 Likes
2,049

Soumya,

I have created a custom routine in VOFM and set a break point.

How do i attach this routine to standard t-code ME22N?

My requirement is related to standard t-code ME22N. The check should be applicable for all the POs having a certain purchasing organisation. Yes it is using the standard code only.

Read only

0 Likes
2,049

Goto NACE-> chose EF -> click procedures -> select the procedure -> double click on control -> here you can attach routine number to output.

once you attach it to output, this will trigger...

Read only

0 Likes
2,049

Hi Soumya,

Thanks for your reply.

I created a new VOFM routine and tried to attach to output type.

But, the output type i am trying to attach to is already assigned to some other VOFM routine.

It is not only one output type for which i have to put this check but there are 6-7 output types (already assigned to some routines).

Can you suggest something on this?

Regards,

Richa

Read only

0 Likes
2,049

Hi Soumya,

Thanks for your reply.

I created a new VOFM routine and tried to attach to output type.

But, the output type i am trying to attach to is already assigned to some other VOFM routine.

It is not only one output type for which i have to put this check but there are 6-7 output types (already assigned to some routines).

Can you suggest something on this?

Regards,

Richa

Read only

0 Likes
2,049

see, you only have to worry about the output types which you are not using.

and for the ones you are using, check what code in in those routines.. if nothing much is there anyways then you can copy that in your code along with your routine code in the new routine you have created

but how many output types you have for a PO!! should be just one i guess

Read only

0 Likes
2,049

Hi Soumya,

The routines which is being used is 101 which has a description as 'Reprinting'.

I am not sure whether putting my code there would actually help.

And when i create a new routine i am not able to attach it to any output type as to the output type with which i want to attach is already attached to routine 101.

Read only

0 Likes
2,049

Richa,

you can replace 101 with your routine number. who said you cannot? in NACE, output procedure

the code in 101.

FORM KOBED_101.
  LOOP AT XNAST WHERE KSCHL EQ KOMT1-KSCHL AND
                      OBJKY EQ MSG_OBJKY   AND
                      AKTIV EQ SPACE       AND
                      VSTAT EQ '0'.
    EXIT.
  ENDLOOP.
  CHECK SY-SUBRC NE 0.
  SY-SUBRC = 4.
  CHECK ( KOMKBEA-DRUVO EQ NEU OR KOMKBEA-DRUVO EQ AEND ).
  CLEAR SY-SUBRC.
ENDFORM.
*---------------------------------------------------------------------*
*       FORM KOBEV_101                                                *
*---------------------------------------------------------------------*
FORM KOBEV_101.
  LOOP AT XNAST WHERE KSCHL EQ T683S-KSCHL AND
                      OBJKY EQ MSG_OBJKY   AND
                      AKTIV EQ SPACE       AND
                      VSTAT EQ '0'.
    EXIT.
  ENDLOOP.
  CHECK SY-SUBRC NE 0.
  SY-SUBRC = 4.
  CHECK ( KOMKBEA-DRUVO EQ NEU OR KOMKBEA-DRUVO EQ AEND ).
  CLEAR SY-SUBRC.
ENDFORM.

so you can copy the code from these forms, and keep them before your code in your custom routine,.. like:


FORM KOBED_901. "==> i am creating a new VOFM routine 901 here
  LOOP AT XNAST WHERE KSCHL EQ KOMT1-KSCHL AND
                      OBJKY EQ MSG_OBJKY   AND
                      AKTIV EQ SPACE       AND
                      VSTAT EQ '0'.
    EXIT.
  ENDLOOP.
  CHECK SY-SUBRC NE 0.
  SY-SUBRC = 4.
  CHECK ( KOMKBEA-DRUVO EQ NEU OR KOMKBEA-DRUVO EQ AEND ).
  CLEAR SY-SUBRC.
"==> from here add your code.
data:lv_subrc type sy-sibrc.
if xyz NE asdasd "==> your validations..
lv_subrc = 4.
endif.
sy-subrc = lv_subrc.
ENDFORM.

*---------------------------------------------------------------------*
*       FORM KOBEV_901                                                *
*---------------------------------------------------------------------*
FORM KOBEV_901.
  LOOP AT XNAST WHERE KSCHL EQ T683S-KSCHL AND
                      OBJKY EQ MSG_OBJKY   AND
                      AKTIV EQ SPACE       AND
                      VSTAT EQ '0'.
    EXIT.
  ENDLOOP.
  CHECK SY-SUBRC NE 0.
  SY-SUBRC = 4.
  CHECK ( KOMKBEA-DRUVO EQ NEU OR KOMKBEA-DRUVO EQ AEND ).
  CLEAR SY-SUBRC.
"==> from here add your code.
data:lv_subrc type sy-sibrc.
if xyz NE asdasd "==> your validations..
lv_subrc = 4.
endif.
sy-subrc = lv_subrc.
ENDFORM.