cancel
Showing results for 
Search instead for 
Did you mean: 

Form Routine for Sales Order creation

Former Member
0 Kudos

Hi,

I need to check the line item details of the sales order that is being created and trigger the output type.

So when i write the code in the form routine, I find two problems.

1. I could not get the sales order doc number that will be created in the structure (komkbv1-vbeln is not being populated)

2. How can i get the line item details? The structure kompbv1 is not being populated with the details...If there are more than one line item, then how can i get the line item details.

Your help will be greatly appreciated.

Thanks,

Bhargav.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi there,

I don't think KOMK will be populated with document number as document would not have saved at the time of pricing. WOuld you please let me know what is the need for item number for calculating price?

If your requirement is not avoidable (calling this in VA02), you can populate document number header additional data fields and item number to item additional data fields to use it later in your pricing routine.

In order to move order number and item numbers, please use userexit_move_field_to_vbak and userexit_move_field tovbap respectively.

Hope that helps

Thanks

Murali

Edited by: Murali K Nimmagadda on Nov 9, 2009 5:49 PM

Former Member
0 Kudos

Hi ,

The requirement is not for pricing. This is a requirement which checks inside the vofm routine corresponding to application V1, the line item details and if the number of line items is one and the material is specific, then the output type has to be triggered and an IDOC is sent to other system.

So how could i find these details?

Thanks.

Former Member
0 Kudos

If it is for output, you will have document number and item number. However as far as I know KOMK and KOMP structures are used for pricing. For output you may check XNAST structure rather KOMK and KOMP

If you do not want to use XNAST, please follow my earlier solution of moving fields to header additional data and item additional data fields using USEREXIT_MOVE_FIELD_TO_VBAK and USEREXIT_MOVE_FIELD_TO_VBAP

Hope that helps.

Thanks

Murali