How to create SOAP Header elements using SAAJ??

I am facing a problem when adding header elements under SOAP Header
using SAAJ(api).
I want to create a structure as following:
I get a empty SOAP header obejct by writing code--> SOAPHeader header
= envelope.getHeader();
But not able to add SOAP header elements as specified in example
below. I tried but its giving me error as
"HeaderElements must be namespace qualified"
CAN ANYBODY TELL ME THAT HOW TO ADD HEADER ELEMENTS USING SAAJ??
<SOAP:Header>
<AccountNumber>123</AccountNumber>
<AuthorisationCode>test111</AuthorisationCode>
<Source>abc</Source>
<Market>01</Market>
</SOAP:Header>

I'm including this comment from some code I've just written after wrestling with this for hours (I've actually left it on another post as well). The upshot of it all is that you have to include a namespace URI when creating a header in SAAJ:
        NOTE: SOAP 1.1 requires that all header entries be namespace-qualified to
        namespace URI's.  The SAAJ 1.2 implementation requires a Name object with
        the namespace URI to make this happen even if the prefix used is already
        visible by being declared higher in the document (e.g. in the Envelope).
        However, the namespace URI is not present in the serialized header element
        as long as it was declared higher in the document.  In order to create a
        header element without a prefix (to conform to a web service definition
        that doesn't use a prefix in its headers, for example), leave the prefix
        null in the addHeaderElement() method. 
        For example, with a SOAPHeader 'hdr':
          //first create the name
          Name name = env.createName("my-local-name", null, "my-URI");
          //then create the header element
          SOAPHeaderElement he = hdr.addHeaderElement(name);
        This would result in an XML element that looked like this:
          <my-local-name xmlns="my-URI"/>
        This would allow SAAJ developers to create a header for a service that
        only expected a local name in its header elements (as many do!).  As long
        as the service doesn't choke on the attribute (validation!  evil!), this
        should work.
                                                    Rob Kemmer
                                                    01/12/2005
 

Similar Messages

  • How to access SOAP header without using SOAP message handler

    I have a requirement to retrieve SOAP header information within each web services operation. So I can't use SOAP message handler. Is there any way to do that? BTW, I am not using workshop.
    Thanks.

    Howeve how can I put data into soap header in UDF? DynamicConfiguration won't work for soap header, right?
    Which data do you want ot put into the Header section.
    ASMA or Dynamic Configuration is used to read/ put the details from/ into the header elements.....
    Refer: http://help.sap.com/saphelp_nw04/helpdata/en/43/0a7d1be4e622f3e10000000a1553f7/frameset.htm
    From the help section:
    This information is not located in the payload of the message, but in additional message header fields.
    Regards,
    Abhishek.

  • How to add SOAP header element?

    Hi,
    Scenario : RFC --> SOAP
    I would like to add parameters into the soap header :
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
          <SOAP:Header>
                *<OPER_REF>SAPPI</OPER_REF>*
          </SOAP:Header>
          <SOAP:Body>
              <ns2:createSapProductRequest xmlns:ns2="http://www.mycompnay.com/projectname">
                        <country>FR</country>
                     <division>1300</division>
                     <productStage/>
              </ns2:createSapProductRequest>
            </SOAP:Body>
    </SOAP:Envelope>
    So I made a Java Mapping to reach my goal so my message looks like :
    <ns0:Messages
         xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
         <ns0:Message1>
              <SOAP:Envelope
                   xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
                   <SOAP:Header>
                        <OPER_REF>SAPPI</OPER_REF>
                   </SOAP:Header>
                   <SOAP:Body>
                        <ns2:createSapProductRequest
                             xmlns:ns2="http://www.mycompany.com/myproject">
                             <country>FR</country>
                             <division>1300</division>
                             <productStage/>
                        </ns2:createSapProductRequest>
                   </SOAP:Body>
              </SOAP:Envelope>
         </ns0:Message1>
    </ns0:Messages>
    But when I launch the process here is what PI do :
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
      <soapenv:Header>
       <OPER_REF xmlns="">SAPPI</OPER_REF>
      </soapenv:Header>
      <soapenv:Body>
       <ns2:createSapProductRequest xmlns="http://www.mycompnay.com/myprojecty" xmlns:ns2="http://www.mycompnay.com/myprojecty">
        <country xmlns="">FR</country>
        <division xmlns="">1300</division>
        <productStage xmlns=""></productStage>
       </ns2:createSapProductRequest>
      </soapenv:Body>
    </soapenv:Body>
    </soapenv:Envelope>
    this request has been found thanks to the tool TCPGW. Has you can see there is 2 <soapenv:Body>
    What is wrong ?
    regards

    I was right, the solution is :
    My problem was the adapter. It was miss used.
    _The configuration is : _
    HTTP without SOAP Envelope and in the Module :
    Name : localejbs/AF_Modules/MessageTransformBean
    Type : L
    Key : Plain2XML
    _Module's Configuration : _
    Plain2XML -> Transform.ContentType -> text/xml;charset=utf-8
    All the XML messages was well formed even with the strange xmlns attributes.
    Regards

  • SSIS : How to create Column Header dynamically using expression in Flat File Source

    Hi Team,
    I need to keep configured Header Names for columns, Is there is any way to set each column name from expression? or is there is any other way?

    Nope
    But you could add a dummy row to your source to include column headers and then use options column headers in first row in flat file connection manager.
    So suppose you've three columns column0,coulmn1,column2 and you want to make it as ID,Name,Datethen make source query as
    SELECT 'ID' AS Col1,'Name' AS Col2,'Date' AS Col3, 0 AS ord
    UNION ALL
    SELECT Column1,Column2,Column3,1
    FROM YourTable
    ORDER BY Ord
    then choose  column headers in first row option
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to create a ComplexType (MULTIREF) soap element using SAAJ

    Hello,
    Bieng a SOAP newbie, I am faced with the task of creating a simple POST message using SAAJ, and then get a response. I have had no problems until now, since I cannot find out how to create the proper "element" to represent a complex type. Basically, I need to pass an object ("OBJECT") which contains three parameters (a, b,c). What is the correct syntax in order to do this? For example, how can I emulate the follwoing multiref xml snippet using the SAAJ API:
    <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:Object" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="Object">
         <a xsi:type="xsd:string"></a>
         <b xsi:type="xsd:string"></b>
         <c xsi:type="xsd:string"></c>
    </multiRef>
    I have tried various versions of the Name and SOAPBodyElement, as well as the SOAPElement but to no avail. AM I missing something obvious here?
    Thanks in advance for any suggestions!

    Hello,
    I have exactly the same question. I want to generate a soaprequest dummy; the parameters should have no value.
    Is there any solution or do I have to generate I manually?
    Regards,
    Dak

  • How to bind soap header using jax-rpc

    To Whom It May Concern:
    I am using Rad7, Ibm Websphere 6.1, on Windows XP.
    I created an SoapHeader first using a string and bind it using jax-ws.
    It works for jax-ws but unfortunately, my work services uses jax-rpc.
    Does anybody know how to bind the soap header using jax-rpc.
    Any help or hint would be greatly appreciated it.
    Here is my code:
    import org.apache.cxf.headers.Header;
    import org.apache.cxf.headers.Header.Direction;
    import org.apache.cxf.helpers.DOMUtils;
    import org.apache.cxf.binding.soap.SoapHeader;
    import javax.xml.namespace.QName;
    import java.io.StringReader;
    import java.util.List;
    import java.util.ArrayList;
    import javax.xml.ws.BindingProvider;
                   @Test
         public void testService() throws Exception {     
                   try
                        URL wsdlURL = new URL("http://localhost:9087/abc/services/ServiceABCService");
                        ServiceRequestServiceService service = new ServiceRequestServiceServiceLocator();
                        ServiceRequestService port = service.getServiceRequestService(wsdlURL);
                   //How to Add Soap Header using jax-ws
              String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><ABCHdrRq "
              + "xmlns=\"http://xmlns.ABCgc.net/ABC/2002/header/\" "
              + ">"
              + "<version>1.0</version><srcInfo><chType>abc</chType><chInst>0124</chInst>" +
                        "<appName>sSAR</appName><hostName>DW70210521</hostName><userId>fxue</userId>" +
                        "</srcInfo><startTimeStamp>2010-06-04T13:44:45.132</startTimeStamp><clientDt>2010-06-04T13:44:53.242</clientDt><serviceInfo><serviceName>ServiceRequestService</serviceName>" +
                        "<serviceFunc>addServiceRequest</serviceFunc></serviceInfo>" +
                   "<prevTransInfo><prevRqUID>BORS2010-06-04T13:41:10.2067f9368d1-8c5c</prevRqUID>" +     
                   "<prevRespTimestamp>2010-06-04T13:41:10.871</prevRespTimestamp>"+
                   "<prevRespEndTimestamp>2010-06-04T13:41:10.902</prevRespEndTimestamp>+</prevTransInfo>"+
                   "</ABCHdrRq>";
              SoapHeader dummyHeader1 = new SoapHeader(new QName("uri:http://xmlns.ABCgc.net/ABC/2002/header/", "ABCHdrRq"),
              DOMUtils.readXml(new StringReader(xml)).getDocumentElement());
              dummyHeader1.setDirection(Direction.DIRECTION_OUT);
              List<Header> headers = new ArrayList<Header>();
                   headers.add(dummyHeader1);
                   ((BindingProvider)port).getRequestContext().put(Header.HEADER_LIST, headers);
                   //How to Add Soap Header to the request using jax-ws
                   catch(Exception e)
                        System.out.println("Exception message:"+e.getMessage());
    Yours,
    Frustrated

    Well, how an attachment is processed depends on your application logic...if your application logic requires to processing attachments and verify it before processing the SOAP message, handlers could be better option.
    If you need to process the attachment while processing the SOAP message, you can do it in the service implementation class.
    In both the cases you need to get access to SOAPMessage object and from there get the attachments with getAttachments method.

  • How to capture SOAP fault when using "Do not use SOAP envelope" parameter

    Hi,
    we have a synchronous  RFC -> XI -> Web Service scenario. The Web Service requires some custom SOAP header elements for user authorization which forced us create the entire SOAP message in a message mapping and to set the "Do not use SOAP envelope" parameter in the receiving SOAP adapter.
    In order to capture the SOAP fault message from the Web Service we have created a message interface with a fault message and also created an interface mapping with a fault message mapping.
    Our problem is that the fault message is not populated when we get a SOAP fault message back from the Web Service. Is this due to the fact that we have set the  "Do not use SOAP envelope" parameter?
    Thanks in advance!
    Stefan
    Message was edited by:
            Stefan Nilsson

    Hi Bhavesh,
    I have exaactly same scenario. But the only difference is that the Successful payload is also not coming into PI.
    The request is successfully hittng the webservice.
    Please guide me on how to capture the paylod.
    I am using the WSDL provided by the thirdparty but sill the message is not coming into PI.

  • How To Create SOAP Envelop For WSDL

    Hi Friends,
    I have created one  webservice WSDL and i want to create SOAP Envelop for this.
    Can any one help me out how to create SOAP Envelop based on WSDL.
    ***************My WSDL***********************************
    <?xml version="1.0" encoding="UTF-8" ?>
    - <!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
    -->
    - <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
    -->
    - <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://annotation/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://annotation/" name="MyCompanyWS">
    - <types>
    - <xsd:schema>
    <xsd:import namespace="http://annotation/" schemaLocation="http://localhost:7101/WebService-Annotation-context-root/MyCompanyPort?xsd=1" />
    </xsd:schema>
    </types>
    - <message name="setMyDepts">
    <part name="parameters" element="tns:setMyDepts" />
    </message>
    - <message name="setMyDeptsResponse">
    <part name="parameters" element="tns:setMyDeptsResponse" />
    </message>
    - <message name="getMyDepts">
    <part name="parameters" element="tns:getMyDepts" />
    </message>
    - <message name="getMyDeptsResponse">
    <part name="parameters" element="tns:getMyDeptsResponse" />
    </message>
    - <message name="addEmployeeToDept">
    <part name="parameters" element="tns:addEmployeeToDept" />
    </message>
    - <message name="addEmployeeToDeptResponse">
    <part name="parameters" element="tns:addEmployeeToDeptResponse" />
    </message>
    - <message name="getDeptInfo">
    <part name="parameters" element="tns:getDeptInfo" />
    </message>
    - <message name="getDeptInfoResponse">
    <part name="parameters" element="tns:getDeptInfoResponse" />
    </message>
    - <portType name="MyCompany">
    - <operation name="setMyDepts">
    <input message="tns:setMyDepts" />
    <output message="tns:setMyDeptsResponse" />
    </operation>
    - <operation name="getMyDepts">
    <input message="tns:getMyDepts" />
    <output message="tns:getMyDeptsResponse" />
    </operation>
    - <operation name="addEmployeeToDept">
    <input message="tns:addEmployeeToDept" />
    <output message="tns:addEmployeeToDeptResponse" />
    </operation>
    - <operation name="getDeptInfo">
    <input message="tns:getDeptInfo" />
    <output message="tns:getDeptInfoResponse" />
    </operation>
    </portType>
    - <binding name="MyCompanyPortBinding" type="tns:MyCompany">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="" />
    - <operation name="setMyDepts">
    <soap:operation soapAction="" />
    - <input>
    <soap:body use="literal" />
    </input>
    - <output>
    <soap:body use="literal" />
    </output>
    </operation>
    - <operation name="getMyDepts">
    <soap:operation soapAction="" />
    - <input>
    <soap:body use="literal" />
    </input>
    - <output>
    <soap:body use="literal" />
    </output>
    </operation>
    - <operation name="addEmployeeToDept">
    <soap:operation soapAction="" />
    - <input>
    <soap:body use="literal" />
    </input>
    - <output>
    <soap:body use="literal" />
    </output>
    </operation>
    - <operation name="getDeptInfo">
    <soap:operation soapAction="" />
    - <input>
    <soap:body use="literal" />
    </input>
    - <output>
    <soap:body use="literal" />
    </output>
    </operation>
    </binding>
    - <service name="MyCompanyWS">
    - <port name="MyCompanyPort" binding="tns:MyCompanyPortBinding">
    <soap:address location="http://localhost:7101/WebService-Annotation-context-root/MyCompanyPort" />
    </port>
    </service>
    </definitions>
    Thanks in Advance.
    Bachan
    Edited by: Bachan on Sep 1, 2010 9:04 PM

    Thanks Sam,
    SOAP UI saved my life but that want last long.
    But still my issue is not resolved.
    I am using a plsql program to take the Values from SOAP envelop and pass it to web-service and get the responce.
    I am sure my approach is perfectly fine. because it is working fine with other examples, but mean while i have a WSDL link this is really big and my program is not working for this WSDL link.
    infact i am getting the output as the same XML of URL.
    Let me know if u can help me out.
    Thanks
    Bachan.

  • How to create new XML file using retreived XML content by using SAX API?

    hi all,
    * How to create new XML file using retreived XML content by using SAX ?
    * I have tried my level best, but output is coming invalid format, my code is follows,
    XMLFileParser.java class :-
    import java.io.StringReader;
    import java.io.StringWriter;
    import javax.xml.transform.OutputKeys;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMResult;
    import javax.xml.transform.sax.SAXSource;
    import javax.xml.transform.sax.SAXTransformerFactory;
    import javax.xml.transform.sax.TransformerHandler;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.XMLFilterImpl;
    public class PdfParser extends XMLFilterImpl {
        private TransformerHandler handler;
        Document meta_data;
        private StringWriter meta_data_text = new StringWriter();
        public void startDocument() throws SAXException {
        void startValidation() throws SAXException {
            StreamResult streamResult = new StreamResult(meta_data_text);
            SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
            try
                handler = factory.newTransformerHandler();
                Transformer transformer = handler.getTransformer();
                transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                handler.setResult(streamResult);
                handler.startDocument();
            catch (TransformerConfigurationException tce)
                System.out.println("Error during the parse :"+ tce.getMessageAndLocation());
            super.startDocument();
        public void startElement(String namespaceURI, String localName,
                String qualifiedName, Attributes atts) throws SAXException {
            handler.startElement(namespaceURI, localName, qualifiedName, atts);
            super.startElement(namespaceURI, localName, qualifiedName, atts);
        public void characters(char[] text, int start, int length)
                throws SAXException {
            handler.characters(text, start, length);
            super.characters(text, start, length);
        public void endElement(String namespaceURI, String localName,
                String qualifiedName) throws SAXException {
            super.endElement("", localName, qualifiedName);
            handler.endElement("", localName, qualifiedName);
        public void endDocument() throws SAXException {
        void endValidation() throws SAXException {
            handler.endDocument();
            try {
                TransformerFactory transfactory = TransformerFactory.newInstance();
                Transformer trans = transfactory.newTransformer();
                SAXSource sax_source = new SAXSource(new InputSource(new StringReader(meta_data_text.toString())));
                DOMResult dom_result = new DOMResult();
                trans.transform(sax_source, dom_result);
                meta_data = (Document) dom_result.getNode();
                System.out.println(meta_data_text);
            catch (TransformerConfigurationException tce) {
                System.out.println("Error occurs during the parse :"+ tce.getMessageAndLocation());
            catch (TransformerException te) {
                System.out.println("Error in result transformation :"+ te.getMessageAndLocation());
    } CreateXMLFile.java class :-
    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();
    Sax.endElement("", "basic-metadata", "basic-metadata");* In CreateXMLFile.java
    class, I have retreived the xml content in the meta_data object, after that i have converted into character array and this will be sends to SAX
    * In this case , the XML file created successfully but the retreived XML content added as an text in between basic-metadata Element, that is, retreived XML content
    is not an XML type text, it just an Normal text Why that ?
    * Please help me what is the problem in my code?
    Cheers,
    JavaImran

    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    </code><code>Sax.endElement("", "basic-metadata", "basic-metadata");</code>
    <code class="jive-code jive-java">Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();     
    * I HAVE CHANGED MY AS PER YOUR SUGGESTION, NOW SAME RESULT HAS COMING.
    * I AM NOT ABLE TO GET THE EXACT OUTPUT.,WHY THAT ?
    Thanks,
    JavaImran{code}

  • How to create the sales order using BAPI's ....?

    Hi Guru's,
    could you please provide how to create the sales order using BAPI's .....i need step by step process and please provide the details from scratch....basically  i don't have basic knowledge on this....please provide required inputs ....:)
    thanks in advance
    Srinivas......

    Hi Guru's thanks for your inouts and your valuble time...
    please find the program logic below...
    *& Report  ZAREPAS30
    REPORT  zarepas30.
    DATA : gs_vbeln                   TYPE  vbak-vbeln,
           gs_order_header_in         TYPE  bapisdhd1,
           gs_order_header_inx        TYPE  bapisdhd1x,
           gt_order_items_in          TYPE  STANDARD TABLE OF bapisditm,
           gwa_itab1                  TYPE  bapisditm,
           gt_order_items_inx         TYPE  STANDARD TABLE OF bapisditmx,
           gwa_itab2                  TYPE  bapisditmx,
           gt_order_partners          TYPE  STANDARD TABLE OF bapiparnr,
           gwa_itab3                  TYPE  bapiparnr,
           gt_return                  TYPE  STANDARD TABLE OF bapiret2,
           gwa_itab4                  TYPE  bapiret2.
    Sales document type
      PARAMETERS: p_auart TYPE auart OBLIGATORY.
    Sales organization
      PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    Distribution channel
      PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    Division.
      PARAMETERS: p_spart TYPE spart OBLIGATORY.
    Requested Delivery Date
      PARAMETERS: p_edatu  TYPE edatu OBLIGATORY.
    Sold-to
      PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    Ship-to
      PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    Material
      PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    Quantity.
      PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    Plant
      PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    Start-of-selection.
      START-OF-SELECTION.
    Header data
    Sales document type
      gs_order_header_in-doc_type = p_auart.
      gs_order_header_inx-doc_type = 'X'.
    Sales organization
      gs_order_header_in-sales_org = p_vkorg.
      gs_order_header_inx-sales_org = 'X'.
    Distribution channel
      gs_order_header_in-distr_chan  = p_vtweg.
      gs_order_header_inx-distr_chan = 'X'.
    Division
      gs_order_header_in-division = p_spart.
      gs_order_header_inx-division = 'X'.
    Reguested Delivery Date
      gs_order_header_in-req_date_h = p_edatu.
      gs_order_header_inx-req_date_h = 'X'.
      gs_order_header_inx-updateflag = 'I'.
    Partner data
    Sold to
      gwa_itab3-partn_role = 'AG'.
      gwa_itab3-partn_numb = p_sold.
      APPEND gwa_itab3 TO  gt_order_partners .
    ship to
      gwa_itab3-partn_role = 'WE'.
      gwa_itab3-partn_numb = p_ship.
      APPEND gwa_itab3 TO  gt_order_partners .
    ITEM DATA
      gwa_itab2-updateflag = 'I'.
    Line item number.
      gwa_itab1-itm_number = '000010'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    Line item number.
      gwa_itab1-itm_number = '000020'.
      gwa_itab2-itm_number = 'X'.
    Material
      gwa_itab1-material = p_matnr.
      gwa_itab2-material = 'X'.
    Plant
      gwa_itab1-plant    = p_plant.
      gwa_itab2-plant   = 'X'.
    Quantity
      gwa_itab1-target_qty = p_menge.
      gwa_itab2-target_qty = 'X'.
      APPEND gwa_itab1 TO gt_order_items_in.
      APPEND gwa_itab2 TO gt_order_items_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
        order_header_in               = gs_order_header_in
        ORDER_HEADER_INX              = gs_order_header_inx
      IMPORTING
        SALESDOCUMENT                 = gs_vbeln
      tables
        RETURN                        = gt_return
        ORDER_ITEMS_IN                = gt_order_items_in
        ORDER_ITEMS_INX               = gt_order_items_inx
        order_partners                = gt_order_partners.
    Check the return table.
      LOOP AT gt_return into gwa_itab4 WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error occured while creating sales order '.
      ELSE.
    Commit the work.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        WRITE: / 'Document ', gs_vbeln, ' created'.
      ENDIF.

  • How to create custom report plugin using child region report metadata

    Hi,
    I want to ask for help on how to create custom report plugin using child region report metadata. My idea is to create a child region, a classic report and set the condition to never.
    Then i will query the child report metadata from apex view and use it to create a custom report like using jquery jq-grid. Any idea how i can create a process that will use the child report
    metadata? I dont know how i can create a process just like how apex work, how apex render report, coz i want it to be control using the standard apex report attribute. This plugin will
    render according to the child report attribute.
    Is there anybody here had ever done this?

    Hi Nicolette,
    Thanks for the reply. I know where to find the metadata, just asking for idea on how the rendering process will be.
    Start from determining column heading, column order until finish rendering the report. The same way how apex
    render the classic report.
    Previously this imy my rendering process:
    FUNCTION GETCOLUMN(P_REGION IN APEX_PLUGIN.T_REGION,
                         P_PLUGIN IN APEX_PLUGIN.T_PLUGIN,
                         P_VALUE  IN VARCHAR2) RETURN SYS.DBMS_SQL.DESC_TAB2 IS
        VSQLHANDLER     APEX_PLUGIN_UTIL.T_SQL_HANDLER;
        VCOLCOUNT       NUMBER;
        VCOLNAMES       VARCHAR2(2000);
        VAJAXIDENTIFIER VARCHAR2(100);
        VPAGESIZE       TYPEATTR := P_REGION.ATTRIBUTE_04;
        VJSCODE         VARCHAR2(32767);
      BEGIN
        VSQLHANDLER := APEX_PLUGIN_UTIL.GET_SQL_HANDLER(P_SQL_STATEMENT  => 'select * from s_emp',
                                                        P_MIN_COLUMNS    => 1,
                                                        P_MAX_COLUMNS    => 999,
                                                        P_COMPONENT_NAME => P_REGION.ID);
        VCOLCOUNT := VSQLHANDLER.COLUMN_LIST.COUNT();
        FOR I IN 1 .. VCOLCOUNT LOOP
          VCOLNAMES := VCOLNAMES || '{name: "' ||
                       UPPER(VSQLHANDLER.COLUMN_LIST(I).COL_NAME) || '",';
        END LOOP;
        APEX_PLUGIN_UTIL.FREE_SQL_HANDLER(VSQLHANDLER);
        RETURN VSQLHANDLER.COLUMN_LIST;
      EXCEPTION
        WHEN OTHERS THEN
          APEX_PLUGIN_UTIL.FREE_SQL_HANDLER(VSQLHANDLER);
          RAISE;
      END GETCOLUMN;
    So this is how i get the header for my report plugin. The same method is use to get the value / data for each column. This process is work. So now
    i want to extend my plugin so that i will use all attributes from the child report to render my plugin. So the column header, column order, all will depend
    on the child report. And the column display condition is set, it will also check the condition before render the column. Sounds like i want to reinvent
    the normal apex rendering process but this is what i want to achieve.
    I need help to find the correct logic for my render process. Don't want too much for starting, just want to render the plugin correctly, same with child report,
    same columns alias, column ordering and column  conditional display.
    Thanks,
    akulala

  • How to create a packet by using java?

    Hi, i am currently working on a research and i have some problems here.
    1) how to create a packet by using java programming ?
    2) How can i set the packet's information (e.g: packet's length, size of its header, etc) by using java?
    I am currently in a midst of this now and i hope that someone is willing to correspond to my questions and help me out of it.
    Thank you!

    I wan to create a customize packet where the user can
    define the header size, the packet's length etc. in
    the program......Then you get to write it to the connection yourself. Look at the OutputStream classes to see how to write low level output to a connection.

  • How to create a modeless dialog using commandlink

    i want to create a modelessdialog using commandlink. and my code is
    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <f:view>
    <script language="Javascript1.2">
    function modelesswin(){
    window.showModelessDialog();
    </script>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <h:form>
    <h:commandLink onclick="javascript:modelesswin('popup.html', 300, 300)" value="click"></h:commandLink>
    </h:form>
    </body>
    </f:view>
    </html>
    when i click the buttonlink the dialog box is not in a stable state that is its will appear and within a second it will disappear .. can any one of them can suggest me how to create a modeless dialoge using commandlink or by jsf option button
    regards
    subramanian

    If I had to guess (and I do :), the onclick is firing, bring up the dialog, but the commandLink causes a form submit, so the page is submitted. There is no action on the commandLink, so it's navigating back to the same page, causing it to refresh and your dialog to disappear. It would appear to me that you need a h:outputLink or simply <a href="# onclick="..." /"></a>

  • How to create a container element?

    Hi,
    Could somebody please tell me how to create a container element and how to create a multi container element? How is this element used in the fork step?
    I am using a fork with 3 branches but the agent assignment is a problem.The workitem does not go to the user set in the agents tab.
    Regards,
    Monica.

    Hi Monica,
    Within your Workflow Builder, there is a box on the left hand side that (Workflow Container). You should have an option (in change mode) to right-click and create or double-click on the <Double-Click to create> tab.
    Or you can go to the Workflow Container "Goto -> Workflow Container" and click on the "Create" <F5> icon.
    Same theory applies to creating a container element in your task. Go to your task and click on the "Container" button and select "Create".
    When creating your container, you can specify if it is a multiline container by checking "Multiline" under the container attributes.
    In a fork step, you would really only use your "Container Element" in the "End Condition" of a Fork step.
    Please advise what the "Agent Assignment" is referring to when you're using it in your fork? Which step in the fork?
    If you are assigning agents in one step of the fork, you cannot expect these agents to apply to your other 2 fork steps. The forks work independently of each other (to a point).
    Please provide more information if you need more help.
    Kind regards,
    Tom

  • Remove SOAP Header Element from ALSB Proxy Service Response

    I've got a client of one of my ALSB Proxy services that needs the SOAP header element removed from the response. I'm struggling to find a way to do that with a WSDL-based proxy service. Do I need to change my service to an Any XML Service or is there an easier way?

    At the same time, could you please also tell me how do i convert a XML Response from a business service to a SOAP Response in Proxy Service.
    My client is expecting a soap response and the backend gives back only the XML Response
    Thanks in advance!!
    ~Swagat

Maybe you are looking for