Application Development and Automation 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: 
Read only

Remove Schedule line Block

former_member184495
Active Contributor
0 Likes
2,962

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

8 REPLIES 8
Read only

Lakshmipathi
SAP Champion
SAP Champion
0 Likes
2,351

You need to brief more on what exactly your requirement is. Also, I am not sure, whether you have already discussed with the SD functional consultant if you are not a functional consultant. If discussed, share the screen where you want the control.

Read only

0 Likes
2,351

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

Read only

VeselinaPeykova
Active Contributor
2,351

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.

Read only

0 Likes
2,351

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

Read only

0 Likes
2,351

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?

Read only

0 Likes
2,351

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

Read only

0 Likes
2,351

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.

Read only

Lakshmipathi
SAP Champion
SAP Champion
0 Likes
2,351

You can try with USEREXIT_MOVE_FIELD_TO_VBEP