Unprotect a Protected Field?

I am trying to change the GL Account in Code 1 below. However, when the logic flows into CODE2, the field is protected = 'X'. And, the field is not changeable on the Purchase Requisition tab as well for a scenario I am working on.
I assume that because it is not changeable, and 'protected', that my ABAP code can not change it? correct?
Is there a way to unprotect it, or is this something configured in SPRO for a Purchase Requisition?
CODE1: Is my custom code.
CODE2: Is the SAP code that my will flow into where this field appears to be unchangeable.
Thank-You
(CODE1)
METHOD IF_EX_ME_PROCESS_REQ_CUST~PROCESS_HEADER.
*Purchase Requisition Item Declarations
  DATA: LT_ITEMS        TYPE MMPUR_REQUISITION_ITEMS.
  DATA: LS_ITEM         TYPE MEREQ_ITEM.
  FIELD-SYMBOLS: <FS_ITEM> TYPE LINE OF MMPUR_REQUISITION_ITEMS.
*Purchase Requisition Accounting Declarations.
  DATA: LT_ACCT         TYPE MMPUR_ACCOUNTING_LIST.
  DATA: LS_ACCT         TYPE EXKN.
  DATA: LS_SETX          TYPE MEPOACCOUNTING_DATAX.
  FIELD-SYMBOLS: <FS_ACCT> TYPE LINE OF MMPUR_ACCOUNTING_LIST.
  CALL METHOD IM_HEADER->GET_ITEMS
    RECEIVING
      RE_ITEMS = LT_ITEMS.
  LOOP AT LT_ITEMS ASSIGNING <FS_ITEM>.
    LS_ITEM = <FS_ITEM>-ITEM->GET_DATA( ).
    LT_ACCT = <FS_ITEM>-ITEM->IF_ACCT_CONTAINER_MM~GET_ITEMS( ).
    LOOP AT LT_ACCT  ASSIGNING <FS_ACCT>.
      LS_ACCT =  <FS_ACCT>-MODEL->GET_EXKN( ).
      LS_ACCT-SAKTO = 'N500300   '.
      LS_SETX-SAKTO = 'X'.
      <FS_ACCT>-MODEL->SET_EXKN( LS_ACCT ).
      <FS_ACCT>-MODEL->SET_EXKNX( LS_SETX ).
    ENDLOOP.
  ENDLOOP.
ENDMETHOD.
(CODE2)
METHOD if_accounting_model_mm~set_exkn.
  DATA: ls_buffer     LIKE LINE OF my_data_input_buffer,
        ls_bufferx    LIKE LINE OF my_data_input_bufferx,
        l_buffered    TYPE sy-subrc,
        l_data_old    TYPE exkn,
        l_data_oldx   TYPE mepoaccounting_datax,
        l_data_newx   TYPE mepoaccounting_datax,
        l_indx        TYPE sy-tabix.      "1478013
  *PROTECT EQ 'X'
  CHECK my_state->protect EQ mmpur_no.

did you check the code written inside method PROTECT?

Similar Messages

  • MultiProvider report not functioning - overwriting protected field

    Hello,
    I have a multiprovider that combines data from the Sales Overview cube (0SD_C03) with a custom plan cube (data from COPA and SIS).  In writing queries off of the (active) multiprovider, short dumps occur except when only running against one infoprovider.  In other words, if the query is restricted to only show Sales data (0SD_C03), it works fine.  If the query is restricted to only show Plan data (custom plan cube), then it works fine.  However, the intersection of the two does not work - which is the entire functionality of the multiprovider (a join). 
    I've cut the query back to the very basics:  Fiscal Year and one Key Figure (that is present in both source infocubes).   Without specifying or splitting out the InfoProviders, it should combine the data (total the two), but instead creates a short dump.  Using a structure to split Actuals from Plan also results the short dump.  The only way to get the report to actually execute and return is to restrict it to just one InfoProvider.  I tried copying the MultiProvider and starting over, but that did not improve the situation.  The failure occurs after the variable screen has been filled in.  (Also tried w/out variables.)
    Using LISTCUBE, the data is found in a single execution (no filter applied to 0INFOPROV) and splits out to the two infoproviders w/ approp. fiscal year and Key Figure totals.  So there seems to be something at the reporting layer malfunctioning.
    Here's the ST22 short dump:
    Does anyone have any ideas?
    Runtime Error          MOVE_TO_LIT_NOTALLOWED_NODATA                                         
    Date and Time          07/17/2006 09:57:23                                                   
    ShrtText                                                                               
    Assignment error: Overwriting a protected field.                                        
    What happened?                                                                               
    Error in ABAP application program.                                                                               
    The current ABAP program "SAPLRSDRC" had to be terminated because one of the            
    statements could not be executed.                                                       
    This is probably due to an error in the ABAP program.
    rror analysis                                                                               
    The program tried to assign a new value to the field "<L_SX_OLAPQUERY>" even though it is protected against changes.                                                                               
    The following objects are protected:                                                       
       - Character or numeric literals                                                            
       - Constants (CONSTANTS)                                                                    
       - Parameters of the category IMPORTING REFERENCE for functions                             
         and methods                                                                               
    - Untyped field symbols to which a field has not yet been assigned                         
         using ASSIGN                                                                               
    - TABLES parameters if the corresponding actual parameter is protected                     
         against changes                                                                          
       - USING reference parameters and CHANGING parameters for FORMs if                          
         the actual parameter for this is protected against changes                               
       - Field symbols if the field assigned using ASSIGN or ASSIGNING                            
         is protected against changes                                                             
       - External write accesses to READ-ONLY attributes                                          
       - Key components of lines in internal tables of the type HASHED or                         
         SORTED TABLE                                                                               
    SORTED TABLE.    
    Message received in web report when failure occurs:
    Error when processing your request 
    Note
    The following error text was processed in the system BW1 : Assignment error: Overwriting a protected field.
    The error occurred on the application server bw_BW1_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Function: RSDRC_CUBE_DATA_GET_DISP of program SAPLRSDRC
    Function: RSDRC_MULTI_CUBE_DATA_GET_PARA of program SAPLRSDRC
    Function: RSDRC_MULTI_CUBE_DATA_GET of program SAPLRSDRC
    Form: DATA_GET of program SAPLRSDRC
    Function: RSDRC_CUBE_DATA_GET of program SAPLRSDRC
    Function: RSDRC_CUBE_DATA_GET_OLAP of program SAPLRSDRC
    Form: FILL_SP_1 of program SAPSRRK0
    Form: FILL_SP of program GP42GWU130B57UDR97PLRZOUC5Z
    Form: DATEN_LESEN of program SAPLRRK0
    Function: RRK_LIST_NOTIFY of program SAPLRRK0
    Thanks in advance!

    Hello
    Check OSS notes as below am not sure if it helps
    957439 - Query dumps with an error
    Below is for 3.5 and below ,just to let you know that there were similar problems in earlier version.
    941862 - *** Dump MOVE_TO_LIT_NOTALLOWED_NODATA with MultiProvider
    Chetan
    @CP..

  • Initializing a protected field in a subclass doesn't work

    Why doesn't this work? And if it shouldn't, how do I get around it?
    public abstract class Ship
         protected double rotationSpeed;
         protected aMethod()
              System.out.println(rotationSpeed);
    public abstract class Cruiser
         protected double rotationSpeed = 3;
    }I thought that when the method 'aMethod' it would print out '3' but it doesn't. I'm not sure why, I also tried this:
    public abstract class Cruiser
         public Cruiser()
              rotationSpeed = 3;
    But it didn't change it. How do I alter protected fields like this?

    happypigface wrote:
    Awesome, thanks, using super worked.You're welcome.
    Note that you don't need to use the 'super' keyword:
    class Cruiser extends Ship {
        public Cruiser() {
            rotationSpeed = 3; // this works too
    }but I find it clearer to use it.
    I didn't think it really mattered if I posted the code running it. I didn't really have one. The names of those fields and classes aren't real.
    ...IMO, it's best to post an SSCCE of the problem/question.

  • Password protect fields in interactive pdf

    Hi all,
    I have completed an interactive pdf online form and I want to make one of the sections (several fields) password protected. So two questions:
    How do you password protect fields?
    Do you have to apply password protection to each individual field or can you highlight a section (several fields) and password protect the whole section?
    Would really appreciate some help.
    Thanks so much. . .

    Many thanks George for your helpful advice. It is appreciated.
    Bridie Hanifee
    Pearson Trueman & Associates
    T:: +61 3 9864 7107
    F:: +61 3 9866 4811
    www.pearsontrueman.com<http://www.pearsontrueman.com>
    Please consider the environment before printing this email
    CAUTION - this message may contain privileged and confidential information intended only for the use of the addressee/s named above. If you are not the intended recipient of this message you are hereby notified that any use, dissemination, distribution, or reproduction of this message is prohibited. If you have received this message in error, please notify the sender immediately.

  • How to use reflection to get base classes protected field

    I have one base Base classes which have protected fields and public get method to get the field.
    class Base
    protected int proField;
    public int getProField(){return proField;}
    Class Derive extends base class Base
    class Derive extends Base implements OtherInterface
    public void funtion(){};
    Now I have an instance of Derive, how can I use reflection to get the protected field inherited from Base. It seems Java Reflection only give runtime accessibility to public field and decleared field, protected-inherited field is excluded.
    Thanks
    Lei

    as the last poster said, traverse up the class hierarchy.
    ex:
    private void doSumfinToField(String fieldName throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException {
    Class clazz = getClass();
    Field field = findFieldInClass(clazz, fieldName);
    //field.doSumfin;
    private Field findFieldInClass(Class clazz, String fieldName) throws NoSuchFieldException {
    try { // to find the field in this class    
    return clazz.getDeclaredField(fieldName);
    } catch (NoSuchFieldException e) {
    // if we don't have a superclass, continue
    if (clazz.getSuperclass().equals(Object.class)) {
    throw e;
    // check in the superclass
    return findFieldInClass(clazz.getSuperclass(), fieldName);
    }

  • How to get protected fields

    Hello,
    I don't know how to get protected fields that a class inherits from its superclass through reflexion ... the getDeclaredFields method seems not working ...
    here is my test program:
    import java.io.File;
    import java.lang.reflect.Field;
    public class Test {
         public static void main(String[] args) {
              Field [] fieldList = SubClass.class.getDeclaredFields();
              for (Field field: fieldList) {
                   field.setAccessible(true);
                   System.out.println (field.getName());
         static class SuperClass {
              protected File file;
              public SuperClass () {
                   file = new File ("a.txt");
         static class SubClass {
              private File myfile;
              public SubClass () {
                   myfile = new File ("b.txt");
    The output is
    myfile
    This means, the getDeclaredField method of the SubClass returns only fields declared by this class, not protected fields declared by its superclass.
    Anyone has an idea to fix the problem, please help me. Thank you a lot
    }

    That's not a problem, the documentation specifically says that getDeclaredFields() only returns fields from this class. If you want fields from the superclass, why not just getSuperclass().getDeclaredFields()?

  • Assignment error: Overwriting a protected field.

    Hi All,
    When I try to post some data from XI through an inbound proxy to R/3, the message get stuck in the R/3 inbound queue because of the SysFail with the error "Assignment error: Overwriting a protected field."
    If I goto SPROXY and debug the interface with the same message payload from the monitor, the execution runs through without any errors.
    If anyone has come across this kind of situation, please throw some light.
    Thanks
    AJ.

    Hi,
    When ur sending data from Source system its giving error,in SPROXY if u post data its not giving any error.R u using any date formats in source side,this will happen when ur data is worng and XI is not transforming the data into ABAP format.
    I to got same error when i have date format at source side.
    'First Check what are the transformation ur using in XI mapping.all are working fine or not.
    After that Take the payload of receiver side in SXMB_MONi and using it execute the proxy then u can find the error.
    Regards,
    Phani
    Reward points if Helpful

  • Protected Field in Purchase Requisition

    When a certain scenario occurs in a Purchase Requisition the G/L Account field is not changeable. I would like to make it changeable. Is this possible in SPRO Screen layout, or other way?  Thank-You

    I am simply trying to change the G/L account in my code. I did not have any issue doing this for Account Assignments K and F previously. This problematic scenario is called 'Service Limits', and the Account Assignment can be K or F...but the item Category is B. The screen out put is different. As I said, GL Account is not changeable for this scenario on the Account Assignment tab, but is for the other scenarios. So, my code is not changing the GL Account value?
    I checked OME9. However, the settings that are based on assignment category only. And, I don't see a setting for 'protect' or 'unprotect. To reiterate....This occurs with a  specific combination related to *** Acc = K or F, and item Acc = B.
      Thank-You
    Edited by: Tom Matys on Dec 13, 2011 11:11 AM
    Edited by: Tom Matys on Dec 13, 2011 11:11 AM

  • Protect field bsec-bankn (one-time vendor) within transaction fb02

    The user who can do " F110 automatic payment transaction" should not be able to change the bank number (bsec-bankn) of an one-time vendor for security reasons. A tried to customize the field groups and put them in the authorization object "F_lfa1_aen" but ended with a problem. It is not possible to add field bsec-bankn into a field group.
    Is it possible to protect this field from being changed for certain users (not all)?

    Hi Donald, as you can see in my container session I do specify:
    <uses-external-connection-pool>true</uses-external-connection-pool>
    I think the problem I have is that cannot co-exists in the same sessions.xml file two sessions one container and one non-container.
    When we ran the non-container server and when sessions.xml has the two sessions inside TopLink it will try, as part of parsing the sessions.xml (and before I really login), to instantiate the External Controller class even so I am not login for that session.
    It would be nice that the TopLink parser does not instantiate the classes at the time of parsing but leave the instantiation for the time of logging in the specific session. For me sessions.xml is a configuration file and it should not force to load and instantiate classes which I do not intend to use at some given time.
    Thank you, Narcisa

  • Hiding and Protecting Fields for Input in SRM 4.0 (BSP) Shopping Cart

    On the Shopping Cart transaction(s) BBPSSC01 to BBPSSC03, the HTML templates are under ITS SERVICE BBPACCOUNT, and the main HTML template is called saplbbp_pdh_acc_2000_1. We want to grey out the G/L Account field and hide the business area field.Is there any other way to satisfy this requirement besides making an actual change to the HTML/BSP page and publishing. After researching this for quite a while I could not find another mechanism to grey out or hide fields. If the page has to be changed it looks like they have a code check if the field is disabled, can we simply set that field to true and the field will be Greyed Out and protected from input?
    SAP ECC 5.0 WAS 6.40
    Thanks

    Rb,
    Did you come up with a solution to your problem? I am wanting to do exactly what you have described in your message. The only way that i can think of is:
    To create a Screen Variant using transaction code SHD0 for those transaction codes i.e. BBPSC01 etc.
    SAP ECC 5, WAS 6.4, SRM server 5 / EBP 5

  • Static protected fields

    Hi.
    In inheritance, when a field is protected, I can access it in the subclass, but I can't access it from an instance of the parent class (the packages are different). Example:
    package parent;
    public class Parent {
        protected int j = 17;
    package child;
    class Child extends Parent {
        void m() {
            new Parent().j = 18; // compiler error
    }However, when the field is static, referencing it from the Child class works fine:
    package parent;
    public class Parent {
        static protected int j = 17;
    package child;
    class Child extends Parent {
        void m() {
            new Parent().j = 18; // works fine
            Parent.j = 19; // so does this
    }Could someone explain this to me? Is this a bug of the java implementation I am testing this on?

    Could someone explain this to me? Is this a bug of the java implementation I am testing this on?It's not a bug. Aside from the static issue already addressed, protected members are accessible from implementation code. Example:
    package a; // <------ Note this.
    public class Foo {
        protected void fun() {}
    package b;  // <---- And this.
    import a.Foo;
    class Main extends Foo {
        void test() {
            fun();      // this will work; part of implementation
            Main m = new Main();
            m.fun();    // this will work, too;
            Foo f = (Foo) m;
            f.fun();    // *this* won't work.
    }~

  • Master Page readOnly or protected fields still open on page 2 of PDF

    I have a flowable form that I have added some textfields to the Master Page in order to have them on every page.
    I have set the fields to global binding so the form filler can access them from any page.  This works fine, the fields populate and the changes to the fields appear on every page.
    The problem: I need to lock these fields after submit.
    I have added the JavaScript found in the reference material to my submit button that finds and sets the access to all of the body page fields to "readOnly".  No problem with this script.
    I am not an experienced JavaScript author, so to lock the fields on the master page, I set each field individually to "readOnly".
    This works great on page 1 of the final PDF, the fields are locked.
    On page 2, however, the fields are still accessible.  In fact, changing the values in the page 2 fields also change the values in the page 1 locked fields.
    I have tried using the relative SOM as well as the absolute SOM for changing the property but no change in results.
    I have also tried changing the property from "readOnly" to "protected" with no change in the results.
    Can anyone tell me what I am doing wrong? 

    Thanks Paul,
    I wish it was that easy.
    I only have one Master Page for this form. 
    The idea is the content could expand and force the form to flow to that second page, or in this case, I've added enough form fields to cause the form to flow to the next page.
    I am including a sample form.  The text field at the top of the form is on the master page.  After hitting the submit button on the bottom of page 2, this form field will be readOnly, at least on page one.  If you look at the same field on the top of page two of the PDF, it will be open.
    Ed

  • Password protected fields

    hi gurus,
    is it possible to make some fields password protected in adobe form?
    we want to use this in offline forms.
    br.
    Jun

    Thanks for the reply, George!  (My apologies - this reply is not formatting correctly).  For the one text field I'm testing, I've placed the code in the Actions>Mouse Up>Execute a Menu Item>Run a JavaScript. Does that seem correct? It sounded like buttons and bookmarks were another way to go, but I had more trouble building those features.  The field is currently marked as Read-only but it's not "locked". The field is named "sign.name", so I updated the original code (where I believed I needed to). I also updated the password.  This is the exact entire code I've placed in the "...JavaScript" action:  (function () {       // Get one of the fields in the group     var f = getField("sign.name");       // Determine new readonly state, which     // is the opposite of the current state     var readonly = !f.readonly;       var readonly_desc = readonly ? "deactivate" : "activate";       // Ask user for password     var resp = app.response({         cQuestion: "To " + readonly_desc + " the fields, enter the password:",         cTitle: "Enter password",         bPassword: true,         cLabel: "Password"     });       switch (resp) {       case "OIE2014": // Your password goes here         getField("sign").readonly = readonly;         app.alert("The fields are now " + readonly_desc + "d.", 3);         break;       case null : // User pressed Cancel button         break;       default : // Incorrect password         app.alert("Incorrect password.", 1);         break; }   })();
    Message was edited by: BPrice

  • Cannot override protected fields

    I know this is not possible, but my question is why did they design it
    that way:
    public class ParentForm {
    protected String name = "ParentForm";
    protected String getName(){return name;}
    public class ChildForm extends ParentForm{
    protected String name = "ChildForm"; //I am trying to override
    the field value but reuse the method from parent.
    public class Test {
    public static void main(String[] args) {
    System.out.println((new ParentForm()).getName());
    System.out.println((new ChildForm()).getName());
    Output:
    ParentForm
    ParentForm
    I wanted to see "ChildForm" in the second line. Why do I have to
    duplicate (literally cut and paste) the getName() method in the child
    to achieve it ?
    Can someone explain the concept I am missing ?

    Wouldn't it be good have the privilege ofsaying,
    "I
    am extending your class wherein I want to
    inherit
    everything from you except override the value ofthis
    one field" ? I've never encountered a situation where thatwould
    be useful.Well, it will surely save a lot of unnecessary coding
    writing dummy methods.I've never had to write dummy methods.
    Like I said, I think the real problem is in your design.

  • Why are protected fields not-accessible from sub-classed inner class?

    I ran across a situation at work where we have to sub-class an inner class from a third-party package. So, it looks something like this...
    package SomePackage;
    public class Outer {
       protected int x;
       public class Inner {
    package OtherPackage;
    public class NewOuter extends Outer {
       public class NewInner extends Outer.Inner {
    }Now the NewInner class needs to access protected variables in the Outer class, just like the Inner class does. But because NewOut/NewInner are in a different package I get the following error message.
    Variable x in class SomePackage.Outer not accessible from inner class NewOuter. NewInner.You can still access those protected variables from the NewOuter class though. So, I can write accessor methods in NewOuter for NewInner to use, but I am wondering why this is. I know that if NewOuter/NewInner are in the same package as Outer/Inner then everything works fine, but does not when they are in different packages.
    I have to use JDK1.1.8 for the project so I don't know if there would be a difference in JDK1.2+, but I would think that nothing has changed. Anyway, if you know why Java disallows access as I have detailed please let me know.

    Although I don't have the 1.1.8 JDK installed on my system, I was able to compile the following code with the 1.3.1_01 JDK and run it within a Java 1.1.4 environment (the JVM in the MSIE 5.5 browser). As long as you don't access any of the APIs that were introduced with 1.2+ or later, the classes generated by the JDK 1.2+ javac are compatible with the 1.1.4+ JVM.
    //// D:\testing\SomePackage\Outer.java ////package SomePackage ;
    public class Outer {
        protected int x ;
        public Outer(int xx) {
            x = xx ;
        public class Inner {
    }//// D:\testing\OtherPackage\NewOuter.java ////package OtherPackage;
    import SomePackage.* ;
    public class NewOuter extends Outer {
        public NewOuter(int xx) {
            super(xx) ;
        public class NewInner extends Outer.Inner {
            public int getIt() {
                return x ;
    }//// D:\testings\Test.java ////import OtherPackage.* ;
    import java.awt.* ;
    import java.applet.* ;
    public class Test extends Applet {
        public void init () {
            initComponents ();
        private void initComponents() {
            add(new Label("x = ")) ;
            int myx = new NewOuter(3288).new NewInner().getIt() ;
            TextField xfld = new TextField() ;
            xfld.setEditable(false) ;
            xfld.setText(Integer.toString(myx)) ;
            add(xfld) ;
    }//// d:\testing\build.cmd ////set classpath=.;D:\testing
    cd \testing\SomePackage
    javac Outer.java
    cd ..\OtherPackage
    javac NewOuter.java
    cd ..
    javac Test.java//// d:\testing\Test.html ////<HTML><HEAD></HEAD><BODY>
    <APPLET CODE="Test.class" CODEBASE="." WIDTH=200 HEIGHT=100></APPLET>
    </BODY></HTML>

Maybe you are looking for

  • Is there a limit to the number of apps that can be Hidden from view in Family Sharing?

    I've just set up a Family Share and have issued invitations to a couple of family members. I'm trying to take full advantage of the "Hide" feature that's available in the Purchased list in the App Store app, mostly to hide really old apps that I have

  • End-of-file on communication channel

    Hello, I'm using Oracle9i Release 9.2.0.3.0 My success SQL: SQL> SELECT livro_isbn FROM tab_livros w where w.livro_cont.extract('/Livro/Livro_Titulo/text()').getStringVal() LIKE 'Geografia SNEM Prof.'; LIVRO_ISBN 8508081707 My unsuccess SQL: SQL> sel

  • DocumentSplitter and memory

    Regarding the DocumentSplitter class that allows for the SAX parsing of large XML documents. Is there a way to free the memory of each of the "temporary" XMLDocuments that get created? I know there's a XMLNodeCover.freeDocument(int id) method in the

  • How to post a web page from Safari to LinkedIn?

    These days many web pages have a widget that easily allows you to post the page to your LinkedIn, Facebook, Twitter, etc.  But many still don't, and it's those that I'm trying to figure out.  Is there any way to post (link) from a "non-widgetized" we

  • Deleting a GL account

    Hi,   is there a way to completely delete  a GL account , besides flagin it for deletion. if yes, pls let me know the steps involved. thanks.