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

a question on bapi call -- BAPI_SALESDOCUMENT_CHANGE

Former Member
0 Likes
1,911

hi all,

i have the following code to update sales order header level delivery block.

i noticed that certain sales order are updated successfully while the other failed with the following message:

"Field 'LIFSK' cannot be changed, VBAKKOM 0001279765 ready for input".

is this something to do with the sales order data or some program problem?

*update header level delivery block

v_head1x-DLV_BLOCK = 'X'.

v_head1x-updateflag = 'U'.

v_head-DLV_BLOCK = w_so-lifsk.

CALL FUNCTION 'BAPI_SALESDOCUMENT_CHANGE'

EXPORTING

salesdocument = w_so-vbeln

order_header_in = v_head

order_header_inx = v_head1x

  • SIMULATION = ' '

TABLES

return = return.

8 REPLIES 8
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,400

It means that the field cannot be changed. If you go to VA02, most lkely you'll see that it is grayed out. Also might be an authorization issue.

Read only

Former Member
0 Likes
1,400

Hi,

Please check that for the erred sales orders whether the deliveries have been already created...?

I am assuming that after creating the delivery for a sales order then you can not able to update the delivery block on the sales order. Any way this is depending upon the definition of Delivery block you configured.

Read only

Former Member
0 Likes
1,400

Hi,

The document is actually open, not yet deliver and i'm able to edit through VA02.

What could be the other reason caused this problem?

Read only

0 Likes
1,400

Well, you said that only some orders are failing - try to find what's so different about them. Also check if there are any other messages in the RETURN table.

Sometimes these errors might be difficult to catch because the field might not be available for input only at the moment when your BAPI runs, but later, when you go to VA02, it is available. Here is an example. We were trying to update the reason for rejection field. It becomes available, for example, when the delivery line item has been confirmed, but for the lower amount. The program with BAPI was running at the background. Sometimes there was an error in the delivery, which was corrected by a user. So when later in the day we went to research this, we couldn't figure out what's wrong. You might want to check the Changes log on the order and on the delivery.

And, of course, there is always the debugger - set the whatchpoint for where this message occurs.

Read only

0 Likes
1,400

Hi Jelena, can you tell me please how to fill this BAPI to update the reason for rejection field?

Thank you very much

Leonardo P.

Read only

0 Likes
1,400

You need to fill in order_header_in and order_header_inx table fields and the order_header_inx structure as follows:

CONSTANTS:
      c_updateflag(1)  TYPE c VALUE 'U',
      c_updatefield(1) TYPE c VALUE 'X',

    s_da_order_item_in-material   = <MATNR>.
    s_da_order_item_in-itm_number = <POSNR>.
    s_da_order_item_in-reason_rej = <rejection reason>.
    APPEND s_da_order_item_in.

    s_da_order_item_inx-updateflag = c_updateflag.
    s_da_order_item_inx-reason_rej = c_updatefield.
    s_da_order_item_inx-itm_number = <POSNR>.
    APPEND s_da_order_item_inx.
  
    s_da_order_header_inx-updateflag = 'U'.

Order number should be in salesdocument FIELD when calling BAPI.

Read only

Former Member
0 Likes
1,400

hi all,

after few tries, we found that "Field 'LIFSK' cannot be changed, VBAKKOM 0001279765 ready for input".

this message come when we try to update the delivery block with some value when the delivery block in the sales document is blank (no block).

please advise how to solve the problem. thanks.

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,400

This is rather strange. I have a code example from a previous project where the code was the same as above and it worked perfectly. However, when I ran the same code in a small test program in the current system, I got the same 'not available for input' error message...

Please take a look at the note 170028. Even though it is an old note and we are on ECC 6.0, I've discovered that, in fact, the corrections described in it are not present in our system.

If this does not work, I'd suggest sending a message to SAP.