Function to Get Menu path

Hi,
Is there any function in abap to get a menu path
(File->open)in a particular screen,given the fcode.
thanx

Hi Kaushik!
Not directly - and I never found a transaction, where only one menue-path exists, there were always several hits.
But maybe you want to put parts of the following coding into a own FM:
TEXT_UPPER_CASE = TEXT.
TRANSLATE TEXT_UPPER_CASE TO UPPER CASE.
select * from smensapnew into table i_smensapnew.
select * from smensapt into table i_smensapt where spras = sy-langu.
DESCRIBE TABLE I_SMENSAPNEW LINES LIN.
IF LIN = 0.
  MESSAGE S265(SF).
ENDIF.
SORT I_SMENSAPT BY OBJECT_ID.
SORT I_SMENSAPNEW BY OBJECT_ID.
LOOP AT I_SMENSAPNEW.
  CLEAR SWITCH.
  IF I_SMENSAPNEW-REPORT = TEXT
                               OR I_SMENSAPNEW-REPORT = TEXT_UPPER_CASE.
    SWITCH = 'X'.
  ENDIF.
  READ TABLE I_SMENSAPT WITH KEY OBJECT_ID = I_SMENSAPNEW-OBJECT_ID
                                          BINARY SEARCH.
  IF SY-SUBRC NE 0.
    I_SMENSAPT-TEXT = '???'.
  ENDIF.
  SEARCH I_SMENSAPT-TEXT FOR TEXT.
  IF SY-SUBRC = 0.
    SWITCH = 'X'.
  ENDIF.
  IF SWITCH = ' '.  CONTINUE. EXIT.  ENDIF.
  READ TABLE I_SMENSAPT WITH KEY OBJECT_ID = I_SMENSAPNEW-OBJECT_ID
                                          BINARY SEARCH.
  IF SY-SUBRC NE 0.
    I_SMENSAPT-TEXT = '???'.
  ENDIF.
  WRITE: /  TEXT-015, AT 20 I_SMENSAPNEW-REPORT(20),
                            AT 40 I_SMENSAPT-TEXT(40).
  FORMAT INTENSIFIED OFF.
  DO.
    READ TABLE I_SMENSAPNEW WITH KEY OBJECT_ID = I_SMENSAPNEW-PARENT_ID
                                                          BINARY SEARCH.
    IF SY-SUBRC NE 0. EXIT. ENDIF.
    IF SY-SUBRC EQ 0.
      READ TABLE I_SMENSAPT WITH KEY OBJECT_ID = I_SMENSAPNEW-OBJECT_ID
                                                          BINARY SEARCH.
    ELSE.
      I_SMENSAPT-TEXT = '???'.
    ENDIF.
    IF I_SMENSAPNEW-REPORTTYPE = SPACE.
      CLEAR I_SMENSAPNEW-REPORT.
    ENDIF.
    WRITE: / TEXT-016, AT 20 I_SMENSAPNEW-REPORT(20),
                                  AT 40 I_SMENSAPT-TEXT(40).
  ENDDO.
  FORMAT INTENSIFIED ON.
  ULINE.
ENDLOOP.
Regards,
Christian

Similar Messages

  • Function to get the path using a parent-child relationship

    Hello,
    I have a table which uses parent-child relationship to store the options available. I need a function to give me the full path given the id of a particular option.
    I have two different functions. One of them uses the Oracle built in function and the other uses simple queries with a loop.The code of the functions are given below.
    Now, the problem is with their "performance". The difference in their performance is significant. The function using the Oracle function takes more than 2 hours to run a query whereas the other function takes less than 2 minutes.
    I am having trouble trusting the other function. No matter how many tests I perform on the output of both the functions, it always comes out to be the same.
    Any thoughts to help me understand this ??
    Function 1
    =====================
    FUNCTION Gettree (opt_id IN NUMBER,i_app_id IN NUMBER)
    RETURN VARCHAR2
    IS
    path VARCHAR2(32767);
    application_no NUMBER;
    BEGIN
    SELECT ABC.APP_OPT_ID INTO application_no FROM ABC
    WHERE ABC.APP_ID = i_app_id AND ABC.PARENT_ID IS NULL;
    SELECT LPAD(' ', 2*LEVEL-1)||SYS_CONNECT_BY_PATH(app_opt_name, '=>') "Path" INTO path
    FROM ABC
    WHERE app_opt_id = opt_id
    START WITH parent_id =application_no
    CONNECT BY PRIOR app_opt_id =parent_id;
    path := SUBSTR(path,INSTR(path,'>')+1,LENGTH(path));
    RETURN path;
    END Gettree ;
    Function 2
    ======================
    FUNCTION GetOptPath(opt_id NUMBER,app_id NUMBER)
    RETURN VARCHAR2
    IS
    string VARCHAR2(900);
    opt VARCHAR2(100);
    pid NUMBER(38);
    BEGIN
    SELECT ABC.parent_id,ABC.app_opt_name INTO pid,string FROM ABC WHERE ABC.app_opt_id = opt_id;
    IF pid IS NULL
    THEN
    RETURN 'root';
    ELSIF pid IS NOT NULL
    THEN
    LOOP
    SELECT ABC.app_opt_name,ABC.parent_id INTO opt, pid FROM ABC WHERE ABC.app_opt_id = pid;
    EXIT WHEN pid IS NULL;
    string := opt || '=>'|| string;
    END LOOP;
    RETURN string;
    END IF;
    END;

    Hi,
    user8653480 wrote:
    Hello Frank,
    The parameters taken by gettree & getoptpath are app_opt_id and app_id and both the functions return only one string i.e. the path of that particular option (app_opt_id) starting from its root and not all the descendants of that option/root node of that option.
    So, does that mean that gettree first fetches all the descendants of the root node of the given option and then returns the required one ??Yes. It's a little like the situation where you need to meet with your co-worker Amy, so you send an e-mail to everyone in the department telling them to come to your office, and then, when they arrive, tell everyone except Amy that they can leave.
    >
    And if that is the case, then won't it be better to use the bottom-up approach to fetch the required path just for that particular option ?? 'coz my requirement is that only.. given an option_id get the full path starting from the root.Exactly!
    I have used explain plan also for both the functions.. but since I did not know how to anlayze the output from plan_table so I just compared the value in the fields and they were exactly the same for both the queries.If you'd like help analyzing the plans, post them, as Centinul said.
    I am attaching a sample data with the outputs of both the functions for the reference.
    (tried attaching the file but could not find the option, so pasting the data here)
    App_opt_ID     App_ID     Parent_ID     App_opt_name     "gettree(app_opt_id,app_id)"     "getoptpath(app_opt_id,app_id)"
    1          1     NULL          application          NULL                    root
    2          1     1          module1               module1                    module1
    3          1     1          module2               module2                    module2
    4          1     2          submod1               module1=>submod1          module1=>submod1
    5          1     3          submod1               module2=>submod1          module2=>submod1
    6          1     5          opt1               module2=>submod1=>opt1          module2=>submod1=>opt1
    7          2     NULL          app2               NULL                    root
    8          2     7          scr1               scr1                    scr1
    9          2     8          opt1               scr1=>opt1               scr1=>opt1
    10          2     7          scr2               scr2                    scr2Please help.The best solution is to do a bottom-up query, and write a function like reverse_path (described in my first message) to manipulate the string returned by SYS_CONNECT_BY_PATH. You seem to have all the PL/SQL skills needed for this.
    Another approach is a revised form of gettree, like I posted earlier. Does it do what you want or not?
    If you'd help, then post a little sample data in a form people can actually use, such as CREATE TABLE and INSERT statements. Post a few sets of parameters, and the results you need from each set, given the sample data posted.

  • Function to get the path without name of file

    Hello everyone!
    I'm using the function 'KD_GET_FILENAME_ON_F4', this function works very good but every time I choose a destination folder in the pop-up window it always asks me for a file name, but I need a function if it exist in SAP of course that only asks me for the destination folder and nothing else.
    I hope somebody could help me to find another function.
    Thanks for you time.

    Hi,
    Try the static method CL_GUI_FRONTEND_SERVICES=> DIRECTORY_BROWSE
    Thanks,
    Naren

  • Need Query to get Menu's - SubMenu's and Functions attached to a Responsibi

    Hi,
    Need SQL Query to get Menu's - SubMenu's and Functions attached to a Responsibility...
    There are two tables fnd_menus_vl and fnd_menu_entries_vl....
    I need to call in these two tables again as the sub_menu_id acts as menu_id in order to get the submenu and their entries....
    Please suggest how to achieve this...
    Thanks
    Aman

    Hi Aman,
    >
    Need SQL Query to get Menu's - SubMenu's and Functions attached to a Responsibility...
    There are two tables fnd_menus_vl and fnd_menu_entries_vl....
    I need to call in these two tables again as the sub_menu_id acts as menu_id in order to get the submenu and their entries....
    Please suggest how to achieve this...please see this
    SQL Query to find menus and submenus attached to responsibility
    Re: How to check a function is accessible under responsibility?
    ;) AppsMasti :)
    sharing is Caring

  • Restriction in menu path access

    Hi all,
    I have just been assigned to limit access to menu path <i>List->Save->File</i> from the output of an ABAP report. Tcode has also been assigned for this report. I was able to access PFCG but I'm not too familiar as to how I could limit access to a menu using activity groups and profiles.
    Any enlightenment is very much appreciated. Thanks.
    Sheila

    Hi,
    If it is a custom code, you can restrict it by using command SET PF-STATUS ... EXCLUDING <menufunc> where 'menufunc' is the function-code (what you get in the sy-ucomm field when you choose this menu option eg %PC is what you get for 'Save to file').
    If you are using standard PF-STATUS (ie no explicit PF-STATUS assigned to the report), you may wish to copy and apply the standard interface (STLI of program SAPMSSY0) to this program. Then you can use this option (or change the PF-STATUS itself to exclude this option in SE41).
    I do not think that with PFCG you can disable menu options from the output screen of a report.
    cheers,

  • Middleware-Partner Functions not getting attached after BP replication

    Dear SDN team,
    We have an problem related to CRM middleware . We have enabled Middleware to download BPs from SAP R/3 system to CRM 5.2 system.
    Problem: We are able to download the individual BPs like Sold to party and Bill to party from SAP R/3 system to the CRM system. _But the Partner function relationships are not getting attached to these BPs after the replication from ERP to CRM _. I mean the Bill to party is not getting attached to the respective Sold to Party in the CRM system .
    Strangely the Contacts for individual BPs is getting replicated via BP relationships
    Can someone help me to solve this problem.
    What should we do on the MW settings to replicate the respective BP relationships ??
    Kindly get back urgently . Suitable points will be awarded for the useful solution.
    Regards
    Ritvij

    Ritvij,
    You can try as suggest to setup a filter on CUSTOMER_REL on KVNK.  I would exclude any entries where PARNR is a non null value.  Beyond that you may need to do a middleware exit to block that data on the R/3 side.
    For your second question:
    R/3 Account Group = CRM BP Grouping
    Your settings PIDE should transfer the the account group to CRM.  You will need however to maintain a corresponding grouping with number range on the CRM.
    I believe from a business partner "role" perspective, you need to do a middleware exit if you want to replicate the custom account group into a custom role.
    If you do however have a relationship then you need need to do the mapping configuration for this.
    In the CRM IMG you can use the Menu Path:
    CRM->Basic Functions->Partner Processing->Data Transfer.  This will alow you to map in any custom partner functions from R/3 into CRM and be linkded on the business partner master.
    Take care,
    Stephen

  • Firefox does not open when i click on the icon or menu path

    when i click on the desktop icon or go through the menu path to open firefox, the computer will run it but nothing appears. apparently, firefox is still running in the background but i cant get to it. so whenever i try to edit another program that involves firefox, i have to go to the task manager to manually shut it down.
    i tried running it in safemode but it does the same thing. furthermore, i deleted the whole program and reinstalled it hoping that that might fix the problem. however that did not work, i have searched all the offered support and have come up dry.
    i am running the current firefox version and i am using a windows 7 professional operating system

    Hi,
    It could be that a security software installed in the system is blocking the new updated Firefox executable. You may have to go into the settings of the security software to re-trust Firefox.
    Please also check if you are able to start Firefox by browsing to the Firefox installation folder ('''Program Files (x86)\Mozilla Firefox\''' or '''Program Files\Mozilla Firefox\''' ) and clicking '''firefox'''.
    Useful links:
    [https://support.mozilla.com/en-US/kb/Options%20window All about Tools > Options]
    [http://kb.mozillazine.org/About:config Going beyond Tools > Options - about:config]
    [http://kb.mozillazine.org/About:config_entries about:config Entries]
    [https://support.mozilla.com/en-US/kb/Page%20Info%20window Page Info] Tools (Alt + T) > Page Info, Right-click > View Page Info
    [https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts Keyboard Shortcuts]
    [https://support.mozilla.com/en-US/kb/Viewing%20video%20in%20Firefox%20without%20a%20plugin Viewing Video without Plugins]
    [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder & Files]
    [https://developer.mozilla.org/en/Command_Line_Options#Browser Firefox Commands]
    [https://support.mozilla.com/en-US/kb/Basic%20Troubleshooting Basic Troubleshooting]
    [https://support.mozilla.com/en-US/kb/common-questions-after-upgrading-firefox-36 After Upgrading]
    [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20plugins Troubleshooting Plugins]
    [http://kb.mozillazine.org/Testing_plugins Testing Plugins]

  • File dialog box: how get full path and filename (firefox 3.0 problem)

    Hi,
    I have a smilar problem then discussed in this thread: file dialog box: how get  full path and filename
    Now this solution doesn't seem to work in firefox 3.0,I only get the filename but not the full path.
    I have tried to solve this problem by adding *"netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");"* in a javacript function but that doesn't do the trick
    Although when i tested it local it does work.
    Any idees how to solve this?
    Best Regards
    Stijn

    Actually, that is strange and scarry. With 20% of the browser market share they decide to behave like Microsoft did in the past - they want to decide what users need and what they do not need. With 3.0 I have a real problem with some of my applications. They are all tested in IE6, IE7, FF2.0 and they all work the same way (they even work with Opera and Safari). Now, I will for sure not go there and make it work for 3.0, just because 2 out of 200 users use FF3.0. Up to now I have always recomended FF as the best browser. 3.0 causes my opinion to change completely. Competition is always good but it is a question if it is good if we have 20 different browsers out there with equal market shares.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Need Help in finding the Menu Path's for the below topics

    Hi,
    Where can i get the menu paths for the below topics in SAP syste. I have searched in the system,But couldnot find the Menu Path's for the below topics.Kindly help me in finding the configuration Path for the below...
    1)Public tendering process
    2)Grants Management
    3)Tax & Revenue management
    4)Public sector accounting --> Budget formulation, preparation, execution & Monitoring.
    Thanks
    Rajitha M

    Hi,
    Check for the relevant path in IMG in Public Sector Management.  The prerequisites being configuration of Financial accounting
    sub modules.
    Best Regards,
    Sadashivan

  • Finding the menu path

    I want 2 do a report for  which shd give me menu path if i give text or short desription of any standard report..
    i dont want 2 use se43 transaction directly!!!!!!!!!!!!!
    plz can anybdy give me idea?
    Thanks in advance
    satya

    Hello Satya
    I do not really understand what you want but I assume you would like to display an <b>area menu</b> (transaction SE43) without using the transaction. If so you can use function module <b>BMENU_START_BROWSER</b> with the following parameters:
      TREE_ID = '<name of your area menu>'
      HIDE_TOGGLE_BUTTON = 'X'                 " only display, user cannot change menu
    Regards
      Uwe

  • How to get the path of  my webapp?

    example mywebapp: " http://xxxx.com/test/index.html"
    The "test" is the path of my webapp,is there any function use to get the path in the HttpServlet?
    thanks!

    request.getContextPath();

  • How to get the path of the selected Jtree node for deletion purpose

    I had one Jtree which show the file structure of the system now i want to get the functionality like when i right click on the node , it should be delete and the file also deleted from my system, for that how can i get the path of that component
    i had used
    TreePath path = tree.getPathForLocation(loc.x, loc.y);
    but it gives the array of objects as (from sop)=> [My Computer, C:\, C:\ANT_HOME, C:\ANT_HOME\lib, C:\ANT_HOME\lib\ant-1.7.0.pom.md5]
    i want its last path element how can i get it ?

    Call getLastSelectedPathComponent() on the tree.

  • How to get the path of placed plugin location

    hi all,
    I want to get the path of my placed plugin location in my custom plug-in code.
    supporse my custom plugin at :
    C:\Program Files\Adobe\Adobe Illustrator CS5.1\Plug-ins\MyCustomPlugin\MyCustomPlugin.aip
    Is any API is there that can tell me my plugin path or the Directory path.
    Regards
    Ashish.

    hi Patterson,
    I actully i am looking for XMLDocument api.
    Is any API adobe providing so I can use this to API for itterate this xml document.
    Let me clear you more...
    see this is my xml document
    <PropertyGridConfiguration>
      <Control  name="ControlType" type="ComboBox">
        <Option>None</Option>
        <Option>List</Option>
        <Option>Menu</Option>
        <Option>Label</Option>
        <Option>TextBox</Option>
      </Control>
      <Control name="ControlStyle" type="ComboBox">
        <Option>None</Option>
        <Option>ListStyle</Option>
        <Option>ItemStyle</Option>
      </Control>
    </PropertyGridConfiguration>
    I want to read this in memory is AI is provides us any API.

  • F4 Help to get the path for a File source directory

    There are numerous function modules for browsing a particular file in desktop and getting the file path (including the fine name)  , like F4_FILENAME , KD_GET_FILENAME_ON_F4 , WS_FILENAME_GET etc. But can anyone tell me how to fetch only the directory path to the field were the F4 help is given. Actually the filename has to come in some other field in the selection screen. Is there separate funtion modules for these OR will changing parameters in the above function modules work?
    Pls Help....
    Also are there function modules for providing F4 help for getting the path to a file in application directory?

    Try this method CL_GUI_FRONTEND_SERVICES.
    It is a Global CLASS which is having different methods for different purposes
    see the documentation of it and use the methods of it
    see
    CL CL_GUI_FRONTEND_SERVICES
    Short Text
    Frontend Services
    Functionality
    The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
    File functions
    Directory functions
    Registry
    Environment
    Write to / read from clipboard
    Upload / download files
    Execute programs / open documents
    Query functions, such as Windows directory, Windows version, and so on
    Standard dialogs (open, save, directory selection)
    Example
    Determine the temp directory on your PC:
    DATA: TEMP_DIR TYPE STRING.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_TEMP_DIRECTORY
    CHANGING
    TEMP_DIR = TEMP_DIR
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2.
    IF SY-SUBRC 0.
    Error handling
    ENDIF.
    flush to send previous call to frontend
    CALL METHOD CL_GUI_CFW=>FLUSH
    EXCEPTIONS
    CNTL_SYSTEM_ERROR = 1
    CNTL_ERROR = 2
    OTHERS = 3.
    IF SY-SUBRC 0.
    Error handling
    ENDIF.
    WRITE: / 'Temporary directory is:', TEMP_DIR.
    Notes
    The class CL_GUI_FRONTEND_SERVICES is based on the Control Framework. See the documentation for more information, in particular on CL_GUI_CFW=>FLUSH which must be called after many CL_GUI_FRONTEND_SERVICES methods.
    Migration Information
    The old file transfer model was based on function modules of the function group GRAP. The old features have been replaced by the class CL_GUI_FRONTEND_SERVICES. The following list contains the old function modules (italic) and the new methods (bold) that replace them:
    CLPB_EXPORT
    CLIPBOARD_EXPORT
    CLPB_IMPORT
    CLIPBOARD_IMPORT
    DOWNLOAD
    GUI_DOWNLOAD, dialog replaced by FILE_SAVE_DIALOG
    PROFILE_GET
    No replacement, use REGISTRY_* methods instead
    PROFILE_SET
    No replacement, use REGISTRY_* methods instead
    REGISTRY_GET
    REGISTRY_GET_VALUE, REGISTRY_GET_DWORD_VALUE
    REGISTRY_SET
    REGISTRY_SET_VALUE, REGISTRY_SET_DWORD_VALUE
    UPLOAD
    GUI_UPLOAD, dialog replaced by FILE_OPEN_DIALOG
    WS_DDE
    Obsolete: This function is no longer supported.
    SET_DOWNLOAD_AUTHORITY
    Obsolete: This function is no longer supported.
    WS_DOWNLOAD
    GUI_DOWNLOAD
    WS_DOWNLOAD_WAN
    Obsolete: This function is no longer supported.
    WS_EXCEL
    Obsolete: This function is no longer supported.
    WS_EXECUTE
    EXECUTE
    WS_FILENAME_GET
    FILE_SAVE_DIALOG, FILE_OPEN_DIALOG
    WS_FILE_ATTRIB
    FILE_SET_ATTRIBUTES, FILE_GET_ATTRIBUTES
    WS_FILE_COPY
    FILE_COPY
    WS_FILE_DELETE
    FILE_DELETE
    WS_MSG
    Obsolete: This function is no longer supported.
    WS_QUERY
    CD (current directory)
    DIRECTORY_GET_CURRENT
    EN (read/write environment)
    ENVIRONMENT_GET_VARIABLE
    ENVIRONMENT_SET_VARIABLE
    FL (determine file length)
    FILE_GET_SIZE
    FE (check if file exists)
    FILE_EXIST
    DE (check if directory exists)
    DIRECTORY_EXIST
    WS (determine Windows system)
    GET_PLATFORM
    OS (operating system)
    GET_PLATFORM
    WS_UPLDL_PATH
    Obsolete: This function is no longer supported.
    WS_UPLOAD
    GUI_UPLOAD
    WS_VOLUME_GET
    Obsolete: This function is no longer supported.
    Reward points if useful.

  • How to get absolute path of a form within the Forms

    Aslam o Alikum (Hi)
    How to get absolute path of a form within the Forms 6i or 9i
    For example
    i am running a from "abc.fmx" from C:\myfolder directory
    can i get the form path 'C:\myfolder' by calling any any function from "abc.fmb"

    There is no direct call that will always work. What you need to do is call get_application_property(current_form). This may have the full path in it, depending on if that path was defined when the form was launched. If there is no path, then you need to use TOOL_ENV.GETVAR to read the Forms<nn>PATH and the ORACLEPATH, parse those out into individual directories and then check for the FMX in each.
    I already have some code to do all this for you see:
    http://www.groundside.com/blog/content/DuncanMills/Oracle+Forms/?permalink=4A389E73AE26506826E9BED9155D2097.txt

Maybe you are looking for

  • I got a new ipod and i want to play it on my computer but its not letting me, how do i change that?

    So I got my iPod stolen and I just got a new one but when i plug it in the computer, i get the libary but if I click on music in device, its not letting me my songs from there and its not letting me add music and I want to know why and how can I chan

  • I cannot re-open Firefox, or open another window, without rebooting

    I get a message indicating that Firefox is already operating and to either close the program or reboot. I cannot access the supposedly open program, nor can I open another window. I am using Windows 7. The problem repeats itself even after rebooting.

  • How to use Javascript in OBIEE?

    Hi all, can any one tell how to use javascript in OBIEE. i.e steps to follow to insert the javascript in OBIEE 11g or 10g

  • Removing 2 years from date in where clause

    I have a table that has a date and I want to select all the rows where the date is between the current date and 2 years back. What is the cleanest way to do it? I have the this so far select TO_DATE(CURRENT_DATE, 'DD-MON-YYYY') from dual Thank you

  • Podcast after one year removed

    hey, two days ago my podcast was removed from itunes and i got an email, which say that my Feed is a test podcast and after i will load my first episode i can ask for a new acception. But my podcast is more then one year old and was updatet regulary.