Module Development, Add Header Segment

Hi Guys
I want to write a module where in I could be able to add the header segment to the XML Header.
I am not sure abt the methods to be used, is there any documentation giving details abt the methods which could be used.
Dheeraj

Hi Dheeraj,
Modify the following code and add your Header segments and deploy it as an EAR Archive.Note Implement your <b><i>YourClass </i></b> code in such a way that it should add Header segments in between your existing SOAP Message.
You can access the incoming message using
payloadData.getInputStream()
and after processing your message set your newly created message using
payloadData.setContent(outXML.toByteArray())
Regards,
Ananth
import java.io.ByteArrayOutputStream;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import com.sap.aii.af.mp.module.Module;
import com.sap.aii.af.mp.module.ModuleContext;
import com.sap.aii.af.mp.module.ModuleData;
import com.sap.aii.af.mp.module.ModuleException;
import com.sap.aii.af.ra.ms.api.Message;
import com.sap.aii.af.ra.ms.api.XMLPayload;
* @author AnanthBabu Chinnaraj
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
* @ejbHome <{com.sap.aii.af.mp.module.ModuleHome}>
* @ejbLocal <{com.sap.aii.af.mp.module.ModuleLocal}>
* @ejbLocalHome <{com.sap.aii.af.mp.module.ModuleLocalHome}>
* @ejbRemote <{com.sap.aii.af.mp.module.ModuleRemote}>
public class YourBean implements SessionBean, Module {
     public void ejbCreate() {
     public void ejbRemove() {
     public void ejbActivate() {
     public void ejbPassivate() {
     public void setSessionContext(SessionContext context) {
          myContext = context;
     private SessionContext myContext;
     /* (non-Javadoc)
      * @see com.sap.aii.af.mp.module.Module#process(com.sap.aii.af.mp.module.ModuleContext, com.sap.aii.af.mp.module.ModuleData)
     public ModuleData process(ModuleContext arg0, ModuleData modData)
          throws ModuleException {
          try {
               Object dataObject = null;
               Message xiMessage = null;
               dataObject = modData.getPrincipalData();
               xiMessage = (Message) dataObject;
               XMLPayload payloadData = xiMessage.getDocument();
               ByteArrayOutputStream outXML=null;
               if (payloadData != null) {
                    outXML = new ByteArrayOutputStream();
                    YourClass obj= new  YourClass();     
                    obj.processXML(payloadData.getInputStream(), outXML);
                    payloadData.setContent(outXML.toByteArray());
               modData.setPrincipalData(xiMessage);
          } catch (Exception e) {
          return modData;
<i></i>

Similar Messages

  • Automatically removing header segments from the existing LVM file

    Hello,
    I have a LVM file containing sampled data of two channels (sampled at a the same rate of 100Hz) without x values(time) with many header segments.I wonder is it possible
    1) to change automatically (not manually because it contians so many header segements) the LVM file such that it contains only first header while removing all other header segments.
    2) how to add x(time) values to the existing LVM file
    Thanks.

    Hi GoviRe.
    Have a look at the attached code
    I haven't verified the output file, I will leave that up to you.
    Best Regards
    Alex E. Petersen
    Certified LabVIEW Developer (CLD)
    Application Engineer
    Image House PantoInspect
    Attachments:
    Main.vi ‏22 KB
    Delete Header.vi ‏31 KB

  • Need to add Header  and footer in an alv grid display output.

    How can I add header and footer in an alv grid dispay output.
    For the grid display, I am using the function module "REUSE_ALV_GRID_DISPLAY".

    HI,
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                i_callback_html_end_of_list = 'END_OF_LIST_HTML'
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
      DATA: ls_text TYPE sdydo_text_element,
            l_grid     TYPE REF TO cl_gui_alv_grid,
            f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
      ls_text = 'Footer title'.
    adds and icon (red triangle)
      CALL METHOD end->add_icon
        EXPORTING
          sap_icon = 'IL'.
    adds test (via variable)
      CALL METHOD end->add_text
        EXPORTING
          text         = ls_text
          sap_emphasis = 'strong'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(bold)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Bold text'
          sap_emphasis = 'strong'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(normal)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Nor'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(bold)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Yellow '
          sap_emphasis = 'str'.
    adds and icon (yellow triangle)
      CALL METHOD end->add_icon
        EXPORTING
          sap_icon = 'IC''.
    display text(normal)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Mor'.
    *set height of this section
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = l_grid.
      CALL METHOD l_grid->parent->parent->(f)
        EXPORTING
          id     = 3
          height = 14.
    ENDFORM. "end_of_list_html.
    This will solve  it. Post if you need more help in this.
    Regards,
    Madhu.

  • 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

  • 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

  • Add-header SAF how-to

    I am using Iplanet 4.1 SP9 on Solaris 2.7. I need the add-header SAF in obj.conf to add P3P headers for my website.
    The documentation says I can use a file (html) to publish additional headers. I have tried:
    P3P: CP="NOI DEVa TAIa OUR BUS UNI STA OTC"
    in a file called p3pheader.html and I have added the following line in the default object in obj.con:
    Service fn="add-header" path="/export/home/enter_4.1/docs/dev/w3c/p3pheader.html" NSIntAbsFilePath="yes"
    Iplanet returns the following error:
    [23/nbre/2001:16:46:24] config ( 5326): for host 141.126.5.15 trying to GET /SME/frameset.html, pcheck_add_header reports: No header specified
    Any help ?

    The addition of HTTP headers is conspicuously missing from the standard
    directives. The add-header function simply adds HTML to the top of a
    page. You'll need to use a custom SAF for HTTP headers. For example
    you could compile this one:
    * NSAPI SAF to add a HTTP header to the server response.
    * Returns REQ_NOACTION so request is processed as normal.
    * Init fn="load-modules" shlib="/libAddHttpHeader.so" funcs="add-http-header"
    * Service fn="add-http-header" name="P3P" value="CP=\"NOI DEVa TAIa OUR BUS
    UNI STA OTC\""
    #include "nsapi.h"
    NSAPI_PUBLIC int add_http_header(pblock pb, Session sn, Request *rq)
    char *name = pblock_findval("name",pb);
    char *value = pblock_findval("value",pb);
    if (name && value){
    param_free(pblock_remove(name, rq->srvhdrs));
    pblock_nvinsert(name, value, rq->srvhdrs);
    return (REQ_NOACTION);
    Jose Niguidula wrote:
    I am using Iplanet 4.1 SP9 on Solaris 2.7. I need the add-header SAF
    in obj.conf to add P3P headers for my website.
    The documentation says I can use a file (html) to publish additional
    headers. I have tried:
    P3P: CP="NOI DEVa TAIa OUR BUS UNI STA OTC"
    in a file called p3pheader.html and I have added the following line in
    the default object in obj.con:
    Service fn="add-header"
    path="/export/home/enter_4.1/docs/dev/w3c/p3pheader.html"
    NSIntAbsFilePath="yes"
    Iplanet returns the following error:
    [23/nbre/2001:16:46:24] config ( 5326): for host 141.126.5.15 trying
    to GET /SME/frameset.html, pcheck_add_header reports: No header
    specified
    Any help ?

  • How to add another Segment field in OBC4

    Dear Experts,
    OBC4 -> select Comp. Code -> field Status Group -> select Field St. Grp -> Duuble click on Field St. Grp
    I have a requirement to make Business Place/secn field Mandatory where ever it is used in transaction F-43 , F-02 , F-48 .
    So for this am going through OBC4 . But there (Under Field status Grp.) am not getting any field named as Business Place . There exists a field Business Area . But Business Area and Business Place both are different .
    So Is it possible to add another segments named as Business Place/secn  there with 3 options Supress , Req. Entry , Opt. Entry . So that i can change it to Mandatory .
    Thanks in Advance
    Jack

    Hi,
    Check this sample process
    To get custom fields on IDOC you need to add custom segment on IDOC and for that you have to create a extension IDOC with reference to Basic IDOC.
    You can do that as explain below.
    Here for example you have basic idoc ORDERS05 and you want to add additional segments at header level - ZE1EDK01 and line item level ZE1EDP01
    1. TCode - WE31 : Create custom segments ZE1EDK01 and ZE1EDP01 with the fields you want and release these segments.
    2. TCode - WE30 : Create extension IDOC
    In WE20 enter extension IDOC name - ZORDERS05, select "Extension" option and hit "create" button. When it gives pop-up, select "create new" and enterd linked basis type as "ORDERS05". Enter proper description and save.
    3. On the next screen of WE30, select the segment under which you want to add your additional segment. Save everything.
    4. TCode - WE82. Here you link extension idoc to basic idoc and message type.
    Go into change mode. Hit "New entries button" Enter Message type = "ORDERS", basic type = "ORDERS05" and extension type = "ZORDERS05".
    Regards,
    Satish

  • How to add header and fooder in text file

    Hi,
    i have created simple application for generate report from database into text file.
    But i need to add header and fooder in text file. I dont know is there any API for adding these.
    Can anyone help me to create header and fooder in text file.
    the below text are needs to be print in the header
    name of the table :
    Recorder type :
    file creation time:
    the below text are needs to be print in the footer
    Recorder Number:
    Record Type;
    the actual code is
                           pst = con.prepareStatement("select REQUEST, DOMAIN_NAME, TRUNC(DATE_OF_CONFIGURATION) AS dateofConfig  FROM employee where id=300");
                               rs = pst.executeQuery();
                            while (rs.next()) {
                                 request = rs.getString("REQUEST");
                                    domain_name = rs.getString("DOMAIN_NAME");
                                    dateofconfig = rs.getString("dateofConfig");
                                    System.out.println(request + " " + domain_name + " " + dateofconfig);
                                   data.add(request + " " + domain_name + " " + dateofconfig);
                            System.out.println("before calling method");
                            writeToFile(data, "c:/Employee.txt");
                            System.out.println("file created successfull");
                            rs.close();
                            pst.close();
           private static void writeToFile(List list, String path) {
                    BufferedWriter out = null;
                    try {
                            File file = new File(path);
                            out = new BufferedWriter(new FileWriter(file, true));
                            for (Object obj : list) {
                                String s=  obj.toString(); 
                                 out.write(s);
                                    out.newLine();
                            out.close();
                    } catch (IOException e) {
    }Thanks
    Jasmin
    Edited by: user13836688 on Mar 21, 2011 4:06 AM
    Edited by: user13836688 on Mar 21, 2011 4:07 AM
    Edited by: user13836688 on Mar 21, 2011 4:08 AM

    user13836688 wrote:
    i have created simple application for generate report from database into text file.First off, when posting code, use &#91;code]...&#91;/code]. or '' tags, not '<code>'.
    But i need to add header and fooder in text file. I dont know is there any API for adding these.
    Can anyone help me to create header and fooder in text file.Well you plainly have the code to write the file contents; and furthermore your report seems to be contained in a List called 'data'. Why not just add the header and footer lines to it? I'd also suggest making 'data' a LinkedList. That way you can add the header afterwards with no performance hit, just in case the information it contains isn't available at the start of your report loop.
    Winston                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to Add Header and Footer in Flat file

    HI All,
    I am using ODI 11g.
    MY interface is populating data from joining to 2 tables through sql query and Loads in to Flat file.
    But i need to add Header and Footer in the Flat file.
    In the below 3 lines
    The 1st line is header ....2nd line is Data ....3rd line is Footer.
    Any ideas how to work on this.
    HSB9KT.KTPRTO.EBSDATA.D0000000 20120626020636
    CFFE00263 SOLGSR014991340000527894536058173880207SOLNE06242012072420120000009048382650000247MRS
    T00000000000000000000
    Thanks,
    Lony

    Hi Drieux,
    i am able to add Header and Footer in this.
    But i want the header like Its like HSB9KT.KTPRTO.EBSDATA.D0000000 || SYSDATE (YYYYMMDDHHMMSS)
    In my Out put i only see header as HSB9KT.KTPRTO.EBSDATA.D0000000 .
    I have added a Variable where i am using SELECT to_char(sysdate,'YYYYMMDDHHMMSS') FROM DUAL query.
    create header (HSB9KT.KTPRTO.EBSDATA.D0000000 #v_DATE)
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=FFT_SOLSNP$CRLOAD_FILE=/home/tarak/FFT_SOL.datSNP$CRFILE_FORMAT=FSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=descrSNP$CRTYPE_NAME=STRINGSNP$CRLINE_OFFSET=1SNP$CRLENGTH=994SNP$CRPRECISION=994SNP$CR$$SNPS_END_KEY*/
    Any idea why this sysdate part is not showing in Header.

  • Add Header and Footer in Live Cycle ES2

    Hi,
    We are quite new to the use of live cycle pdf generation. Can anyone help us with information as to how we can add header and footers to our pdf files using livecycle ES2.
    And further, we would like to know whether header and footer adding is available in the trial version of Livecycle ES2?

    Hi,
    Thanks for the reply.
    We have another newly raised problem in the header and footer adding from Livecycle ES2. According to the PDF that you referred in the previous reply, we can add graphics to the PDF header, but we are unable to find a DDX tag that would enable us to add a image URL.
    Can you please help us again on the above?
    Purnima

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

  • How to add header and button

    i want to add header to my ALV report
    i am using cl_salv_table method
    i want to write a few sentences.
    in addition i want to add a button to my report,
    which will display the values the user put in the selection screen.
    please give me detailed explenation
    thanks

    Display header:--steps
    1. call the factory method and it reruns the ref variable..
          try.
              call method cl_salv_table=>factory
                exporting
                  list_display = list_display
                importing
                  r_salv_table = vref_alv
                changing
                  t_table      = i_sflight.
            catch cx_salv_msg into oref_error.
              l_text_alv_e = oref_error->get_text( ).
              message i000 with l_text_alv_e.
              leave list-processing.
          endtry.
    2. Create header object and attached it with ALV
      data: lr_grid type ref to cl_salv_form_layout_grid.
    1st step: create the grid object
      create object lr_grid.
    2nd step: add some text items
      lr_grid->create_header_information( row = 1  column = 1
                             text = 'Flight List Grp ##'(fll) ).
      lr_grid->create_text( row = 2  column = 1
                             text = 'Please check utilization'(uti) ).
    3rd step: declare grid as header of list
      vref_alv->set_top_of_list( value = lr_grid ).
    Display - button steps:
    1. Create pf status and Set pf status:
    Create pf-status and add ur custom button with a fcode then set this status with alv.
      vref_alv->set_screen_status( pfstatus = 'SALV_TABLE_STANDARD'
                                report = sy-repid
                           set_functions = p_alv->c_functions_all ).
    2. Get all the events and set the event handler for this added button.
      data: lr_event type ref to cl_salv_events_table.
    get the EVENT object
      lr_event = p_alv->get_event( ).
      set handler :
      lcl_handler=>on_added_function for lr_event,
    2. Create the local class to handle this event:
    class lcl_handler definition.
      public section.
        class-methods:
        on_added_function for event added_function of cl_salv_events_table
                importing e_salv_function, " type salv_de_function
    endclass. "lcl_handler definition
    CLASS lcl_handler IMPLEMENTATION
    class lcl_handler implementation.
      method on_added_function.
        data: l_oref_columns type ref to cl_salv_columns_table,
              l_oref_column  type ref to cl_salv_column_table,
              l_oref_column1 type ref to cl_salv_column,
              l_except1      type ref to cx_salv_not_found,   "Exception
              l_text1        type string,                     "Exception msg
              l_lvc_s_colo type lvc_s_colo.
        case e_salv_function.
          when '<fcode of ur button>'.
        write ur logic here.
       endcase.
      endmethod.
    endclass. "lcl_handler IMPLEMENTATION
    Regards,
    Joy.
    Edited by: Joyjit Ghosh on Jul 13, 2008 12:16 PM

  • How to add header and footer to a file through ODI?

    hi,
    I want to add header and footer to my file..............footer should contain a counter so that page number can be displayed...................
    Can anyone please guide me .................
    Thanks .............
    Ritika

    what is the utility you are using to create file . Interface or OdiSqlUnload ?
    and what do you want to have Header and Footer as and how are you concluding the File as page 1 and page 2 etc ... ?

  • How to add header line in a file from XI system using file adapters

    Hi All,
    I need to add header line (Column names) in a file coming from XI system.
    I am using file adapters.
    Thanks & Regards,
    Gaurav Mittal

    The Receiver File Adapter is configured, using the following settings:
    1) Choose File Content Conversion as the Message Protocol.
    2) You give the ‘addHeaderLine’ parameter as 1
    3) For the ‘fieldSeparator’ parameter you need to give field separator for both list and substructure (referring to the data type above). For eg: it may be a ‘,’ (comma) for substructure in a comma separated file.
    4) The ‘endSeparator’ parameter needs to given for substructure only. For eg: it may be a ‘nl’ (new line)
    5) Give the file name, the directory and the Construction mode. Activate all the settings. Receiver File Adapter with F.C.C. is configured.
    please visit the blog.
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

  • How to add header to a file in mapping

    Hi,
    I need to add header to a file , the header information i am getting is dynamic , it is an IP address of the m/c from where i received the file and keeps on changing.
    Can we add this information in the header in mapping or there is any other way to acheive this.This IP is used to make a lookup  at a  latter stage  for verification purpose.
    Regards,
    SRi

    Hi Sri,
    Write Java class or an ABAP class
    in Java class or ABAP class write logic to find the first word or line
    once you find that word in your incoming file, you need to replace with a string which has the static header+firstword what you have searched
    for exmple
    Incoming file
    abcd
    <abc>123</abc>
    <def>321</def>
    Your logic should find "abcd"
    String Header = "http://www.sap.sdn.com"
    String A = "abcd" (bcoz u kow u r searching for this word)
    now concat A+Header and return the string
    IF you are writing an ABAP or Java  class include this in Interface Mapping
    Hope this helps.

Maybe you are looking for

  • I have a trail version, now I can not install Master Collection version

    I used a trail version of Flash Catalyst and now I purchased master Collection, but when I try to use Flash Catalyst I get a messages that says the licensing for this produce has expired. I installed Master Collection CS5 but I am not able to open Fl

  • How can i transfer my ipod music to a new pc

    My PC crashed and i lost my itunes.  Most of it was recorded music of my CD;s but some had been downloaded.  I downloaded a new version of itunes onto my new laptop but when i try to psync it with my ipod it tells me it will wipe what is on there.  I

  • ITunes whacky after upgrading to lates iTunes

    I upgraded my iTunes last week and ever since I am having trouble with my iTunes. When I insert a CD, it takes forever to read the titles from CDBD or even to play. The radio stations stop playing midway and I get the message that it is streaming. I

  • Lexical paramaters

    Am very new to Oracl Reports - and SQL. I have the Oracle U training manuals, and Pinnacle's book, have used the online help. I'm sorry, but I do not find any simple explanation on exactly how to use the lexical parameters. I've created 4 user parame

  • Spreading user data across multiple HD's?

    I hope this is the right forum for this. I'm on a Mac Pro 1,1 and recently installed a few extra hard drives to optimize performance for video editing (accoring to recommendations over at another big software company's support docs -- this is not abo