cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Order Output Type

former_member206170
Participant
0 Kudos

Hi,

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 :

Routine
FORM KOBED_ABC.
   if KOMPBV1-ABGRU is NOT INITIAL.
     sy-subrc = 0.
   else.
     sy-subrc = 4.
   ENDIF.
ENDFORM.
FORM KOBEV_905.
ENDFORM
.


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.


Thanks,

Himanshu

Accepted Solutions (1)

Accepted Solutions (1)

sez41
Active Contributor
0 Kudos

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.

former_member206170
Participant
0 Kudos

Hi Kıvanç,

Thank you for your response.

Your answer has made my understanding much more clearer now. I think a change in the logic is required. 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.

The output shall be triggered for orders which has a specific 'Purchase Order' type and which meets the routine requirements.

So option '1' sounds logical and it should be easy to implement it.

Thanks,

Himanshu.

sez41
Active Contributor
0 Kudos

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.

Answers (0)