BAPI_SALESORDER_CREATEFROMDAT2 Partial Delivery [FIXED]

Question: Having hunted around on the net and come up empty, I'm hoping that someone here can help point me in the right direction.

I'm in the process of setting up a new interface using BAPI_SALESORDER_CREATEFROMDAT2 to create sales orders, and would like all orders created to have partial deliveries enabled.

I have tried setting the field "PART_DLV" within order_items_in to each of the settings, but it doesn't seem to have an effect. Is there something else I need to set to get the orders to set up partial deliveries?

Here's the test code I'm using to try out the BAPI:


wa_header-doc_type    = 'ZOR'           ."Sales document type
wa_headerx-doc_type   = 'x'.
wa_header-sales_org   = '4000'          ."Sales organization
wa_headerx-sales_org  = 'x'.
wa_header-distr_chan  = '40'            ."Distribution channel
wa_headerx-distr_chan = 'x'.
wa_header-division    = '40'            ."Division
wa_headerx-division   = 'x'.

wa_partner-partn_role = 'AG'        ."Partnerfunctions,SP sold-to party
wa_partner-partn_numb = '0000043580' ."Customer number
APPEND wa_partner TO i_partner.

wa_items-material = '000000000000757434'       ."Material number
wa_itemsx-material = 'x'.
wa_items-part_dlv  = 'A'.
wa_itemsx-part_dlv = 'x'.
APPEND wa_items TO i_items.
APPEND wa_itemsx TO i_itemsx.

wa_schedule-req_qty = '120.000'.
wa_schedulex-req_qty = 'x'.
APPEND wa_schedule TO i_schedule.
APPEND wa_schedulex TO i_schedulex.


CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
  EXPORTING
    order_header_in               = wa_header
    order_header_inx              = wa_headerx
  IMPORTING
    salesdocument                 = w_docnum
  TABLES
    return                        = i_return
    order_items_in                = i_items
    order_items_inx               = i_itemsx
    order_partners                = i_partner
    order_schedules_in            = i_schedule
    order_schedules_inx           = i_schedulex
          .


Answer:
A stupid idea, but I'm betting that the SAP code goes something like this:

If blah = 'X'.

rather than

If blah <> ' '.

so change your 'x's to big 'X's and see what happens.
_________________
Regards

R


Abap KC
SFMDR

Answer:
Worth a try but unfortunately didn't have any effect, still no partial.

Answer:
Ah well....

I don't see a required date in your schedule table.

Also, for these types of Bapi's, I define some macro's like this:

     Define MoveX.
            Move &1   to &2-&3.
            Move True to &2x-&3.
     End-Of-Definition.
*
     Define Move_Order_Header.
            Movex &1 w_Order_Header_In &2.
     End-Of-Definition.
*
     Define Move_Item_Line.
            Movex &1 w_Order_Item &2.
     End-of-Definition.
*
     Define Move_Schedule_Line.
            Movex &1 w_Schedule &2.
     End-Of-Definition.


And use them like this:

        Move_Order_Header c_Po_Method_Email Po_Method.
        Move_Order_Header pu_IhRez          Ref_1.
        Move_Order_Header pu_SenderName     Name.


The idea being that I don't have to remember to set the 'X' each time in the corresponding record of the 'X' table ie schedule and schedulex for instance.
_________________
Regards

R


Abap KC
SFMDR

Answer:
I've tried specifying the required date as sy-datum (we're just looking for as soon as possible) but that to had no effect.

Answer:
In the interests of completeness, and for future reference of anyone else with a similar problem:

After talking with SAP OSS, we've found that the transaction OVZJ was needed, to set the default delivery proposal for creating Sales Orders.
Copyright ?2007 - 2008 www.jt77.com