Skip to Content

Change Field Value in payload body of standard Artifact CPI

Hi experts!

May be this development is simple but I couldn't find how to solve it in the easiest way, i didn't find any information (may be i use wrong tags)

So Requirement is: From ERP y send sales orders and sales quotes that have currency code " COL " and I need to change it in CPI by " COP " then in C4C will receive it like "COP"

code in payload looks like <CurrencyCode>COL</CurrencyCode>

In CPI im using artifact: "Replicate Sales Order and Sales Quote from SAP Business Suite"

Any idea to change it easyly without losing updates in SAP CPI WEBGUI? Thanks...

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Jul 14, 2020 at 06:18 AM

    Hello Rodrigo,

    You can extend the iflow using below concept so that you will not lose updates.

    https://blogs.sap.com/2018/08/12/extending-standard-integration-flow-to-support-customer-extensions/

    https://blogs.sap.com/2019/02/28/extending-standard-integration-flow-to-support-customer-extensions-part-ii/

    https://blogs.sap.com/2019/08/25/extending-standard-integration-flow-to-support-customer-extensions-part-iii/

    Create a new IFlow with Process Direct adapter with sender Process Direct adapter with url "/ERP/COD/COD_REPLICATE_SALE_ORDER01_PostExit" and perform whatever transformation you are looking for.

    Regards,

    Sriprasad Shivaram Bhat


    Add a comment
    10|10000 characters needed characters exceeded

    • Hi, i got an error, in iFlow "Replicate Sales Order and Sales Quote from SAP Business Suite"

      "Error Details org.apache.camel.component.directvm.DirectVmConsumerNotAvailableException: No consumers available on endpoint: Endpoint[%2FERP%2FCOD%2FCOD_REPLICATE_SALES_ORDER01_PreExit]. Exchange[] "It is suppoused that I dont need to set a PreExit but is needed in the iflow, how can I ignore it ?

      Regards
  • Posted on Jul 13, 2020 at 08:14 PM

    Hi Jordan,

    If you are using the CPI standard iFlows, the only change it allows is configuration of endpoints.

    Any changes made inside the iFlow will still allow updates to come however when you apply the updates, your changes might overwrite.(in your case you will have to update the message mapping and put a condition to change this from COL to COP)

    Regards,

    Yatan

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Jordan,

      Inside the iFlow there is message mapping, you need to edit it, right now it has a direct mapping, i.e. whatever is coming the same data is being passed, you will have to update it and put a condition to check for the string COL and replace it with COP. Later you can use the simulate to test your changes.

      Regards,

      Yatan

  • Posted on Jul 14, 2020 at 05:16 PM

    Hello Rodrigo,

    Unfortunately you need to create 2 IFlows 1 for Pre exit and 1 for post exit as the external parameter you have set is applicable to both the Routers.

    For PreExit you can just create an IFlow without any transformation and put the actual logic in post exit.

    Regards,

    Sriprasad Shivaram Bhat

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Bhat,

      Excuse me but I'm a little lost, i created and mapped pre exit custom iflow like image below with standard mapping pre processing

      later i got error in standard iflow, standard mapping, it says on trace

      " Error Details com.sap.xi.mapping.camel.XiMappingException: com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception during processing target field mapping /ns0:CustomerOrderRequestMassRequest/CustomerOrderRequest/CustomerOrderRequest/Item/ItemFulfillmentStatusCode. The root message is: Exception:[com.sap.aii.mappingtool.tf7.rt.BehaviorInvocationException: Too many values in second queue in function useOneAsMany. It must have over all contexts the same number of values as third queue.] in class com.sap.aii.mappingtool.flib7.NodeFunctions method useOneAsMany[[Ljava.lang.String;@dcbafc7, [Ljava.lang.String;@536821e8, [Ljava.lang.String;@4a87b4d1, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@722b1322, com.sap.aii.mappingtool.tf7.rt.Context@22ce3f37], cause: com.sap.aii.mappingtool.tf7.FunctionException: Too many values in second queue in function useOneAsMany. It must have over all contexts the same number of values as third queue. "

      What am I doing wrong?

      I hope you can help me.

      Regards

      td6ktceaha.png (90.8 kB)
  • Posted on Jul 22, 2020 at 04:16 AM

    Hello Rodrigo,

    You dont have to do any change or mapping on Pre Exit flow,Just create an iflow with Sender and receiver.

    Since you want to change only one field value do it on Post Exit flow ( on the IDoc field ).

    Regards,

    Sriprasad Shivaram Bhat

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.