Skip to Content

Sales Order Output Type


We have a requirement where an output type should be triggered at the sales order header level when any of the items in the order is rejected.

A routine (lets say ABC) was created and was added against the output condition type in the output determination procedure. Now one of the items in the order was rejected (ABGRU field set), however the output type XXX was not triggered. After performing the determination analysis, it was found that the routine was not fulfilled and hence the output was not triggered.

Below is the routine written by the technical person :

     sy-subrc = 0.
     sy-subrc = 4.

After debugging it was then observed that the structure KOMKBV1 (sales header communication structure) is getting filled, however KOMPBV1 (sales item communication structure) is not getting filled. So I want to understand if the structure KOMPBV1 is supposed to get filled if an output type is triggered at the header level of the sales order?

Please let me know if the above explanation/question is not clear.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 09, 2016 at 01:16 PM

    Hi Himanshu,

    I'm not 100% sure about the answer of your question, but I can share my thoughts.

    KOMPBV1 is a structure. Let's say you have 10 items in order, and reject 3 of them and save the order. What would you expect in your requirement 905? You should expect it to be triggered once, as it is on order header level. So in this case KOMPBV1 should not have been filled (if it should be filled, for which item should it be filled?)

    I guess in order to fulfill your requirement you need to change the logic. You might need to create a z-field for sales order header (VBAK-ZZABGRU?) and fill it in program MV45AFZZ when an item is rejected. You have a turnout then:

    1- You can modify the routine accordingly (If KOMKBV1-ZZABGRU....)

    2- In your condition table, use field ZZABGRU and delete the requirement routine. This would be the approach I'd suggest.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      Unfortunately I cannot go with your second suggestion (In your condition table, use field ZZABGRU and delete the requirement routine) since the output condition table that was created for this requirement has the following fields.

      Sales Area / Sales doc type/ Purchase Order type.

      I get this part - but if the creation of output depends on rejection of an item (you've already said this), then using ZZABGRU in your table will be only logical. I'm not saying use only this field, but change your table to

      Sales Area / Sales doc type/ Purchase Order type / Rejection

      This way you'd have got rid of the routine which becomes obsolete (if rejection of item is the only code written there).

      Your choice.