Skip to Content
0
Jun 29, 2009 at 02:38 PM

BAPI 'BAPI_SALESORDER_CHANGE' - Change a field

782 Views

Hi all!

I am doing an exercise which it's necessary to change just one field (PO number) in a sales order using the BAPI from the subject. After the execution of the BAPI, "return" table shows the following message:

E |V2 |051 |Terms of delivery FH are not defined. <

E |V4 |219 |Sales document 0000001666 was not changed<

Here follows the code:

DATA: " for BAPI use
    v_vbeln LIKE vbak-vbeln, " order that i would like to change
    v_order_header_in LIKE bapisdh1, 
    v_order_header_inx LIKE bapisdh1x,
    v_purch_no_c LIKE bapisdh1-purch_no_c, "
    v_return LIKE TABLE OF bapiret2.

"(...)

INITIALIZATION.
  p_vbeln = 1666.
  v_order_header_inx-updateflag = 'U'.
  v_order_header_inx-purch_no_c = 'X'.

"(...)

  CONCATENATE 'test_' v_purch_no_c INTO v_purch_no_c.
  v_order_header_in-purch_no_c = v_purch_no_c.
  v_order_header_inx-purch_no_c = 'X'.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
      salesdocument               = v_vbeln
      order_header_in             = v_order_header_in
      order_header_inx            = v_order_header_inx
    TABLES
      return                      = v_return.

If sy-subrc = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

What does the error "Terms of delivery FH are not defined" mean? Did i forget to import an obligatory entry?

Thanks a lot!