Dynamically set Property (Read-Only,Changeable...) of an attribute

Hi,
I have a requirement to change an attributes display to 'READ-ONLY' on a specific condition during CREATE or EDIT operation.
I have written the following lines of code to achiveve the same, but i get an error :-
data : lr_prop    TYPE REF TO if_genil_obj_attr_properties.
if cond1 =  true.
lr_prop->set_property_by_name( iv_name = 'PROBABILITY' iv_value = if_genil_obj_attr_properties=>read_only ). --> error-line
endif.
Can you please suggest what's gone wrong?
Thanks
Dedeepya

But GET_I* is called before DO_PREPARE_OUTPUT, and the variables in GET_I* are not recognized in DO_PREPARE_**...
Current Code :-
GET_I_PROBABILITY
*CALL METHOD SUPER->GET_I_PROBABILITY
**  EXPORTING
**    iterator    =
*  RECEIVING
*    RV_DISABLED =.
  DATA :   lr_btopporth TYPE REF TO cl_crm_bol_entity,
           lv_read      TYPE crmt_genil_attr_property,
           lv_phase     TYPE string, lv_process TYPE string,
           current      TYPE REF TO if_bol_bo_property_access,
           property     TYPE REF TO cl_crm_bol_entity.
IF iterator IS BOUND.
    current = iterator->get_current( ).
  ELSE.
    current = collection_wrapper->get_current( ).
  ENDIF.
     IF current->is_property_readonly( 'PROBABILITY' ) = abap_false. "#EC NOTEXT
        CALL METHOD current->get_property_as_value
          EXPORTING
            iv_attr_name = 'CURR_PHASE'
          IMPORTING
            ev_result    = lv_phase.
        CALL METHOD property->get_property_modifier
          EXPORTING
            iv_attr_name = 'PROBABILITY'
          RECEIVING
            rv_result    = lv_read.
      ENDIF.
DO_PREPARE_OUTPUT
*CALL METHOD SUPER->DO_PREPARE_OUTPUT
**  EXPORTING
**    iv_first_time = ABAP_FALSE
  DATA : lr_btadminh  TYPE REF TO cl_crm_bol_entity,
         lv_process TYPE string.
  CALL METHOD lr_btadminh->get_property_as_value
    EXPORTING
      iv_attr_name = 'PROCESS_TYPE'
    IMPORTING
      ev_result    = lv_process.
IF ( lv_process EQ 'ZPPT' AND lv_phase = 'ZA' ) OR ( lv_process EQ 'ZPT2' ).
*    lv_read = lr_btopporth->get_property_modifier( 'PROBABILITY' ).
    IF lr_prop->get_property_by_name( 'PROBABILITY' ) EQ if_genil_obj_attr_properties=>changeable.
      "-- <ZPPT-> Business/Affaire> "-- <ZPT2-> Prospection>  "-- <ZA-> Finale>
      lr_prop->set_property_by_name( iv_name = 'PROBABILITY' iv_value = if_genil_obj_attr_properties=>read_only ).
    ENDIF.
  ENDIF.

Similar Messages

  • How to set the read only property for dynamic ALV column

    Hi All,
    I have built one dynamiv ALV and I have one name column inside that ALV for which I have to set read only property based on two column fields that exist in the same ALV,say IS_SP and IS_CORP of type boolean.
    If any one of the flag is 'X',i have to make that name column as display only and
    If both flag are not set,it should be displayed as ediatable column.
    I have written one method as INIT_ALV which gets called when ALV is loaded.
    Code is as  follows:
      lr_column_settings ?= wd_this->alv_all_roles.
      lt_columns = lr_column_settings->get_columns( ).
    LOOP AT lt_columns INTO ls_column.
    CASE ls_column-id.
       WHEN <NAMECOLUMN>. "name column which should be editable/display
    Create Input Field
            CREATE OBJECT lr_uie_input_field_ro
              EXPORTING
                value_fieldname = ls_column-id.
         ls_column-r_column->set_cell_editor( lr_uie_input_field_ro ).
        After this,I have to set the read only property based on IS_SP and IS_CORP values,
              CALL METHOD lr_uie_input_field_ro->set_read_only_fieldname
              EXPORTING
                *value = 'IS_SP' or 'IS_CORP'
    ENDLOOP.
    I dont want to use cell variants also.
    Help me to achieve this.
    Thanks and Regards,
    Divya

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • Why is URLResource url property read-only?

    Why is URLResource url property read-only?

    We didn't have a reason to make it writeable.  Typically it's set in the constructor and never needs to change.  Do you have a case where you want to change it and creating a new URLResource isn't possible?

  • Permissions on Android AT200 removable SD card set to read only

    Recently the removale SD card on my at200 has been set to read only for all but a few applications. This mean that when editing or trying to save, copy docs on the SD card I get the "not enough permissions" message. Any editing by these applications requires shifting files to onboard SD card and back again.
    Toshiba file manager is able to rw OK, but my other file manager fails, as does ezy PDF.
    Reading the attributes of the SD card show that it is set to rw for data.p (permissions XML). But looking at info from file manager shows sdcard directories and files set to dr- or -r-.
    Is there some way of getting this changed to allow access for all my installed apps? Or even some?
    Cheers
    rabel

    MisterX,
    Found this note from zc2 on the xda forum dealing with the same issue December 2011.
    "The owners of Honeycomb-powered tablets experience a problem writing to the external SD card, because since v3.2 the permissions for the files there were changed from sdcard_rw to media_rw.
    According the file /system/etc/permissions/platform.xml, any application with declared permission "android.permission.WRITE_MEDIA_STORAGE" should be included to that media_rw group.
    But that won't happen.
    I made a test application to show the group membership (it just executes the "id" command), and according to its output, the application is not member of the media_rw group, despite the "android.permission.WRITE_MEDIA_STORAGE" permission is mentioned in its manifest.xml"
    This is somewhat confirmed by a comment returned to me from the AntTek File Explorer developers on an interum work around for this problem (a common one since 3.2)
    "While waiting, the simple solution, if your device is rooted, is as follows:
    1. Using AntTek File Explorer, active Native mode from application preference.
    2. Navigate to /system/etc/permissions.
    3. Open platform.xml and find the WRITE_EXTERNAL_STORAGE permission.
    4. Add an additional group definition for this permission: <group gid="media_rw" />. It will grant AntTek Explorer (and other applications) permission to writing to removable SD Card. After edited, it will look like:
    <permission name="android.permission.WRITE_EXTERNAL_STORAGE">
    <group gid="sdcard_rw" />
    <group gid="media_rw" />
    </permission>
    5. Save the changes to the file.
    6. Restart your tablet."
    My tablet is not rooted so this was not available to me, but it appears this is a major issue for Honeycomb, including the version on the AT200. Is there any plans to fix this bug do you think? Or is there a date for the promised update to ICS for the AT200, another prime selling point.
    Cheers

  • Set to read only

    in  sender file adapter in processing mode what is the use of set to read only  option
    regards
    raghu

    Hi,
    This set to read only mode for sender file communication channel will process the fiels have write permission and change it to Read only to not to modify it later on.
    this option is available for NFS only (Native file system)
    Thanks
    Swarup

  • Accidently changed the "ownership & permissions" access admin setting to "read only"

    In the "Get Info" window on my MacBook hard drive icon, I accidently changed the "ownership & permissions" access admin setting to "read only" & now it won't re-boot the operating system. Just displays the Apple logo & running wheel on a white screen . Any advice on how best to re-set/restore would be very much appreciated, thanks

    This might help. Otherwise, it might be necessary to reinstall.
    https://discussions.apple.com/docs/DOC-2240

  • Is ProPhoto.icm's permissions suppose to be set to Read Only in CS2/OS X?

    I went rummaging around Application Support>Adobe>Color>Profiles and found ProPhoto.icm is set to Read Only as seen in the Get Info Window in CS2 OS 10.3.9.
    All the other profiles in this folder are set to Read and Write as are the rest of the Colorsync profiles in the system. Colorsync Utility's Profile First Aid reports ProPhoto needs fixing reporting "Header white point is not D50". Of course it can't fix it because it reports it is locked.
    Is there a reason it's locked or is this a repair permission issue?
    The only way for me to make ProPhoto Read and Write is to drag a copy to the desktop and change it in the Get Info Window. It's grayed out when it's in the Application Support folder.
    I'm using a third party RAW converter-(Raw Developer) with ProPhoto set as my output space and I'm wondering if this permission setting is causing it to randomly crash.

    Ok - I understand now, but I'm not able to duplicate this behavior. When I create a group web calendar that anyone can view but only group members can edit, clicking on a time block (to create a new event) opens a login window. I noted that while it does appear to create an event, but when I navigate away from, then back to the web calendar, that event is no longer there. Also, it doesn't show up in the 'Upcoming Events' sidebar on the Wiki's home page.
    If I double-click on an existing event, the event opens as if it's going to allow me to edit it. But once I click the 'OK' button, a login window opens. Still, it seems as if I was able to edit the event...until I navigate away, then back to the web calendar page. Then all changes are gone. So it does give the illusion that events can be created/edited by non-group members.
    By any chance, are you logged in as a non-group member when you try to create/edit a calendar event, and are these users included in the list of those that can create Wiki's in Server Admin?
    BTW: I'm not using Sunbird.

  • My calendar is set at "read only" on my iPhone how do i get access

    My calendar is set at "read only" on my iPhone how do i get access

    Contact the person who 'gave' you the iPhone and have follow this link:
    Prepare your device to sell or give away
    If they do not have the AppleID and passcode requested, turn the iPhone
    in to your local authorities as it is stolen or lost, and in either case it is not yours
    nor does it belong to the person who gave it to you.
    There is no workaround for Activation Lock.
    iCloud: Find My iPhone Activation Lock in iOS 7 & later
    http://support.apple.com/kb/HT5818?viewlocale=en_US&locale=en_US
    http://support.apple.com/kb/TS4515

  • Changing sales employee on document set to read only

    *Our customer has invoices set to read only for certain users.  however they need these users to be able to change just one field - sales employee.*
    *Is there anyway this can be achieved??
    Edited by: Samantha Glanville on Oct 8, 2009 3:25 PM

    If it set up as read only, there is no room for updating even only one field.  Better leave this to other more powerful user to change.  Otherwise, the read only setting would be overridden.
    Thanks,
    Gordon

  • My shared files are all set as read only. How do I sort this out?

    I am trying to set up our iMac and MacBook so that they share files.
    In System Preferences/Sharing I have set the File sharing to ON, I have selected which folders are to be shared and I have set it so that everyone can read and write the files.
    In the iMac files when you check various properties NONE are set as read only, however, when the files are access from the MacBook they are all READ ONLY.
    What am I doing wrong and how do I sort this out so that I can access files from either computer and amend and save them without having to change file names?
    Please help!!
    Karl

    I have had similar problems and have given up trying to use the "everyone" user setting.  Instead, to give shared access to a folder I add specific users and then set their access level.  To add users to a folders sharing profile click on the [+] button at the bottom of the Users column.

  • JS CS3: Is a property read only? How to find out...

    Hello all,
    I found out about the x.reflect.properties object and find it very helpful in my current project.
    Now I know how to find out about the properties of a dynamically given object :)
    But here's the rub: is there any better way to find out if I can actually change one of those properties (i.e. whether it is not "read-only") other than just to try {} catch(){} it?
    Thank you
    Gerald

    [email protected] wrote:
    > Hello all,
    >
    > I found out about the x.reflect.properties object and find it very helpful in my current project.
    >
    > Now I know how to find out about the properties of a dynamically given object :)
    >
    > But here's the rub: is there any better way to find out if I can actually change one of those properties (i.e. whether it is not "read-only") other than just to try {} catch(){} it?
    From the JS Tools Guide
    ReflectionInfo.type (String)
    The type of the reflected element. One of:
    readonly: A Read only property.
    readwrite: A read-write property.
    createonly: A property that is valid only during creation of an
    object.
    method: A method.
    for photoshop scripting solutions of all sorts
    contact: [email protected]

  • Property Read Only

    Hello, I would like to change "contenttype" property for document in my programm, but when I doing this Exception raise:
    ResourceException---com.sapportals.wcm.repository.PropertyReadOnlyException:
    Read-only property: {http://sapportals.com/xmlns/cm}contenttype
    I look over over all folder above this file, and everywear Read Only checkbox is unmarked and everyone group have full rights.
    What is this?
    (EP6.0 SP9)

    Not sure how to define "extended information about the CR Object Model", but there is the following:
    [CR 2008 developer library|http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm]
    [API reference|http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_apiRef_12_en.chm]
    [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23]
    Samples:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples
    Re. margins, see the KB [1313082 - Printer Margin Settings set in the Crystal Reports Designer not respected in VS .NET application|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333333313333333033383332%7D.do].
    A while back I did a fair bit od playing with this and the code as bellow worked fine:
    ReportDocument myReport = new ReportDocument();
    myReport.Load(....rpt");
    PageMargins myMargin = new PageMargins();
    myMargin = myReport.PrintOptions.PageMargins;
    myMargin.topMargin = 240;
    myMargin.bottomMargin = 240;
    myMargin.rightMargin = 240;
    myMargin.leftMargin = 240;
    myReport.PrintOptions.ApplyPageMargins(myMargin);
    - Ludek

  • After 10.5.3 update, Time Machine disk getting set to read-only

    "The Further Adventures of Time Machine..."
    Since applying the 10.5.3 update, Time Machine (or something) seems to be randomly setting my backup disk (external Western Digital "My Book Studio Edition" 500GB) to read-only which, of course, brings Time Machine backups to a halt. I can generally just restart my MacBook Pro and all is well again but then after a few more hourly backups, it will go back to read-only status again. There's a couple of things about this that are odd:
    1) Even if I open "Get Info" and try to reset the permissions on the drive, I'm locked out of doing so even though I'm the admin. What's even odder (more odd?), my user and "staff" show read & write but about the user name list, it states "You can only read"!?
    2) I have this disk partitioned and even the partitions are read-only. Disk Utility reports the entire disk is locked.
    Like I said, this has only start happening since 10.5.3 update.
    Regards,
    Terry

    Here's the latest:
    Also, the time machine back up drive had been smooth sailing since I hooked it up. Never had an ounce of problems until 10.5.3.
    Format is Mac OS Extended.
    Thanks.
    CP
    Last login: Mon Jun 9 18:36:23 on ttys000
    cpstaley:~ cpstaley$ ls -aleO@ /Volumes/iMac\ Back-Up
    total 9008
    drwxrwxr-t@ 35 root admin - 1258 Jan 3 20:22 .
    com.apple.FinderInfo 32
    drwxrwxrwt@ 7 root admin hidden 238 Jun 5 21:04 ..
    com.apple.FinderInfo 32
    -r-------- 1 root wheel - 16 Dec 31 20:43 .0011243977f4
    -rw-rw-r--@ 1 cpstaley admin hidden 12292 Feb 18 21:26 .DS_Store
    com.apple.FinderInfo 32
    -rw-rw-rw- 1 cpstaley cpstaley - 862 Dec 31 16:12 .MaxSyncConfig
    drw------- 3 root admin hidden 102 Dec 31 20:43 .Spotlight-V100
    drwxrwxrwt@ 3 cpstaley admin hidden 102 Jan 3 20:22 .TemporaryItems
    com.apple.FinderInfo 32
    d-wx-wx-wt 2 root admin hidden 68 Jun 5 16:46 .Trashes
    -rw-r--r--@ 1 cpstaley admin hidden 135038 Jan 1 20:15 .VolumeIcon.icns
    com.apple.FinderInfo 32
    -rw-r--r-- 1 cpstaley admin - 59078 Aug 31 2007 .VolumeIcon.icns.candybarbackup
    -rw-r--r-- 1 root admin - 0 Dec 31 19:52 .com.apple.timemachine.supported
    drwx------ 96 root admin - 3264 Jun 5 03:30 .fseventsd
    drwxrwxr-x@ 122 root admin - 4148 Dec 31 15:49 Applications
    com.apple.FinderInfo 32
    drwxr-xr-x+ 3 root admin - 102 Dec 31 20:44 Backups.backupdb
    0: group:everyone deny addfile,delete,add_subdirectory,deletechild,writeattr,writeextattr,chown
    -rw-r--r--@ 1 root cpstaley hidden 6656 Dec 31 19:50 Desktop DB
    com.apple.FinderInfo 32
    -rw-r--r--@ 1 root cpstaley hidden 11522 Dec 31 19:30 Desktop DF
    com.apple.FinderInfo 32
    drwxrwxr-t@ 48 root admin - 1632 Dec 31 15:49 Library
    com.apple.FinderInfo 32
    drwxr-xr-x 2 root wheel - 68 Dec 31 15:52 Network
    drwxr-xr-x 4 root wheel - 136 Nov 26 2007 System
    lrwxr-xr-x 1 root admin - 60 Dec 31 19:19 User Guides And Information -> /Library/Documentation/User Guides and Information.localized
    drwxrwxr-t 7 root admin - 238 Dec 31 19:34 Users
    drwxrwxrwt@ 3 root admin hidden 102 Dec 31 16:33 Volumes
    com.apple.FinderInfo 32
    drwxr-xr-x@ 4 root admin hidden 136 Aug 30 2007 automount
    com.apple.FinderInfo 32
    drwxr-xr-x@ 40 root wheel hidden 1360 Nov 26 2007 bin
    com.apple.FinderInfo 32
    drwxrwxr-t@ 2 root admin hidden 68 Mar 22 2005 cores
    com.apple.FinderInfo 32
    dr-xr-xr-x 2 root wheel - 68 Dec 31 15:51 dev
    lrwxr-xr-x@ 1 root admin hidden 11 Dec 31 19:19 etc -> private/etc
    com.apple.FinderInfo 32
    -rw-r--r--@ 1 root wheel hidden 4352200 Oct 10 2007 mach_kernel
    com.apple.FinderInfo 32
    drwxr-xr-x@ 6 root wheel hidden 204 Dec 31 15:51 private
    com.apple.FinderInfo 32
    drwxr-xr-x@ 63 root wheel hidden 2142 Dec 26 13:32 sbin
    com.apple.FinderInfo 32
    lrwxr-xr-x@ 1 root admin hidden 11 Dec 31 19:19 tmp -> private/tmp
    com.apple.FinderInfo 32
    drwxr-xr-x@ 9 root wheel - 306 Sep 10 2007 usr
    com.apple.FinderInfo 32
    lrwxr-xr-x@ 1 root admin hidden 11 Dec 31 19:19 var -> private/var
    com.apple.FinderInfo 32

  • How set as Read only file.

    How can I set my spreadsheet I just made into a "read only" Format?

    eroom,
    Also, you may select your file in the Finder and CTRL-Click or Right-Click and select Get Info. Then, Check the 'Locked' check box.
    Jerry

  • USB hard drive is set to read only?

    I'm am very new to Mac (my first one). I plug my USB Seagate drive into the Mac and it reads it fine, but says everything is read only. How do i set it up to allow the Mac to modify the files? Does the hard drive have to be reformatted to a Mac OS and/or is it possible to use the same hard drive on the Mac and PC. I have windows XP Pro SP3 installed using VM Fusion as well.
    I have done a lot of video editing Windows based and very rarely moved the files to my PC hard drive. I have to assume you can do the same with Mac, however I have been able to figure out how to do this in iMovie 2009.
    Thanks in advance,

    BRDVPRA,
    Your external drive is undoubtedly formatted as NTFS. As you already know, your Mac can read this format, but it cannot write to it. There are some third-party shareware applications that will allow your Mac to write to the NTFS volume; search for these on versiontracker.com, if you want to give this a try.
    The native Mac format is HFS+ (Mac OS Extended), which cannot be read natively by Windows. Again, there are third-party solutions for this (specifically, a Windows app called "MacDrive," also available on versiontracker.com).
    The only format that will allow reading and writing from both OS X and Windows is the FAT-32 format (called MS-DOS in Disk Utility). This format is older, and less compatible with modern file formats. For example, it will not support files larger than 4 GBs.
    The question that needs answering is whether or not you will using this drive cross-platform, or whether it will be dedicated solely to OS X. If the former, you'll need to use either the FAT-32 format or some third-party solution. If this drive will only be accessed from OS X in the future, you should copy the data, format it as HFS+ (Mac OS Extended), then return the data to it.
    Scott

Maybe you are looking for

  • How do I use the USB port on my MBP for audio output

    I am a fairly new commercial sound provider running live sound and the occassional itunes type playback at events.  I currently use a Y cable from the headphone output of my MBP osX  into the RCA inputs on my audio mixer.  On an older HP laptop I was

  • Write XML file on client

    I'm trying to generate XML files on a client machine. I'm using SQL*Plus Instant Client v 10.1.0.4.0 connected to DB version 10.1.0.3.0. I've created a view of XMLType and am able to select XML from this view. I've been unable to figure out a way to

  • Excel download from ALV not working inproduction

    Hi all, I am using "set_table_for_first_display" for alv display. the excel download from alv is woking fine in development and quality stystem but in production only first 3-4 rows are getting downloaded. Other rows donot appear in excel. Any Idea !

  • Installation Disks Issue

    Having misplaced my installation DVDs I ordered a replacement from Apple(they now charge $16 US....was heretofore free). When I received my order I found that only disk #1 was included. I called AppleCare and as told that disk 1 contains everything t

  • Updating Primary key while creating entries

    Hi All, I have a requirement to update a primary key while the entry is being created in the database table. The program uses the INSERT statement to create entries but the primary key is unknown at that time. I want to create this primary key value