cancel
Showing results for 
Search instead for 
Did you mean: 

How to update Profit Center in S/4HANA with SOAP service profitcentrereplicationbulkreq?

Dear community,

I am trying to update profit centers using the following SOAP API:

SAP Documentation

My communication arrangements are all setup and calls made from SoapUI reach the S/4HANA Message Dashboard. Within the dashboard, we see the error message: Profit Center already exists from 05/18/2020 to 12/31/2030.

Clearly, S/4HANA thinks I want to create the Profit Center, but in fact I want to update the existing one.

The sent payload is as follows:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <ns3:ProfitCentreReplicationBulkRequest xmlns:ns3="http://sap.com/xi/SAPGlobal20/Global">
         <MessageHeader>
            <CreationDateTime>2020-05-18T00:00:00.000</CreationDateTime>
         </MessageHeader>
         <ProfitCentreReplicationRequestMessage>
            <MessageHeader>
               <CreationDateTime>2020-05-18T00:00:00.000</CreationDateTime>
            </MessageHeader>
            <ProfitCentre actionCode="04" nameListCompleteTransmissionIndicator="false" companyAssignmentListCompleteTransmissionIndicator="true">
               <ID>A00099999</ID> <- Area code + profit center ID
               <BusinessCharacterValidityPeriod>
                  <StartDate>2020-05-18</StartDate>
                  <EndDate>2030-12-31</EndDate>
               </BusinessCharacterValidityPeriod>
               <Name>
                  <Name languageCode="EN">English Name</Name>
                  <Description languageCode="EN">English Description</Description>
               </Name>
               <SegmentAssignment>
                  <SegmentID>1000_S</SegmentID>
               </SegmentAssignment>
               <CompanyAssignment>
                  <CompanyID>4000</CompanyID> <- our actual company code is different
                  <CompanyIdentifierUsageCode>AA</CompanyIdentifierUsageCode>
               </CompanyAssignment>
               <ResponsibleManager>
                  <ResponsibleManagingEmployeeID/>
                  <FormattedName>Kevin Dekker</FormattedName>
               </ResponsibleManager>
            </ProfitCentre>
         </ProfitCentreReplicationRequestMessage>
      </ns3:ProfitCentreReplicationBulkRequest>
   </soapenv:Body>
</soapenv:Envelope>

When I do not send one of the nodes 'ResponsibleManager, CompanyAssignment, or SegmentAssignment' I get the notification in the message dashboard: "not all required fields are filled". Another indication that the API expects me to create a new rather than update an existing profit center. I have tried to leave out the action code and filling it with a space, resulting in the same error: "profit center already exists from ..."

The same method / message structure worked for me with cost center updates. I must be doing something wrong, but haven't found out what it is.

Does anyone know how to update a profit center using this S/4HANA SOAP API?

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Amith_Nair
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kevin,

I am sure you may have come to a conclusion, but strange enough, as of 2108.1 release, this is not possible, I vaguely remember this was available in the past( back to 1808 release and prior) but I request to raise an influence/improvement request to have them back although this may be already under consideration for SAP Product Development.

Hope to have better solution in the near future!

Thanks!

Amith Nair

Answers (0)