Skip to Content
0
Former Member
May 21, 2016 at 04:22 AM

BAPI_SHIPMENT_CHANGE Issue

96 Views

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.