Bug in NI_XML.lvlib:Get First Non-Text Child.vi

This VI fails to handle the output of the first Property Node on its block diagram. Here's a screenshot of the BD in LV 2013 SP1:
Here's a fixed version:

I agree with David, but I hesitate to call it a bug.  Spewing meaningless errors into unrelated parts of your code is on the NI-sanctioned Error-handling Greatest Hits album so it is probably intentional.
There are 4 scenarios here to consider:
1) Bad reference passed in
2) Good reference, no child nodes
3) Good reference, no non-text child nodes
4) Good reference, 1 or more non-text child nodes.
What are the outputs:
1) Error message from first PN, boolean false, NotARefnum
2) Error message from second PN, boolean false, NotARefnum
3) No Error, boolean false, NotARefnum
4) No Error, boolean true, valid Refnum
How is an outsider suppposed to know from the error messages which of 1 & 2 happened?  You have to know what goes on inside and see which node threw the error.  Having to know the insides of a VI to decipher an error message is not good API design IMO.
What should happen in my opinion is the following:
Input check, invalid refnum throws an error clearly indicating "Bad refnum input"
The output refence would only be valid in case 4, so the boolean is redundant, but I would include it as a usability measure.  No errors should be thrown in cases 2-4, no text nodes versus no nodes at all is almost certainly a distinction without a difference in this case.
David's fix cleans up the unhelpful error message being thrown during an unsuccessful search of a valid refnum.  I would add an input validation check in the interest of providing a useful error message and not the "random property called with bad reference" error.

Similar Messages

  • Error in Get Next Non-Text Sibling for XML without CR at end of tag

    Hallo all,
    I'm having a strange error parsing XML files with labview. I have an XML file in one single line, without CR at end of each tag. A normal browser or XML parsing tool is capable to read it, but not with Labview.
    The error I have is with "Get Next Non-Text Sibling.vi", which internally fails to read Type property (Error -2630, Property Node (arg 1) in NI_XML.lvlib:Get Next Non-Text Sibling.vi->XML Get Siblings Childs Nodes.vi->Encode data to label (Path).vi).
    Labview XML parser works if I add a CR at each tag/node.
    I'm quite sure this is a labview bug. A workaround I have found is to open the file, then save the file with Save File (Pretty Print) method and reopen it again, but it is time-consuming and I would like to avoid it.
    Regards,
    Daniele
    Solved!
    Go to Solution.
    Attachments:
    xmlwithnoCR.xml.txt ‏1 KB

    Which node do you pass to XML Get Siblings Child Nodes.vi ? That is also important.
    I can imagine the following scenario causing your problem: Your input node has a child node C,, but this child node has no siblings. Get Next Non-Text Sibling.vi will fail in this case. If you put a <CR> at the right position in your XML you create a text node with content <CR>. If this text node is a sibling of child C then Get Next Non-Text Sibling.vi still won't return anything but no error should occur. IMHO this is expected behavior. You can however implement your own version of Get Next Non-Text Sibling.vi. Use the Next Sibling property and check if it returns a valid refnum.

  • Verizon Webmail Long Non-text windows do not have vertical scrollbar

    When I get a non-text message in Verizon Webmail that requires me to scroll down to see it all, there is no vertical scrollbar. When I display this same message in IE9, the scrollbar appears. I think this is another problem in V30/V31 as I did not see this problem before upgrading.

    As a test to see whether a Reset might help, you could try this (takes about 3 minutes):
    '''Create a new Firefox profile'''
    A new profile will have your system-installed plugins (e.g., Flash) and extensions (e.g., security suite toolbars), but no themes, other extensions, or other customizations. It also should have completely fresh settings databases and a fresh cache folder.
    Exit Firefox and start up in the Profile Manager using Start > search box (or Run):
    firefox.exe -P
    ''Do not delete anything here.''
    Any time you want to switch profiles, exit Firefox and return to this dialog.
    Click the Create Profile button, choose a name like Aug7, and skip the option to change the folder location. Then start Firefox in the new profile you created.
    Does Verizon mail work differently in the new profile?
    When returning to the Profile Manager, you might be tempted to use the Delete Profile button. But... it's a bit too easy to accidentally delete your "real" profile, so I recommend resisting the temptation. If you do want to clean up later, I suggest making a backup of all your profiles first in case something were to go wrong.

  • Error 363507 occurred at LabVIEWHTTPClient.lvlib:GET.vi:390001 - after upgrade to LV2014SP1

    I am using the HTTP-tool to get the body text from a website.
    After upgrading LV 2014 to SP1 I now receive:
    Error 363507 occurred at LabVIEWHTTPClient.lvlib:GET.vi:390001
    Possible reason(s):
    LabVIEW: LabVIEW could not verify the authenticity of the server.
    Complete call chain:
    LabVIEWHTTPClient.lvlib:GET.vi:390001
    Test.vi
    Before the upgrade this worked with no issues.
    My code also works fine on another PC that does not have SP1 (but 2014).
    I tried installing the Runtime-Engine 2014 SP1 on a new PC - this also fails with error Error 363507.
    What is going on? 
    The website I access is a public one, freely available in any browser. So I should not need authentication.
    Obviously something changed going to SP1.
    Bjarke Dahl-Madsen - CLA

    Well, I can see the site from here, though some of Google's automatic translation from Danish to English does sound a little ominous, like the story: "Police Control of Easter" -- which is actually a story about the police stepping up DUI drug and alcohol enforcement, not the police controlling Easter.
    But on a serious note, I don't see an issue right off, though it does appear to be related to that one site. One more thought, does this happen with all the links on that site? It might be related to this one page.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • My sister and myself are getting each others text messages. Help! (Hard Question)

    This whole problem started when I first got my Iphone 5 around christmas time of last year. And i did the normal activation of my new Iphone and syncing my old iphone 4 with this new phone. I synced everything and it was all good, but i started to get these random text from people in my message log. I soon found out that i was recieving every text that was sent to my sister. And if i replied to someone who was texting my sister it would show up like she texted them, not me on a seperate number. Also when i text my sister she would get the text but immidiatly after i sent her it, i would also get a text from myself saying what i sent her. I will literally get a text message from my own number to myself, (Weird ****). So its like my sisters text messaging is fused with mine. Its only messages though, no images or anything else. In the beginging i didnt care about this becasue she wasnt recieving my text i was only getting hers. But now just today she tells me she is getting my text too. And thats a problem! This problem lasted all the way up to about 2 months ago and then i stopped getting her messages. But i gave one of my friends my old iphone 4 and once they activated it for there own use it started to happen again. They use a seperate plan then i do and there number on the phone is different. Before i gave them the phone i wiped everything off of it. i took off the contacts, messages, everything. They use a different apple account and icloud account now on the phone. So idk why it started up again i need help. Here is some background. My whole family shares the same apple account with everything. We have seperate phones, numbers and data for the most part. But with dealing with Icloud and itunes anything like that, we use the same account. My sister uses a Iphone 4s btw. With my old Iphone 4 i had no probelms with this, everything was normal. But once i switched to the new iphone 5 this problem has occured. Idk what this is about, i havent heard anyone else with this problem, but i need help! btw my other family members on their phones do not have this problem. So i think it has to do something with the icloud but im not sure! This is a serious problem and i need help! Goodluck!

    Get your Apple ID sort out.
    Only use the same Apple ID in Settings > iTunes & App Stores to share purchases, no where else.
    Here some tips, it was written for IOS 5 but it's still valid for iOS 6.
    iOS 5 & iCloud Tips: Sharing an Apple ID With Your Family

  • Can I get the same text messages on both my iPhone and my iMac

    can I get the same text messages on both my iPhone and my iMac
    It seems that my Mac is getting them and they dont show up on my iphone.

    Hi julian KAYE!
    You will want to make sure that both your computer and phone have all options checked in the “Start new conversations from” section in your Messages settings:
    iOS: Using Messages
    http://support.apple.com/kb/ht3529
    You can change the address that new iMessage conversations are started with in Settings > Messages > Send & Receive > Start new conversations from. Note that this setting applies only to new conversations. If you would like to change the address from which messages are sent, first change this setting, and then delete the existing conversation and start a new one.
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • To get first date and end date after entering any month and year

    Hi,
    I need to to get first date and end date of a month and year in yyyyMMdd format. I am reading month and year from a properties file. But I don't know how to get the first date and End date in given format. The properties file gives me just text. But I don't know how to get the date format using this. I need this urgently. Can anyone help me to get code for this?
    I am reading the fields as,
    Properties props = new Properties();
    props.load(new FileInputStream("AnyMonthVolume.properties"));
    String date_month = props.getProperty("date_month");
    String date_year = props.getProperty("date_year");
    Thanks.

    I know this has been posted a while ago but incase someone looking for it, here is the code to get the end of current month date.
    Calendar cal = Calendar.getInstance();
         cal.setTime(new java.util.Date());
         cal.set(Calendar.DATE, 1); //set the date to start of month
         cal.add(Calendar.MONTH,1);
         cal.add(Calendar.DATE,-1);
    System.out.println(cal.getTime());

  • How to get Grand Total Text in ALV GRID

    Hi Folks,
    I am able to get the SUBTOTAL TEXT .....But i need...
    How to get Grand Total Text in ALV GRID Display...
    Can any one give a Solution for this...

    Hi Surendar,
    Check out this code.. this is showing Total Text in Toal line in the very first column.
    REPORT  zsales_ord_det_1                        .
    TABLES: ztable_10.
    TYPE-POOLS: slis.
    DATA: BEGIN OF it OCCURS 0,
    srno(6) type c,
    name LIKE ztable_10-name,
    age LIKE ztable_10-age,
    END OF it.
    DATA : BEGIN OF it_temp OCCURS 0,
    name LIKE ztable_10-name,
    age LIKE ztable_10-age,
    END OF it_temp.
    DATA: i_fieldcat  TYPE slis_t_fieldcat_alv,
          wa_fieldcat TYPE  slis_fieldcat_alv.
    DATA: v_repid LIKE sy-repid,
           i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
           gs_layout TYPE slis_layout_alv,
           gd_layout TYPE slis_layout_alv,
           i_sort TYPE STANDARD TABLE OF slis_sortinfo_alv,
           wa_sort TYPE slis_sortinfo_alv.
    START-OF-SELECTION.
      v_repid = sy-repid.
      SELECT * FROM ztable_10 INTO TABLE it_temp.
      LOOP AT it_temp .
        it-srno = 'Total'.
        it-name = it_temp-name.
        it-age = it_temp-age.
        APPEND  it.
      ENDLOOP.
    END-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name               = v_repid
         i_internal_tabname           = 'IT'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
         i_inclname                   = v_repid
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = i_fieldcat[]
       EXCEPTIONS
         inconsistent_interface       = 1
         program_error                = 2
         OTHERS                       = 3
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    wa_fieldcat-row_pos = 1.
    wa_fieldcat-col_pos = 1.
    wa_fieldcat-fieldname = 'SRNO'.
    wa_fieldcat-tabname = it.
    append wa_fieldcat to i_fieldcat.
      LOOP AT i_fieldcat INTO wa_fieldcat.
        IF wa_fieldcat-fieldname = 'AGE'.
          wa_fieldcat-do_sum = 'X'.
          MODIFY i_fieldcat FROM wa_fieldcat.
        ENDIF.
       IF wa_fieldcat-fieldname = 'SRNO'.
         Hide this field so that it can display it's content i.e.
            Total text in Subtotal level
        wa_fieldcat-tech = 'X'.
          wa_fieldcat-no_out = 'X'.
          MODIFY i_fieldcat FROM wa_fieldcat TRANSPORTING tech no_out.
       ENDIF.
      ENDLOOP.
    wa_sort-spos = 1.
    wa_sort-fieldname = 'SRNO'.
    wa_sort-up = 'X'.
    wa_sort-subtot = 'X'.
    APPEND wa_sort TO i_sort.
      gd_layout-no_totalline = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                       = ' '
         i_callback_program                        = v_repid
      I_CALLBACK_PF_STATUS_SET     = ' '
    i_callback_user_command                = 'USER_COMMAND'
      I_CALLBACK_TOP_OF_PAGE         = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE  = ' '
      I_CALLBACK_HTML_END_OF_LIST    = ' '
      I_STRUCTURE_NAME                       =
      I_BACKGROUND_ID                        = ' '
      I_GRID_TITLE                                  =
      I_GRID_SETTINGS                          =
         is_layout                                      = gd_layout
         it_fieldcat                                      = i_fieldcat[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
         it_sort                           = i_sort
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      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
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it
       EXCEPTIONS
         program_error                     = 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.
    Regards,
    Seema

  • How to get the bold texts in JTextPane?

    How to get the bold texts in JTextPane?

    I believe you need to look at the Elements of the Document. Use the Document.getDefaultRootElement() method to get the first root Element. From there you can iterate through all the Elements. You should then be able to check the attributes of the element to see if it contains the Bold attribute using something like:
    AttributeSet attributes = element.getAttributes();
    if ( attributes.containsAttribute(StyleConstants.Bold, Boolean.TRUE)
    // do processing here

  • Getting Payment Terms Text of PO

    Hi All,
    I need to get the Payment terms text of PO.
    I am able to get the Own explanations from T052U table.
    The payment terms entered in the PO can be got using Read_text passing F07, EKKO and the PO number.
    What i need is getting the Explanation of First Payment Term, Explanation of Second Payment Term and Explanation of Net Payment Term.
    Regards
    Arun

    check table
    T052U
    <b>Hi ARUN ,
    i am unable to get ur Point ? Can u tell me more abt this ?
    if i am giving payment term =  1050 @ PO header ? So what do u want to get ? long text of 1050 or what ?</b>Regards
    Prabhu
    Message was edited by: Prabhu Peram

  • How to get the highlighted text range through Framemaker's API calls?

    Hi all,
    I'm new to the Framemaker API (7.x) and developing a plugin for Framemaker 7.x. I wanted to get the highlighted objects from the active mif document. Tried this code:
    F_TextRangeT tr;
    /* Get the current text selection. */
    tr = F_ApiGetTextRange(FV_SessionId, docId, FP_TextSelection);
    Here is how I tested it:
    1. some text in the mif doc was highlighted.
    2. I clicked the menu item "my_plugin", a framemaker dialog popped up, some test configuration was sent through the dialog.
    3. The test configuration was read by my program correctly.
    However, the debugger showed that the tr is null! When I changed the first step of the test into:
    1. placed the mouse cursor at somewhere in the mif doc.
    The plugin worked somehow, the line where the mouse cursor was placed got selected, although I did not highlight anything.
    My question is: how to get a highlighted range though the Framemaker API call? I've been flipping through the FDK 7.0 Programmer's Reference but haven't found a solution yet. Any hint will be highly appreciated.
    Best Regards,
    Ellen N. Zhao

    Here is some information from the FDK Programmer's guide page 115:
    IMPORTANT: A valid text range can span multiple paragraphs, subcolumns, or text frames.
    It cant span multiple flows, footnotes, table cells, or text lines.
    It is possible for a document to have no text selection or insertion point at all. This can occur in
    the following circumstances:
    ● One or more graphic objects in the document are selected
    ● One or more entire table cells in the document are selected
    ● There is no selection of any type in the document
    So, I did select one or more entire table cells in the document in my first test. It's logical that the result was not like expected.
    But selecting one or more entire table cells is a crucial requirement for my plugin, is there anyway to get things straight?
    Simply put, I want to enable users to select one or more table cells in the document, and I want to get the object handles of the first cell and the last cell through Framemaker API calls. How?
    Many thanks in advance!
    Best Regards,
    Ellen N. Zhao

  • How can I get a match text effect in a Choice

    How can I get a match text effect in a Choice; I mean, for instance, that if a type a "p" the first choice item that begins with a "p" should be automatically selected

    Here is a pretty simple example. Keep in mind that I am coverting all comparison characters to UpperCase. If you allow LowerCase characters in you Choice items then remove the appropriate Character.toUpperCase() calls.
    Hope this helps
    Mike
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TestApplet extends Applet implements KeyListener {
         private Choice choice;
         public void init()
              setLayout(new FlowLayout());
              choice = new Choice();
              choice.add("Aaron");
              choice.add("Adam");
              choice.add("David");
              choice.add("Mike");
              choice.addKeyListener(this);
              add(choice);
         public void keyPressed(KeyEvent e)
              int current = choice.getSelectedIndex();
              int x = 0;
              char c = Character.toUpperCase(e.getKeyChar());
              while(x<choice.getItemCount()) {
                   if(c == Character.toUpperCase(choice.getItem(x).charAt(0))) {
                        current = x;
                        break;
                   x++;
              choice.select(current);
         public void keyReleased(KeyEvent e) { }
         public void keyTyped(KeyEvent e) { }
    }

  • How do I get an additional text on rollover?

    Hi guys,
    So I'm looking to get an extra text to show when hovering over a thumbnail.
    Situation: I have a thumbnail linking to a page (frame in timeline) with a YouTube video on it. So I want the title of the video to show up under the thumbnail upon rollover.
    What I use: Flash CS5 & Actionscript 3
    Anyone know how to get this done?

    Can we start again.. My site is now online, I couldn't wait any longer because I need it for my buisness so I got rid of the code that wasn't working.
    But I still need a rollover text to appear so..
    1) I go into the code snippets and add a mouse over event
    2) In my actionscript I add your text: yourtextfield.text = "whatever text you want to show";
    So do I make an empty text field first, give it a name and replace "yourtextfield" with the name?
    Or do I replace "whatever text you want to show" with my text and thats just it?
    Or both?
    Or am I way off?

  • How can i get the additional text fields in the ALV methods

    Hi all,
    I have 2 different layouts in the same screen, here i am using the 2 custom containers,for each container having the method called SET_TABLE_FOR_FIRST_DISPLAY, in this i have used the Title through the gridtitle field, now i need to display some more texts under the title OR in the top of the layouts.
    Please suggest me.
    Thanks
    Giridhar

    Hi,
    check this code, here i developed using splitter container, and implemented top of page event. check it. and i documented it also.
    REPORT  ZTEST1234_ALV_TOP    MESSAGE-ID ZZ                           .
    DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: L_VALID TYPE C,
          V_FLAG,
          V_DATA_CHANGE,
          V_ROW TYPE LVC_S_ROW,
          V_COLUMN TYPE LVC_S_COL,
          V_ROW_NUM TYPE LVC_S_ROID.
    DATA: IT_ROW_NO TYPE LVC_T_ROID,
          X_ROW_NO TYPE LVC_S_ROID.
    DATA:BEGIN OF  ITAB OCCURS 0,
         VBELN LIKE LIKP-VBELN,
         POSNR LIKE LIPS-POSNR,
         CELLCOLOR TYPE LVC_T_SCOL, "required for color
         DROP(10),
         END OF ITAB.
    "The Below Definitions Must.....
    DATA:
    * Reference to document
           DG_DYNDOC_ID       TYPE REF TO CL_DD_DOCUMENT,
    * Reference to split container
           DG_SPLITTER          TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
    * Reference to grid container
           DG_PARENT_GRID     TYPE REF TO CL_GUI_CONTAINER,
    * Reference to html container
           DG_HTML_CNTRL        TYPE REF TO CL_GUI_HTML_VIEWER,
    * Reference to html container
           DG_PARENT_HTML     TYPE REF TO CL_GUI_CONTAINER.
    "up to here
    *       CLASS lcl_event_handler DEFINITION
    CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION .
        METHODS:
    **Hot spot Handler
        HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
                          IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
    **Double Click Handler
        HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
                                         IMPORTING E_ROW E_COLUMN ES_ROW_NO,
        TOP_OF_PAGE FOR EVENT TOP_OF_PAGE              "event handler
                             OF CL_GUI_ALV_GRID
                             IMPORTING E_DYNDOC_ID.
    *        END_OF_LIST FOR EVENT end_of_list              "event handler
    *                         OF CL_GUI_ALV_GRID
    *                         IMPORTING E_DYNDOC_ID.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    *       CLASS lcl_event_handler IMPLEMENTATION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    *Handle Hotspot Click
      METHOD HANDLE_HOTSPOT_CLICK .
        CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
        V_ROW  = E_ROW_ID.
        V_COLUMN = E_COLUMN_ID.
        V_ROW_NUM = ES_ROW_NO.
    *    MESSAGE I000 WITH V_ROW 'clicked'.
        CLEAR IT_ROW_NO[].
        X_ROW_NO-ROW_ID = V_ROW.
        APPEND X_ROW_NO TO IT_ROW_NO .
        CALL METHOD G_GRID->SET_SELECTED_ROWS
          EXPORTING
            IT_ROW_NO = IT_ROW_NO.
      ENDMETHOD.                    "lcl_event_handler
    *Handle Double Click
      METHOD  HANDLE_DOUBLE_CLICK.
        CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
        V_ROW  = E_ROW.
        V_COLUMN = E_COLUMN.
        V_ROW_NUM = ES_ROW_NO.
        IF E_COLUMN = 'VBELN'.
          SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
          CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
        ENDIF.
        IF E_COLUMN = 'POSNR'.
          SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
          CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN."
        ENDIF.
      ENDMETHOD.                    "handle_double_click
    *  METHOD END_OF_LIST.                   "implementation
    ** Top-of-page event
    *    PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
    *  ENDMETHOD.                            "top_of_page
        METHOD TOP_OF_PAGE.                   "implementation
    * Top-of-page event
        PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
      ENDMETHOD.                            "top_of_page
    ENDCLASS.                    "LCL_EVENT_HANDLER IMPLEMENTATION
    *&             Global Definitions
    DATA:      G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,"Container1
                G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler
    DATA: OK_CODE LIKE SY-UCOMM,
          SAVE_OK LIKE SY-UCOMM,
          G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST',
          GS_LAYOUT TYPE LVC_S_LAYO.
    data: v_lines type i.
    data: v_line(3) type c.
    *- Fieldcatalog for First and second Report
    DATA: IT_FIELDCAT  TYPE  LVC_T_FCAT,
          X_FIELDCAT TYPE LVC_S_FCAT,
          LS_VARI  TYPE DISVARIANT.
    *                START-OF_SELECTION
    START-OF-SELECTION.
      SELECT VBELN
             POSNR
             FROM LIPS
             UP TO 20 ROWS
             INTO CORRESPONDING FIELDS OF TABLE ITAB.
    describe table itab lines v_lines.
    END-OF-SELECTION.
      IF NOT ITAB[] IS INITIAL.
        CALL SCREEN 100.
      ELSE.
        MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
      ENDIF.
    *&      Form  CREATE_AND_INIT_ALV
    *       text
    FORM CREATE_AND_INIT_ALV .
      DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
      "attention.....from here
      "split your container here...into two parts
      "create the container
      CREATE OBJECT G_CUSTOM_CONTAINER
               EXPORTING CONTAINER_NAME = G_CONTAINER1.
      "this is for top of page
    * Create TOP-Document
      CREATE OBJECT DG_DYNDOC_ID
                       EXPORTING STYLE = 'ALV_GRID'.
    * Create Splitter for custom_container
      CREATE OBJECT DG_SPLITTER
                 EXPORTING PARENT  = G_CUSTOM_CONTAINER
                           ROWS    = 2
                           COLUMNS = 1.
    * Split the custom_container to two containers and move the reference
    * to receiving containers g_parent_html and g_parent_grid
      "i am allocating the space for grid and top of page
      CALL METHOD DG_SPLITTER->GET_CONTAINER
        EXPORTING
          ROW       = 1
          COLUMN    = 1
        RECEIVING
          CONTAINER = DG_PARENT_HTML.
      CALL METHOD DG_SPLITTER->GET_CONTAINER
        EXPORTING
          ROW       = 2
          COLUMN    = 1
        RECEIVING
          CONTAINER = DG_PARENT_GRID.
    *  CALL METHOD DG_SPLITTER->GET_CONTAINER
    *    EXPORTING
    *      ROW       = 2
    *      COLUMN    = 1
    *    RECEIVING
    *      CONTAINER = DG_PARENT_HTML.
    *  CALL METHOD DG_SPLITTER->GET_CONTAINER
    *    EXPORTING
    *      ROW       = 1
    *      COLUMN    = 1
    *    RECEIVING
    *      CONTAINER = DG_PARENT_GRID.
      "you can set the height of it
    * Set height for g_parent_html
      CALL METHOD DG_SPLITTER->SET_ROW_HEIGHT
        EXPORTING
          ID     = 1
          HEIGHT = 5.
      "from here as usual..you need to specify parent as splitter part
      "which we alloted for grid
      CREATE OBJECT G_GRID
             EXPORTING I_PARENT = DG_PARENT_GRID.
    * Set a titlebar for the grid control
      CLEAR GS_LAYOUT.
      GS_LAYOUT-GRID_TITLE = TEXT-003.
      GS_LAYOUT-ZEBRA = SPACE.
      GS_LAYOUT-CWIDTH_OPT = 'X'.
      GS_LAYOUT-NO_ROWMARK = 'X'.
      GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
      CALL METHOD G_GRID->REGISTER_EDIT_EVENT
        EXPORTING
          I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_ENTER.
      CREATE OBJECT G_HANDLER.
      SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
      SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
    *  SET HANDLER G_HANDLER->END_OF_LIST FOR G_GRID.
      SET HANDLER G_HANDLER->TOP_OF_PAGE FOR G_GRID.
      DATA: LS_CELLCOLOR TYPE LVC_S_SCOL. "required for color
      DATA: L_INDEX TYPE SY-TABIX.
      "Here i am changing the color of line 1,5,10...
      "so you can change the color of font conditionally
      LOOP AT ITAB.
        L_INDEX = SY-TABIX.
        IF L_INDEX = 1 OR L_INDEX = 5 OR L_INDEX = 10.
          LS_CELLCOLOR-FNAME = 'VBELN'.
          LS_CELLCOLOR-COLOR-COL = '6'.
          LS_CELLCOLOR-COLOR-INT = '0'.
          LS_CELLCOLOR-COLOR-INV = '1'.
          APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
          MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
          LS_CELLCOLOR-FNAME = 'POSNR'.
          LS_CELLCOLOR-COLOR-COL = '6'.
          LS_CELLCOLOR-COLOR-INT = '0'.
          LS_CELLCOLOR-COLOR-INV = '1'.
          APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
          MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
        ENDIF.
      ENDLOOP.
    * setting focus for created grid control
      CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
        EXPORTING
          CONTROL = G_GRID.
    * Build fieldcat and set editable for date and reason code
    * edit enabled. Assign a handle for the dropdown listbox.
      PERFORM BUILD_FIELDCAT.
      PERFORM  SET_DRDN_TABLE.
    * Optionally restrict generic functions to 'change only'.
    *   (The user shall not be able to add new lines).
      PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
    **Vaiant to save the layout
      LS_VARI-REPORT      = SY-REPID.
      LS_VARI-HANDLE      = SPACE.
      LS_VARI-LOG_GROUP   = SPACE.
      LS_VARI-USERNAME    = SPACE.
      LS_VARI-VARIANT     = SPACE.
      LS_VARI-TEXT        = SPACE.
      LS_VARI-DEPENDVARS  = SPACE.
    **Calling the Method for ALV output
      CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
          IS_VARIANT           = LS_VARI
          IS_LAYOUT            = GS_LAYOUT
          I_SAVE               = 'A'
        CHANGING
          IT_FIELDCATALOG      = IT_FIELDCAT
          IT_OUTTAB            = ITAB[].
      "do these..{
    * Initializing document
      CALL METHOD DG_DYNDOC_ID->INITIALIZE_DOCUMENT.
    * Processing events
      CALL METHOD G_GRID->LIST_PROCESSING_EVENTS
        EXPORTING
          I_EVENT_NAME = 'TOP_OF_PAGE'
          I_DYNDOC_ID  = DG_DYNDOC_ID.
      "end }
    * Set editable cells to ready for input initially
      CALL METHOD G_GRID->SET_READY_FOR_INPUT
        EXPORTING
          I_READY_FOR_INPUT = 1.
    ENDFORM.                               "CREATE_AND_INIT_ALV
    *&      Form  EXCLUDE_TB_FUNCTIONS
    *       text
    *      -->PT_EXCLUDE text
    FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
    * Only allow to change data not to create new entries (exclude
    * generic functions).
      DATA LS_EXCLUDE TYPE UI_FUNC.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  build_fieldcat
    *       Fieldcatalog
    FORM BUILD_FIELDCAT .
      DATA: L_POS TYPE I.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
      X_FIELDCAT-FIELDNAME = 'VBELN'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-NO_ZERO    = 'X'.
      X_FIELDCAT-OUTPUTLEN = '10'.
      X_FIELDCAT-HOTSPOT = 'X'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Item'(025).
      X_FIELDCAT-FIELDNAME = 'POSNR'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '5'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Drop'(025).
      X_FIELDCAT-FIELDNAME = 'DROP'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '5'.
      X_FIELDCAT-EDIT = 'X'.
      X_FIELDCAT-DRDN_HNDL = '1'.
      X_FIELDCAT-DRDN_ALIAS = 'X'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
    ENDFORM.                    " build_fieldcat
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      IF G_CUSTOM_CONTAINER IS INITIAL.
    **Initializing the grid and calling the fm to Display the O/P
        PERFORM CREATE_AND_INIT_ALV.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  SET_DRDN_TABLE
    *       text
    FORM SET_DRDN_TABLE.
      DATA:LT_DRAL TYPE LVC_T_DRAL,
            LS_DRAL TYPE LVC_S_DRAL.
      LOOP AT ITAB .
    * First listbox (handle '1').
        IF SY-INDEX = 1.
          LS_DRAL-HANDLE = '1'.
          LS_DRAL-VALUE =  ' '.
          LS_DRAL-INT_VALUE =  ' '.
        ELSE.
          LS_DRAL-HANDLE = '1'.
          LS_DRAL-VALUE =  ITAB-POSNR.
          LS_DRAL-INT_VALUE =  ITAB-POSNR.
        ENDIF.
        APPEND LS_DRAL TO LT_DRAL.
      ENDLOOP.
    **Setting the Drop down table for Reason Code
      CALL METHOD G_GRID->SET_DROP_DOWN_TABLE
        EXPORTING
          IT_DROP_DOWN_ALIAS = LT_DRAL.
    ENDFORM.                               " set_drdn_table
    *&      Form  EVENT_TOP_OF_PAGE
    *       text
    *      -->DG_DYNDOC_ID  text
    FORM EVENT_TOP_OF_PAGE USING   DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.
      "this is more clear.....check it
      "first add text, then pass it to comentry write fm
      DATA : DL_TEXT(255) TYPE C.  "Text
    * Populating header to top-of-page
      CALL METHOD DG_DYNDOC_ID->ADD_TEXT
        EXPORTING
          TEXT      = 'Test Report'
          SAP_STYLE = CL_DD_AREA=>HEADING.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
      CLEAR : DL_TEXT.
    * Move program ID
      CONCATENATE 'Program Name :' SY-REPID
             INTO DL_TEXT SEPARATED BY SPACE.
    * Add Program Name to Document
      PERFORM ADD_TEXT USING DL_TEXT.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
      CLEAR : DL_TEXT.
    * Move User ID
      CONCATENATE 'User ID :' SY-UNAME INTO DL_TEXT SEPARATED BY SPACE
    * Add User ID to Document
      PERFORM ADD_TEXT USING DL_TEXT.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
      CLEAR : DL_TEXT.
    * Move count (no of records).
      move v_lines to v_line.
      CONCATENATE 'No of records :' v_line INTO DL_TEXT SEPARATED BY SPACE.
    * Add Client to Document
      PERFORM ADD_TEXT USING DL_TEXT.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
      CLEAR : DL_TEXT.
    * Move date
      WRITE SY-DATUM TO DL_TEXT.
      CONCATENATE 'Date :' DL_TEXT INTO DL_TEXT SEPARATED BY SPACE.
    * Add Date to Document
      PERFORM ADD_TEXT USING DL_TEXT.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
      CLEAR : DL_TEXT.
    * Move time
      WRITE SY-UZEIT TO DL_TEXT.
      CONCATENATE 'Time :' DL_TEXT INTO DL_TEXT SEPARATED BY SPACE.
    * Add Time to Document
      PERFORM ADD_TEXT USING DL_TEXT.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
    * Populating data to html control
      PERFORM HTML.
    ENDFORM.                    " EVENT_TOP_OF_PAGE
    *&      Form  ADD_TEXT
    *       To add Text
    FORM ADD_TEXT USING P_TEXT TYPE SDYDO_TEXT_ELEMENT.
    * Adding text
      CALL METHOD DG_DYNDOC_ID->ADD_TEXT
        EXPORTING
          TEXT         = P_TEXT
          SAP_EMPHASIS = CL_DD_AREA=>HEADING.
    ENDFORM.                    " ADD_TEXT
    *&      Form  HTML
    *       text
    FORM HTML.
      DATA : DL_LENGTH  TYPE I,                           " Length
             DL_BACKGROUND_ID TYPE SDYDO_KEY VALUE SPACE. " Background_id
    * Creating html control
      IF DG_HTML_CNTRL IS INITIAL.
        CREATE OBJECT DG_HTML_CNTRL
             EXPORTING
                  PARENT    = DG_PARENT_HTML.
      ENDIF.
    * Reuse_alv_grid_commentary_set
      CALL FUNCTION 'REUSE_ALV_GRID_COMMENTARY_SET'
        EXPORTING
          DOCUMENT = DG_DYNDOC_ID
          BOTTOM   = SPACE
        IMPORTING
          LENGTH   = DL_LENGTH.
    * Get TOP->HTML_TABLE ready
      CALL METHOD DG_DYNDOC_ID->MERGE_DOCUMENT.
    * Set wallpaper
      CALL METHOD DG_DYNDOC_ID->SET_DOCUMENT_BACKGROUND
        EXPORTING
          PICTURE_ID = DL_BACKGROUND_ID.
    * Connect TOP document to HTML-Control
      DG_DYNDOC_ID->HTML_CONTROL = DG_HTML_CNTRL.
    * Display TOP document
      CALL METHOD DG_DYNDOC_ID->DISPLAY_DOCUMENT
        EXPORTING
          REUSE_CONTROL      = 'X'
          PARENT             = DG_PARENT_HTML
        EXCEPTIONS
          HTML_DISPLAY_ERROR = 1.
      IF SY-SUBRC NE 0.
        MESSAGE I999 WITH 'Error in displaying top-of-page'(036).
      ENDIF.
    ENDFORM.                    " HTML
    Regards
    vijay

  • Under the settings messages SMS/MMS there is no option to turn on/off group chats. As a result I don't get any group texts. Help!

    Group chat so I don't get any group texts.

    The setting to turn that on or off does not affect your receiving group texts. Are these group texts from a non-iDevice? Do you have MMS turned on? Many group texts are turned into MMS by some carriers.

Maybe you are looking for