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: 

BAPI_SHIPMENT_CHANGE Issue

Former Member
0 Kudos

Hi,

I'm trying to change a shipment field using the code below, but so far it didn't get updated. Could you please help me?

            RfcRepository repo = destination.Repository;

            IRfcFunction salesShip = repo.CreateFunction("BAPI_SHIPMENT_CHANGE");

            IRfcFunction salesShipCommit = repo.CreateFunction("BAPI_TRANSACTION_COMMIT");

          

            IRfcStructure salesShipHeader = salesShip.GetStructure("HEADERDATA");

            salesShipHeader.SetValue("SHIPMENT_NUM", "0011406654");

            salesShipHeader.SetValue("SERVICE_AGENT_ID", "30003367");

            IRfcStructure shipHeaderAction = salesShip.GetStructure("HEADERDATAACTION");

            shipHeaderAction.SetValue("SERVICE_AGENT_ID", "X");

            RfcSessionManager.BeginContext(destination);

            salesShip.Invoke(destination);

            salesShipCommit.Invoke(destination);

            RfcSessionManager.EndContext(destination);

I don't receive any error message in the return.

1 ACCEPTED SOLUTION

SimoneMilesi
Active Contributor
0 Kudos

Attention, check the domain for fields in HEADERDATAACTION.

It's not "Blank" or "X" but instead A-D-C

3 REPLIES 3

SimoneMilesi
Active Contributor
0 Kudos

Attention, check the domain for fields in HEADERDATAACTION.

It's not "Blank" or "X" but instead A-D-C

0 Kudos

Thank you so much for your help! I change the value to C and it worked perfectly!

What is the transaction that you use to check the domain for the fields?

0 Kudos

Hi Leandro,

For this kind of issue, in SE37, double click on the structure, double click on the data element, double click on the domain.

If you already know the domain name, you can use SE11