cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Order Acknowledgement printing when incomplete

Former Member
0 Kudos

Hello Friends

I am having a dilemma in reference to how a Sales Order Ack is printing even though the form routine appears that it is not to print if incomplete.  My ABAPer said she believed the code is right and it should be working.  There was not any modification to the SAP form routine 002 in the control data of the output determination procedure. 

My issue happens if the line item price is not in the sales order...I get the incomplete sales order notification and save the document. The acknowledgement still prints. I have checked several places in config...they all look ok to me. The code also mentions the credit block and to not print if there is a credit block, this part DOES work and is part of the same code in the form routine 002.  The code is below for your review if needed.  I have checked NACE, incompletion procedure in sales doc and item categories and it all appears correct.  I have also looked for an OSS note on this but to no avail.

In Debug Mode when I place a stop on the If Statements for  KOMKBV1-UVALL NE 'C'

the sales order is coming as 'C' even though I think it should not be a C for the 

KOMKBV1-UVALL (this also is listed in the code below twice?  I am not sure why) however it is not a 'C' for the  KOMKBV1-CMGST CA 'BC' which is the credit block and it is working only for this area.

Is there a reason SAP has made the form routine 002  looking at the status of just the header (as it says complete?  Is there someplace else I need to configure to it looks at the overall status of the document (incomplete)?  I looked at form routine 021 and it looks like it is for the line item but there is nothing there to use for the credit block and plus when i enter the price it will not print automatically and has to be done manually.  My ABAPer does not want to copy the routine and create one for our use unless we absolutely have to in order to get this to work properly. So I am asking for input.

FORM KOBED_002.

* If the sales document is complete, then the output should be created.

   SY-SUBRC = 0.

   IF KOMKBV1-UVALL NE 'C'.

     SY-SUBRC = 4.

     EXIT.

   ENDIF.

   IF KOMKBV1-COSTA NE SPACE AND

      KOMKBV1-COSTA NE 'C'.

     SY-SUBRC = 4.

     EXIT.

   ENDIF.

   IF NOT KOMKBV1-LIFSK IS INITIAL.

     IF KOMKBV1-LIFSK NE TVLS-LIFSP.

       SELECT SINGLE * FROM TVLS WHERE LIFSP = KOMKBV1-LIFSK.

     ENDIF.

     IF SY-SUBRC = 0 AND

        TVLS-SPEDR NE SPACE.

       SY-SUBRC = 4.

       EXIT.

     ENDIF.

   ENDIF.

* Kein Druck, wenn Kreditsperre sitzt

* No output if the credit block is set.

   IF   KOMKBV1-CMGST CA 'BC'.

     SY-SUBRC = 4.

     EXIT.

   ENDIF.

ENDFORM.

FORM KOBEV_002.

* Falls Verkaufsbeleg vollständig ist, soll Nachricht erzeugt werden

* If the sales document is complete, then the output should be created.

   SY-SUBRC = 0.

   IF KOMKBV1-UVALL NE 'C'.

     SY-SUBRC = 4.

     EXIT.

   ENDIF.

   IF KOMKBV1-COSTA NE SPACE AND

      KOMKBV1-COSTA NE 'C'.

     SY-SUBRC = 4.

     EXIT.

   ENDIF.

   IF NOT KOMKBV1-LIFSK IS INITIAL.

     IF KOMKBV1-LIFSK NE TVLS-LIFSP.

       SELECT SINGLE * FROM TVLS WHERE LIFSP = KOMKBV1-LIFSK.

     ENDIF.

     IF SY-SUBRC = 0 AND

        TVLS-SPEDR NE SPACE.

       SY-SUBRC = 4.

       EXIT.

     ENDIF.

   ENDIF.

* Kein Druck, wenn Kreditsperre sitzt

* No output if the credit block is set.

   IF   KOMKBV1-CMGST CA 'BC'.

     SY-SUBRC = 4.

     EXIT.

   ENDIF.

ENDFORM.

Your help is greatly appreciated.  Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Shiva_Ram
Active Contributor
0 Kudos

The code looks SAP standard (routine 002 in VOFM) and looks correct. Check in the sales order header -> status tab - field Header data under Completeness. Also check what it reads on item data.

Regards,

Former Member
0 Kudos

Hi Shiva:  Thank you so much for your response! 

This is what it reads...

Under Completeness

Header Data - complete

Header DLV Data - complete

Header Bill Data - complete 

Item Data - All items incomplete

Item Deliv Data - All items incomplete

Item Bill data - all items incomplete

This is what the header status shows on the sales order and still prints.  I understand that the header is complete but the items are not....and I need it to not print if anything in the sales document is not complete whether it is in the header or in the line item.

Shiva_Ram
Active Contributor
0 Kudos

It looks you have to copy and create a new routine to check the Item level completness status. It looks the routine checks the header level and header/item level combination and allows to print. Discuss with an ABAP'er to create a new routine, by copying routine 002 and add additional codings to check with Item level status field.

Regards,

Answers (1)

Answers (1)

eduardo_hinojosa
Active Contributor
0 Kudos

Hi Kim,

To know more about VOFM, please, see Note 327220 - VOFM function and its objects. After you read this note perhaps you will understand they are a tool with problems (sometimes, after a transport,if you forget run the report RV80HGEN and there are jobs or users working), so, it's understandable the attitude of your ABAPer.

Although this other note is a requirement for pricing, I believe it helps you to understand how the requirements routines work. This note is SAP Note 156230 - Requirements: What is permitted, what is not?. The relevant is the value of SY-SUBRC. So, the VOFM sets the conditions. SAP provides VOFM for the most usual scenarios, for more specific requirements SAP gives us the possibility to create our own requirements, formulas and so on according these requirements.

I hope this helps you

Regards

Eduardo

Former Member
0 Kudos

Both of you guys gave excellent answers...I wish I could have awarded the same amount of points for both answers....thank you so much for your help!!!