Module development

Hi all
I had try develop module to use in file adapter but I getting confuse. My module that is no any error and CC log no any error. But nothing happen from my module. So could you please to show me a full example module code? I'm not sure my code that is correct or not.
I had try follow these document
How to create module for J2EE Adapter Engine.pdf and
Step by step guide to develop a module for reading filename in a sender file adaptor.pdf
Everything is fine but no any result from my module....-_-!
Thanks
Park

check the below blogs
Some situations are:
https://weblogs.sdn.sap.com/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken] [original link is broken]
/people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter
/people/william.li/blog/2006/08/28/teched-2006-epi350--developing-and-testing-adapter-modules-in-sap-netweaver-exchange-infrastructure
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e21106cc-0c01-0010-db95-dbfc0ffd83b3
The how to guide is available at the SAP marketplace.
https://service.sap.com/~sapdownload/011000358700003237612005E/HowToCreateAdapterModules.pdf
and also go through Step by Step guide to develop a module for reading a file name in sender file adapter
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/4bc635ddb13162e10000000a11466f/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/53/21ee41c334c717e10000000a155106/frameset.htm

Similar Messages

  • 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.

  • Help required in File Adapter Module Development

    Hi All,
    I am working out a File to File scenario where my source file is in some different format. Please find the below sample:
    <Root>
    <ID>100</ID>
    <NAME>SAP</NAME>
    <END-Root>
    Before taking this into IS, I need to change the file to a proper XML format. I need to replace "END-" with "/".
    <?xml version="1.0" encoding="UTF-8" >
    <Root>
    <ID>100</ID>
    <NAME>SAP</NAME>
    </Root>
    I think I can achive this by developing Adapter Modules. I am new to Adapter Module development.
    Can you please tell me if there are any inbuilt Adapter Modules for this. If not please suggest me some relevant blogs to solve this issue. Thanks in Advance.

    Hi Phani Kumar
    There are more than one ways to do this. As per your timelines and skill set you can decide
    1. You can use the XMLAnonymizerBean this is an inbuilt module
    Check Stefen's blog
    Remove namespace prefix or change XML encoding with the XMLAnonymizerBean
    2. You can read this complete file in a single field and then you can create XSLT or Java mapping to parse it in a target XML you desire.
    Check these
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken](XSLT mapping)
    Java Mapping (Part I) (Java Mapping)
    The specified item was not found. (Java Mapping helper DOM)
    The specified item was not found. (XML Node into string)
    3. You can develop Adapter modules for this
    Refer
    Check Guides
    XI 3.0
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a
    PI 7.0
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e
    PI 7.1
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00838345-708c-2a10-1199-9514c0b0a91c

  • PI 7.1 Adapter Module Development - Identify SOAP Fault Message

    Hi Experts,</br>
    here's a PI 7.1 Adapter Module Development issue I hope you can help me to resolve. It's about identifying SOAP fault messages.</br>
    </br>
    Scenario at a glance:</br>
    Adapter Modules placed in the modules chain at request and response time in a synchronous Scenario:</br>
    - Request: SOAP Axis to RFC </br>
    - Response and Fault Response: RFC to SOAP Axis</br>
    </br>
    The issue is how to identify SOAP fault message in SOAP Axis Adapter Module in the response message:</br>
    The client gets SOAP fault messages like the follwong one:</br>
       <SOAP:Body>
          <SOAP:Fault>
             <faultcode>SOAP:Server</faultcode>
             <faultstring>Server Error</faultstring>
             <detail>
                <ns1:exception xmlns:ns1="http://typen.geschaeftsstelle.pab.barmer.de">
                   <ns1:errortext>bla bla bla ...</ns1:errortext>
                </ns1:exception>
             </detail>
          </SOAP:Fault>
       </SOAP:Body>
    </br>
    </br>
    But when trying to access the tags faultcode and/or faultstring in the adapter module via xPath expressions I do not get them. Obviously the SOAP Fault tags are built AFTER the adapter module has been passed. So my question is:</br>
    How can I clearly/uniquely detect a SOAP fault response message (and distinguish it from a "normal" response message) in my SOAP Axis Adapter Module?</br>
    </br>
    I tried it the following way:</br>
    </br>
    </br>
    // Check Message Payload for SOAP Fault Message via xPath expressions</br>
    ...</br>
    // SOAP Fault Code</br>
    zv_xPression = zc_constXPattern.replaceFirst("&", "faultcode");</br>
    zv_soapFaultCode = XPathAPI.eval(zv_doc, (String) zv_xPression).toString();</br>
    // SOAP Fault String</br>
    zv_xPression = zc_constXPattern.replaceFirst("&", "faultstring");</br>
    zv_soapFaultString = XPathAPI.eval(zv_doc, (String) zv_xPression).toString();</br>
    // check for SOAP Fault Message</br>
    if (zv_soapFaultCode.equals("") && zv_soapFaultString.equals("")) {</br>
         // Create Audit Log entry - NOT a SOAP Fault Message</br>
         zv_msgText = zc_constModuleName + " 0190: xPath - OK! This message is NOT a SOAP Fault Message";</br>
         zv_audit.addAuditLogEntry(zv_msgKey, AuditLogStatus.SUCCESS, zv_msgText);</br>
         zv_faultCheck = false;</br>
    }</br>
    else {</br>
         ...</br>
         // Create Audit Log entry - SOAP Fault Message</br>
         zv_msgText = zc_constModuleName </br>
              + " 0200: xPath - this message is a SOAP Fault Message. " </br>
              + " - Faultcode is: " + zv_soapFaultCode </br>
              + " - Faultstring is: " + zv_soapFaultString; </br>
         zv_audit.addAuditLogEntry(zv_msgKey, AuditLogStatus.ERROR, zv_msgText);</br>
         ...</br>
    }</br>
    ...</br>
    </br></br>
    But zv_soapFaultCode and zv_soapFaultString are always empty (with other payload tags this coding works fine).</br>
    </br>
    Any ideas? </br></br>
    Thanx very much in advance!</br></br>
    Regards,</br>
    Volker

    Hi Alex!
    Like already mentioned I solved my problem by identifying the SOAP exception with the messageClass attribute of the PI message header. Acess code:
    try {
    String zv_msgClass = zv_piMsg.getMessageClass().toString();
    } catch (Exception e) {
    zv_msgText = zc_constModuleName
    + " E0110: Message processing terminated."
    + " Reason: Error while getting MessageClass "
    + zv_dataSource
    + e;
    // create trace and audit log entry (severity ERROR) for exception
    zv_location.errorT(ZV_SIGNATURE, zv_msgText);
    zv_audit.addAuditLogEntry(zv_msgKey, AuditLogStatus.ERROR, zv_msgText);
    ModuleException me = new ModuleException(e);
    zv_location.throwing(ZV_SIGNATURE, me);
    e.printStackTrace();
    throw me;
    }     // end of try-catch-block
    But I do not think this will solve your problem. I am almost sure, that something in your Axis configuration is wrong/missing. If a handler cannot be instatiated then it really may be missing. Have a look at defaultTrace.trc. Maybe you will find more suitable information about the root cause of your problem. Also have a look at NWA under software components and/or application modules if you can find/see your modules.
    But there is a general issue when trying to catch PI fault messages. If e.g. the requestor tries to login with wrong userid/pasword, then you will have no chance to catch this kind of error - at least as far as I know. Because in this very early stage of PI message processing no module is called.
    One last question: Did you develop your own Adapter or just an adapter module? In the first case: Is your adapter started and healthy? Have a look at RWB -> communication channel monitoring.
    Regards,
    Volker

  • Module Development for XI3.0 Adapters

    Hello,
    we are currently trying to develop a xi 3.0 adapter module. Modules are a way to expand the functionalities of a xi adapter, in our cas the file adapter.
    Our module should be used to perform a more complex transformation from flat file to xml.
    We know, that we have to develop the modul as a stateless session bean, and that we have to implement some modul-interfaces.
    What we are missing are some examples, code fragments and some more detailed informations.
    Anybody out there, who can help us?
    Thanks in advance,
    Frank Winkler

    There's a How-To Guide that describes Module Development (How To Create Modules for the J2EE Adapter Engine )
    https://websmp105.sap-ag.de/~form/sapnet?_SHORTKEY=01200252310000071155&_SCENARIO=01100035870000000202
    and a sample Module comes with XI. Details are available throught the SAP Help http://help.sap.com/saphelp_nw04/helpdata/en/e9/61e1407e858031e10000000a1550b0/frameset.htm
    General info on the Module Processor is here
    https://websmp105.sap-ag.de/~form/sapnet?_SHORTKEY=01200252310000071155&_SCENARIO=01100035870000000202
    The easiest way to deploy the module is through Netweaver Developer Studio. Alternatively you can go through SDM.
    Hope that's a starting point.
    regards,
    Peter

  • Clarification in Module Development

    Hello Friends,
                       We are working on Module development.We have imported jar files i.e sda files.In ejb-j2ee-engine .xml we have included the following code..
    <reference
         reference-type="weak">
         <reference-target
         provider-name="sap.com"
         target-type="service">com.sap.aii.af.svc</reference-target>
         </reference>
    Now..We have imported a external DOM4j.jar file..for our programming requirement. My doubt is should i include any piece of code like the above one for my imported jar file?? as we are calling the module from Receiver Communication Channel, it is throwing an error regarding that DOM4j. jar file. Please help me out.
    Thanks & Regards,
    N.Jayanth Kumar

    check this links for reference:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81
    https://www.sdn.sap.com/irj/sdn/webinar?rid=/library/uuid/8257ed90-0201-0010-b6a8-e9cd808eb1a9
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a
    note:reward points if solution found helpfull.....
    regards
    chandrakanth.k

  • SOAP attachment - module development?

    Hi,
    I have an IDOC -> SOAP scenario where I have to call a webservice that uses SOAP attachment.
    Example:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ueb="IBrokerInterface">
       <soapenv:Header/>
       <soapenv:Body>
          <ueb:TEBIBrokerInterface_PublishWS>
             <aClientId>TEST</aClientId>
             <aMessage>cid:file.xml</aMessage>
             <aDuplicates>0</aDuplicates>
          </ueb:TEBIBrokerInterface_PublishWS>
       </soapenv:Body>
    </soapenv:Envelope>
    The "file.xml" has to be a SOAP attachment.
    If I use a SOAP receiver channel how do I get the IDOC payload moved into a SOAP attachment and still keep the SOAP envelope?
    Can this only be done with module development?
    Thanks Rasmus

    Hi Rasmus,
    You cannot create an attachment in mapping.
    In PI 7.1 there will be a Java Mapping API for working with attachments, but the code will be similar to an adapter module. It will not be possible with XSLT.
    Regards
    Stefan

  • Module developement

    hi people,
          i have a problem in module developent.
    i m creating a module sample, for converting <b>xls data into xml.</b>
    but i m getting error in cc monitoring
    Error: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at ejb Module, the whole lookup name is localejbs/sap.com/com.abc/GetFileNameBean.
    my module name is  <b>localejbs/sap.com/com.abc/GetFileNameBean.</b>
    type is <b>local</b>
    module key is 0
    can any one suggest me ,how to solve the problem.
    thanx
    HONEY

    Hi
    This pdf will guide u
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a
    Regards
    Santhosh

  • Some issues regarding JEE adapter module development in NWDS 7.1

    Hi guys,
    I'm trying to develop my first AM in NWDS 7.1 and I'm facing some issues which I'd be happy if you would help me out with.
    1, I'm going step by step according this document http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa&overridelayout=true  but I have an information Warning "Classpath entry PI_AF_LIBS/... (all PI AF 7.1 classes) will not be exported or published. Runtime ClassNotFOundExcpetion may result". Why am I getting this if I have checked the checkboxes with these libraries in Project->Preferences->Java Build Path->Order and Export(tab)? If this checked I'd say it will be exported with the project.
    2, I need to create an SDA file to deploy the module, because the server is not available directly. So first if I'm not wrong I need to have an EAR file which I can use to create the SDA. But how can I get this EAR file? This document describes only direct way of deployment.
    Thanks in advance,
    Olian

    1. The jars need to be referenced in the project build path to enable the compilation of the code
        The warning can be overlooked as the jars are present in PI.
    2. The EAR Project that gets created (as per the description in the referred document) can be exported to the get the necessary
        ear file.

  • Best practice for function module development

    When designing a function module, what is the best practice. Should we develop it so that most of the extraction is done within the function module, or should we develop it such that prior to calling the function module the extraction should be done in the main calling program and the function module would have a huge interface of many importing parameters?
    For e.g. lets say for some business logic I need MATNR MTART MEINS BSTME and so on. Now by knowing the matnr I can get all the other fields. Should I create a function module with just matnr as importing parameter and do the Select on MARA in the FM or should I create the function module with all the fields as required importing parameters. What would be a best practise in such a scenario.
    Thank you.

    Now we are getting into the ecapsulation part of function groups.  Did you know that when you run your program, and it executes a FM, that ALL function modules in the function group are loaded into memory?  And that global data inside the function group can be shared across functino module calls?  This is how you would relieve your concern.  Lets say that all of your function modules belong to the same group,  And all of them need to use a record from MARA, and you don't want to do a SELECT in all of these functions.  Basically, you just create a global structure variable in the TOP include of the function group.  In the first FM, you simply do the select and put that data into the global variable, then during the next FM call(the FM must be in the same group) you can get the data from the global variable directly without having to go to the database.
    Regards,
    Rich Heilman

  • Adapter Module Development in PI 7.1

    Hi,
    I need to develop an adapter module and am using NetWeaver PI 7.1.
    1. Should I develop an EJB 2.1 or EJB 3.0 bean?
    2. Should I develop a bean that conforms to both standards, if so, how?
    Cheers,
    Earlence

    Hi ,
    These Links should be good enough for you.
    http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3414900)ID1219082550DB01455545497474264448End?rid=/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a&overridelayout=true
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414900)ID1219082550DB01455545497474264448End?blog=/pub/wlg/10260
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414900)ID1219082550DB01455545497474264448End?blog=/pub/wlg/10319
    Regards,
    Amith.

  • Module Development using PCK

    Hi All,
    I have to develop a module for the file adapter. I have installed the PCK (Partner Connectivity Kit) and the related development environment. I just need to test the module for the Receiver File Adapter. But how can this be done using PCK. What should be the minimum things required? Are there any articles or help available?
    Thanks,
    Sandeep

    http://help.sap.com/saphelp_nw04/helpdata/en/8b/895e407aa4c44ce10000000a1550b0/frameset.htm
    The PDF
    How To Create Modules for the J2EE Adapter Engine 
    available at service marketplace
    https://websmp106.sap-ag.de/~form/sapnet?_SHORTKEY=01200252310000071155&_SCENARIO=01100035870000000202
    Should help you!!!
    Regards,
    Amol
    Message was edited by: Amol Joshi

  • Adapter Module Development Hashtable entries

    Hi I am developing an adapter module, I need to capture the SourceDirectory and Source file Timestamp, I am not able to capture the directory and file time stamp. Is there any way we can Print out the Hashtable entries into the audit log ???
    I am using the below code 
    String fileName = (String) mp.get("FileName");
    String  Directory = (String) mp.get("SourceDirectory");
    String  SourceFileTimestamp =  (String) mp.get("SourceFileTimestamp");

    Hi,
    >>>String fileName = (String) mp.get("FileName");
    >>>String Directory = (String) mp.get("SourceDirectory");
    >>>String SourceFileTimestamp = (String) mp.get("SourceFileTimestamp");
    this approach works only for filename where did you read that it will work
    for SourceDirectory or anything else?
    you need to use adapter specific message arrtibutes to get that inside
    an adapter module
    that's the only way and it works for sure
    Regards,
    Michal Krawczyk

  • Finance module developed using D2K Vs. Financials

    Hello,
    I was involved in the development of a Finance module using Oracle Forms. Could someone tell me few differences(like development time, extra functionality, Adm & maintenance, user convenience etc..) between Oracle Financials Package and a Finance app. developed using Oracle Forms. And I would like to know how easy is Oracle Financials Package to learn if we know Oracle Forms , Reports, SQL and PL/SQL thouroughly.
    Thanks in Advance,
    Partha

    Re. CR 2008 runtime.
    SP4 MSI     
    https://smpdl.sap-ag.de/~sapidp/012002523100008782532011E/cr2008sp4_redist.zip
    SP4 MSM     
    https://smpdl.sap-ag.de/~sapidp/012002523100008782522011E/cr2008sp4_mm.zip
    Re. which crystal reference
    Run [Modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip]  on your development computer where the app works. this will show you the dlls the app needs.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • JAAS Login Module development/deployment  - getting en error

    Guys,
    I have developed a JAAS Login Module (as per the SAP documentation) and configured the J2EE Engine  (as per the SAP documentation) for this module to sit amongst several other standard modules,  but I have a problem. I am unable to get the Module working on one portal instance and I am getting an error in the default.trc file when the server restarts after SDM deployment.
    The error is:  "cannot load login module class....... java.lang.ClassNotFoundException........"
    The whole thing works on another instance of EP6 SP16,17 and 18..... however it does not work on this one completely separate instance  (there probably are configuration difference between these instances!)
    Im not quite sure, given this set of circumstances,  what could be causing the Login Module not to load.  Which part of the configuration of the J2EE engine should I look in, something perhaps overlooked in the documentation? 
    Thanks
    Adrian

    With some help I have now solved this.
    In the properties tab of Security Provider,  the reference to your login module in the classloader needs to be prefixed with library:~<provider>.   For the default SAP example the provider in com.sap...... or whatever you have changed it to.

Maybe you are looking for

  • Error while opening two cursors in same procedure...

    Hi : I have written following Procedure: Declare procedure pro_canefortnight_master Is kr_caneperiodid integer; last_caneperiod_id number(10,0); kr_forthnightid integer; last_forthnight_id number(10,0); ref_caneperiodid integer; ref_seasonyrid intege

  • Mapping Sales dist from customer master to 0SD_C01 infocube

    Dear All, I have a requirment of mapping Sales Dist ( 0SALES_DIST )  from Customer Master ( 0CUST_SALES ) into report based on Infocube Billing Condition Value ( ZSD_C01 ) . i.e. report should show Sales dist data fro customer master and not from tra

  • WRT54G V8 randomly disconnects/"powers off"

    Well, I'm having an issue here. I got a WRT54G V8 two days ago, so it's brand new. Anyway, I have this problem where the router randomly "powers off". By that, I mean that the power LED (orange light) goes off for a few seconds, then comes back on. T

  • "Other" storage taking up all my HD space

    My HD space is being taken up by "other".  I believe this to be caused by an iMail application problem related to recovered mail being stored somewhere on my HD.  I've had problem with sending and receiving emails from day one and often times receive

  • All Novell's BrainShare videos

    You can find all of Novell's BrainShare videos on our YouTube channel