How to correctly use the evaluate() method in Xpath?

I have this sample code. I would expect the output to be something like
Channel #0
Channel Name : Ch1
Channel #1
Channel Name : Ch2
Channel #2
Channel Name : Ch3
but all I get is
Channel #0
Channel Name : Ch1
Channel #1
Channel Name : Ch1
Channel #2
Channel Name : Ch1
Do I misuse the evaluate() method? It seems the evaluate method disregards the"doc" start node I pass in and always start from the beginning of the XML...
Very appreciate your suggestion. Thank you very much.
import javax.xml.xpath.*;
import org.xml.sax.InputSource;
import java.io.StringReader;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
public class EvaluateTest {
     * @param args
     public static void main(String[] args) {
          String myxml = "<?xml version='1.0' encoding='utf-8' ?><mytest><ChannelList>" +
          "<Channel><ChannelId>0001</ChannelId><ChannelName>Ch1</ChannelName></Channel>" +
          "<Channel><ChannelId>0002</ChannelId><ChannelName>Ch2</ChannelName></Channel>" +
          "<Channel><ChannelId>0003</ChannelId><ChannelName>Ch3</ChannelName></Channel>" +
          "</ChannelList></mytest>";
          //Get the Document object
          Document doc = null;
          try {
               InputSource inputSource = new InputSource();
               inputSource.setCharacterStream( new StringReader(myxml));
               DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
               DocumentBuilder db = factory.newDocumentBuilder();
               doc = db.parse(inputSource);
               //Iterate thru the Channel list
               NodeList channellist = getSubElements(doc, "/mytest/ChannelList/Channel");
               if (channellist==null)
                    System.out.println("the channel list is null");
               for (int i=0, len=channellist.getLength(); i<len; i++) {
                    System.out.println("Channel #" + i);
                    /*{XPathFactory factory = XPathFactory.newInstance();
                    XPath anxpath = factory.newXPath();
                    String result = (String)anxpath.evaluate(".", channellist.item(i), XPathConstants.STRING);
                    out.println(result);}*/
                    String name = getTagValue(channellist.item(i), "//ChannelName/text()", -1);
                    System.out.println("Channel Name : " + name);
          catch ( Exception e ) {
               e.printStackTrace();
               return;
     //Get the text value of a tag from a document object using XPath method
     static public String getTagValue(Object doc, String xpathstr, int index) throws Exception {
          String result = "";
          if ((doc==null)     || (xpathstr==null) || "".equals(xpathstr))
               return result;
          XPathFactory factory = XPathFactory.newInstance();
          XPath xpath = factory.newXPath();
          result = (String)xpath.evaluate(xpathstr, doc, XPathConstants.STRING);
          if (result==null)
               result = "";
          return result;
     static public NodeList getSubElements(Object doc, String xpathstr) throws Exception {
          if ((doc==null)     || (xpathstr==null) || "".equals(xpathstr))
               return null;
          XPathFactory factory = XPathFactory.newInstance();
          XPath xpath = factory.newXPath();
          Object result = xpath.evaluate(xpathstr, doc, XPathConstants.NODESET);
          return (NodeList)result;
}

Sorry here is a repost of the code. Didn't realize there is a code tag feature.
import javax.xml.xpath.*;
import org.xml.sax.InputSource;
import java.io.StringReader;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
public class EvaluateTest {
    * @param args
   public static void main(String[] args) {
      String myxml = "<?xml version='1.0' encoding='utf-8' ?><mytest><ChannelList>" +
                  "<Channel><ChannelId>0001</ChannelId><ChannelName>Ch1</ChannelName></Channel>" +
                             "<Channel><ChannelId>0002</ChannelId><ChannelName>Ch2</ChannelName></Channel>" +
                  "<Channel><ChannelId>0003</ChannelId><ChannelName>Ch3</ChannelName></Channel>" +
                  "</ChannelList></mytest>";
      //Get the Document object
      Document doc = null;
      try {
            InputSource inputSource = new InputSource();
            inputSource.setCharacterStream( new StringReader(myxml));
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder db = factory.newDocumentBuilder();
            doc = db.parse(inputSource);
            //Iterate thru the Channel list
            NodeList channellist = getSubElements(doc, "/mytest/ChannelList/Channel");
            if (channellist==null)
                  System.out.println("the channel list is null");
            for (int i=0, len=channellist.getLength(); i<len; i++) {
                  System.out.println("Channel #" + i);
                  String name = getTagValue(channellist.item(i), "//ChannelName/text()", -1);
                  System.out.println("Channel Name : " + name);
      } catch ( Exception e ) {
            e.printStackTrace();
            return;
   //Get the text value of a tag from a document object using XPath method
   static public String getTagValue(Object doc, String xpathstr, int index) throws Exception {
      String result = "";
      if ((doc==null)     || (xpathstr==null) || "".equals(xpathstr))
            return result;
      XPathFactory factory = XPathFactory.newInstance();
      XPath xpath = factory.newXPath();
      result = (String)xpath.evaluate(xpathstr, doc, XPathConstants.STRING);
      if (result==null)
            result = "";
      return result;
   static public NodeList getSubElements(Object doc, String xpathstr) throws Exception {
      if ((doc==null)     || (xpathstr==null) || "".equals(xpathstr))
            return null;
      XPathFactory factory = XPathFactory.newInstance();
      XPath xpath = factory.newXPath();
      Object result = xpath.evaluate(xpathstr, doc, XPathConstants.NODESET);
      return (NodeList)result;
}

Similar Messages

  • How do I use the find method to find multiple items in a single paragraph?

    I am desigining a script to find any instances where ctrl+b and ctrl+i are applied to body text and then replace those character format overrides with Italic or Bold chartag.  Here's what the script is supposed to do:
    put the find method in a while loop that searches for character format overrides.
    If a character format override is found, pass the text range returned by the find method and the CharPropsChange flag to the GetTextForRange method.
    Use a boolean compare between the idata of the text item to the character angle and character weight constants.
    Whichever boolean evaluates to true, then use the SetTextProp method to set properties of the text range to the properties of the italic or bold character tag.
    This script does work on the first character format override found however it ignores any other overrides in the same paragraph. The cause of this is that the while loop updates the text loc that the find method uses to the next paragraph in flow. I suspect that i need to add an inner loop that goes through all the text in a single paragraph, where at teach iteration the text loc used by the find method is based on the same paragraph but the offset is modified. I am just not sure how to do that.
    function removeOverrides (pDoc)
        var vDocStart = pDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
        var vBoldFmt=getCharFmt (pDoc, 'Bold')
        var vItalicFmt=getCharFmt (pDoc, 'Italic')
        initFA_errno ();
        while (FA_errno==Constants.FE_Success)
            var vTextLoc = new TextLoc(vDocStart,0);
            var vFindParams=findOverrideParams (pDoc);
            var vTextRange=pDoc.Find(vTextLoc,vFindParams);
            if (vTextRange.beg.obj.ObjectValid())
                var vTextItems=pDoc.GetTextForRange (vTextRange, Constants.FTI_CharPropsChange)
                if (vTextItems.length==!0 )
                    if (vTextItems[0].idata==Constants.FTF_WEIGHT)
                       pDoc.SetTextProps (vTextRange, vBoldFmt.GetProps())
                    if (vTextItems[0].idata==Constants.FTF_ANGLE)
                       pDoc.SetTextProps (vTextRange, vItalicFmt.GetProps())
                    } else (Log (vLogFileName, '\nERROR: No items were found in the text format array but format override was found: '+pDoc.Name))
            vDocStart=vDocStart.NextPgfInFlow;
    function findOverrideParams (pDoc)
        var vFindParams = AllocatePropVals(1);
        vFindParams[0].propIdent.num = Constants.FS_FindObject;
        vFindParams[0].propVal.valType = Constants.FT_Integer;
        vFindParams[0].propVal.ival = Constants.FV_FindCharacterFormatOverride;
       return vFindParams;

    Hi Rick,
    Well, following up on the previous posting, I actually did figure out how to make it work but it seems rather inefficient. I can insert a new paragraph right after the paragraph that has the table anchor but when i cut the table, i also cut the paragraph i just created. So to get around that, I create two paragraphs, so that there will be one paragraph left after i do the cut and that is the paragraph that I paste the table into. Once the table is pasted into the new paragraph, I delete the other paragraph that I created.
    Here's the updated code from the for loop:
    var vTbl = vDoc.GetUniqueObject(Constants.FO_Tbl, vTextItems[i].obj.Unique);                 
    var vAnchorPgf=vDoc.NewSeriesPgf (vTbl.TextLoc.obj)      
    var vAnchorPgf2=vDoc.NewSeriesPgf (vAnchorPgf);        
    var vAnchorTextLoc=new TextLoc (vAnchorPgf2, 0);             
    var vTblTextRange=new TextRange ();        
    vTblTextRange.beg.obj=vTbl.TextLoc.obj;       
    vTblTextRange.beg.offset = vTbl.TextLoc.offset;        
    vTblTextRange.end.obj=vTbl.TextLoc.obj;        
    vTblTextRange.end.offset = Constants.FV_OBJ_END_OFFSET                 
    vDoc.TextSelection=vTblTextRange;        
    vDoc.Cut (0);                
    vTblTextRange.beg.obj=vAnchorTextLoc.obj;        
    vTblTextRange.beg.offset = 0;              
    vTblTextRange.end.obj=vAnchorTextLoc.obj;       
    vTblTextRange.end.offset =0;                 
    vDoc.TextSelection=vTblTextRange;       
    vDoc.Paste (0);                   
    vAnchorPgf2.Delete();        

  • How to use the index method for pathpoints object in illustrator through javascripts

    hii...
    am using Illustrator CS2 using javascripts...
    how to use the index method for pathpoints object in illustrator through javascripts..

    Hi, what are you trying to do with path points?
    CarlosCanto

  • How to use the POST method In Oracle APEX 3.1

    Hi,
    In APEX if we are submitting the page the parameters( Variables ) will pass through URL.
    How to hide the these parameters from URL??
    I Hope POST method will solve this problem.
    How to use the POST method in APEX???
    Help me out to solve this problem.
    thanks in advance.
    Cheers,
    Shan

    In APEX if we are submitting the page the parameters( Variables ) will pass through URL.No they won't. Submission POSTs the <tt>wwv_flow</tt> form.
    Sometimes a branch may be performed after submission, generating a URL in which parameter values are visible. To avoid this, use the save state before branching option.
    Other actions&mdash;like using navigation lists, or clicking a link in a report&mdash;will perform a GET using parameters in the URL. In these cases using Session State Protection is advised.

  • How can I use the "Correct camera distortion" filter and process multiple files in PSE 11?

    How can I use the "Correct camera distortion" filter and process multiple files in PSE 11?

    Did you check the help page for Correct Camera Distortion and Process multiple file
    Correct Camera Distortion: http://helpx.adobe.com/photoshop-elements/using/retouching-correcting.html#main-pars_headi ng_5
    Process multiple files: http://help.adobe.com/en_US/photoshopelements/using/WS287f927bd30d4b1f89cffc612e28adab65-7 fff.html#WS287f927bd30d4b1f89cffc612e28adab65-7ff6

  • How we can use class and methods for the FM of reuse_alv_list_display

    Hi Abapers,
    Please provide the sample code of class and method of REUSE_ALV_LIST_DISPLAY.
    Which Class i can use for this Function module.
    I need to write a code using OOPS concept.
    I was done the GRID display  using this class cl_gui_alv_grid.
    But i want only List Display using the class & methods.
    Plz provide sample code.
    Thanks
    Nani.

    Hi Nani,
    This is the sample code..
    *&amp; Report Z_OO_ALV
    *& We can Use Two containers in OOALV
    REPORT z_oo_alv LINE-COUNT 50.
    *types gt_struct type sflight.
    DATA BEGIN OF gt_struct.
    INCLUDE STRUCTURE sflight.
    DATA rcol(4) TYPE c.
    DATA colors TYPE lvc_t_scol.
    DATA END OF gt_struct.
    *ALV GRIDs
    DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid.
    DATA gr_alvgrid1 TYPE REF TO cl_gui_alv_grid.
    DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV'.
    DATA gc_custom_control_name1 TYPE scrfname VALUE 'CC_ALV1'.
    *CONTAINERs
    DATA gr_ccontainer TYPE REF TO cl_gui_custom_container.
    DATA gr_ccontainer1 TYPE REF TO cl_gui_custom_container.
    *FIELDCATALOGs
    DATA gt_fieldcat TYPE lvc_t_fcat WITH HEADER LINE.
    DATA gt_fieldcat1 TYPE lvc_t_fcat WITH HEADER LINE.
    *LAYOUTs
    DATA gs_layout TYPE lvc_s_layo.
    DATA gs_layout1 TYPE lvc_s_layo.
    DATA pt_exclude TYPE ui_functions. "internal table declaration to be passed.
    *DATA pt_cell TYPE lvc_t_cell with header line.
    DATA : gt_list LIKE gt_struct OCCURS 50 WITH HEADER LINE,
    gt_list1 LIKE gt_struct OCCURS 50 WITH HEADER LINE.
    *DATA v_ucomm TYPE sy-ucomm.
    CALL SCREEN 100.
    *& Module display_alv OUTPUT
    text
    MODULE display_alv OUTPUT.
    PERFORM display_alv.
    ENDMODULE. " display_alv OUTPUT
    *& Module PAI INPUT
    text
    MODULE pai INPUT.
    CASE sy-ucomm.
    WHEN 'EXIT'.
    PERFORM exit_program.
    WHEN 'PICK'.
    PERFORM cell_info.
    ENDCASE.
    ENDMODULE. " PAI INPUT
    *& Form display_alv
    text
    FORM display_alv.
    PERFORM prepare_field_catalog CHANGING gt_fieldcat[].
    PERFORM prepare_layout CHANGING gs_layout.
    PERFORM data_retrival.
    IF gr_alvgrid IS INITIAL.
    CREATE OBJECT gr_ccontainer
    EXPORTING
    container_name = gc_custom_control_name
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    create_error = 3
    lifetime_error = 4
    lifetime_dynpro_dynpro_link = 5
    OTHERS = 6.
    IF sy-subrc <> 0.
    ENDIF.
    CREATE OBJECT gr_alvgrid
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    i_parent = gr_ccontainer
    I_APPL_EVENTS = space
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    I_FCAT_COMPLETE = SPACE
    EXCEPTIONS
    error_cntl_create = 1
    error_cntl_init = 2
    error_cntl_link = 3
    error_dp_create = 4
    OTHERS = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    PERFORM exclude_tb_functions CHANGING pt_exclude.
    PERFORM set_col.
    CALL METHOD gr_alvgrid->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    is_layout = gs_layout
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    it_toolbar_excluding = pt_exclude "excluding toolbar functions
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    it_outtab = gt_list[]
    it_fieldcatalog = gt_fieldcat[]
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ELSE.
    CALL METHOD gr_alvgrid->refresh_table_display
    EXPORTING
    IS_STABLE =
    I_SOFT_REFRESH =
    EXCEPTIONS
    finished = 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.
    ENDIF.
    PERFORM prepare_field_catalog1 CHANGING gt_fieldcat1[].
    PERFORM prepare_layout1 CHANGING gs_layout1.
    PERFORM data_retrival1.
    IF gr_alvgrid1 IS INITIAL.
    CREATE OBJECT gr_ccontainer1
    EXPORTING
    container_name = gc_custom_control_name1
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    create_error = 3
    lifetime_error = 4
    lifetime_dynpro_dynpro_link = 5
    OTHERS = 6.
    IF sy-subrc <> 0.
    ENDIF.
    CREATE OBJECT gr_alvgrid1
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    i_parent = gr_ccontainer1
    I_APPL_EVENTS = space
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    I_FCAT_COMPLETE = SPACE
    EXCEPTIONS
    error_cntl_create = 1
    error_cntl_init = 2
    error_cntl_link = 3
    error_dp_create = 4
    OTHERS = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    PERFORM set_col1.
    CALL METHOD gr_alvgrid1->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    is_layout = gs_layout1
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    it_outtab = gt_list1[]
    it_fieldcatalog = gt_fieldcat1[]
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ELSE.
    CALL METHOD gr_alvgrid1->refresh_table_display
    EXPORTING
    IS_STABLE =
    I_SOFT_REFRESH =
    EXCEPTIONS
    finished = 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.
    ENDIF.
    ENDFORM. "display_alv
    *& Form prepare_field_catalog
    text
    -->GT_FIELDCAT text
    FORM prepare_field_catalog CHANGING pgt_fieldcat TYPE lvc_t_fcat.
    DATA ls_fieldcat TYPE lvc_s_fcat.
    ls_fieldcat-tabname = 'gt_list'.
    ls_fieldcat-fieldname = 'CARRID'.
    ls_fieldcat-scrtext_m = 'Air line code'.
    ls_fieldcat-col_pos = 0.
    ls_fieldcat-outputlen = 10.
    ls_fieldcat-emphasize = 'C400'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO pgt_fieldcat.
    ls_fieldcat-tabname = 'gt_list'.
    ls_fieldcat-col_pos = 1.
    ls_fieldcat-fieldname = 'CONNID'.
    ls_fieldcat-scrtext_m = 'Connection code'.
    ls_fieldcat-emphasize = 'C900'.
    APPEND ls_fieldcat TO pgt_fieldcat.
    ls_fieldcat-tabname = 'gt_list'.
    ls_fieldcat-fieldname = 'PRICE'.
    ls_fieldcat-scrtext_m = 'PRICE'.
    APPEND ls_fieldcat TO pgt_fieldcat.
    ENDFORM. "prepare_field_catalog
    *& Form prepare_layout
    text
    -->GS_LAYOUT text
    FORM prepare_layout CHANGING gs_layout TYPE lvc_s_layo.
    gs_layout-stylefname = 'FIELD_STYLE'.
    gs_layout-zebra = 'X'.
    gs_layout-grid_title = 'FLIGHT'.
    gs_layout-sel_mode = 'A'.
    gs_layout-ctab_fname = 'COLORS'.
    ENDFORM. "prepare_layout
    *& Form data_retrival
    text
    FORM data_retrival.
    SELECT carrid
    connid
    price
    FROM sflight
    INTO CORRESPONDING FIELDS OF TABLE gt_list
    UP TO 50 ROWS.
    ENDFORM. "data_retrival
    FORM EXIT_PROGRAM *
    FORM exit_program.
    CALL METHOD gr_ccontainer->free.
    CALL METHOD gr_ccontainer1->free.
    LEAVE TO SCREEN 0.
    ENDFORM. "exit_program
    *& Module STATUS_0100 OUTPUT
    text
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'STAT'.
    SET TITLEBAR 'xxx'.
    IF W_CUSTOM_CONTAINER IS INITIAL.
    **sets TITLEBAR
    PERFORM TITLEBAR.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Form prepare_field_catalog1
    text
    -->GT_FIELDCAT text
    FORM prepare_field_catalog1 CHANGING pgt_fieldcat1 TYPE lvc_t_fcat.
    DATA ls_fieldcat TYPE lvc_s_fcat.
    ls_fieldcat-tabname = 'gt_list1'.
    ls_fieldcat-fieldname = 'SEATSMAX'.
    ls_fieldcat-scrtext_m = 'MAX. SEATS'.
    ls_fieldcat-col_pos = 0.
    ls_fieldcat-outputlen = 10.
    ls_fieldcat-emphasize = 'C400'.
    ls_fieldcat-key = ' '.
    APPEND ls_fieldcat TO pgt_fieldcat1.
    ls_fieldcat-tabname = 'gt_list1'.
    ls_fieldcat-col_pos = 1.
    ls_fieldcat-fieldname = 'SEATSOCC'.
    ls_fieldcat-scrtext_m = 'SEATS OCCUPIED'.
    APPEND ls_fieldcat TO pgt_fieldcat1.
    ENDFORM. "prepare_field_catalog
    *& Form prepare_layout1
    text
    -->GS_LAYOUT text
    FORM prepare_layout1 CHANGING gs_layout1 TYPE lvc_s_layo.
    gs_layout1-stylefname = 'FIELD_STYLE'.
    gs_layout1-zebra = 'X'.
    gs_layout1-grid_title = 'DETAILS'.
    gs_layout-sel_mode = 'C'.
    gs_layout1-info_fname = 'RCOL'.
    gs_layout-no_toolbar = 'X'.
    ENDFORM. "prepare_layout
    *& Form data_retrival1
    text
    FORM data_retrival1.
    SELECT seatsmax
    seatsocc
    FROM sflight
    INTO CORRESPONDING FIELDS OF TABLE gt_list1
    UP TO 50 ROWS.
    ENDFORM. "data_retrival
    *& Form exclude_tb_functions
    &---- subroutine to exclude toolbar options -
    text
    -->PT_EXCLUDE text
    FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
    DATA ls_exclude TYPE ui_func.
    ls_exclude = cl_gui_alv_grid=>mc_fc_maximum.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_minimum.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_subtot.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_sort.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_fc_sum.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_mb_subtot.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_mb_sum.
    APPEND ls_exclude TO pt_exclude.
    ls_exclude = cl_gui_alv_grid=>mc_mb_filter.
    APPEND ls_exclude TO pt_exclude.
    ENDFORM. "data_retrival1
    *& Form cell_info
    text
    FORM cell_info. "CHANGING pt_cell TYPE lvc_t_cell.
    DATA lt_cell TYPE lvc_t_cell WITH HEADER LINE.
    CALL METHOD gr_alvgrid->get_selected_cells
    IMPORTING
    et_cell = lt_cell[].
    LOOP AT lt_cell.
    WRITE : lt_cell-col_id , lt_cell-row_id.
    ENDLOOP.
    MODIFY pt_cell[] from lt_cell[].
    ENDFORM. "cell_info
    *& Form set_col
    text
    FORM set_col .
    DATA ls_cellcolor TYPE lvc_s_scol.
    LOOP AT gt_list.
    IF gt_list-price GT 500.
    ls_cellcolor-fname = 'PRICE'.
    ls_cellcolor-color-col = 5.
    ls_cellcolor-color-int = 1.
    ls_cellcolor-color-inv = 0.
    APPEND ls_cellcolor TO gt_list-colors.
    else.
    ls_cellcolor-fname = 'PRICE'.
    ls_cellcolor-color-col = 3.
    ls_cellcolor-color-int = 1.
    APPEND ls_cellcolor TO gt_list-colors.
    ENDIF.
    MODIFY gt_list.
    ENDLOOP.
    ENDFORM. "set_col
    *& Form set_col1
    text
    FORM set_col1.
    data : ind type sy-tabix,
    indx type sy-tabix.
    loop at gt_list1.
    ind = sy-tabix / 2.
    indx = sy-tabix - ind.
    if indx eq ind.
    gt_list1-rcol = 'C500'.
    endif.
    MODIFY gt_list1.
    endloop.
    ENDFORM. "set_col
    *FORM TITLEBAR.
    *SET TITLEBAR 'TITLE'.
    *ENDFORM.
    *double click on TITLE and write ur title
    Thanks,
    Samantak.
    Rewards points for useful answers.

  • How to know the size of the string with out using the length() method

    i want to find the lenght of the
    String s="Sudha";
    with out using the lenght() method.

    Not true (I mean the part about "The only String
    call"). But if it had been true, I might haveagreed
    with this:
    Assuming one uses the 'exception' approach thenwhat
    method other than charAt() is needed?I probably misunderstood your post, I thought you
    meant that the only alternative to length() would be
    charAt() and catching the exception.There are many ways and if the teacher had said find 5 ways of finding the length of a String then I would have fealt happier because it would have meant the student would have to read and study the whole of the String API.
    I like
    int length = (s+"sabre").lastIndexOf("sabre");

  • Adding a pre-existing podcast to iTunes U using the feed method.

    While trying to add another pre-existing CSULB podcast to our CSULB on iTunes U (using the "feed" method), I encountered an error message that I don't know how to interpret.
    Can you help me with this or is there somebody else at Apple I should work with?
    The pre-existing podcast is at: http://www.ccpe.csulb.edu/citt/podcast/feed.aspx
    The error message reads:
    "While attempting to download. . . iTunes U encountered an authorization error and could not update the content. Verity your authorization access to the feed specified in the feed URL field, including the user name and password permissions, and then try again."
    I have no idea what this means. Can someone please help?
    Walter

    bgerth wrote:
    Is anyone using Podcast Producer 2 to publish content on iTunes U, and if so, does it work reasonably well (do you recommend using it)?
    Its spiffy. I like it, but I'm a softie when it comes to Apple stuff.
    Am I correct in thinking Podcast Producer 2 can only be used to create an RSS feed to point to podcasts stored in its Podcast Library or can you use Podcast Producer to upload files into our institutional iTunes U storage space (yes we are fortunate to have access to Apple's 500 GB storage space)?
    You can choose to do either. Although I haven't seen anything official, I suspect that Apple prefers the use of Podcast Library…but that's just a preference, not any sort of recommendation or future direction. In the end, I suggest (and I think Apple would agree) that you do what makes the most sense for you. For example, we choose to do it both ways.
    Can you provide a link to instructions (or explain how to either identify in iTunes U that the podcast is in Podcast Producer's Podcast Library as an RSS Feed or how to upload the podcast from Podcast Producer to a specific tab in a specific iTunes tab.
    I believe someone (a friend from Apple…??) released a PcP workflow action that deals with iTunes U the same way as PcPv1 did. Overall, though, probably the best kept PcP secret is that Podcast Producer is a generalized workflow solution. Sure, it's cast as a podcasting solution…but if you can get OS X Server to do something, you can get Podcast Producer to turn it into a workflow…anything. Since OS X Server can be scripted to upload content to iTunes U, Podcast Producer can handle that too.
    I appreciate any information given as I have tried with little success to find this information in either the iTunes U or Podcast Producer Admin guides.
    Thanks!!
    BGerth

  • Using the ContactInsertOrUpdate method from the ContactWS but error msg rcv

    [This thread was migrated from the On Demand Developer Forum in the old Siebel Community]
    Corsa
    Contributor
    I am getting the following error I do not know why or how to work around
    it.
    Method 'SetFieldValue' of business component 'Contact' (integration
    component 'Contact') for record with search specification '[External <br/>
          System Id] = "123456"' returned the following error:"Access <br/>
    denied.(SBL-DAT-00542)"(SBL-EAI-04375)
    Does any out there have any ideas?
    Previously when I tried to do the same action I got the following message:
    Multiple matches found for instance of integration component 'Contact'
    using search specification '[External System Id] = "123456"' in the
    business component 'Contact', based on user key 'Contact User
    Key:3'.(SBL-EAI-04390)
    Both messages are baffling me. Please, please help
    Product: CRM OnDemand
    06-16-2006 04:35 AM
    Re: Using the ContactInsertOrUpdate method from the ContactWS but error
    msg rcvd
    BigSlick
    Valued Contributor
    Hi Corsa,
    Can you access the record in the online application. Perhaps someone has
    changed the access rights for this Contact on the Contact Team ?
    -BigSlick
    06-20-2006 12:33 PM
    Re: Using the ContactInsertOrUpdate method from the ContactWS but error
    msg rcvd
    Corsa
    Contributor
    I realise now that the field AccountID is readonly and cannot be assigned.
    I was attempting to assign contactsList[count].AccountId to a value . I
    believe, this is the reason I was getting the access denied error.
    06-23-2006 11:10 AM
    ==============================================================================
    Click on the board or message subject at the top to return.

    Ok, so I hit a bump in the road. Just when I think I understand something It doesn't work correctly.
    I implemented it I thought correctly. I looked up something on the sun website (core java) I used advice from here, and my professor finaly responded to me with almost identical instructions. So I did it
    my RationalNumber.java no looks like this.
    public class RationalNumber implements Comparable
    //.....Break to new section
      public  float compute ()
           float value = getNumerator() / getDenominator();
         return value;
       public int compareTo(RationalNumber op2)
           if (Math.abs(compute() - op2.compute()) < .0001)
              return 0; //Equal
          if (compute() > op2.compute())
            return + 1; //Rational Number bigger
          if (compute() < op2.compute())
               return - 1; //Rational Number Smaller
         }I thought that would work fine, but it gives me an error when I compile it:
    RationalNumber.java:8: RationalNumber is not abstract and does not override abstract method compareTo(java.lang.Object) in java.lang.Comparable
    public class RationalNumber implements Comparable
           ^So now what, making it abstract only creates more errors....
    Also, thanks ChuckBing, I'm glad you like the screen name, I've been using it for years.

  • There is no printer output when using the PrintOut method

    I have a VB6 app with CR XI, and a customer found a situation that when printing a report directly to the printer using the PrintOut method, there is no printer output or error message.
    Some reports using the same code print normally, but a report that is preceded by another print call, presents this behavior.
    And when the output is directed to the screen, we can see the report.
    Could someone give me an idea of what is the problem?
    Thanks,
    Isis
    SP - Brazil
    The code used is below:
                       Set rpt = applic.OpenReport(App.Path & "SEFoto" + TipoRPT + ".rpt")
                       rpt.FormulaSyntax = crCrystalSyntaxFormula
                       rpt.FormulaFields.GetItemByName("Empresa").Text = "'" + Company + "'"
                       rpt.FormulaFields.GetItemByName("Idioma").Text = "'" + Idioma + "'"
                       rpt.FormulaFields.GetItemByName("Versao").Text = "'" + Versao + "'"
                       ' ... Some lines to compose the selection formula
                       rpt.RecordSelectionFormula = Cond
                       ' To evaluate the image length:
                       Arq = rsTMP3!FT_Arquivo
                       ImageScaling = FatorDeReducao(Arq, "F")
                       ' To reduce the image length:
                       AchouOLE = False
                       For Each oSection In rpt.Sections
                           For Each oObject In oSection.ReportObjects
                               If oObject.Name = "PictureFoto" Then
                                  Set oOleObject = oObject
                                  AchouOLE = True
                                  Exit For
                               End If
                           Next oObject
                           If AchouOLE Then Exit For
                       Next oSection
                       With oOleObject
                            .Suppress = True
                            .XScaling = ImageScaling    ' 0.5 = 50%, 1 = 100%
                            .YScaling = ImageScaling
                            .Suppress = False
                       End With
                       Aguarde.Show 1
                       If DestinoRel = 9 Or DestinoRel = 1 Then ' Padrão ou impressora
                          rpt.PrintOut True              ' <<<---- Here using true or false nothing happens
                       Else
                          PrintRPTtela rpt, "Fotos"   ' <<<--- Here it works fine
                       End If

    Hi Isis,
    Not sure if you have applied any service Packs to CR? If please do so and test again. Then you can upgrade to CR XI R2 for free, use your XI Keycode and download Service Pack 4 from this link:
    https://smpdl.sap-ag.de/~sapidp/012002523100011802732008E/crxir2_sp4_full_build.exe
    You'll find the distribution files for your app also from that same download area.
    If you don't want to upgrade to XI R2 then download all patches from XI and test again. This issues rings a bell that it may have been fixed.
    Thank you
    Don

  • How can I use the "Copy and paste" tool in order get stamps in the same position in different pages (Acrobat XI for PC)?

    With Acrobat 6.0 I was able to copy a stamp in the same position (I mean "exactly" the same one) of different pages just by using the "copy/past" tool.
    Now I am using Acrobat XI and it seems like it is not possible anymore: I am copying a stamp and I am trying to past it in anoter page, but it appears in the center of the page (or wherever it wants to...).
    Does anyone have a solution?
    Thanks in advance.

    Thank you very much. I'll be waiting for you message.
    Messaggio originale----
    Da: [email protected]
    Data: 26/01/2015 17.56
    A: "Umberto Gangi"<[email protected]>
    Ogg:  How can I use the "Copy and paste" tool in order get stamps in the same position in different pages (Acrobat XI for PC)?
        How can I use the "Copy and paste" tool in order get stamps in the same position in different pages (Acrobat XI for PC)?
        created by Gilad D (try67) in Creating, Editing &amp; Exporting PDFs - View the full discussion
    Well, I was in the same situation so I've developed a tool that allows one to do it. I will send you some additional information about it in a private message.
         If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7132586#7132586 and clicking ‘Correct’ below the answer
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7132586#7132586
         To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, &amp; "Stop Following"
         Start a new discussion in Creating, Editing &amp; Exporting PDFs by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • How do i get a list of all Roles defubed under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?

     

    Sorry for the typographical mistake.
    Please read the question as:"How do i get a list of all Roles defined under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?"

  • How can I use the update service

    Hello experts,
    could you please explain me how to use the update service from a business object in the VC. I have created a object which contains following attributes:
    - key(ID)
    - created by(UserID)
    - creted at(Datetime)
    - modifiedAt(Datetime)
    - modifiedBy(UsedID)
    - argument(string)                 Kardinalität: 1...1
    I have developed an application service which returns the whole entries of the table.
    Now I want to select the row and update the attribute argument.
    (For example the value is 24, and now I want to change it to 25. )
    But if I test the service UPDATE in the Service Browser it cames always the error message that a value in the mandatory field argument is missing.
    Any ideas?????? I am using the NWDS SP1.
    Many thanks!!!
    Regards Marco

    Hi Marco,
    In CAF you can do it by first using the update method to retrieve the BO instance and set the new value.
    Regards,
    Srinivasan Subbiah

  • How do I use this StringManip method?

    I want to be able to use the following method:
    java.lang.Object
    |
    --SSF.OS.BGP4.Util.StringManip
    public class StringManip
    extends java.lang.Object
    This class contains public utility methods useful for manipulating character strings.
    static java.lang.String ws(int len)
    Creates a string of whitespace composed of space characters only.
    ws
    public static final java.lang.String ws(int len,
    int min)Creates a string of whitespace composed of space characters only.
    Parameters:
    len - The length (in characters) of the whitespace to be created. A negative value will be treated as a 0.
    min - The minimum length (in characters) of the whitespace to be created.
    Returns:
    a string composed only of spaces
    but everytime i try to use this in my code, it gives me an error.
    can someone tell me what i need to import, extend, or implement in order to use the ws method?
    Thanks.

    but everytime i try to use this in my code, it gives me an error.Do you seriously expect anyone to be able to tell what the problem is from this description? How about some details?

  • How can i use Catalog in Method Type?

    Dear Experts,
    How can i use Catalog in Method Type?
    I want to use Multiple method type mean require selection option(help from catalog)and also need to entere the result against certain parameters. So how can i do this possible ?
    Except use of additional infrmation field
    Regards,
    Abhishek

    Hi,
    Can i provide selection option F4 help at Method while enteing the result?
    Because for 1 MIC as per buyer method testing different so it will come alternately.
    i.e i have 3 methods which comes altarnative for one MIC
    TST_ISO
    TST_AATC
    TST_ASTM
    So how it is possible???

Maybe you are looking for

  • How to have more than one Bridge Web Photo Gallery in a site

    I'm having a problem inserting more than one bridge web photo gallery in my site. I have thumbnails of different jobs and when clicked I want a new page to load with all the images of that job. I have one thumbnail linked to one of the galleries and

  • Portuguese Keyboard on Macbook pro retina display.

    Dear All. Is there a possibility to buy a macbook pro retina display with portuguese keyboard in Apple Store in the U.S.A.? Regards. Emilio Silva

  • How can I stop Firefox 's private browsing mode from restricting Netlflix from storing settings on my computer?

    I have a Netflix subscription, which is supposed to let me watch movies online, on its website. However, when I selected one of their "Instant Viewing" movies, a page popped up, saying: "Silverlight Application Storage Error -- Firefox's private brow

  • s:any/ and data type

    I am having this wsdl <s:element name="procesaXml">                  <s:complexType>                        <s:sequence>                            <s:element minOccurs="0" maxOccurs="1" name="nombreAplicacion" type="s:string" />                     

  • SAP Netweaver 7.3 with JDK 1.7

    Hi I wanted to know whether SAP Netweaver Portal 7.3 is compatible with Java 1.7. Will we face any issues if we upgrade the java version to 1.7 and the Portal version to 7.3 If anyone knows regarding this please reply us on the same. Regards JM