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

BAPI_SALESORDER_CHANGE lock

Former Member
0 Likes
1,783

Hi all,

I have the following problem. In my code I'm trying to delete a delivery and after that change the schedule line of the salesorder. I'm using the following function/bapi:

WS_DELIVERY_UPDATE (to delete the delivery)

BAPI_SALESORDER_CHANGE (to update the scheduleline lifsp (delivery block))

But the bapi returns errors saying Field LIFSP can't be changed, because there is nog input possible VBEPKOM etc.

Can someone help me with this.

Thnx in advance.

Pieter

Hi all,

I have the following problem. In my code I'm trying to delete a delivery and after that change the schedule line of the salesorder. I'm using the following function/bapi:

WS_DELIVERY_UPDATE (to delete the delivery)

BAPI_SALESORDER_CHANGE (to update the scheduleline lifsp (delivery block))

But the bapi returns errors saying Field LIFSP can't be changed, because there is nog input possible VBEPKOM etc.

Can someone help me with this.

Thnx in advance.

Pieter

11 REPLIES 11
Read only

Former Member
0 Likes
1,461

Hi Pieter,

The error you are getting is related to the conditions tab in the BAPI SALES ORDER CHANGE . But this is not a mandatory tab.

if you want to change delivery , you only need to update orders and delivery tab

and in the orderx and deliveryx tab u need to update the indicators for whatever fields you want to update.

if you have all the above parameters correct, pls paste your code and maybe i can help.

tc

sajimon chandran

Read only

0 Likes
1,461

Hi Sajimon,

Thanks for the quick reply. I'm just confused with you reply because in the BAPI SALESORDER CHANGE there is no deliveryx to fill. What I have done is the following:


call function 'BAPI_SALESORDER_CHANGE'
     exporting
      salesdocument    = wa_tussen-order
      order_header_inx = wa_order_header_inx
      tables
      return           = gi_return
         schedule_lines   = gi_schedule_lines
        schedule_linesx  = gi_schedule_linesx.

Read only

0 Likes
1,461

Sorry for the last post, some code is missing. Here again the code:


    wa_schedule_lines-itm_number = wa_tussen-orderpositie.
    wa_schedule_lines-sched_line = '0001' .
    wa_schedule_lines-req_dlv_bl = '15'.

    append wa_schedule_lines to gi_schedule_lines.

    wa_schedule_linesx-itm_number = wa_tussen-orderpositie.
    wa_schedule_linesx-sched_line = '0001'.
    wa_schedule_linesx-updateflag = 'U'.
    wa_schedule_linesx-req_dlv_bl = 'X'.

    append wa_schedule_linesx to gi_schedule_linesx.

      call function 'BAPI_SALESORDER_CHANGE'
        exporting
          salesdocument    = wa_tussen-order
          order_header_inx = wa_order_header_inx
        tables
          return           = gi_return
          schedule_lines   = gi_schedule_lines
          schedule_linesx  = gi_schedule_linesx.

      if   gv_recordfout = 'X'.
        move   wa_return-message to wa_tussen-omschrijving.
        append wa_tussen to gi_fout.
        continue.
      endif.

      call function 'BAPI_TRANSACTION_COMMIT'
        exporting
          wait   = 'X'
        importing
          return = wa_return.

Read only

0 Likes
1,461

Hi,

Can you post the error message number and id?

Is it possible to change the field value online via VA02 transaction?

Incase it is not then there might be some functional reason for the same which you need to understand with your functional consultant.

Regards,

Ankur Parab

Edited by: Ankur Parab on Aug 20, 2009 3:04 PM

Read only

0 Likes
1,461

See here the records of the return table:

TYPE ID NUMBER MESSAGE

I |V1 |739 |Veld 'LIFSP' niet wijzigbaar, omdat geen

E |V4 |219 |Verkoopdocument 0006479955 is niet gewijz

Message tekst is in dutch.

Pieter

Read only

0 Likes
1,461

Hi,

Can the field changed online via VA02?

Did you check the same?

Regards,

Ankur Parab

Read only

0 Likes
1,461

Hi,

Yep I can change the field in VA02.

Pieter

Read only

0 Likes
1,461

Hi,

Is the UPDATEFLAG passed in the structure ORDER_HEADER_INX?

Regards,

Ankur Parab

Read only

0 Likes
1,461

Hi Ankur,

Yes.

Pieter

Read only

0 Likes
1,461

Hi,

Try passing the item details also to the BAPI.

ORDER_ITEM_IN and ORDER_ITEM_INX

Regards,

Ankur Parab

Edited by: Ankur Parab on Aug 20, 2009 4:51 PM

Read only

Former Member
0 Likes
1,461

Hi,

I think that you should use BAPI_TRANSACTION_COMMIT or COMMIT WORK statement after calling the BAPI.

Hope , it works fine for you.

Thanks,

Sarita Singh