‎2017 Dec 12 7:00 AM
Hi,
thru ABAP, is it possible to remove 'schedule line' for item(s) (make this field blank) using BAPI_SALESORDER_CHANGE ?
I tried using it, may be am missing something.
Aditya V
‎2017 Dec 12 8:15 AM
‎2017 Dec 12 12:16 PM
Hi Lakshmipathi,
my requirement is that thru ABAP I want to remove the entry for schedule line (VBEP-LIFSP, which you see under Schedule lines tab and field is 'Delivery Block') item to blank.
Thanks,
Aditya V
‎2017 Dec 12 8:21 AM
I do not know what exactly you passed as parameters, so I will share what I populated for a blocked schedule line from 06 to ' ' via a test sequence of this bapi and bapi_transaction_commit:
SALESDOCUMENT = '13761'
ORDER_HEADER_INX-UPDATEFLAG = 'U'
SCHEDULE_LINESX:
ITM_NUMBER = '000010'
SCHED_LINE = '0001'
UPDATEFLAG = 'U'
REQ_DLV_BL = X
SCHEDULE_LINES:
ITM_NUMBER = '000010'
SCHED_LINE = '0001'
REQ_DLV_BL = ' '
Is it possible that you are trying to modify the wrong schedule line? I used BAPISDORDER_GETDETAILEDLIST to check the right schedule line number for my item.
‎2017 Dec 12 12:20 PM
Hi Vaselina,
thanks for the response, below is my code.
-------------
l_salesdocument = '211435122'.
ls_bapisdhlx-updateflag = 'U'.
ls_bapischdlx-ITM_NUMBER = '000010'.
ls_bapischdlx-SCHED_LINE = '0001'.
ls_bapischdlx-updateflag = 'U'.
ls_bapischdlx-REQ_DLV_BL = 'X'.
APPEND ls_bapischdlx to lt_bapischdlx.
ls_bapischdl-ITM_NUMBER = '000010'.
ls_bapischdl-SCHED_LINE = '0001'.
ls_bapischdl-REQ_DLV_BL = ''.
APPEND ls_bapischdl to lt_bapischdl.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING SALESDOCUMENT = l_salesdocument
ORDER_HEADER_INX = lt_bapisdhlx
TABLES RETURN = ireturn
SCHEDULE_LINES = lt_bapischdl
SCHEDULE_LINESX = lt_bapischdlx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
-------------
Anything missing? 🙂
Thanks,
Aditya V
‎2017 Dec 12 12:40 PM
I am not a developer, but your code looks OK assuming that this is the right item and schedule line and that the schedule line block is modifiable in the order.
I apologize for asking about something that you have probably checked already, but do you see something out of the ordinary in the return table? For example if I try to clear the block of a rejected item, I will have Field 'LIFSP' cannot be changed, VBEPKOM 000010 0001 ready for input.
If you see nothing unusual, only success infos - is there any possibility that the schedule line block is set automatically after you save via some custom code?
‎2017 Dec 13 7:00 AM
Hi Veselina,
why apologies 🙂 you helping me out 🙂
However in return table I see "Field header_inx-updateflag0 is not an input field" though I am filling that field with 'U'.
Aditya V
‎2017 Dec 13 7:41 AM
Sometimes developers get offended if you ask them to check something that they have already done 🙂
If I understood correctly, the reason why the delivery block is not cleared is the error that you get in the return table.
I only used a test sequence, I did not try your code. 🙂
It is strange that you receive an error for updateflag0 (if this is not a typo), because in my system there is no such field in header_inx, I have just header_inx-updateflag.
This is probably a dumb question, but you set ls_bapisdhlx-updateflag = 'U', but when you call the first BAPI you use ORDER_HEADER_INX = lt_bapisdhlx. I do not see in the code sample where you populate lt_bapisdhlx with values and I did not understand why you need to use lt_bapisdhlx instead of ls_bapisdhlx when you require a single line. My guess is that this is where your problem lies, because I tried with a test sequence with the same data and only removed updateflag. As a result I got E 00 347 "Field header_inx-updateflag is not an input field". If the message that you have is exactly like mine - please try using ls instead of lt.
‎2017 Dec 12 1:11 PM