Application Development 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: 

Updating delivery block using 'BAPI_SALESDOCUMENT_CHANGE'

Former Member
0 Kudos

Hi!

I need to update the delivery block field of a sales order.

I am using 'BAPI_SALESDOCUMENT_CHANGE' and passing

delivery block also.

ls_order_header_in-dlv_block = lp_lifsk.

ls_order_header_inx-dlv_block = lp_lifsk.

Could you please let me know how to achieve it.

Thanks.

-Shreyas

PS: Helpful answers will be rewarded.

8 REPLIES 8

Former Member
0 Kudos

Hi,

Check whether u call this function module 'BAPI_TRANSACTION_COMMIT' and check whether u have set this flag ls_order_header_inx-updateflag = 'U'.

Adithan S.

Former Member
0 Kudos

Hello,

I see that you are using the same field (lp_lifsk) to fill both structures ( HeaderIn and HeaderInX ).

In fact dlv_block in HeaderInX is a CHAR1, and should be filled with an X if you want to update the field.

Don't forget to set the UpdateFlag in HeaderInx to 'U'.

Regards,

Ivo Martins

Former Member
0 Kudos

Hi

please check the following code ..hope it will help you

LOOP AT l_i_headr ASSIGNING <l_fs_headr>.

l_wa_order_in-dlv_block = space(the desired value which u want to update).

l_wa_header_inx-updateflag = l_c_update.

l_wa_header_inx-dlv_block = l_c_set.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = <l_fs_headr>-vbeln

order_header_in = l_wa_order_in

order_header_inx = l_wa_header_inx

TABLES

return = l_i_return.

  • Check for abort messages and error messages

LOOP AT l_i_return TRANSPORTING NO FIELDS WHERE type EQ l_c_abort OR

type EQ l_c_error.

  • Set the flag to indicate that there is an error.

l_v_error_flg = l_c_set.

ENDLOOP.

*Commit the changes in the database only if there are no errors

IF l_v_error_flg IS INITIAL.

*UPDATE the delivery block to space

  • Commit work

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = space.

ELSE.

  • Roll back the changes if there are errors.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ENDIF.

ENDLOOP.

Former Member
0 Kudos

try

ls_order_header_inx-dlv_block = 'X'

ls_order_header_inx-Updateflag = 'U'.

0 Kudos

Hi Experts,

I too have the same issue.

If it is resolved, please let me know the solution.

Thanks much in advance.

Best regards,

Naveen

0 Kudos

Hi Experts,

I too have the same issue.

If it is resolved, please let me know the solution.

Thanks much in advance.

Best regards,

Naveen

0 Kudos

Hi Experts,

I too have the same issue.

If it is resolved, please let me know the solution.

Thanks much in advance.

Best regards,

Naveen

0 Kudos

Hi Experts,

I too have the same issue.

If it is resolved, please let me know the solution.

Thanks much in advance.

Best regards,

Naveen