‎2011 Apr 22 2:49 PM
Hi I am looking change Schedule Line Date at Item List in Sales Order using BAPI_SALESORDER_CHANGE function module.
I am unable to find the fields where I need to give. could you please any one help?
-purna
‎2011 Apr 22 3:14 PM
Hi,
You need to populate SCHEDULE_LINES and SCHEDULE_LINESX.
Like:
G_SCH_LINE_IN-ITM_NUMBER = X_file_struc-posnr.
G_SCH_LINE_IN-SCHED_LINE = '0001'.
G_SCH_LINE_IN-REQ_DATE = SY-DATUM.
G_SCH_LINE_IN-REQ_QTY = X_file_struc-qty.
APPEND G_SCH_LINE_IN TO T_SCH_LINE_IN.
G_SCH_LINE_INX-ITM_NUMBER = X_file_struc-posnr.
G_SCH_LINE_INX-UPDATEFLAG = C_I. " I
G_SCH_LINE_INX-SCHED_LINE = '0001'.
G_SCH_LINE_INX-REQ_DATE = C_X. "X
G_SCH_LINE_INX-REQ_QTY = C_X. "X
APPEND G_SCH_LINE_INX TO T_SCH_LINE_INX.
Hope this helps.
rgds,
Raghav.
‎2011 Apr 22 3:50 PM
Hi Raghav
thanks for your reply.
I have no luck with this code. I am looking to change the date VBEP-EDATU. can you please help me regarding this.
‎2011 Apr 22 4:03 PM
Have you read the documentation?
You need to fill at minimum Sales order number in SALESDOCUMENT and You must always specify the update indicator in ORDER_HEADER_INX. In your case it is 'U'.
Then you need fill the required info in the following structures.
SCHEDULE_LINES - Actual data for example date and so on.
SCHEDULE_LINESX = You need specify 'X' for the same field that you mentioned in the above structure.
Do this:
wa_shd type BAPISCHDL
it_shd type table of BAPISCHDL
wa_shdx type BAPISCHDLX
it_shdx type table of BAPISCHDLX.
Wa_shd-itm_number = vbep-posnr
wa_shd-sched_line = vbep-etenr
wa_shd-DLV_DATE = vbep-edatu (whatever date you want to change to )
Append wa_shd to it_shd
wa_shdx-updateflag = 'U'.
wa_shdx-dlv_date = 'X'
append wa_shdx to it_shdx.
instead of this, you can see the error in return table parameter and change according. if you cannot solve, you better post your code first and then ask users for a solution
‎2011 Apr 25 7:30 PM
Hi I was still not able to change the sales order schedule line date here is my input.
SALESDOCUMENT = 2517085
SCHEDULE_LINES:
ITM_NUMBER 000010
SCHED_LINE 0001
REQ_DATE 05/12/2011
DATE_TYPE
REQ_TIME 00:00:00
REQ_QTY 0.000
REQ_DLV_BL
SCHED_TYPE
TP_DATE
MS_DATE
LOAD_DATE
GI_DATE
TP_TIME 00:00:00
MS_TIME 00:00:00
LOAD_TIME 00:00:00
GI_TIME 00:00:00
REFOBJTYPE
REFOBJKEY
REFLOGSYS
DLV_DATE
DLV_TIME 00:00:00
REL_TYPE
PLAN_SCHED_TYPE
SCHEDULE_LINESX:
ITM_NUMBER 000010
SCHED_LINE 0001
UPDATEFLAG U
REQ_DATE X
DATE_TYPE
REQ_TIME
REQ_QTY
REQ_DLV_BL
SCHED_TYPE
TP_DATE
MS_DATE
LOAD_DATE
GI_DATE
TP_TIME
MS_TIME
LOAD_TIME
GI_TIME
REFOBJTYPE
REFOBJKEY
DLV_DATE
DLV_TIME
REL_TYPE
PLAN_SCHED_TYPE
When run this code, it returns successfully but sales order date is not changed.
please help.
‎2011 Apr 25 7:59 PM
Alright.... You have to troubleshoot the problem.
If you don't receive any error in return table parameter - Are you using commit work after the BAPI call? if no, please commit the changes.
if yes,
add the following in your BAPI
move: u to wa_hdrx-updateflag.
order_header_inx = wa_hdrx (this is the import parameter for bapi)
Next, I see, you have mentioned the req'd date but have tried with DLV_Date ? if not, try that first.
If that doesn't work, then go to the table (Schedule line table) - Check the values and try to use the values and make sure to update the date in each and everyline.
If that doesn't work, Give us more information like what is your requirement i mean, do you want to change the Schedule line date or are you confirming the quantity? or any other ?
good luck
Try all of the above before returning back....
Edited by: Sampath Kumar on Apr 25, 2011 1:00 PM
‎2011 Apr 26 5:32 AM
Alongwith schedule line details, you have to pass item details also (fields ORDER_ITEM_IN-ITM_NUMBER, ORDER_ITEM_INX-ITM_NUMBER , ORDER_ITEM_INX-UPDATEFLAG (U)). In addition to this you should pass 'U' in the structure field ORDER_HEADER_INX-UPDATEFLAG.