Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

sales order item split

Former Member
0 Kudos

Hi Experts,

We have requirement where we have to split the item,

ex Initially

item qty

10 20

Requirement:

item qty

10 11

11 9

the qty should be splitted and stored in another item 11, I have tried to do this but i am getting the pricing error: pricing condition missing for one item, when I try to modify the qty of the splitted item that particular item is quantity is getting greyed out. Please let me know if any Enhancement points or any Information regarding this.

Regards,

Vinod

2 REPLIES 2

Former Member
0 Kudos

Change schedule line of first item with new quantity.

Here 'req_qty' of 'schedule_lines' of BAPI_SALESORDER_CHANGE = new quantity and 'sched_line' = '0001'.

*-> To add new line item with remaining quantity

populate 'order_item_in' and t_order_item_inx of BAPI_SALESORDER_CHANGE with required details.

and then create schedule line for newlty created item.

'sched_line' for new item = '0001'.

Also populate 'req_qty', 'req_date' and 'dlv_date' of schedule line.

I have done same requirement.

Refer my piece of code-

  • Change schedule line with new qty

t_schedule_lines-itm_number = l_posnr.

t_schedule_lines-sched_line = '0001'.

IF t_order_schedules_out-req_date > sy-datum.

t_schedule_lines-req_date = sy-datum.

t_schedule_lines-dlv_date = sy-datum.

ENDIF.

t_schedule_lines-req_qty = req_qty.

APPEND t_schedule_lines.

CLEAR t_schedule_lines.

t_schedule_linesx-itm_number = l_posnr.

t_schedule_linesx-sched_line = '0001'.

t_schedule_linesx-updateflag = 'U'.

IF t_order_schedules_out-req_date > sy-datum.

t_schedule_linesx-req_date = 'X' .

t_schedule_linesx-dlv_date = 'X'.

ENDIF.

t_schedule_linesx-req_qty = 'X'.

APPEND t_schedule_linesx.

CLEAR t_schedule_linesx.

  • Add new item with remaining qty

t_order_item_in-itm_number = w_next_item.

t_order_item_in-material = t_items-matnr.

t_order_item_in-plant = t_items-werks.

t_order_item_in-store_loc = t_items-lgort.

t_order_item_in-target_qty = w_req_qty.

t_order_item_in-serv_date = req_date.

t_order_item_in-ship_point = '1030'.

APPEND t_order_item_in.

CLEAR t_order_item_in.

t_order_item_inx-itm_number = w_next_item.

t_order_item_inx-material = 'X'.

t_order_item_inx-plant = 'X'.

t_order_item_inx-store_loc = 'X'.

t_order_item_inx-target_qty = 'X'.

t_order_item_inx-serv_date = 'X'.

t_order_item_inx-ship_point = 'X'.

APPEND t_order_item_inx.

CLEAR t_order_item_inx.

  • Create schedule line for newly created item

t_schedule_lines-itm_number = w_next_item.

t_schedule_lines-sched_line = '0001'.

t_schedule_lines-req_qty = w_req_qty.

t_schedule_lines-req_date = req_date.

t_schedule_lines-dlv_date = req_date.

APPEND t_schedule_lines.

CLEAR t_schedule_lines.

t_schedule_linesx-itm_number = w_next_item.

t_schedule_linesx-sched_line = '0001'.

t_schedule_linesx-req_qty = 'X'.

t_schedule_linesx-req_date = 'X'.

t_schedule_linesx-dlv_date = 'X'.

APPEND t_schedule_linesx.

CLEAR t_schedule_linesx.

w_vbeln = t_items-vbeln.

order_header_in-req_date_h = sy-datum.

order_header_inx-updateflag = 'U'.

order_header_inx-req_date_h = 'X'.

logic_switch-scheduling = 'X'.

  • Change sales order

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = w_vbeln

order_header_in = order_header_in

order_header_inx = order_header_inx

logic_switch = logic_switch

TABLES

return = t_return

order_item_in = t_order_item_in

order_item_inx = t_order_item_inx

schedule_lines = t_schedule_lines

schedule_linesx = t_schedule_linesx.

Regards,

Aparna Gaikwad

0 Kudos

Hi Aparna,

Thanks a lot for your soultion, can we call this BAPI save_document_prepare, please let me know where you have called the BAPI.

I need to split the item when user enter's the material number and qty and presses enter in VA01.

Regards,

Vinod

Edited by: Vinod Devo on Sep 15, 2008 5:09 PM