Value mapping in the adapter module

Hi all...
There was been alot of writing about value mapping in many different ways.
But I have not been able to find help about doing the lookup in the adapter module.
Has anyone tried this?
Regards Peter

Hi,
In this case you can perfrom a RFC Lookup, but, from an Adapter Module, you would need to use the concept of JRA to do the same.
Amol Joshi has described how he called the Alerts RFC from the adapter module in these blogs and you can apply the same logic for your case as well to trigger the RFC from your module, get the data and then do the needful.
/people/amol.joshi2/blog/2006/11/27/alerts-from-adapter-modules--the-jra-way
/people/amol.joshi2/blog/2006/11/28/alerts-from-adapter-modules--the-jra-way-part-ii
Regards
Bhavesh

Similar Messages

  • Value mapping access from XI module adapter

    Hi,
    is it possible to access a value mapping from an XI module adapter?
    Thanks
    Yann

    hi
    1)what is the differnce between ValueMappingReplication(Asynchronous) and ValueMappingReplicationSynchronous .
    In sync you will get the value mapping replication status back and in async you won't. In sync based on the response u can update again in case of any failure. If data size is large use async.
    2) Message type ValueMappingReplication contains Operation ,GroupId,Context,scheme,agency.
    what is the meaning of Operation??
    The operation that you are going to perform. Below is the operations list and the contents to be set in the message for the same
    Insert = all fields must be set;
    Delete =all fields must be set;
    DeleteGroup = fields GroupID and context must be set;
    DeleteContext = field Context must be set;
    DeleteContextGeneric = Context contains the starting part for the context to be deleted
    what is the use of group ID??
    Displays the different representations of an object.
    A value mapping group is identified uniquely by a GUID.
    You can also assign a name to a value mapping group.
    is this necessary to maintain all these values in Ztable and also source and target values ?? and use them in Abap aproxy logic??
    no. system creates the value mapping table. you can take it frm there. no need of any ztables.
    3) is there any Message Mapping Needed.?? and Interface Mapping Needed to implement value Mapping replication??
    You will be sending the value mapping data from a sender system. If it can sent in the same format not required, otherwise you will have to.
    4)what is the Sender Adapter type ??
    Any adapter...depends on the sender system.
    5) if I did replication from SAP..can I see the details in ID
    You can see it in Cache monitoring in RWB.
    for more details refer
    http://help.sap.com/saphelp_nw70/helpdata/EN/13/ba20dd7beb14438bc7b04b5b6ca300/content.htm
    rgds
    Arun

  • ModuleData.getPrincipalData returns null in the adapter module development

    Hi gurus,
    i am doing a test on the adapter module development following an article written by William Li:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0ac06cf-6ee2-2c10-df98-e17430ca5949?QuickLink=index&overridelayout=true
    my problem is after the EJB has been deployed, it seems that the return of inputModuleData.getPrincipalData() is always null which makes the program can not get the xml payload from the framework.
    the main process of the example has been simplified like this:
         public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {
              Object           obj = null;
              try {
              obj = inputModuleData.getPrincipalData();
              Message     msg1 = (Message) obj;          
                    XMLPayload xmlpayload = msg1.getDocument();}          
              catch (Exception e) {
                   ModuleException me = new ModuleException(e);
                   throw me;
              return inputModuleData;
    after deployed, i get the following error in the adapter monitor of RWB: (my JNDI is testtest)
    17.02.2012 17:13:44.643 Information Send binary file  "test8.xml" from FTP server "10.18.48.150:/encrypt_test/", size 206 bytes with QoS EO
    17.02.2012 17:13:44.644 Information MP: processing local module localejbs/CallSapAdapter
    17.02.2012 17:13:44.644 Information Application attempting to send an XI message asynchronously using connection File_http://sap.com/xi/XI/System
    17.02.2012 17:13:44.645 Information Trying to put the message into the send queue
    17.02.2012 17:13:44.648 Information MP: processing local module localejbs/testtest
    17.02.2012 17:13:44.648 Error MP: exception caught with cause java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.Message.getDocument() of an object loaded from local variable 'msg1'
    whereas if the code has been changed like this:
         public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {
              Object           obj = null;
              try {
                   obj = inputModuleData.getPrincipalData();
                   Message     msg1 = (Message) obj;     
                   if (obj != null )
                        XMLPayload xmlpayload = msg1.getDocument();
              catch (Exception e) {
                   ModuleException me = new ModuleException(e);
                   throw me;
              return inputModuleData;
    the file can be read by the file adapter.
    i just quite confused that why the return of the getPrincipalData() is null? where is the problem? thanks
    Edited by: Stephen Xue on Feb 17, 2012 5:22 AM

    I'm gonna reply to myself here. I changed the processing sequence of the adapter modules in the  in the FileSender channel so that my module comes first then CallSapAdapter. Then getPrincipalData() contains the message.
    Hope this helps someone else.

  • Retrieving the file name in the adapter module in the sender file adapter

    hi,
    i need to retrieve the file name, in the adapter module. This module is placed in the sender file channel.
    After the file adapter has picked up the file from the file directory, the file is placed in the archived directory.Custom adapter mofule is place in the file shanel. i need to retrieve the file name of the file in the adapter module. Is it possible to retrieve the file name?
    Also is it possible to retrieve the archive directory path in module?
    Regards,
    Meenkashi

    Hi Meenakshi,
    I guess you are looking for this
    /people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules
    Regards
    Suraj

  • Retreving Values from RFC in Adapter Module

    Hi All
    I have a scenario where I have to retreive a value from database table using RFC and import those values in adapter module for comparing it with some other Values. Can some one guide me how to retreive values in RFC using Adapter module. Some standard methods would be really helpful.
    Regards
    Abhishek Mahajan

    hi
    check this
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70d90a91-3cf4-2a10-d189-bfd37d9c3231
    bvr

  • Naming a file in the adapter module

    Hi All,
    I have written an adapter module that is used in a receiver mail adapter. In my module I am renaming the attachment name to "abc.cpi". The problem is I am getting the output from the adapter as abc.cpi.xml. I tried changing the content type in the adapter module to text/plain that gave me an output as abc.cpi.txt. How can I get only abc.cpi as the name of the attachment using this module?
    Thanks
    Abinash

    Hi,
    This might be help you
    http://help.sap.com/saphelp_nw04/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Regards
    Agasthuri Doss

  • A problem with ACL in the class-map on the ACE module

                      Hi all,
    I configured the following on the ACE module:
    object-group network test
      host 192.168.1.21
      host 192.168.1.22
      host 192.168.1.23
    object-group service port
      tcp eq www
      tcp eq 8080
    access-list T line 8 extended permit object-group port object-group test any
    I tried to configure a class-map for matching this ACL:
    ACE-4710-2/Lab-OPT-11(config)# class-map match-any TEST_C
    ACE-4710-2/Lab-OPT-11(config-cmap)# match access-list T
    Error: Cannot associate acl having object-group ACEs in class-map.
    So couldn't I  configure the class-map by using ACL with object-groups involved? Is it the bug or the normal behaviour? Because the customer uses object-groups in ACLs and he has to configure ACL without object-groups for the traffic classification. It is horrible.
    Thank you
    Roman

    Hi Roman,
    I'm afraid it's the expected behavior. You cannot use an ACL with object-groups inside a class-map.
    Regards
    Daniel

  • Error while deploying the Adapter Module

    Expets,
    i am getting below error in communication channel:
    Message processing failed. Cause: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name localejbs/WriteExcelFile, cannot resolve object reference. [Root exception is javax.naming.NamingException: Error occurs while the EJB Object Factory trying to resolve JNDI reference Reference Class Name: Type: clientAppName Content: sap.com/WriteExcelEAR Type: interfaceType Content: local Type: ejb-link Content: WriteExcelFile Type: jndi-name Content: WriteExcelFile Type: local-home Content: com.sap.aii.af.lib.mp.module.ModuleLocalHome Type: local Content: com.sap.aii.af.lib.mp.module.ModuleLocal com.sap.engine.services.ejb3.runtime.impl.refmatcher.EJBResolvingException: Cannot start applicationsap.com/WriteExcelEAR; nested exception is: java.rmi.RemoteException: [ERROR CODE DPL.DS.6125] Error occurred while starting application locally and wait.; nested exception is: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: [ERROR CODE DPL.DS.5035] Application [sap.com/WriteExcelEAR] cannot be started. Reason: it has hard reference to resource [com.sap.xi.repository] with type [library], which is not active on the server. Hint: 1) Is referred resource deployed? 2) Is referred resource able to start? at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.startApp(DefaultContainerRepository.java:315)
    I am also getting the same warning when i am deploying the adapter.
    Reference list in   application-j2ee-engine.xml   is as follows:
    engine.security.facade
    engine.j2ee14.facade
    com.sap.aii.af.svc.facade
    com.sap.aii.af.ifc.facade
    com.sap.aii.af.lib.facade
    com.sap.base.technology.facade
    com.sap.xi.repository
    Kindly help.
    Edited by: Priyanka Sharma on Jun 18, 2010 4:29 PM

    com.sap.xi.repository reference is not required,, how are you deploying your module on PI server,
    You must be using some external library for excel conversion, if external library is present in your deployed file, you don't need to add com.sap.xi.repository reference.
    Check:
    Is EAR to SDA conversion needed for EJB EAR module
    if you opt to use CECLT tool provided with NWDS 7.1, make sure you import SAP EAR File(it will have External library) on your local system.

  • Value mapping in the ERP system during IDOC creation

    We have a PI File-IDOC scenario.
    We can translate simple mappings such as currency or unit of measure in PI(7.1) using the Value Mapping function. For complicated mappings involving business logic (e.g. Tax code which is derived from multiple fields) we want to perform these mapping in the ERP (ECC6) system. Is there an approved generic SAP standard process where these value mappings can be done in the IDOC creation which is still valid when re-processing?
    e.g. a specific BADI or enhancement point recommended for these mapping?
    There might also be a requirement to add segments based on value mapping logic for example when a tax record segment is only required for a non-zero tax code which is mapped via business logic.
    Can someone please direct me in the right direction.

    Thanks for your answers but I assumed that using a user exit / Enhancement point was obvious. What I'd like to know is a generic entry point that I can estabolish a IDOC enhancement framework. Somewhere I can call a class containing methods linked to IDOC message types
    e.g. Call similar to my prototype (this will be where dependant on mappings certain segments will need to be inserted such as tax segments.
      ASSIGN control-mestyp TO <mestyp>.
        CALL METHOD (<mestyp>)
          EXPORTING
            control        = control
            data           = data
          IMPORTING
            have_to_change = have_to_change
            protocol       = protocol
            new_entries    = new_entries.
    The "entry point" must be processed both at creation and reprocess. We are also dealing with Inbound IDOCs not outbound

  • Set a variable in Adapter Module and read it during message mapping

    Hi guys,
    is there any way, how I could set some variable and store its value during the adapter module processing and read back this value in message mapping and use it? Without using a database or files.. I mean, some j2ee storage or something like that..
    Thanks for your help,
    Olian

    Hi guys,
    thanks for your answers..  just a clarification, what the problem is.
    I need to validate a message in the adapter module, if it's digital signature is valid. If it is, I need to send back to the sender a return code (message) OK, otherwise ERROR. I can't modify the message (or dynamic configuration) as I'm using a WSS in the sender channel. The system doesn't allow me to change anything in the message, so I can't find out in the mapping what the validation result was. I then tried to do the validation directly in the message mapping, but I have some issues there with libraries or what, because the validation code, which works in the adapter module, doesn't work in the mapping java class. So my final thought was maybe I could validate the message in the adapter module and pass the result to the message mapping and then create an appropriate return message (in the mapping). However, I see no way of passing a value there. I'm stuck and have no Idea how to resolve the problem. Any hints guys?
    Thanks a lot for your help!
    Olian

  • Setting the charset from an adapter module

    Hi folks,
    I'm trying to set the charset encoding of a payload using an adapter module (I know there is a TextCodepageConverterBean, but I want to set the charset for a message that hasn't one yet). The problem is probably more clear using an example.
    I output a UTF-8 flat string from my message mapping to the adapter framework (mail adapter in my case). Afterwards I want to convert this UTF-8 string to an ISO-8859 encoding with the TextCodepageConverterBean. But if I set the charset using the setContentType() function of my TextPayload object the information gets cut away. I'm using the format
    setContentType("text/plain;charset=utf-8;name=Test.txt")
    . But everything after the first semicolon is dropped. Setting the charset using the MessageTransformBean works, but I want to avoid this by all means, as I need to set the mime type from the adapter module.
    This is running on NW2004 with SP 16 and the latest patch.
    Any idea, why the MessageTransformBean works and not the setContentType call?

    This bug will be fixed with SP20.
    Regards
    Stefan

  • Modify the payload in a soap receiver adapter module

    Hi all,
    I have an scenario where I should modify the soap_body tag (adding a head and a tail).
    I have implemented it using an adapter module, since the mapping is for business stuff and this head and tail is just a technical requirement of the third party web service
    It works fine when I use a file channel for testing, but when added to the soap channel, then leaves the soap body empty.
    Is there any difference between using the Adapter module on a file channel and a soap channel?
    regards,
    David R.

    David,
    Is your requirement that you need to create the SOAP enevlope with some custom fields when sending the data to the SOAP adapter?
    if yes, this is what you need to do,
    1. In your mapping ( using XSL or Java ) create the Entire SOAP envelope including the SOAP header and the SOAP Body.
    2. In the receiver SOAP adapter, select option "Do not use SOAP Envelope".
    By default, the SOAP adapter creates the SOAP Envelope for the message and strips out the SOAP content for the response. If you need to add custom fields etc in the SOAP header you need to manually create the SOAP header and body and then select the above option.
    Regards
    Bhavesh

  • Adapter Module Error-Sending excel file as an attachment of the mail

    Hi ,
    My scenario is as follows
    1)I am sending an excel file as an attachment of the mail.I need to read that excel attachment as a payload.
    So mail adapter is used in sender side.
      To configure this, have used standard PayloadSwapBean  module with proper module key.
      Next to convert excel to XML another custom adapter module is being used.
    Both this adapter module , I configured into the CC of sender mail adapter.
    The order in which adapter modules are being used in the sender CC are as follows
    1)localejbs/AF_Modules/PayloadSwapBean
    2)localejbs/MDPExcelToXMLConversion
    3)sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    MDPExcelToXMLConversion-Custom adapter module written to convert excel to xml.
    I am getting the following error
    exception caught during processing mail message [4899]com.sap.aii.af.lib.mp.module.ModuleException
    And also,
    no messages in coming MONI of PI.
    Pls suggest what to do.
    Thanks
    Ayan

    Shabarish,
    Will the ordering in which the adapter modules(In this case there are two-PayloadSwapBean & MDPExcelToXML) are appearing into Module tab of sender adapter matter?
    Firstly, what is happenning
    1)If I take out the custom  adapter module MDPExcelToXML and put only PayloadSwapBean  then it is successfully converting mail attachment into the main Payload i.e PayloadSwapBean   module is working.
    2)Nextly, my local code( i.e java code without including standard Module specific method like ejbActivate(),ejbPassivate(),process()  etc etc.)) for MDPExcelToXML is successfuly converting the excel file into the XML file.Then I am making the local code into adapter module specific code and deploying that.
    A few question arises here,
    Do I need to do any specific configurations here in PI for this particular things.Maybe both the adapter module is clashing with each other.
    And also using tracing and logging into my custom adapter module code.Getting the following error,
    java.io.IOException: Unable to read entire header; 116 bytes read; expected 512 bytes#
    Thanks
    Ayan

  • How to implement the schema validation with XSD in adapter module

    Dear All,
    I am trying to develop a EJB as the file adapter mudule.
    Please guide me how to implement the schema validation of the source message with XSD.
    Or provide me the relative resources about this task.
    Thanks & Regards,
    Red
    Edited by: Grace Chien on Nov 19, 2008 8:23 AM

    Hi Grace,
    You can do the xml scema validation in PI7.1 version directly.
    To develop the adapter module for xml schema validation
    Validating messages in XI using XML Schema
    Schema Validation of Incoming Message
    Regards
    Goli Sridhar

  • Is there any way to read the Value mapping input values dynamically?

    Hi all..
    I have a scenario where i have used value mapping. now the issue is when the input is not having any corresponding output value in value mapping then i should get null as output. can anyone suggest how can this be achieved?..
    Regards
    Anu.

    Hi,
    Do you know if the value in not maintained/found in the value mapping then it returns the same value as a result at runtime.
    So, simply if and else will help you to get your desired result..
    SourceField ---> ValueMapping------>|
                                        |----->equalS---IF---->Then -----> Map constant (null) ----> Target
    SourceField------------------------>|
    Else ---->map (SourceField ---> ValueMapping) --->Target.
    Regards,
    Sarvesh

Maybe you are looking for