Covnert Complex XML to Simple XML tags using Adapter Module

Hi
<buyer>
<fnParty:partyIdentifier partyIdentifier="GER" partyIdentifierQualifierCode="SenderAssigned"/>
</buyer>
I want to convert above complex xml into following simple xml document
<buyer>GER</buyer>
I am writing adapter module. Could any one please tell me how to convert this
Regards
Sowmya

Hi,
Is partyidentifier is source xml and buyer in target xml?
You can map the attribute to buyer element in message mapping itself.
Why do you want adapter module?
Thanks,
Beena.

Similar Messages

  • Example of  a Simple ALV Report using Function Modules (not OO)

    Hi,
    I am new to ABAP. Where can I get a proper Example of  a Simple ALV Report using Function Modules?  I searched the forum but did not find a proper solution. Kindly help.
    Smruthi.
    Edited by: Smruthi Acharya on Jan 29, 2009 7:13 PM

    Hi,
    Use this demo code:-
    REPORT  z_alv01 MESSAGE-ID zmsg.
    *          TABLES
    TABLES : ekpo.
    *          TYPE POOLS
    TYPE-POOLS : slis.
    *          TYPE DECLARATION
    TYPES : BEGIN OF t_ekpo,
              ebeln TYPE ekpo-ebeln,
              ebelp TYPE ekpo-ebelp,
              matnr TYPE ekpo-matnr,
              werks TYPE ekpo-werks,
              menge TYPE ekpo-menge,
            END OF t_ekpo.
    *          PARAMETERS
    PARAMETERS : s_var TYPE disvariant-variant.
    *          DATA DECLARATION
    *VARIABLES
    DATA : check(1),
           rep_id TYPE sy-repid.
    *INTERNAL TABLE TYPE OF ZEKPO
    DATA : it_ekpo TYPE STANDARD TABLE OF t_ekpo WITH HEADER LINE.
    *FIELD CATALOG
    DATA : it_field TYPE slis_t_fieldcat_alv,
           wa_field TYPE slis_fieldcat_alv.
    *SORTING
    DATA : it_sort TYPE slis_t_sortinfo_alv,
           wa_sort TYPE slis_sortinfo_alv.
    *FOR TOP OF THE PAGE
    DATA : it_top TYPE slis_t_listheader,
           wa_top TYPE slis_listheader.
    *FOR END OF THE PAGE
    DATA : it_end TYPE slis_t_listheader,
           wa_end TYPE slis_listheader.
    *TO CAPTURE EVENTS AND HANDLE
    DATA : it_event TYPE slis_t_event,
           wa_event TYPE slis_alv_event.
    *FOR GRID TITLE
    DATA : wa_title TYPE lvc_title.
    *FOR LAYOUT
    DATA : wa_layout TYPE slis_layout_alv.
    *FOR EXCLUDING STANDARD BUTTON FROM ALV TOOLBAR
    DATA : it_exclude TYPE slis_t_extab,
           wa_exclude TYPE slis_extab.
    *FOR VARIANT
    DATA : wa_variant TYPE disvariant.
    *          INITIALIZATION
    INITIALIZATION.
      check = 'X'.
      rep_id = sy-repid.
      wa_variant-report = sy-repid.
    *GET DEFUALT ON THE SELECTION SCREEN FOR DEFAULT DISPLAY
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save        = 'A'
        CHANGING
          cs_variant    = wa_variant
        EXCEPTIONS
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          OTHERS        = 4.
      IF sy-subrc = 0.               " IF DEFAULT VARIANT FOUND
        s_var = wa_variant-variant.  " PASS THE DEFAULT VARIANT TO THE SELECTION SCREEN FIELD
      ENDIF.
    *          AT-SELECTION SCREEN ON VALUE REQUEST
    *          TO GET THE F4 HELP FOR VARIANT
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_var.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant                = wa_variant
    *   I_TABNAME_HEADER          =
    *   I_TABNAME_ITEM            =
    *   IT_DEFAULT_FIELDCAT       =
         i_save                    = 'A'
    *   I_DISPLAY_VIA_GRID        = ' '
       IMPORTING
    *   E_EXIT                    =
         es_variant                = wa_variant
       EXCEPTIONS
         not_found                 = 1
         program_error             = 2
         OTHERS                    = 3.
      IF sy-subrc = 0.
        s_var = wa_variant-variant. " PASS THE SELECTED VARIANT TO THE SELECTION SCREEN FIELD
      ENDIF.
    *          AT-SELECTION SCREEN
    *          TO CHECK THE EXISTENCE FOR VARIANT
    AT SELECTION-SCREEN.
      wa_variant-variant = s_var.
      CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
        EXPORTING
          i_save        = 'A'
        CHANGING
          cs_variant    = wa_variant
        EXCEPTIONS
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          OTHERS        = 4.
      IF sy-subrc <> 0.
        MESSAGE w001.
      ENDIF.
    *          START OF SELECTION
    START-OF-SELECTION.
      SELECT ebeln
             ebelp
             matnr
             werks
             menge
             FROM ekpo
             INTO TABLE it_ekpo.
    *          FIELD CATALOG
      wa_field-fieldname = 'EBELN'.
      wa_field-tabname = 'IT_TAB'.
      wa_field-outputlen = 10.
      wa_field-seltext_l = 'PO #'.
      APPEND wa_field TO it_field.
      CLEAR wa_field.
      wa_field-fieldname = 'EBELP'.
      wa_field-tabname = 'IT_TAB'.
      wa_field-outputlen = 10.
      wa_field-seltext_l = 'Line Item'.
      APPEND wa_field TO it_field.
      CLEAR wa_field.
      wa_field-fieldname = 'MATNR'.
      wa_field-tabname = 'IT_TAB'.
      wa_field-outputlen = 15.
      wa_field-seltext_l = 'Material'.
    *  wa_field-input = check.
    *  wa_field-edit = check.
      APPEND wa_field TO it_field.
      CLEAR wa_field.
      wa_field-fieldname = 'WERKS'.
      wa_field-tabname = 'IT_TAB'.
      wa_field-outputlen = 6.
      wa_field-seltext_l = 'Plant'.
    *  wa_field-input = check.
    *  wa_field-edit = check.
      APPEND wa_field TO it_field.
      CLEAR wa_field.
      wa_field-fieldname = 'MENGE'.
      wa_field-tabname = 'IT_TAB'.
      wa_field-outputlen = 10.
      wa_field-seltext_l = 'Qty.'.
    *  wa_field-input = check.
    *  wa_field-edit = check.
      wa_field-do_sum = check.
      APPEND wa_field TO it_field.
      CLEAR wa_field.
    *          SORT W.R.T. PURCHASE ORDER NUMBER
      wa_sort-spos = 1.
      wa_sort-fieldname = 'EBELN'.
      wa_sort-tabname = 'IT_EKPO'.
      wa_sort-up = check.
      wa_sort-subtot = check.
      APPEND wa_sort TO it_sort.
      CLEAR wa_sort.
    *          FOR GRID TITLE
      wa_title = 'Hello'.
    *          FOR LAYOUT
      wa_layout-zebra = check.
    *          FOR EXCLUDING STANDARD BUTTONS FROM ALV TOOLBAR
      wa_exclude-fcode = '&OUP'.
      APPEND wa_exclude TO it_exclude.
      CLEAR wa_exclude.
      wa_exclude-fcode = '&ODN'.
      APPEND wa_exclude TO it_exclude.
      CLEAR wa_exclude.
      wa_exclude-fcode = '&OAD'.
      APPEND wa_exclude TO it_exclude.
      CLEAR wa_exclude.
    *  wa_exclude-fcode = '&AVE'.
    *  APPEND wa_exclude TO it_exclude.
    *  CLEAR wa_exclude.
      wa_exclude-fcode = '&INFO'.
      APPEND wa_exclude TO it_exclude.
      CLEAR wa_exclude.
    *          POPULATE ALL EVENTS INTO INTERNAL TABLE
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_event
        EXCEPTIONS
          list_type_wrong = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE it_event INTO wa_event WITH KEY name = 'END_OF_LIST'.
      wa_event-form = 'END'.
      MODIFY it_event FROM wa_event INDEX sy-tabix.
      CLEAR wa_event.
    *          DISPLAY RECORDS IN ALV GRID
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
       i_callback_program                = rep_id
    *   i_callback_pf_status_set          = 'PF'
       i_callback_user_command           = 'COMMAND'
       i_callback_top_of_page            = 'TOP'
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
       i_grid_title                      = wa_title
    *   I_GRID_SETTINGS                   =
       is_layout                         = wa_layout
       it_fieldcat                       = it_field
       it_excluding                      = it_exclude
    *   IT_SPECIAL_GROUPS                 =
       it_sort                           = it_sort
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
       i_save                            = 'A'
       is_variant                        = wa_variant
       it_events                         = it_event
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   I_HTML_HEIGHT_TOP                 = 0
    *   I_HTML_HEIGHT_END                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   IR_SALV_FULLSCREEN_ADAPTER        =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_ekpo
    EXCEPTIONS
       program_error                     = 1
       OTHERS                            = 2.
      IF sy-subrc <> 0.
      ENDIF.
    *&      Form  top
    *       TO WRITE THE HEADER
    FORM top.
      REFRESH it_top.
      wa_top-typ = 'S'.
      wa_top-key = text-001.
      wa_top-info = rep_id.
      APPEND wa_top TO it_top.
      CLEAR wa_top.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = it_top
    *   I_LOGO                   =
    *   I_END_OF_LIST_GRID       =
    *   I_ALV_FORM               =
    ENDFORM.                    "top
    *&      Form  end
    *       TO WRITE THE FOOTER
    FORM end.
      REFRESH it_end.
      wa_end-typ = 'S'.
      wa_end-key = text-001.
      wa_end-info = rep_id.
      APPEND wa_end TO it_end.
      CLEAR wa_end.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = it_end
    *   I_LOGO                   =
    *   I_END_OF_LIST_GRID       =
    *   I_ALV_FORM               =
    ENDFORM.                    "end
    *&      Form  pf
    *       FOR PF-STATUS WITH USER DEFINED BUTTONS
    *      -->RT_EXTAB   text
    FORM pf USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZTG_PF_ALV'.
    ENDFORM.                    "pf
    *&      Form  command
    *       TO HANDLE USER ACTIONS AGAINST PF-STATUS
    *      -->UCOMM      text
    *      -->SELFIELD   text
    FORM command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
      DATA : ok_code TYPE sy-ucomm.
      ok_code = ucomm.
      CASE ok_code.
        WHEN 'T_DOWN'.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = 'HELLO'
              txt1  = 'USER COMMAND'
              txt2  = 'TOTAL DOWN'.
        WHEN 'DOWN'.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = 'HELLO'
              txt1  = 'USER COMMAND'
              txt2  = 'DOWN'.
        WHEN 'UP'.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = 'HELLO'
              txt1  = 'USER COMMAND'
              txt2  = 'UP'.
        WHEN 'T_UP'.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = 'HELLO'
              txt1  = 'USER COMMAND'
              txt2  = 'TOTAL UP'.
      ENDCASE.
    ENDFORM.                    "command
    Hope this helps you.
    Thanks & Regards,
    Tarun Gambhir

  • Urgent help needed for XML Tags using XMLForest()

    Folks
    I need some urgent help regarding getting use defined tag in your
    XML output.
    For this I am using XMLElement and XMLForest which seems to work fine
    when used at the SQL prompt but when used in a procedure throws and error
    SQL> Select SYS_XMLAGG(XMLElement("SDI",
                                       XMLForest(sdi_num)))
         From sdi
         where sdi_num = 22261;- WORKS FINE
    But when used in a procedure,doesnt seem to work
    Declare
        queryCtx  DBMS_XMLQuery.ctxType;
        v_xml     VARCHAR2(32767);
        v_xmlClob CLOB;
        BEGIN
        v_xml:='Select SYS_XMLAGG(XMLElement("SDI",
                                             XMLFOREST(sdi_num)))
        From sdi
        where sdi_num = 22261';
        queryCtx :=DBMS_XMLQuery.newContext(v_xml);
        v_xmlClob :=DBMS_XMLQuery.getXML(queryCtx);
        display_xml(v_xmlClob);
    End;
    CREATE OR REPLACE PROCEDURE  display_xml(result IN OUT NOCOPY CLOB)
    AS
         xmlstr varchar2(32767);
         line varchar2(2000);
    BEGIN
         xmlstr:=dbms_lob.SUBSTR(result,32767);
         LOOP
         EXIT WHEN xmlstr is null;
         line :=substr(xmlstr,1,instr(xmlstr,chr(10))-1);
         dbms_output.put_line('.'||line);
         xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
         END LOOP;
    end;
    SQL> /
    .<?xml version = '1.0'?>
    .<ERROR>oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an
    XML tag name.</ERROR>
    PL/SQL procedure successfully completed.
    SQL>HELP is appreciated as to where I am going wrong?

    Hi,
    if you want to transform something to something else, you should declare, what is your source.
    I would prefer to use plain XSL-Transformations, because you have a lot more options to transform your source and you can even better determine, how your output should looks like.
    Kind regards,
    Hendrik

  • Remove Empty XML Tags using module parameters

    Hi All,
    In my lanscape I have two PI Systems.
    My scenario is an IDOC reaches 1st PI system gets converted into an EDIFACT and then goes to the 2nd PI and from there it gets routed to the respective AS2 Party.
    I am using SOAP to pass message between the PI systems and B2B Toolkit's AS2 Adapter for the communication with AS2 party.
    The issue is when the message is getting converted from IDOC to EDIFACT there are a few feilds with occurence 1..1 and due to these fields i get an empty XML tag at the output. These empty XML tags give me an error in the B2B Toolkit's AS2 Adapter Receiver Channel
    I cannot change the occurence in the structure of the EDIFACT nor can I use an XSLT mapping to remove empty tags before the message reaches the Communication Channel.
    I want to know if there are any module parameters which i can use either in SOAP Channel or the AS2 Channel to remove the XML Tags.

    Hi Muni,
    "1..1 means, you must send some values for that fields. try to find out why these are not getting any values."
    This empty tag is expected. Before using B2B Toolkit's AS2 Adapter we used to use Seeburger's AS2 Adpater and the message used to get executed successfully with these empty tags.The issue is coming only when we are using B2B Toolkit's AS2 Adapter.
    "if you want to stop sending(the fields which are not needed in target) you can you can disable the fields in the message mapping."
    I cannot disable the feild in the mapping as some other message may use this field.
    Thanks,
    Farhaan

  • Rename an XML tag using javascript

    Dear adobe experts,
    I have a requirement to rename XML tags, in the interface for an adobe form, using javascript.
    the XML looks like this:
    <ELEMENT>
         <DATA>
              <ROW_IID>0</ROW_IID>
              <PARENT>0</PARENT>
              <CHILD>0</CHILD>
         </DATA>
         <DATA>
              <ROW_IID>1</ROW_IID>
              <PARENT>0</PARENT>
              <CHILD>0</CHILD>
         </DATA>
    </ELEMENT>
    and the result should look something like this:
    <ELEMENT>
         <CHAIR>
              <ROW_IID>0</ROW_IID>
              <PARENT>0</PARENT>
              <CHILD>0</CHILD>
         </CHAIR>
         <TABLE>
              <ROW_IID>0</ROW_IID>
              <PARENT>0</PARENT>
              <CHILD>0</CHILD>
         </TABLE>
    </ELEMENT>
    Is this possible and how can I do this? I was hoping that something like renameNode() (for instance) is also possible in the javascript set for adobe forms.
    If it's not possible I'm going to have to create new nodes, put the data from the existing node in the new node and remove the original node. This will be a lot more work and just renaming is easier :-).
    Kind regards,
    Niels

    Hi,
           Thanks a lot Jeff...
            I'm doing a huge program with lot of tasks. While doing that,my mind didn't strike to check if the tag is not already exist, then only to create new tag...  Thanks for all of the indesigner experts for their replies...
    I used the following codes with ur idea.
                        var renamewith = textbox1.text;
                        try
                            alert(app.activeDocument.xmlTags.item(renamewith).name);
                            if(app.activeDocument.xmlTags.item(renamewith).name)
                               var testTag = app.activeDocument.xmlTags.item(renamewith);
                        catch(e)
                            var testTag = app.activeDocument.xmlTags.add({name: renamewith});
    With Regards,
    Vel.

  • XML:selecting the value of a xml tag using plsql

    Hi,
    I have a table xx_table with one of the column xx_column which is of type XMLTYPE.I inserted the xml data into this column with xml data as below.
    <userComments xmlns:ns1="http://xmlns.oracle.com/XXXX_AccountDistribution"
    xmlns="http://xmlns.oracle.com/XXXXX_AccountDistribution">
    <task:userComment
    xmlns:task="http://xmlns.oracle.com/bpel/workflow/task">
    <task:comment>*********** Rejecting invoice **********</task:comment>
    <task:updatedBy>
    <task:id>r</task:id>
    <task:displayName></task:displayName>
    <task:systemVersionFlag></task:systemVersionFlag>
    </task:updatedBy>
    <task:updatedDate>2010-05-19T14:09:15-07:00</task:updatedDate>
    <task:displayNameLanguage></task:displayNameLanguage>
    <task:action></task:action>
    <task:systemVersionFlag></task:systemVersionFlag>
    </task:userComment>
    </userComments>
    My question ,how do i select the value of the tag "comment" from the above xml data using plsql? Can we write a query to select the value of the tag "comment" to fetch "*********** Rejecting invoice **********" as value.
    Regards,
    Sandeep

    If you have rights to modify tabular model then, you can create a measure in your Tabular model which returns previous week and then use this measure in Pivot Table.
    Thanks,
    Sagar K 
    (Blog: http://datamazik.blogspot.in/)

  • How to create nested xml tags using java parser?

    Hi,
    I need to create a xml file containing following tags using java program-
    <A attr1="abc">
    <B attr2="xyz">
    <C attr3="pqr"> </C>
    </B>
    </A>
    Can anyone please let me know which parser should I use to create the above mentioned xml file?
    If possible, please post a code snippet for the same.
    Thanks in advance..

    Well, you could start by doing it all the 'old fashioned' way; create a String object containing that text and then write it away to a file. Or you could take the time to look at the javadoc for all of the xml support that the Java language itself supplies - XMLReader/Writer for a start. After that put together some code that you think would do the job and ask for help on any specific problems you encounter.

  • How to read XML payload in Adapter module

    Hi all,
    I have to read content of xml payload inside custom adapter module:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_REQ xmlns:ns0="namespace">
    <record>
      <EmployeeName>a</EmployeeName>
      <EmployeeID>9999</EmployeeID>
      </record>
    <record>
      <EmployeeName>b</EmployeeName>
      <EmployeeID>9999</EmployeeID>
      </record>
    <record>
      <EmployeeName>c</EmployeeName>
      <EmployeeID>9999</EmployeeID>
      </record>
      </ns0:MT__REQ>
    obj = inputModuleData.getPrincipalData();
    msg = (Message) obj;
    XMLPayload xpld = msg.getDocument();
    String xmltxt = xpld.getText();
    InputStream in = new ByteArrayInputStream(xmltxt.getBytes("UTF-8"));
    & then using DOM parser i am trying to read the contents.
    But i am not able to read anything. And no exception is raised.
    How can i read contents of this xml file.
    Thanks,
    Mayank

    hi,
    I am still getting same Blank payload.
    My Code for Parsing is:
    doc = db.parse((InputStream) xpld.getInputStream());
    NodeList list_Set=doc.getElementsByTagName("record");
    NodeList list_Set1=doc.getElementsByTagName("EmployeeName");
    NodeList list_Set2=doc.getElementsByTagName("EmployeeID");
    Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "12");
    String input = "";
    for(int i = 0; i < list_Set.getLength(); i++){
    Node f=list_Set1.item(i);
    f=f.getFirstChild();
    String str_f=f.getNodeValue();
    Node f2=list_Set2.item(i);
    f2=f2.getFirstChild();
      String str_f2=f2.getNodeValue();
    input = input + str_f + "," + str_f2 +  "END" ;
    Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Value added from incoming payload");
    Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, input);
    And in RWB monitoring, i am able to see:
    2009-10-01 14:20:51 Information 12
    2009-10-01 14:20:51 Information UNDEFINED
    2009-10-01 14:20:51 Information 14
    So UNDEFINED is coming for input.
    Edited by: Mayank  Gupta on Oct 1, 2009 11:08 AM

  • Problem changing XML element in Adapter Module

    Hey!
    I am developing an adapter module to transform a coded password back to clear text. I have access to the XML element where the password is and I get to transform it, but I have 2 problems as also stated in the code:
    1) I cannot set the new value back to the node. I try with
    firstNode.getFirstChild().setNodeValue(decodedPwd);
    but this does not seem to work. How can I achieve this?
    2) Between the first issue and the code
    msg.setDocument(xmlpayload);
    I am not sure how to get my new values for the node back in the XMLPayload. How can I achieve this?
    Here is the code:
    msg = (Message) inputModuleData.getPrincipalData();
              XMLPayload xmlpayload = msg.getDocument();
              factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = factory.newDocumentBuilder();
              Document document = builder.parse((InputStream)xmlpayload.getInputStream());
              password = (Element)document.getElementsByTagName("ns1:passord").item(0);
              firstNode = password.getFirstChild();                    
              pwd = firstNode.getNodeValue();
              if(pwd != null){
                   decodedPwd = Decoder.decodeString(pwd);
    // THIS FAILS!
              firstNode.getFirstChild().setNodeValue(decodedPwd);
    //HOW TO SET NEW NODE VALUE TO XMLPAYLOAD HERE?
              msg.setDocument(xmlpayload);
              inputModuleData.setPrincipalData(msg);
                   return inputModuleData;          
    Help is much appreciated!
    Thanks!
    regards Ole

    Hey!
    The problem was solved. The code snipped I found was:
                   DOMSource DOMSource = new DOMSource(document);
                   ByteArrayOutputStream myBytes = new ByteArrayOutputStream();
                   Result dest = new StreamResult(myBytes);
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer serializer = tf.newTransformer();
                   serializer.transform(DOMSource, dest);
                   byte[] docContent = myBytes.toByteArray();
                   xmlpayload.setContent(docContent);
                   msg.getDocument().setContent(xmlpayload.getContent());               
    Ole
    Edited by: Ole Mugaas on Mar 27, 2008 8:43 PM

  • Converting INVOIC02 idoc to EDIFACT INVOIC message (Using Adapter Module

    Hi Friends,
    We are sending customer idoc (INVOIC02) from R/3 to external system through PI. We want to generate EDIFACT output file (message type : INVOIC).
    Is it possible to convert IDoc message to EDI file format through java adapter module ? Will adapter module support this  without using Seeburger adapter ?
    kindly clarify, friends.
    Kind regards,
    Jegathees P.

    There is an alternative to Seeburger.
    DataDirect also has complete EDI-XML conversion by way of deploying a module which is called from an adapter. The range of parameters with the conversion is also quite extensive, allowing tolerance for partners who may have included non-standard EDI qualifiers and such.  The XML tags make for easier mapping.  StylusStudio XML Suite includes the EDI<->XML adapter so you can try the conversions each way directly in that package.  If you are happy with it, you need to then purchase the package from DataDirect.  We did this and implemented EDI for X12 and EDIfact, including Orders and Invoices and some other messages.  The communications part was not included.  We wrote the EDI files and used a separate process to actually send and receive the files. The IDoc <-> EDI mapping  was done using the normal graphical mapping of SAP PI. The Stylus Studio package includes the functionality to generate the XSD, which we imported to SAP PI.

  • Issue with overwriting msg using adapter module when WSS enabled in SOAP CC

    Hi guys,
    I have a SOAP->RFC scenario where on the sender side I'm using an adapter module. This adapter module should modify the message content based on some conditions. This works fine unless the WSS is enabled in the sender SOAP CC. When enabled, the message doesn't get modified. If disabled, it works fine. Do you have any explanation for this? Is there any workaround for this?
    Thanks, Olian

    Hi Olian,
    For 2004s (PI71) too sender adapter doesn't support modules (in normal SOAP mode and not in AXIS)
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/a4/f13341771b4c0de10000000a1550b0/frameset.htm
    >>if I use the module w/o WSS enabled on the CC,
    Can you tell me how you did this??
    Regards
    Suraj

  • Problems in creating xml tags using java

    i had analysed the xmlnode builder class but i am unable to learn what is the functions of that class.
    so please send me a sample coding to create the following output.
    i need this kind of output.
    <?xml version="1.0"?>
    <tree>
    <node id="acc" text="Accounts" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="1" text="Liabilites" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="5" text="Capital" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="L5" text="Gods A/c" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    </contents>
    </node>
    <node id="10" text="Current Liablities" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    <node id="11" text="Cash On Hand" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="L11" text="Cash" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    </contents>
    </node>
    <node id="12" text="Bank Balance" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="L12" text="ICICI" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    </contents>
    </node>
    </contents>
    </node>
    <node id="2" text="Asset" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="6" text="Fixed Asset" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2"/>
    </contents>
    </node>
    <node id="3" text="Expenses" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="15" text="Direct Expenses" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2">
    <contents>
    <node id="8" text="Purchase" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2"/>
    </contents>
    </node>
    <node id="16" text="InDirect Expenses" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2">
    <contaents>
    <node id="L16" text="Staff Welfare" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2"/>
    </contaents>
    </node>
    </contents>
    </node>
    <node id="4" text="Income" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="13" text="Direct Income" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2">
    <contents>
    <node id="7" text="Sales" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2"/>
    </contents>
    </node>
    <node id="14" text="InDirect Income" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2"/>
    </contents>
    </node>
    </contents>
    </node>
    <node id="inv" text="Inventory" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="1" text="Raw Material" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="I1" text="Pigments" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    </contents>
    </node>
    <node id="2" text="Intermediate" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    <node id="3" text="Work In Process" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    <node id="4" text="Finised Goods" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    <node id="5" text="Packing Materials" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    </contents>
    </node>
    </tree>

    Unless you are using some special tag library or something, SQL is not, as far as I've ever seen, going to handle while loops within the statements. You want to create the table, then you have to create the CREATE statement string
    String c = "CREATE TABLE [dbo].[tblNewTable] (";
    for(int x = 0; x < vFieldFruitVector.size(); x++) {
       c += vFieldFruitVector.get(x) + " char 50 COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL";
    c += ")";
    int res = stmt.executeUpdate(c);

  • Searching for XML tags using Oracle Text

    I am using full text search to find documents based on a search text. It works fine for pdf, word documents, etc. However for XML documents, searching for a particular tag name does not find anything. Searching for text within tags works fine. Any thoughts?
    Edited by: miyer on Feb 21, 2011 6:25 PM

    Hi
    Try adding the following variable to ucm config.cfg and then see if a new xml checkin returns the result for FT search :
    TextIndexerFilterFormats=xml
    Save the file , restart UCM and then test .
    If the new checkin gets the results as expected then execute Collection Rebuild cycle to have the existing contents as well FT indexed to be searchable (for XML).
    Thanks
    Srinath

  • How to comment the xml tags using java

    Iam using a xml file i want to comment some of the tags in that file

    And your quesion is? Did you parse it into a Document and do you want to write a changed version into another file?

  • Q: How to access and modify xml tags using Java

    I have an xml based document that i need to access and change. For example, the code
    <section id="section1">
    <div>
    <xforms:group id="id1">
    <xforms:label id="label1">
    <l style="font-size:16pt"> something </l>
    </xforms:label>
    </xforms:group>
    </div>
    </section>
    Working with Java I need to access all the tags, select some of them that are relevant to the current device and remade the document. I thought I would read the file character by character identifying the different labels and building a tree, storing in the tree nodes the relevant information as some kind of attributes (for example, in the case of the <xforms:group id="id1"> I would name the node "xforms:group" and create an "id" attribute with value "id1"). I'm not sure if that is the most efficient way of accessing the problem (computational power might be an issue), and would appreciate some help on the subject.
    Thanks,

    this may help you..
    this is a little util i made to help me read/write files.
    using this, you are only one step away from your solutions, you only need to figure out the regex you need to run on the text of the file to make it become what you need it to become.
    though if you use non-standard encoding, you might not want to use this code..
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.Arrays;
    public class ASCIIFile {
         private File file;
         private StringBuilder builder;
         public ASCIIFile(String path) throws IOException{
              file = new File(path);
              openFile();
         public ASCIIFile(File file) throws IOException{
              this.file = file;
              openFile();
         public void setNewFileName(String fileName){
              file = new File(file.getAbsolutePath(), fileName);
         public void setNewFilePath(String filePath){
              file = new File(filePath, file.getName());
         private void openFile() throws IOException{
              if(!file.exists()) file.createNewFile();
              BufferedReader read = new BufferedReader(new FileReader(file));
              String line = read.readLine();
              builder = new StringBuilder();
              while(line != null){
                   builder.append(line);
                   builder.append("\n");
                   line = read.readLine();
              read.close();
         public String getContents(){
              return builder.toString();
         public StringBuilder getStringBuilder(){
              return builder;
         public void setStringBuilder(StringBuilder b) throws IOException{
              setContents(b.toString());
         public void setContents(String contents) throws IOException{
              FileWriter writer = new FileWriter(file);
              writer.write(contents);
              writer.flush();
              writer.close();
              builder = new StringBuilder(contents);
         public static File[] getAllFilesUnderDir(String fullpath, boolean recursive) {
              ArrayList queue = new ArrayList(10);
              ArrayList matched = new ArrayList();
              File root = new File(fullpath);
              File[] files = root.listFiles();
              if (files == null || files.length == 0) {
                   return new File[] {};
              queue.addAll(Arrays.asList(files));
              for (int j = 0; j < queue.size(); j++) {
                   File child = (File) queue.get(j);
                   if (child.isDirectory() && recursive) {
                        files = child.listFiles();
                        if (files != null) {
                             queue.addAll(Arrays.asList(files));
                   } else { // child is file
                        matched.add(child);
              return (matched.size() > 0)?((File[]) matched.toArray(new File[] {})):(new File[] {});
    }

Maybe you are looking for