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 change shipment doc

Former Member
0 Likes
2,950

Hi,

I'm using FM BAPI_SHIPMENT_CHANGE to change shipment doc, just to un-tick checkbox "Shipment costs relevance" from shipment header. Below is my code:

DATA: HEADER LIKE BAPISHIPMENTHEADER,
      HEAACT LIKE BAPISHIPMENTHEADERACTION,
      RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.

HEADER-SHIPMENT_NUM = '1121110450'.
HEADER-SHPMNT_COST_REL = ''.

HEAACT-SHPMNT_COST_REL = 'C'.

CALL FUNCTION 'BAPI_SHIPMENT_CHANGE'
  EXPORTING
    HEADERDATA                 = HEADER
    HEADERDATAACTION           = HEAACT
  TABLES
    RETURN                     = RETURN.
IF SY-SUBRC = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ENDIF.

There is no error from RETURN tab and transaction commit, but it doesn't clear the value for field "Shipment costs relevance". Could u please comment?

Hi,

I'm using FM BAPI_SHIPMENT_CHANGE to change shipment doc, just to un-tick checkbox "Shipment costs relevance" from shipment header. Below is my code:

DATA: HEADER LIKE BAPISHIPMENTHEADER,
      HEAACT LIKE BAPISHIPMENTHEADERACTION,
      RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.

HEADER-SHIPMENT_NUM = '1121110450'.
HEADER-SHPMNT_COST_REL = ''.

HEAACT-SHPMNT_COST_REL = 'C'.

CALL FUNCTION 'BAPI_SHIPMENT_CHANGE'
  EXPORTING
    HEADERDATA                 = HEADER
    HEADERDATAACTION           = HEAACT
  TABLES
    RETURN                     = RETURN.
IF SY-SUBRC = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ENDIF.

There is no error from RETURN tab and transaction commit, but it doesn't clear the value for field "Shipment costs relevance". Could u please comment?

4 REPLIES 4
Read only

Former Member
0 Likes
1,081

Hi, this is to update you that my prob resolved. This is what i changed:

HEAACT-SHPMNT_COST_REL = 'D'.

Thanks.

Read only

0 Likes
1,081

Hi

I am having a similar problem to the above. I want to change the shipment planned status (STDIS) from Planned (X) to unplanned (SPACE) and vice versa. Please suggest what should be the values for HEAACT-STATUS_PLAN as I did not understand why you used 'D' for clearing the check box of shipment cost relevance in the earlier case.

Please reply at the earliest.

Thanks!!

Read only

Former Member
0 Likes
1,081

Hi,

I am currently working on the same issue. I need to untick the shipment cost relevance check box under stages tab in VT02N Tcode.

Please suggest how to do this. I am unable to do with the code provided by you.

please guide as you have already solved this before.

thanks for your help in advance.

Read only

Former Member
0 Likes
1,081

Hi abc efc,

            I'm facing the same problem about How to use this BAPI. Can you please tell me when do you find the information?

Where is this BAPI?

Best Regards!

Thanks In Advance!