I'll try to explain what I would do and what are my requirements.
"As is" situation.
When an Opportunity coming from SAP CRM is correctly received and processed in SAP C4C a new outbound (from C4C) message is automatically generated. This message is the Opportunity Confirmation, directed back to SAP CRM in order to pass to SAP CRM the C4C opportunity ID that will become the external ID in SAP CRM.
For this flow (Opportunity confirmation back to CRM) the standard integration interface grabs from C4C only the C4C Opportunity ID and "hardcodes" in PI mapping the following fields:
PROCESS_TYPE = OPPT (Business Transaction Type)
OBJECT_TYPE = BUS2000111 (Object Type)
Our Issue.
Our problem is in the hardcoded Business Transaction Type.
If we send from CRM to C4C an Opportunity with a custom Business Transaction Type (for example ZOPT) we need that the coming back confirmation message from C4C must contain again this Business Transaction Type otherwise the inbound idoc processor will go in error, status 51, with a "No valid document header could be determined". I tried to edit the IDOC in CRM changing OPPT with the correct code (for example ZOPT) and the I posted it again using BD87. Posting succesful, status 53.
Possible Solution.
I had a look at the data structure of the confirmation service and it has not used field. I want to fill one of those field with the C4C Processing Type Code that is the Business Transaction Type in CRM and another one with the OBJECT TYPE. Then I will create a PI Value Mapping in order to decode the C4C processing type code in SAP CRM Business Transaction Type.
What I miss here is where's the consumer source code that fill the outbound message structure. We are talking about already existing C4C fields that in the case of the Opportunity-Confirmation-to-CRM are not passed.