How to use a protected attribute of class cl_gui_alv_grid

Hello all,
       i have a scenario where i need to use the attribute 'm_appl_events' which is protected attribute. in need to add this event type into my events and add this to registered events.
    when i tried to use this with refrence to class i defined, it showing an error message 'access to protected attribute m_appl_events is not allowed. i already inherieted the cl_gui_alv_grid class into my class
     can any one please tell me how exactly could i use the protected attribute.
Thanks,
raju N

Hi Krishna,
Protected method or attrubute can be accessed through Inheritence or Friends functionality. So you can inheritence easily in you case . so that you can access the variable in the Inherited sub class only. So you can write 2 methods ie GET or SET ing the value of your protected method.
I think this informatio may help you.
Best Regards,
Vijay

Similar Messages

  • V.Important: How to use se24 to build a class step by step:  Points assured

    hi all
    I am new to OO based abap programming.  I want to build a class using SE24 but i dont know where to put the various pieces of code in SE24.
    Can anyone please provide a step by step procedure (including screenshots) on how to use SE24 to build a class using most of the features like constructor, attributes , interface , friend etc.
    Documents would be more helpful as compared to links.
    Points will be awarded
    thanks in advance

    Hi,
    Just follow the below givenlink. Using this you can create a class in SE24.
    http://help.sap.com/saphelp_nw04/helpdata/en/b3/f4b1406fecef0fe10000000a1550b0/content.htm
    I think the below document would be
    a very good introduction
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0a33479c-0b01-0010-7485-dc8c09d6bc69
    See the Following Dem Program:
    DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects
    DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen
    DEMO_ABAP_OBJECTS_DIALOG_BOX Splitter Control for Screen with Dialog Box
    DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects
    DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration
    DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects
    DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen
    Regards,
    Padmam.

  • How to use abap memory in global class

    Hi experts,
                     I want to  know how to use abap memory in global class. when i try write export and import statement its showing
    error is export statement does not support in object oriented concept.
    Thanks
    Ramesh Manoharan

    Hi Ramesh,
    Export and import statements were not allowed to use in  classes. Create a global variable in public section of that class of type of  export parameter.Then pass value to the global variable of class  by calling that class.
    by
    Prasad GVK.

  • How to use custom password encryptor/decryptor class for jdbc connection

    I am in process of migrating application from Jrun server to weblogic . In jrun we use to provide our custom class which used to decrypt the password provided in resource file as below
    <username>webclt</username>
    <password>AAAAAAASSSSSSSCCCCCCCCCCCCCC</password>
    <encrypted>true</encrypted>
    <encryption-class>com.CustomEncryptor</encryption-class>
    How could i use the same class while configuring datasource in weblogic 10 server.

    1- By default, the jre will read the user's cacerts which runs the program.
    2- You can specify another cacerts this way :
    System.setProperty("javax.net.ssl.trustStore", my_trust);
    For the case 1 and 2, you need to put the certificate in the cacerts.. Or,
    3- You implement a custom TrustManager which, for example, accepts all certificates :
    class X509TrustManagerTrustAll implements X509TrustManager {
    public boolean checkClientTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public boolean isServerTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public boolean isClientTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public java.security.cert.X509Certificate[] getAcceptedIssuers() {
    return null;
    public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {}
    public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {}
    and you call it in the right place in the code you wrote (SSLContext,..)
    Hope it helps and deserves a duke star ;)

  • How to use logging in the actions classes extends standart actions?

    Hello!
    I have some action classes extends standart actions, for example Z_ExtMaintainBasketDispatcherAction extends MaintainBasketDispatcherAction. I tried to use logging functionality in my classes but there were no my lines in log and trace files.
    For example I added followed lines in basketPerform() method of Z_ExtMaintainBasketDispatcherAction:
    boolean isDebugEnabled = log.isDebugEnabled();
    if(isDebugEnabled){
    log.debug("++++++++++++++++ Test tracing in B2B_SNG. ++++++++++++++++");
    but in there was no such line neither in log file nor in trace file.
    How I can use logging functionality in my own classes? I need it for tracing and logging.
    CRM 5.0
    regards, Lev

    Well, here is solution. I created a log formatter and log destination like this:
    <log-formatters>
    <log-formatter name="application_sap.com/crm~b2b" type="TraceFormatter" pattern="%d,%-3p %t %s %l %m"/>
    </log-formatters>
    <log-destinations>
    <log-destination name="application_sap.com_crm.b2b" type="FileLog"
        count="10" effective-severity="ALL" limit="10000000" pattern=".\log\applications\isa_ru.log">
    <formatter-ref name="application_sap.com/crm~b2b"/>
    </log-destination>
    </log-destinations>
    and new log controller like this:
    <log-controller effective-severity="ALL" name="ru.sng.isa">
    <associated-destinations>
    <destination-ref name="application_sap.com_crm.b2b" association-type="LOG"/>
    </associated-destinations>
    </log-controller>
    in file META-INF\log-configuration.xml
    Thanks everybody for help!
    Regards, Lev.

  • Use of a method in class CL_GUI_ALV_GRID

    Dear all,
    I have a requirement in which i have to use the method - SHOW_GRAPHICS of the class - CL_GUI_ALV_GRID, but the problem is there is a red traffic light in front of the method. Now my dilemma is how to turn that light green so that i can use this method.
    Kindly help.
    Thanks,
    Saurabh Chauhan.

    The red light says that it is a private method .. So it means that this method can not be used out side the class !
    There is a way out ... Create your own class that ZCL_GUI_ALV_GRID that inherits the CL_GUI_ALV_GRID.
    Here you create a public method my_method and in this method call the private method.
    Warning : If the architect had created that method as a Private one ... he must have done it for a reason .. may be this method has access to some attributes that must not be made available to the outside world ... which might cause serious damage !!
    Rule 1: Trust the architect .. If he has made it private.. it is for a reason... and Ideally there can not be any case why some one else would use this method out side the class..
    Hint: May be it is possible to achieve the same without using this method (in a different way) ..
    Regards,
    Varun.

  • How to change a private atribute of class CL_GUI_ALV_GRID

    I would like to influence attribute"M_DISABLE_SAVE" in this class.
    Is it possible? If so, how can I do it.
    Thanks.

    If you don't want the user to be able to save a layout of the grid, then make sure to pass "SPACE" to the I_SAVE parameter of the SET_TABLE_FOR_FIRST_DISPLAY method of the class CL_GUI_ALV_GRID.
    CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
               I_SAVE                 = space    "<--- do not allow to save layout
          CHANGING
               IT_OUTTAB       = I_ALV[]
    Regards,
    Rich Heilman

  • 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);
    }

  • PowerShell-EWS How to use .Forward Method of EmailMessage Class

    Hello, 
    im new to PowerShell and EWS and would like to know how to forward an E-Mail with the .Forward Method of the EmailMessage Class.
    Is it possible to also forward an Email with an FileAttachment?
    I already have access to the Messages i want to forward but i cant figure out how to .Forward these Messages.
    Thank you for your help
    Greetings 
    Ingo

    >> Is it possible to also forward an Email with an FileAttachment?
    Yes doing a normal forward is EWS should maintain the attachment on the message eg the following would forward the last email in the Mailbox
    $folderid= new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$MailboxName)
    $Inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid)
    $ivItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(1)
    $fiItems = $null
    $fiItems = $service.FindItems($Inbox.Id,$ivItemView)
    $messageBodyPrefix = "This is message that was forwarded by using the EWS Managed API";
    $addresses = New-Object Microsoft.Exchange.WebServices.Data.EmailAddress[] 1
    $addresses[0] = "[email protected]";
    $fiItems.Items[0].Forward($messageBodyPrefix, $addresses);
    If your looking to forward the actual message as an attachment you can use something like
    http://gsexdev.blogspot.com.au/2013/07/forwarding-message-as-attachment-using.html
    Cheers
    Glen

  • JNI: How to use FindClass to get a class in a Jar file?

    Is it possible to use the FindClass method of the JNI environment object to get a class that is in a jar file? My sample application was working when my class files were in the local directory. Now that I have replaced the class files with a jar file containing the classes, the app no longer works. I'd appreciate tips from anyone who knows how to do this.
    -Andreas

    Is it possible to use the FindClass method of the
    JNI environment object to get a class that is in a
    jar file? My sample application was working when my
    class files were in the local directory. Now that I
    have replaced the class files with a jar file
    containing the classes, the app no longer works. I'd
    appreciate tips from anyone who knows how to do this.It has nothing to do with JNI.
    The method uses the class path just like any other class loading situation in java. The reason it worked before is because your class path included the directory. It doesn't work now because either the jar is not in the class path or there is something wrong with the class path.

  • How to use bean as attribute?

    I create a bean(sql result) from a servlet and put it in the request using setAttribute(bean) and then use dispacher to send the request to the display.jsp. In display.jsp i have a <jsp:usebean id="bean" class="beanClass"> but when i use <jsp:getProperty name="bean" property="colum1"/> it doesnt give anything. Did i miss anything? How does the usebean tag know which bean i wanna use? The usebean tag i used creates a new bean, right?
    Hope to get some help

    May be you need to define the scope for <jsp:useBean> tag. For class, try to add package.class.

  • How to use function of an abstract class??

    Hi all,
    I want to use the format(object obj) function of the package java.text.Format. But as the Format class is an abstract class i could not instantiate it, so that i can call the format(object obj) method using the dot(.) operator.
    I know what is an abstract class. i've studied and tried to understand. as everybody knows, studied the perfect example(because i've read it in all the abstract class tutorial, books) of the Shape class. But still i dont understand how am i going to use that format(object obj) method. Please help me..

    Instead of using the abstract class Format use the
    concrete classes DecimalFormat
    SimpleDateFormat etc check java.text APIS
    http://java.sun.com/j2se/1.4.2/docs/api
    Hi!! Thanks both of you.
    If Sun has a abstract class then there must be a
    concrete class which extends that abstract class .It
    is always better to check the APIWhat do you mean by this line. Is it true for all the abstract classes in the jdk?

  • How to use server time in  Timer Class

    Hai,
    I have develped an application(stand alone) using swings. the exe runs in all the systems in my company.
    requirement is
    --> application has to be closed at 11.59 P.M everyday.
    i did this task using Timer class. Timer class takes the system time in which the application runs. what i need is the server time. so when the application runs it has to check the server time and when the server time is equal to 11.59 PM application has to be closed.
    so how do i map the timer class to my server time?
    iam breaking my head for this for past few days. is there any way to do this?
    thanks

    1)Do you have one database in total? I mean all Java Application read and save data to this database. If so, try to get time from database by using database function. I recommend you to do this because database is central and all application share data with the database.
    2) You can still call web server in Java application. My link in last post will tell you.
    3) You can write a Java Server application for providing current server time for all your Java application. Socket technique may be used.
    Therefore, solution 1 and solution 2 look simpler than solution 3.

  • How to use multiple dimension attributes in SCOPE function

    Hello everyone,
    Need urgent help on the following:
    The requirement is, when [EMPLOYEE ONSHORE OFFSHORE] attribute of EMPLOYEE dimension having value "ATC Onsite" or "Permanent Onsite", "Onsite CPC" measure will have same the value of "Forecasted Blended CPC"
    measure. In all other cases, it will be 0.
    Here's the code snippet:
    I have created a new calculated member as:
    CREATE MEMBER CURRENTCUBE.[Measures].[ONSITE CPC]
    AS 0,
    FORMAT_STRING = "#,##0.00;-#,##0.00",
    VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'MARGIN ANALYSIS' ;
    Then, I have used the scope function. Here I am getting a build/compile time error.
    SCOPE([Measures].[ONSITE CPC]);
    SCOPE([EMPLOYEE].[EMPLOYEE ONSHORE OFFSHORE].&[ATC Onsite], [EMPLOYEE].[EMPLOYEE ONSHORE OFFSHORE].&[Permanent Onsite]);
    THIS = [Measures].[FORECASTED BLENDED CPC];
    END SCOPE;
    END SCOPE;
    Best Regards, Arka Mitra.

    Use { } in the second scope.
    SCOPE([Measures].[ONSITE CPC]);                 
            SCOPE({[EMPLOYEE].[EMPLOYEE ONSHORE OFFSHORE].&[ATC
    Onsite], [EMPLOYEE].[EMPLOYEE ONSHORE OFFSHORE].&[Permanent
    Onsite]});
                    THIS
    = [Measures].[FORECASTED BLENDED CPC];
            END SCOPE;                 
    END SCOPE; 

  • How to use Master Data Attribute of in Update Rule's Formula

    Hi experts.
    In update rule, there is an option to use <b>Master Data Attribute of</b>. However, due to user requirement, I need to use that in <b>Formula</b> instead.
    <b>Field to update:</b>
    Profit Center
    <b>Logic:</b>
    If Cost Center is empty
    Then Profit Center
    Else
    Master Data Attribute of Cost Center
    I use the following formula at the moment but it is not 100% correct.
    <b>IF( Cost Center = '', Profit Center, Cost Center )</b>
    Appreciate if anyone could help me out.
    Thanks!

    Hi,
    The easier thing to do will be to use a Update Routine.
    Logic will be as follows :-
    If Cost center iss initial.
    Result = Profit Center
    else.
    result = Cost center.
    endif.
    Regards
    SM

Maybe you are looking for

  • Acrobat Forms with Javascript

    I have a form that I would like to have required fields before saving or print. I am really new to javascript coding and know nothing about syntax. I do have some experience with basic html, but this form will not be used online. It will get emailed,

  • Saving PDF's

    I have a PDF file that is being used on a urgent project. I have separated it into 10 individual sections. I want to upload these 10 files to Acrobat.com so that my committee members can access and edit the files. My problem is that I don't know Acro

  • ITunes 7 Rendering Issues

    Ahoy hoy, I became entangled in this problem upon first running iTunes; Running it for the first few minutes, all is fine, tick-tock, no problems so far. Then... If one is inclined to switch applications, to say Firefox etc., hide iTunes, and then sw

  • Mass Change in Credit Limit

    Dear All I have four company codes and i each company i have lot of customers and i have to increase the credit limit of customer at each company codes so plz tell me how to do this at mass level. Looking Forward Shujaat Abbas.

  • .wid file opens for some developers Web Intell Rich Client but not others

    4 developers with same BO client installs @ 12.2.7.598** (server at 3.2 SP 2.7) 2 can read demo .wid files and 3rd party supplied .wid file, 2 cannot!* Error produced when running: An internal error occured while calling 'openDocumentMDP' API. (Error