Read profile parameter with less "IF" arguments

HI ,
there is a better way to do this if statement,without the 3 if  ?
IF is_dev-ext_langu IS INITIAL .
    is_dev-be_langu = ls_defultes-langu.
    IF is_de-be_langu IS INITIAL.
      "Retrieve from system  RZ11
      lv_par_name =  para.
      "Calls a C-routine within the SAP kernel.
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD lv_par_name 
                          ID 'VALUE' FIELD is_device-be_langu.
      IF sy-subrc <> 0.
        CALL 'C_SAPGALLPARAM' ID 'PAR_SUB'  FIELD lt_par_sub.
        READ  TABLE lt_par_sub INTO ls_par_sub WITH KEY pname = para1
        is_dev-be_langu = ls_par_sub-default_wert.
      ENDIF.
    ENDIF.
  ENDIF.
regards
Chris
Edited by: Julius Bussche on Sep 14, 2009 8:59 PM

Thanks SaS,
There are a lot of things to fix here...
- Duplicate deleted.
- Title given more meaning.
- Moved to performance, though I am not completely sure why you wanted that...
Now for the coding, I leave that up to you guys - but wonder for what one wants to compare the logon language or sy-langu with the instance default language.
C-calling the kernel routine is anyway a bit ugly, even if stable...
A released FM would be a much better option...
@Chris: What exactly are you trying to achieve here and why? (what are you doing with it)
Cheers,
Julius

Similar Messages

  • Msprot: cant read profile parameter rdisp/mshost

    Hi
    When I run : msprot -name <SID> -l it returns:
    cant read profile parameter rdisp/mshost
    rdisp/mshost is set in the default profile to : sapms<SID>
    in etc/services  sapms<SID> is assigined to   <port_number>/tcp
    If you change rdisp/mshost to the port number rather than sapms<SID> it works....but we don't want to change the parameter to the port number.
    Thanks
    Jim

    Thanks.....i've being testing the command....it's like it can't read the default profile...
    if i use mshost switch it complain it can't read msserv.....once I use both switch it runs ok....
    I changed default profile to 777 just to test if it was a permissions issue but that didn't make a difference.
    Thanks for the note but that seems to be dealing with windows...i'm working on sun...tried it on linux also and get
    the same problem....
    Cheers
    Jim

  • Read profile parameter in ABAP

    How could I read out a profile parameter such as zcsa/installed_languages in ABAP?
    Is the a function I could use?
    regards HT

    Here is one way...
    REPORT  zrich_0001.
    types: begin of tpar,
           status type sy-index,
           name(60) type c,
           user_wert(60) type c,
           default_wert(60) type c,
           end of tpar.
    data: par_usub type table of tpar with HEADER LINE.
    data: par_sub  type table of tpar  with header line.
    call 'C_SAPGALLPARAM' id 'PAR_USUB' field par_usub-*sys*
                          id 'PAR_SUB'  field par_sub-*sys*.
    read table par_usub with key name = 'zcsa/installed_languages'.
    if sy-subrc = 0.
      write:/ par_usub-name(30), par_usub-user_wert(20),
              par_usub-default_wert(20).
    endif.
    REgards,
    Rich Heilman

  • Read function block parameter with its object dictionary index in VC?

    How do I read  a function block parameter with its object dictionary index using NI-Fbus Communications Manager Programmer VC API?

    You can use  marco NIFB_INDEX(index) as parameter for nif_ReadObject function. The index is the relative index of the parameter in the block.
    nifError_t nifReadObject(nifDesc_t ud, NIFB_INDEX(uint32 idx), void *buffer, uint8 *length)
    Please also refer to 'NI-FBUS Hardware and Software User Manual' from Start->National Instruments->NI-FBUS->Manuals. Page 6-41 ~ Page 6-44 describe the detail information about nifReadObject() function.
    Page 6-51 ~ Page 6-52 explain the usage of marcos for processing index.
    Feilian (Vince) Shen

  • Profile Parameter : Time out for executing query on the web

    Hi gurus,
    I am executing queries on the web directly. This can be done from query designer with the button that says "Execute query on web". The problem is that for queries that take more than 600 Secs to run, I get an Application timed out error. Queries that take less than this run smoothly.
    Can anyone please tell me the profile parameter associated with this particular setting. It is not rdisp/max_wprun_time, I know for sure since the value for this profile parameter in my system is 9999. Please help.
    Thanks & rgds,
    Sree

    Issue resolved.
    Profile Paramter - icm/server_port_0
    Current Value - PROT=HTTP,PORT=8000,TIMEOUT=60,PROCTIMEOUT=600
    Changed to - PROT=HTTP,PORT=8000,TIMEOUT=60,PROCTIMEOUT=3600
    rgds,
    Sree

  • User Profile Parameter ID KVS not work

    Hi,
    I've got some troubles with parameter id KVS. I set it in my user profile,
    parameter = KVS    
    value = B2   
    description = Version (CO)
    when I call report GPCQE53LSADXCC16KZ1R96N5156001, there are two fields with this parameter,
    and their value remain "0" instead of "B2".
    I need to put the parameter value on one of this two fields, how can I do?
    Could someone help me?
    thank you in advance,
    Fede

    You can run Incremental Sync from user profile 3-4 times. This will delete the user profile from SharePoint UPA.
    Now, we need to run UPA clean job timer job available in Job Definition inside central administration.
    This is a by design issue which you have raised. But, to get it done on the same day you need to follow above mentioned steps. This would be done in some hour and cannot be achieved in 4-5 minutes. So, your original request is a by design issue and can be
    done i some hours.
    Thank You, Pallav S. Srivastav ----- If this helped you resolve your issue, please mark it Answered.

  • Setting profile parameter icm/HTTP/error_templ_path

    Hi, I have a SAP Enterprsie Portal installation with only java stack (no abap stack),
    i want to set a profile parameter icm/HTTP/error_templ_path,
    please direct me how to set this parameter, 
    also, i need this parameter to be applicable for the SAP web dispatcher, i mean it should be effective for all java instances (i have 2 java instances),
    please help,.......................as there is no ABAP stack, i dont know where to set this parameter

    That parameter you mentioned describes of where the error templates can be found
    You can generate your own static or dynamic error pages for the ICM
    which are sent to the client if an error occurs. Use this parameter
    to specify the directory in which the ICM can find the pages.
    If this parameter is not set, the ICM returns its own static error
    page.
    For information about how to generate the error pages, see the
    documentation in the SAP Library or using the Help Portal.
    SAP Web Application Server -> Client/Server Technology ->
    Architecture of the SAP Web Application Server -> SAP Web
    Application Server Components -> Internet Communication Manager ->
    Error Handling Using the ICM.
    Eventhough u have only java stack u'll have an ICM.
    Since the value for the parameter is just a string mentioning the path of the folder which contains the customised web pages.
    Mention the same path in all the instance profiles (in your case 2 java instances).

  • "Cannot evaluate parameter 'NewName' because its argument input did not produce any output." error received

    I need to rename a set of files with a subset of the files' original name. I wrote this script:
    dir | rename-item -newname {if ($_.name -match '\d{4,5}\-\d{5}\s\-\s(.+)\s\-\s.+\s\-\s.+'){$name=$matches[1]; -replace '.+', "$name";}}
    This works in that the file and/or directory names are changed, but it also gives me the error:
    Rename-Item : Cannot evaluate parameter 'NewName' because its argument input did not produce any output.
    At C:\...\FileStrip.ps1:1 char:28
    + dir | rename-item -newname {if ($_.name -match '\d{4,5}\-\d{5}\s\-\s(.+)\s\-\s.+ ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Vivek Shyam:PSObject) [Rename-Item], ParameterBindingException
        + FullyQualifiedErrorId : ScriptBlockArgumentNoOutput,Microsoft.PowerShell.Commands.RenameItemCommand
    I'm not sure how to fix this. Any assistance would be appreciated.

    ok, thanks.
    You've avoided the whole 'use the piped data implicitly' thing by the explicit ForEach. I'm ok with that, but I'm still curious how to get the non-ForEach version to not error.
    Anyway, what you provided almost worked. I modified to be this:
    dir -file |
       Where{$_.name -match '\d{4,5}\-\d{5}\s\-\s(.+)\s\-\s.+\s\-\s.+'} |
       ForEach-Object{
            $match=$matches[1]
            $newname=$_.Name -replace '.+', "$match"
            Rename-item $_ $newname
    to get it working properly.
    But it looks like the simplest form is:
    dir -file |
       Where{$_.name -match '\d{4,5}\-\d{5}\s\-\s(.+)\s\-\s.+\s\-\s.+'} |
       ForEach-Object{
            Rename-item $_ $matches[1]

  • SAP Security audit log and Profile Parameter rsau/enable

    Does the Profile Parameter rsau/enable have to ="1" for the audit log to be active or is this parameter set to purely allow the maintainance of static profiles. I have been reading into SAP's documentation and they only refer to this parameter in the "Maintaining Static Profiles" section. Therefore I would like to know if the audit log can record when the parameter rsau/enable = "0"?
    Many thanks

    Hi
    I have it running on my NW2004s sneak peak system, whit a dynamic filter and the rsau/enable = 0. So Yes - it's possible to record in the secure audit log with rsau/enable = "0", if your using the dynamic filters
    Regards
    Morten Nielsen

  • Is it possible to declare method with non-finite argument list ?

    Hi, everyone,
    Is it possible to declare method with non-finite argument list
    and to read values of these arguments inside this method ?
    I'm not talking about main() method (i know it can), but
    values to this method are passed through array. That won't do
    do for me.
    If it is possible, could someone show an example how to do this.

    void method(Object[]o)
    for (int i=0; i<o.length; i++)
    if (oinstanceof Integer)
    System.out.println("is is an integer: "+o[i]);
    else if (o[i]instanceof Point)
    System.out.println("is is an Point: "+((Point)o[i]).x+"/"+((Point)o[i]).y);
    else if (o[i]instanceof String)
    System.out.println("is is an String: "+o[i]);
    if you call it like
    method(new Object[]{new Integer(123), "Hello!", new Point(100, 200), "goodbye!"});then the method will output:
    is is an integer: 123
    is is an String: Hello!
    is is an Point: 100/200
    is is an String: Goodbye!
    this is as powerful as varible parameter counts like in c, and it it typesafe.

  • Creating a Perl script for SAP sytem profile parameter

    Hi,
    I need to create a perl script for all th eprofile parameter to check as a security directive ,so that whenever the system is started it checks for this profile parameter.
    As per my company sap directive ,these are the profile parameter i need to set.
    Can anyone let me know how to write the scripts.
    login/min_password_lng Minimum password length for user password 320 Min.
    8
    login/password_expiration_t
    ime
    Number of days between forced password change. 0 Max.
    35
    login/fails_to_session_end Number of invalid logon attempts allowed before the
    SAP GUI is disconnected.
    3 Max.
    3
    login/fails_to_user_lock Number of invalid logon attempts before the user id is
    automatically locked by the system.
    12 Max.
    6
    rdisp/gui_auto_logout Time, in seconds, that SAPGUI is automatically disconnected
    because of in-activity.
    0 60-
    7200
    21
    auth/test_mode Jump into report RSUSR400 at every authority check N N22
    auth/system_access_check_
    off
    Switch off automatic authority check for special ABAP
    commands
    0 0
    auth/no_check_in_some_ca
    ses
    Special authorization checks turned off by customer.
    Enabling of Profile Generator
    N/Y23 Y
    login/ext_security Security access controlled by external software. N N24
    auth/rfc_authority_check Permission for remote function calls from within ABAP
    programs
    0 1
    login/failed_user_auto_unlo
    ck
    Enable system function for automatic unlock of users
    at midnight. (0 = locks remain)
    0 0
    login/
    no_automatic_user_sapstar
    (as of 3.1h)
    login/no_automatic_user_sa
    p* (prior to 3.1h)
    Disable ability to logon as SAP* with PASS as password
    when SAP* deleted.
    0 125,26
    auth/tcodes_not_checked TCode checking for SU53 & SU56 analysis disabled (empty
    "SU5
    3
    Regards,
    Chetan.

    Here's a simple perl script that should help you get what it is you're looking for - you can add all the parameters you want to search for, I just took a few of them:
    #!/usr/bin/perl -w
    use strict;
    use sapnwrfc;
    SAPNW::Rfc->load_config;
    my $rfc = SAPNW::Rfc->rfc_connect;
    my @parms = (   "login/min_password_lng",
              "login/password_expiration_time",
              "login/fails_to_session_end",
              "login/fails_to_user_lock" );
    for my $x (0 .. $#parms) {
         my $rcc = $rfc->function_lookup("SXPG_PROFILE_PARAMETER_GET");
         my $slr = $rcc->create_function_call;
         $slr->PARAMETER_NAME($parms[$x]);
         $slr->invoke;
         print "Value for $parms[$x] is: ".$slr->PARAMETER_VALUE."\n";
    $rfc->disconnect();
    And running it, you'll get:
    [dhull@397 scripts]$ ./read-profile.pl
    Value for login/min_password_lng is: 7
    Value for login/password_expiration_time is: 90
    Value for login/fails_to_session_end is: 3
    Value for login/fails_to_user_lock is: 6
    [dhull@397 scripts]$
    If you need to get your perl environment read to make RFC calls to your SAP system, check my series of blogs on how to do so here:
    https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/u/251752730
    Cheers,
    David.

  • Glitch with less

    Sorry if this has been covered, it's a tough one to search for.
    I first noticed this with man, but later duplicated it with less directly.  It appears to only occur in vc/1.
    Basically, when I read a man page or pipe something into less that's longer than a page, I get 4 lines which don't update at the top.  They're written with the initial top 4 lines, but as I page down they don't update.  Then, when I page up line 1 updates, but the entire rest of the document doesn't (not just the other 3 lines.)  If I scroll up and down short distances a few times, I end up with mixed up lines all through the document.
    more works, as does most
    At first I thought it only happened after I first logged in, and had something to do with the login message (immediately after login, 4 lines are used.)  Unfortunately, a 'clear' in /etc/profile didn't help.
    I commented out everything in /etc/rc.local to no avail, same with the removal of kernel options.
    I even resorted to a 'pacman -Sc; pacman -U /var/cache/pacman/pkg/*.pkg.tar.gz'
    After exiting less, the top 4 lines continue to not update, even if I issue a few commands to advance the post-less output into those lines.  Issuing 'clear' fixes it until I use 'less' again.
    I'm happily using 'most' for man pages, and have an alias set up, but damnit, it shouldn't do this.

    Could you see if this still occurs with hardware acceleration disabled?
    How do I disable or enable hardware acceleration?
    If so, please try updating your video drivers and try again.
    Windows: how do I update the device driver for my video/display adapter?

  • Cannot assign an empty string to a parameter with JDBC type VARCHAR

    Hi,
    I am seeing the aforementioned error in the logs. I am guessing its happening whenever I am starting an agent instance in PCo. Can somebody explain whats going on?
    Regards,
    Chanti.
    Heres the complete detail from logs -
    Log Record Details   
    Message: Unable to retreive path for , com.sap.sql.log.OpenSQLException: Failed to set the parameter 1 of the statement >>SELECT ID, PARENTID, FULLPATH, CREATED, CREATEDBY, MODIFIED, MODIFIEDBY, REMOTEPATH, CHECKEDOUTBY FROM XMII_PATHS WHERE FULLPATH =  ?  <<: Cannot assign an empty string to a parameter with JDBC type >>VARCHAR<<.
    Date: 2010-03-12
    Time: 11:32:37:435
    Category: com.sap.xmii.system.FileManager
    Location: com.sap.xmii.system.FileManager
    Application: sap.com/xappsxmiiear

    Sounds like a UI browsing bug (when no path is selected from a catalog tree folder browser) - I would suggest logging a support ticket so that it can be addressed.

  • Unable to bind portlet parameter with page parameter in webcenter portal

    Hi All,
    I am trying to bind portlet parameter with the page parameter so that I can ahieve some business requirements.
    Here is what I did,
    In my Portlet producer application:
    1) Created standards based portlet (jsr 286) with view.jspx and edit.jspx with rest of the things being default.
    2) In my portlet.xml created two parameters and assigned these parameters to the portlet created above.
    3) In the view.jspx added couple of output label adf components in the page.
    4) deployed this to integrated weblogic server.
    In my WC portal application:
    Created a new page and added the portlet to this page( WSRP connection already exists).
    deployed portal application on integrated server.
    In the edit mode of the page I added one page parameter(Param1) and some default (constant) value added.
    What I want is this:
    when Param1 value is One display first output label and
    when Param1 value is Two display second output label.
    I am using jdev 11.1.1.5.0 with integrated weblogic server.

    There is no need to use page parameters for this.
    You also have two types of parameters depending on what you want...
    1) Preferences: these parameters can be used on a user based level. This means that users can personalize the portlets. When a user change the value of a preference, it is only applied for that specific user
    2) Public parameters: these parameters are used to customize the portlet. The value you set in these parameter apply for all users.
    I have made a simple example to show these two differences: http://www.yonaweb.be/PortletTest.zip
    The portlet has 4 inputText on it. The first two can be set by specifying One or Two into the preference.
    The other 2 inputText uses the value of the public parameter.
    You should only deploy the portlet and consume it in a webcenter application. In the webcenter application, you don't need to do anything special. All is done in the portlet.
    I am guessing you don't have written the code that will get the value of the parameter:
    in case of a preference you will get the value by following code:
       PortletRequest request = (PortletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
       PortletPreferences preferences = request.getPreferences();
       return preferences.getValue("outputparam", "One");In case of a public parameter (for customization instead of personalization) you use following code to retreive the value of a public parameter:
    PortletRequest req = (PortletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
      String param = (String)req.getParameter("PublicParam");
      if(param == null)
          return "Three";
      return param;This code can also be found in the sample portlet application.

  • Multiple windows of the same class with a different argument

    Suppose I have a main window with a list of users. If I click on any one user, the "chat window" should open with the argument as that "user".
    If i click on another, a similar "chat window" should open but with a different user.
    I can't have so many stages because I don't know how many users are there.
    How do I open multiple windows of the same class but with a different argument?

    Here is a sample (opens, at random locations, a bunch of child windows parameterized by color).
    Could be simpler, but hopefully you get the gist.
    import java.util.Random;
    import javafx.application.Application;
    import javafx.geometry.Rectangle2D;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.layout.StackPane;
    import javafx.stage.*;
    public class ColoredStages extends Application {
      final String[] colors = { "firebrick", "palegreen", "azure", "chocolate", "goldenrod" };
      final Random random = new Random(42);
      Rectangle2D screenBounds;
      public static void main(String[] args) { launch(args); }
      @Override public void start(Stage stage) {
        screenBounds = Screen.getPrimary().getVisualBounds();
        stage.setTitle("Primary");
        stage.setScene(new ColoredScene("cornsilk"));
        stage.show();
        for (String color : colors) {
          Stage coloredStage = new ColoredStage(stage, color);
          coloredStage.show();
      class ColoredStage extends Stage {
        ColoredStage(Stage owner, String color) {
          super();
          initOwner(owner);
          initStyle(StageStyle.UTILITY);
          setX(screenBounds.getMinX() + random.nextInt((int) screenBounds.getWidth()));
          setY(screenBounds.getMinY() + random.nextInt((int) screenBounds.getHeight()));
          setScene(new ColoredScene(color));
      class ColoredScene extends Scene {
        ColoredScene(String color) {
          super(new StackPane());
          StackPane layout = (StackPane) getRoot();
          layout.getChildren().addAll(new Label(color));
          layout.setStyle("-fx-font-size: 20px; -fx-padding: 30px; -fx-background-color: " + color);
    }

Maybe you are looking for