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_SHIPMENT_CHANGE Issue

Former Member
0 Likes
1,343

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
Read only

SimoneMilesi
Active Contributor
0 Likes
1,223

Attention, check the domain for fields in HEADERDATAACTION.

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

3 REPLIES 3
Read only

SimoneMilesi
Active Contributor
0 Likes
1,224

Attention, check the domain for fields in HEADERDATAACTION.

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

Read only

0 Likes
1,223

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?

Read only

0 Likes
1,223

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