Tree structure in f4 help

Hi experts,
can any one give me sample code for providing tree structure in f4help.  like object part field have in iw21 transaction
Regards
reddy

Hi Muttukundu,
SAP has provided a lot of sample programs for developing tree structures. Just go to SE38, type BCALVTREE and hit F4. You'll get different sample programs with a range of operations on trees
Go through the link,
http://www.sapdevelopment.co.uk/reporting/alv/alvtree.htm
Slowly check this code..you will get idea of how to develop tree structure.
REPORT y_hierarchies_in_tables
NO STANDARD PAGE HEADING.
PARAMETER: g_group TYPE grpname. " DEFAULT 'Z_GLAB0000'.
DATA:
g_setid TYPE setid,
g_class TYPE setclass.
DATA: lt_hier TYPE STANDARD TABLE OF sethier,
lt_val TYPE STANDARD TABLE OF setvalues.
DATA: hier LIKE sethier OCCURS 0 WITH HEADER LINE,
val LIKE setvalues OCCURS 0 WITH HEADER LINE,
setinfo LIKE setinfo OCCURS 0 WITH HEADER LINE.
DATA: zaccbas(20) TYPE c OCCURS 0 WITH HEADER LINE.
DATA: miss_val LIKE setvalues-from OCCURS 0 WITH HEADER LINE.
DATA: table_name TYPE tabname,
field_name TYPE setfld.
DATA: ambiguity_flag TYPE c.
Ambiguity check
PERFORM ambiguity_check.
Display Records
PERFORM display_records.
*& Form AMBIGUITY_CHECK
Ambiguity check
FORM ambiguity_check .
DATA: it_abaplist LIKE abaplist OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF it_ascilist OCCURS 0,
zeile(256) TYPE c,
END OF it_ascilist.
DATA: flag.
SUBMIT rgsovl00 "VIA SELECTION-SCREEN
WITH p_shrtn = g_group
WITH path = 'X'
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = it_abaplist
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = it_ascilist
listobject = it_abaplist
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3 .
LOOP AT it_ascilist.
IF it_ascilist-zeile = text-001.
flag = 'X'.
ENDIF.
IF flag = 'X' AND
it_ascilist-zeile = text-002.
ambiguity_flag = 'X'.
CLEAR flag.
ENDIF.
ENDLOOP.
FREE MEMORY.
ENDFORM. " AMBIGUITY_CHECK
*& Form DISPLAY_RECORDS
Display the Records
FORM display_records .
PERFORM get_records.
PERFORM header_data.
PERFORM item_data.
ENDFORM. " DISPLAY_RECORDS
*& Form GET_RECORDS
Get all the Node values
FORM get_records .
Get the ID name for the Hierarchy
CALL FUNCTION 'G_SET_GET_ID_FROM_NAME'
EXPORTING
shortname = g_group
setclass = g_class
old_setid = g_setid
IMPORTING
new_setid = g_setid.
Get the Table and Field name for the Top Node
CALL FUNCTION 'G_SET_GET_INFO'
EXPORTING
setname = g_setid
no_set_title = 'X'
use_table_buffer = 'X'
IMPORTING
info = setinfo.
table_name = setinfo-tabname.
field_name = setinfo-fld.
Get all the Nodes for the Hierarchy
CALL FUNCTION 'G_SET_TREE_IMPORT'
EXPORTING
no_descriptions = ' '
no_rw_info = 'X'
setid = g_setid
TABLES
set_hierarchy = lt_hier
set_values = lt_val.
hier[] = lt_hier.
val[] = lt_val.
SELECT (field_name) FROM (table_name) INTO TABLE zaccbas.
LOOP AT zaccbas.
READ TABLE val WITH KEY FROM = zaccbas.
IF sy-subrc = 0.
DELETE zaccbas.
CLEAR zaccbas.
DELETE val INDEX sy-tabix.
CLEAR val.
ENDIF.
ENDLOOP.
ENDFORM. " GET_RECORDS
*& Form HEADER_DATA
Header Data
FORM header_data .
DATA: desc TYPE settext.
READ TABLE hier WITH KEY fieldname = field_name
shortname = g_group.
IF sy-subrc = 0.
desc = hier-descript.
ENDIF.
SKIP.
WRITE: 'Node :',g_group.
WRITE:75 'User name :', sy-uname.
WRITE:/ 'Description :', desc.
WRITE:75 'Date:', sy-datum.
WRITE:/ 'Table Name :' , table_name.
WRITE:75 'Time:', sy-timlo.
WRITE:/ 'Field Name :', field_name.
write:75 'Client:', SY-MANDT.
skip.
IF ambiguity_flag = 'X'.
WRITE:/ 'Ambiguity Check :'. WRITE: 'Success' COLOR 5.
ELSE.
WRITE:/ 'Ambiguity Check :'. WRITE: 'Failed' COLOR 6 .
ENDIF.
WRITE:/ sy-uline.
WRITE:/37 'Validation for Hierarchy'.
WRITE:/ sy-uline.
ENDFORM. " HEADER_DATA
*& Form ITEM_DATA
Output Report for Nodes
FORM item_data .
IF NOT zaccbas[] IS INITIAL.
WRITE:/ 'Missing Records from Hierarchy' COLOR 3.
LOOP AT zaccbas.
WRITE:/ zaccbas.
ENDLOOP.
ENDIF.
IF NOT val[] IS INITIAL.
SKIP 1.
WRITE:/ 'Additional Records in Hierarchy' COLOR 3.
LOOP AT val.
WRITE:/ val-from. ", 28 val-DESCRIPT.
ENDLOOP.
ELSEIF ZACCBAS[] IS INITIAL.
WRITE:/ 'No Missing Records Found' COLOR 3.
ENDIF.
ENDFORM. " ITEM_DATA
Reward if found helpfull,
Cheers,
Chaitanya.

Similar Messages

  • Search help like tree structure.

    Hi All,
    I have a requirement to display the F4 search help like a tree structure  , with  different
    Node(category fields ), under each node(category fields ) different work centers  will exist.
    Please suggest how I can achieve the tree format categories in search help.
    Thanks for your cooperation.
    Thanks,
    Sri.

    Hi Sri,
    U can have a look at the search help PRCTH in se11, which has an search help exit K_F4IF_SHLP_STANDARD_HIERARCHY
    just execute this and try to debugg it...
    Hope this solves your problem...
    please ack if helpful .
    Best of luck !
    Thanks,
    Ravi Aswani
    Edited by: Ravi Aswani on Mar 15, 2010 8:45 AM

  • F4 search help as tree structure in a module for one field

    hi experts,
    i have created a z module by copying standard module SAPMV23N of vbg1/2/3 transaction and i have added one tab in vbg1/2/3. the 5th tab is working. i am calling a subscreen using 5 tabstrip. there are one field MAKTL i want to use a F4 search as tree structure for that MAKTL field.
    in code for displaying tree structure i am using function module RS_TREE***
    please help me

    Hi,
    Please study this search help, there is a search help exit in which the hierarchy part it written,
    Search Help: PRCTH
    Search help exit:   K_F4IF_SHLP_STANDARD_HIERARCHY
    Hope this helps you,
    Regards,
    Abhijit G. Borkar

  • F4 Help for Training Event -Tree structure like in PSV2

    Hi,
    There is any function module to give the F4 help in custome development for Training Event like Tree structure in PSV2.

    Check AL S's response here for how to do this. CVI 6.0 does not have a native Tree control. This was introduced with CVI 7.0.
    Bilal Durrani
    NI

  • How to create a tree structure using forms.

    Hi,
    How do i create a tree structure using oracle forms,i have a table named Functions and a specific column 'Function Name' should be displayed in the tree nodes.Can anyone help me out on how to create a tree structure and populating the nodes??
    thanks in advance
    Regards
    Karthik

    The FTree package provides functions to populate the tree - look for the topic "Manipulating a hierarchical tree at runtime
    " in the online help this point to all the functions and triggers

  • How to use ONE query to find out tree structure?

    ID------------upperID----------Name------------------------isFolder
    1------------ 0---------- Folder
    1------------------------------------1
    2------------ 1------------ Folder 1- Sub
    Folder--------------------1
    3------------ 2------------
    Folder1-Item1-A--------------------------0
    4------------ 1------------ Folder 1- Sub
    Item-----------------------0
    Hi all, if I have a table like above to demonstrate the
    folders and item relationship. This structure allows the user to
    create unlimited folders and items.
    Now I would like to use one query to find out the tree
    structure of this table, how could I do the query.
    Any help on this will be highly appreciated!
    Thanks,
    ez

    Also, see this thread:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=12 55788&enterthread=y

  • How to create a form on a tree structured table

    Hi,
    I have a table that is designed to do a tree structure  like:
    Table Name: test
    Fields:
    ID
    ParentID
    Description
    I created a browser (IR) (page 1) that calls a form (page 2)
    The form has the editing fields and at the bottom layer I have a reports region where I display the children records using a query like:
    select * from test where ParentID = :P2_ID
    I need at the region level to add a button to call a form to edit the child record (which is the same table) and when done, to return to the form again but to the parent record.
    How can I do that successfully? Is there any example:?
    Thank you

    Maybe this can help:
    http://apex.oracle.com/pls/otn/f?p=31517:157
    using instead of trigger on a view.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to create Tree structure in Visual Composer

    Hi All,
         I need to develop tree structure in my VC application. Can any one of you please suggest me the steps to do it.Its very urgent please can any one help me out in this.
    Regards,
    Lakshmi

    Hi Nutan,
    if you want to solve it with webdynpro it depends on your skills in java and abap. There are books available to start with webdynpro and there are examples for building tree structures with Webdynpro.
    [Java Webdynpro|http://www.sappress.com/product.cfm?account=&product=H983]
    [ABAP Webdynpro|http://www.sappress.com/product.cfm?account=&product=H1916]
    If you want to do it in VC you have to write e.g. an ABAP rfc function module, which returns you the tree with the information about childnode, parentnode and so on, so that you can display it in the table. But if the users click on sort then the tree is "destroyed". You can also display only a few levels of your tree and when you select a certain node a drill down is done by calling a rfc which returns the child nodes of the corresponding node.
    But I think the solution with VC is not the best. Use webdynpro for this requirements.
    Best Regards,
    Marcel

  • How to get Tree structure in JSP page?

    Hi,
    I would like get data from the database and display the data in tree structure with the check boxes at each nodes on a jsp page with out using any third party tools. how can i do that? Do i require any new tags to fulfill this requirement?
    can any one help me out by sending any example code?
    thanks in advance.
    Regards,
    Reddy

    Once you have the data in a list or something, can't you just use <c:forEach> and then output standard nested <ul> and <li> tags to give the tree structure.
    <html>
         <style>
              li
                   list-style-type:none;
         </style>
         <body>
              <form>
                   <ul>
                        <li>
                             <input type="checkbox">Check 1</input>
                             <ul>
                                  <li>
                                       <input type="checkbox">Check 1A</input>
                                  </li>
                                  <li>
                                       <input type="checkbox">Check 1B</input>
                                  </li>
                             </ul>
                        </li>
                        <li>
                             <input type="checkbox">Check 2</input>
                             <ul>
                                  <li>
                                       <input type="checkbox">Check 2A</input>
                                  </li>
                             </ul>
                        </li>
                        <li>
                             <input type="checkbox">Check 3</input>
                        </li>
                   </ul>
              </form>
         </body>
    </html>

  • How can I create a Tree  Structure in java ??

    Hi,
    I want to create a tree structure(objects hierarchy) using java language. Is there any API method for this ?
    Can any one please give me a hint or suggestion how I can do this ??
    Thanks for the help in advance.

    Do you mean graphically?
    You can use a TreeSet or TreeMap if you just want to use tree structures.
    Kaj

  • How to get the folder name of selected subitem in tree structure?

    Hi All,
               I created a tree structure like below.
             ->Folder1-- 1
                              2
                              3
            ->Folder2-----1
                               2
                               3
                    i.e i have two folders & each folder having the values like above.Now i want to perform some action by clicking on the any of the values.Suppose if i click value 2,i want to do some action.the actions need to perform is varies from floder to to folder.
            So How can i get the folder name of clicked Value?
    Regards,
    Ravi

    Hi Kumar ,
    the below code should help you.
    Register the below action for the leaf node for which u need the subfolder's name above it.
    Worked fine in my system ...hope it does in ur scenario too
    method ONACTIONGET_PATH .
      data : lr_element TYPE REF TO if_wd_context_element,
             lr_node TYPE REF TO if_wd_context_node,
             ls_path type string,
             ls_path_node TYPE string,
             lt_string type TABLE OF string,
             l_lines type i,
             l_lines_1 TYPE i.
      lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
    **-> getting the path of the node/leaf
    *which  u had clicked and from that getting the node above it
      ls_path = lr_element->get_path( ).
      SPLIT ls_path at '.' into table lt_string.
    -> remove the first 2 entries as they will contain the view name
      DELETE lt_string FROM 1 to 2.
      l_lines = LINES( lt_String ).
      l_lines_1 = l_lines - 1.
    -> remove the last 2 entries as they will contain the element in the path
      DELETE lt_string  from l_lines_1 to l_lines.
      LOOP AT lt_string into ls_path.
        CONCATENATE LINES OF LT_STRING into ls_path_node SEPARATED BY '.'.
      ENDLOOP.
    **-> getting access to the node above the leaf element
    LR_NODE = WD_CONTEXT->PATH_GET_NODE( path = ls_path_node ).
    lr_element = lr_node->get_element( ).
    **-> Getting the name of the folder...
    *here path is the attribute in my context which stores the name of the folder
    lr_element->get_attribute( EXPORTING name = 'PATH' IMPORTING value = ls_path ).
    endmethod.

  • How to create a PortalSite map in a tree structure

    Hi,
    We are trying to reuse SAP Portal EP 7.3 standard functionalities related to create a Portal Site Map.
    I've seen the procedure to create a Workset map iview (http://help.sap.com/saphelp_nw73/helpdata/en/49/32a7a9e8c45aaae10000000a42189d/frameset.htm), but we are interested in generate this map contained in a tree structure, because currently the SAP EP 7.1 brings the menu and option format.
    I would like to know if this is possible using the standard functionalities or it is required to develop any application?
    Please if you could help me it would be really useful.
    Thanks in advance,

    Thanks for your help Srinivas,
    I was trying to know if it was possible to assign a style or layout to the site map iview created using the standard map iview delivered by SAP EP 7.3. I was looking for documentation but it is not enough at all and in my project we are still working with SAP EP 7.0
    Please, if anyone could know about the map site iview standard and the available styles or maybe it is not changeable.
    In that case, the only way it would be a development to get the tree structure.
    Thanks!!!!

  • I would like to know where the forum tree structure is so I can see what I'm doing and not be led around to irrelevant information.

    I'm having trouble '''Finding''' the forum where I can look for the information I need. I keep ending up in '''endless menus of non-helpful information. '''
    I got a popup message, I needed to upgrade to 3.6.17. After allowing it and rebooting, I couldn't start FF anymore, just got a crash report. I tried going to the restore point I had set with no luck and I tried creating a new profile. I lost all my bookmarks (only the Cache remained). And I sat in live chat for an hour waiting for help. German live chat had one helper and English live chat was closed.
    So I gave up on help, uninstalled FF 3.6.17 and downloaded FF 3.6.15 and installed it. It loads but all bookmarks are gone. More importantly, now when I load the bookmarks, I can't '''retrieve''' them except by storing a new one. '''Only''' when I create a new bookmark can I see the folders I've created. I can't get to the organizer so I can't use the bookmarks to retrieve websites.
    I'm disturbed that I can't get to the tree-structure forum where I can get the help I need. This "lead me around" labyrinth from one question to another, without being able to look through the forum for the information I need, is not helpful.
    Thank you.
    Foxhunt

    I believe you just are able to delete them from iTunes.
    Hope it will be helpful

  • How to populate Tree structure from BAPI while tree grows or shrinks

    Hi All
    Currently I am populating the tree structure from BAPI based on the HLevel (Hierarchy  Level) parameter, but when ever insertion and deletion happens in the tree at any level in the UI and at the same time i am updating these tree node values with HLevel value(example : 1 is first level , 2 is second level, 3 is third level etc)  updating successfully& correctly  into the BAPI, no issues.
    Once it is updated into the BAPI, next time when i refreshed the UI then i am not populating the tree structure correctly from BAPI with updated new nodes based on the HLevel. when tree struture grows or shrinks in the BAPI after updating into BAPI from UI then i am not populating the tree sturcture correctly based on the HLevel value from the BAPI.
    Please let me know any sample code how to populate tree structure correctly when tree structure grows or shrinks based on the HLevel value ( Hierarchy Level , for example : 1 is level , 2 is 2nd level , 3 is third level nodes etc)
    anybody helps in this regard with sample code on the populating tree tructure then it would be great help to me.
    Thanks in advance
    Regards
    Kalki Reddy
    Edited by: KalkiReddy on Nov 29, 2009 3:48 PM

    Bapi output node:
    Value     | Text     | HLevel
    01     | A     | 1               
    0101     | AA       | 2
    010101     | AAA     | 3
    01010B     | AAB     | 3
    0102     | AB     | 2
    02     | B     | 1
    0201     | BA        | 2
    This code is used to build the tree in wdDoInit method
         IE_T_CatalogueNode catalogueNode = wdContext.nodeE_T_Catalogue();
         int size = catalogueNode.size();
         ICatalogoElement level1elem = null;
         for (int i = 0; i < size; i ++)
              IE_T_CatalogueElement catalogueElem = catalogueNode.getE_T_CatalogueElementAt(i);
              if (catalogueElem.getLevel().equals("1"))
                   // 1 Livello
                   level1elem = wdContext.createCatalogoElement();
                   level1elem.setKATALOGART_CODE(catalogueElem.getKatalogart());
                   level1elem.setCODEGRUPPE_CODE(catalogueElem.getCodegruppe());
                   level1elem.setCODE(catalogueElem.getCode());
                   level1elem.setCODE_DESCR(catalogueElem.getKatalogart_Descr());
                   level1elem.setDESCR(catalogueElem.getKatalogart_Descr());
                   wdContext.nodeCatalogo().addElement(level1elem);
                   for (int j = i + 1; j < size; j ++)
                        IE_T_CatalogueElement catalogueElem2level =
                                                 catalogueNode.getE_T_CatalogueElementAt( j );
                        String level2 = catalogueElem2level.getLevel();
                        if (level2.equals("2"))
                             ICatalogoElement level2elem = level1elem.nodeChild().createCatalogoElement();
                             level2elem.setKATALOGART_CODE(catalogueElem2level.getKatalogart());
                             level2elem.setCODEGRUPPE_CODE(catalogueElem2level.getCodegruppe());
                             level2elem.setCODE(catalogueElem2level.getCode());
                             level2elem.setCODE_DESCR(catalogueElem2level.getCodegruppe_Descr());
                             level2elem.setDESCR(catalogueElem2level.getCodegruppe_Descr());
                             level1elem.nodeChild().addElement(level2elem);
                             for (int k = j + 1; k < size; k ++)
                                  IE_T_CatalogueElement catalogueElem3level =
                                                           catalogueNode.getE_T_CatalogueElementAt( k );
                                  String level3 = catalogueElem3level.getLevel();
                                  if (level3.equals("3"))
                                       ICatalogoElement level3elem = level2elem.nodeChild().createCatalogoElement();
                                       level3elem.setKATALOGART_CODE(catalogueElem3level.getKatalogart());
                                       level3elem.setCODEGRUPPE_CODE(catalogueElem3level.getCodegruppe());
                                       level3elem.setCODE(catalogueElem3level.getCode());
                                       level3elem.setCODE_DESCR(catalogueElem3level.getCode_Descr());
                                       level3elem.setDESCR(catalogueElem3level.getCode_Descr());
                                       level2elem.nodeChild().addElement(level3elem);
    Damiano

  • Bookmark tree structure using Microsoft word 2007 not creating properly

    I have a word document file in MS office 2007. When i am converting the word document to a PDF file using the HEADING option , the bookmarks tree structure  in the PDF file is not created properly. Means that the between content of a topic is also read
    as a bookmark heading while conversion. Only the heading of a topic should be read as a bookmark and the sub heading as a sub-bookmark but the content should not come in the tree structure of bookmarks in a PDF file..
    For Example:- if MICROSOFT is the heading of any xyz.doc then it should be the parent bookmark. . but in my case , MICROSOFT is coming as a bookmark but the content inside this is also created as a bookmark..
    So my question is that what is the internal structure of the of the MS word 2007 to convert a doc to a PDF file???
    Because it is not creating the bookmarks tree structure properly...and taking the content randomly from the middle of a topic and adding it in the bookmark tree structure...(which should not happen). The font throughout the doc is the same and aligned properly..so
    why it is randomly taking the between text as a bookmark...???
    what is the root cause of this bug..?? how can this problem be solved..?? is there any sort of change have to be done in my word doc.?
    i need an urgent help regarding this...
    NOTE:- I am using MS office 2007.

    I tried this but didnt work for mr. Can you help? How did you PDFed??
    It works for me in Word 2010 (or later) using Save As PDF. It did not work in Word 2007 using the Adobe Acrobat PDF printer nor using Word 2007's save as pdf utility. (The hyperlink showed up but was not active.) It did work using the Acrobat tab in Word
    2007 (this requires Adobe Acrobat).
    I did this by:
    first creating the text box with the hyperlink in the body of the document and moving it into the footer area (but still not in the footer itself).
    Then I used the Format tab of Text Box Tools and the Postion button (More Layout Options).
    I gave it an absolute vertical position relative to the page.
    Then I cut the text box, went into the footer, and pasted it there.
    It might have worked to just create the text box in the footer itself.
    I personally prefer it that the header and footer are not part of the active page when I am typing. This hyperlink is not clickable in Word without going into the header/footer view and I'm fine with that. The QAT workaround is just fine.
    Charles Kenyon Madison, WI

Maybe you are looking for

  • How to install Firefox OS on ZTE Open C?

    I've purchased ZTE Open C on Ebay, and it has arrived today, but it's got Android OS instead of Firefox one - how can I install FF OS on it? Another thing is that in settings it says the model of my phone is Kis 3 and not Open C - is this correct? Th

  • How do I stop Preview printing things in the center of the paper?

    Preview always insists on printing things in the center of the paper, which is handy when I'm printing, say, a paper-page document, but when I'm printing images or PDF's less than the full paper size, the result is a big waste of paper, especially wh

  • No partitions avalilable on Page Cluster configuration storage

    hello all, I am trying to install RAC R2 on windows Server 2003 (Standard Edition) with 2 nodes. When installing Clusterware. I can't see all the partitions of the raw device but When i go to Computer Management, i see all of them. One "Cluster Confi

  • Vertical scroll in edit mode and Open a complete row in edit mode

    Any help would be greatly appreciated , if someone can share their knowledge/experience on the following two items .. 1. Can you please help on how to implement vertical movement in  data grid (Using the up and down arrows to move from an editable ce

  • Storing different languages of data in Oracle database.

    Hi Sir, I'm currently using Oracle8iEE (816). I would like to know: How to store chinese character into Oracle database? How to sort the result if I have different language of data in the same table? Please advise on what are the common practice and