Is it possible to use Global class variable in a  BAdi

Hello Experts,
  I have a requirement wherein ,
         I need the Reference of the Class Object to be used in a BAdi. The class object is defined as a global variable.
By any means can I use the reference variable inside the BAdi.
thanks

Hi Hari,
U can access any objects or variables in BADI only if they are used as parameters in it.
So please check whether that global object is declared as parameters in the corresponding BADI.
If so, you can surely use it.
Reward points if this is useful.
Regards,
kamalapriya

Similar Messages

  • How to use global classes and display returned data?

    Hello experts,
    I have the following code in a program which accesses a global class (found in the class library). It executes one it's static methods. What I would like to do is to get hold of some elements of the returned data. How do I do that please?
    Your help is greatly appreciated.
    ***Use global class CL_ISU_CUSTOMER_CONTACT
    DATA: o_ref TYPE REF TO CL_ISU_CUSTOMER_CONTACT.
    DATA: dref_tab LIKE TABLE OF O_ref.
    DATA: begin OF o_ref2,
    CONTACTID               TYPE CT_CONTACT,
    P_INSTANCES             TYPE string,
    P_CONTEXT               TYPE CT_BPCCONF,
    P_CONTROL               TYPE ISU_OBJECT_CONTROL_DATA,
    P_DATA                  TYPE BCONTD,         "<<<=== THIS IS A STRUCTURE CONTAINING OTHER DATA ELEMENTS
    P_NOTICE                TYPE EENOT_NOTICE_AUTO,
    P_OBJECTS               TYPE BAPIBCONTACT_OBJECT_TAB,
    P_OBJECTS_WITH_ROLES    TYPE BAPIBCONTACT_OBJROLE_TAB,
    end of o_ref2.
    TRY.
        CALL METHOD CL_ISU_CUSTOMER_CONTACT=>SELECT  "<<<=== STATIC METHODE & PUBLIC VISIBILITY
          EXPORTING
           X_CONTACTID = '000001114875'   "Whatever value here
          RECEIVING
            Y_CONTACTLOG = o_ref
    ENDTRY.
    WHAT I WOULD LIKE TO DO IS TO MOVE o_ref TO o_ref2 and then display:
    1) P_DATA-PARTNER
    2) P_DATA-ALTPARTNER
    How can I do this please?

    I now have the following code. But when I check for syntax I get different error. They are at the end of the list.
    Here is the code the way it stands now:
    ================================================
    ***Use global class CL_ISU_CUSTOMER_CONTACT
    DATA: oref TYPE REF TO CL_ISU_CUSTOMER_CONTACT.
    DATA: dref_tab LIKE TABLE OF oref.
    DATA: begin OF oref2,
    CONTACTID TYPE CT_CONTACT,
    P_INSTANCES TYPE string,
    P_CONTEXT TYPE CT_BPCCONF,
    P_CONTROL TYPE ISU_OBJECT_CONTROL_DATA,
    P_DATA TYPE BCONTD,      "THIS IS A STRUCTURE CONTAINING OTHER DATA ELEMENTS
    P_NOTICE TYPE EENOT_NOTICE_AUTO,
    P_OBJECTS TYPE BAPIBCONTACT_OBJECT_TAB,
    P_OBJECTS_WITH_ROLES TYPE BAPIBCONTACT_OBJROLE_TAB,
    end of oref2.
    TRY.
    CALL METHOD CL_ISU_CUSTOMER_CONTACT=>SELECT     " STATIC METHODE & PUBLIC VISIBILITY
    EXPORTING
    X_CONTACTID = '000001114875' "Whatever value here
    RECEIVING
    Y_CONTACTLOG = oref
    ENDTRY.
    field-symbols: <FS1>      type any table,
                   <wa_oref2> type any.
    create data dref_tab type handle oref.   " <<===ERROR LINE
    assign dref->* to <FS1>.
    Loop at <FS1> assigning  <wa_oref2>.
    *use <wa_orfe2> to transfer into oref2.
    endloop.
    write: / 'hello'.
    =========================================
    Here are the errors I get:
    The field "DREF" is unknown, but there is a field with the similar name "OREF" . . . .
    When I replace itr by OREF I get:
    "OREF" is not a data reference variable.
    I then try to change it to dref_tab. I get:
    "DREF_TAB" is not a data reference variable.
    Any idea? By the way, must there be a HANDLE event for this to work?
    Thanks for your help.

  • RFC using global class.

    Hello Folks,
    I have developed FM using global class(se24), just calling method inside FM. My question is that, which has more prefrence a class or PERFORM.
    Thanks,
    Amol.

    Your question is unclear. However, you seem to be saying you have created an RFC enabled function module in which you use a class. If this is the case, you've done the right thing as in later releases of ABAP performs are marked as obsolete. Further, if all your logic is inside the class, then you've the opportunity to exploit the benefits of OO over procedural programming.

  • Is it possible to use a Shared Variable within a Chart?

    I have a shared variable between a container report and a subreport called {@ResponseCount}:
    whileprintingrecords;
    shared numbervar Responses:= DistinctCount ({Survey_Response.RecipID})
    I placed the variable in the report footer and the value is passing correctly.  I would like to use this shared value in a chart; however, it is not even listed in the Chart Expert as an available field.  I was placing the chart in Report Footer b.
    I have also tried moving the variable value to the Report Header and placing the chart in the Report Footer, with the same result.
    I tried changing the variable to a global variable, thinking that I was using the incorrect scope, but that passed a zero value instead.
    Any suggestions would be welcome.  Thank you.

    Thank you for the response.  Though I almost gave up on this, I did find a way to access the shared variable after all.  I created a formula that simply called the variable formula.  For this example, I was using a shared variable to pull a value from my container report into my sub report for use in a chart.
    In my container report I created the shared variable {@Get_Responses}:
    whileprintingrecords;
    shared numbervar Responses:= DistinctCount ({Survey_Response.RecipID})
    In my sub report I created the formula to call the above variable {@Fetch_Responses}
    whileprintingrecords;
    shared numbervar Responses;
    Then, again in my sub report, I created a second formula to call the above formula {@ResponsesForChart}
    {@Fetch_Responses}
    This last formula was then available for use in the chart I needed to create.

  • Store Counter Number in BODS using Global/Local Variable

    Hi All,
    Anyone done before adding a counter integer field into a table based on key via BODS?
    Example:
    Table 1 (contains just 1 field) <-Input:
    Key 1
    Key 1
    Key 2
    Key 2
    Key 2
    Table 2(contains 2 fields with INT as the 2nd field) <-Output:
    Key 1      1
    Key 1      2
    Key 2      1
    Key 2      2
    Key 2      3
    I was wondering if populating the Local Variable or Global Variable might work but from my understanding, inside the Data Flow , it's not possible to increase the variable value ($count = $count + 1).

    Hi Maurice,
    Thats a good idea!!
    I had currently implemented a solution where i use Variables and Customize Functions to solve the problem.
    Will give a try and see if your solution produce the same result.
    Tim

  • Is it possible to use a ODI variable in a procedure

    I am trying to call an external java program from the operating system (MS-DOS) using a procedure. This is possible using the os.system("<command>") syntax - declaring a procedure to use Jython. However, I want to be able to pass two ODI variables to the java program. I do not seem able to do this, is it possible ?
    I also tried calling the OS command from within a package - but again cannot get the OS command to pass the variables.
    I would appreciate any help on this.

    Thanks for your response.
    I am still unable to do this.
    Problem is the procedure is "Jython" and it does not know what the ODI variables are.
    I basically have two variables source and target which need to be passed to a java procedure.
    So I created two VARIABLES in ODI - source and target.
    I then have a procedure with the command;
    import os
    import sys
    cmd = "java ConvFile"
    rc = os.system(cmd)
    when this runs it does not pass the variables.
    if you have
    import os
    import sys
    cmd = "java ConvFile"+#Tax_Updates.SourceFile+#Tax_Updates.TargetFile
    rc = os.system(cmd)
    then it does not know what #Tax_Updates.SourceFile and #Tax_Updates.TargetFile are and so just passes them as strings.
    If you still think it is possible or anyone esle knows can you elaborate a little on the solution.
    Thanks
    Nick

  • How to use globally defined variable in SQ01

    Hi,
    I have created one InfoSet using SQ02. In that I have declared some Additional Fields. These Additional Fields are of type String , so I have declared thses fields in DATA Section of Code of Infoset as it is not possible to define a custom field of type string.
    Now I have to add these fields to Field Groups, so that I can use them in queries (SQ01). 
    Can anyone plz tell me how to add these fields in Field Groups?
    Thanks.
    Edited by: hrishi_k126 on Sep 23, 2010 9:46 AM

    Hello,
    Please, ask this kind of questions in the e-business forum.
    Francois

  • Is it possible to use a form variable (in memory) as input to render pdf?

    Hi,
    I understand that the render to PDF service takes URI as input, but what if I have a xdp form modified and stored in memory, and would like to use that to render PDF, how can this be done?
    Thakns in advance.

    Hi Jasmine,
    Thanks for the tip. So, is this what I need to do?
    I have an xdp form in the repository, and xml data I generate from a custom component.
    1. render the pdf form (merge xdp (no data) with xml data)
    2. convert pdf back to xdp (this xdp now includes data) and stored as a document variable in memory
    3. manipulate the xdp (via custom component)
    4. render the pdf form by passing the xdp (from step 3) in a document variable type as part of the data parameter, leaving URL blank.
    5. write pdf to disk
    This would work right? Is there another way?
    Thanks in advance.

  • Is it possible to use parameters as variables in templates?

    Hi there,
    When you see a statement like the following in your template:
    <$defaultPageTitle=lc("wwNgEditFolder")$>
    Is there any way to replace lc("wwNgEditFolder") for something more dynamic? For instance, if I replaced the above with something like this:
    <$defaultPageTitle=myURLVariable$>
    and then use the url as follows:
    .../idc/idcplg?IdcService=MY_SERVICE&myURLVariable=mytitle
    Would that work? or what else can I do to dynamically give values to my page.
    Thanks!

    Any parameter you pass to a Service in the QueryString will be available to you as a variable in the template.

  • Using Global Variables in Data Quality Address Cleanse Transforms

    I am currently developing in Data Services 12.2.
    I am trying to dynamically populate the List Owner information in the option tabs of the USA Regulatory Address Cleanse by using global variables.  It populates the 3553 with the variable name instead of the value assigned.
    According to the Technical Manual, it is possible to use global variables in Data Quality Address Cleanse transforms:
    However, you can use substitution parameters in all places where global variables are supported, for example:
    Query transform WHERE clauses
    Mappings
    SQL transform SQL statement identifiers
    Flat-file options
    User-defined transforms
    Address cleanse transform options
    Matching thresholds
    Does anyone know if it is possible to use global variables in the option tab of the Address Cleanse; if so, can you describe how it is done?
    Thanks in advance,
    Rick

    Hi,
    U can refer to the following links in help.sap.com
    GlobalContainer Object
    http://help.sap.com/saphelp_nw04/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/content.htm
    Container Object
    http://help.sap.com/saphelp_nw04/helpdata/en/78/b4ea10263c404599ec6edabf59aa6c/content.htm
    Also some of the RUN TIME CONSTANTS are available in your BPM. So if you are trying to retrieve those variables in your Mapping(that is used in BPM), also read the following thread.
    Re: Message id in BPM
    Cheers,
    Siva Maranani.

  • XI 3.0: Using global variables in mapping

    Hi everybody
    Since it seems that during mapping you have only access to messages fields, does anybody has got idea or a workaround to use global/external variables or constants during mapping??
    Example: i would like to store the mail address where i send my error mails outside each mapping program (something like using a properties file or something like that).
    Any idea???

    Hi,
    U can refer to the following links in help.sap.com
    GlobalContainer Object
    http://help.sap.com/saphelp_nw04/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/content.htm
    Container Object
    http://help.sap.com/saphelp_nw04/helpdata/en/78/b4ea10263c404599ec6edabf59aa6c/content.htm
    Also some of the RUN TIME CONSTANTS are available in your BPM. So if you are trying to retrieve those variables in your Mapping(that is used in BPM), also read the following thread.
    Re: Message id in BPM
    Cheers,
    Siva Maranani.

  • Global classes / Doppelclick

    Hello Every Body,
    please can someone tell me how can implement Doppelclick using Global classes.!!
    Best regards.
    daniel

    Hello Daniel
    I assume you want to handle DOUBLE_CLICK events of controls (e.g. ALV grid, tree) using global classes.
    That's a piece of cake. Below I outline a possible procedure:
    (1) Create your control instance (e.g. go_grid, CL_GUI_ALV_GRID)
    (2) Create an instance of your global class. The CONSTRUCTOR method may look like this:
    CREATE OBJECT go_myclass
      EXPORTING
        io_instance = go_grid.  " Assumption: class should only handle ALV grid events
    METHOD constructor.
      me->mo_grid = io_instance.  " class may have instance attribute for grid instance
      me->set_handler( ).  " perhaps private method for setting event handler 
    ENDMETHOD.
    METHOD set_handler.
      SET HANDLER: handle_double_click FOR me->mo_grid.
    ENDMETHOD.
    (3) Create an event handler method (e.g. HANDLE_DOUBLE_CLICK for event DOUBLE_CLICK of cl_gui_alv_grid) within your global class.
    That's it. As soon as the user double-clicks on a row in the ALV grid (go_grid) the method HANDLE_DOUBLE_CLICK of your global class will be called to handle the event.
    Regards
      Uwe

  • How to use outside Class in packed library plugins

    I have found the very useful article from Michael Lacasse (https://decibel.ni.com/content/docs/DOC-19176) on how to use packed library as plugins. This approach makes the most sense when you try to distribute additional code after your executable has already been installed.
    My problem is that when I try to use a class from the main code in a plugin, the plugins won't work anymore. Ideally, I would have liked the parent plugin-interface to inherit from a class used in the main code, or using the class as an input parameter of the plugin would be the next best thing.
    I got several errors, some at execution time (#1448) or at edit time ("This VI does not match other VIs in the method: connector pane terminal(s)"). I have settled to use clusters to pass data to the plugins.
    My question is: Is it possible to use a class defined in the main code in a packed-project-library, either inherited or as a parameter? If yes, do you have any example?
    Marc Dubois
    HaroTek LLC
    www.harotek.com
    Solved!
    Go to Solution.

    I should point out that it's important to use the copy THAT'S IN THE PPL, *-NOT-* the copy from your source.
    It will compile if you mix them together, but they aren't the same object, and won't share data.
    You should never refer to your source code for the class, except to build the PPL.
    (Consider using a separate project, to avoid temptation).
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Using a java variable in jsp-Reports?

    Hello everyone,
    is it possible to use a java variable in the xml-definition of a report? Something like
    <%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %>
    <% String someSqlStatement="select * from emp"; %>
    <rw:report id="myReport">
    <rw:objects id="myObjects">
    <report DTDVersion="9000010" name="myReport">
    <data>
    <dataSource name="Q_1">
    <select>
    <![CDATA[
    <%= someSQLStatement %>
    ]]>
    </select>
    It won't work that way (as the string is not evaluated and inserted into the definition, but how could it be done? Would be great to modify the report programatically that way? Any ideas?
    TIA,
    Marcel Jantz

    To pass values to Reports, you should use the "parameters" attribute in the <rw:report> tag. In the above case you would have:
    <% String myParameters="p_someSqlStatement=select%20*%20from%20emp"; %>
    <rw:report id="myReport" parameters="<%= myParameters %>">
    <rw:objects id="myObjects">
    <report DTDVersion="9000010" name="myReport">
    <data>
    <dataSource name="Q_1">
    <select>
    <![CDATA[ &p_someSqlStatement ]]>
    </select>
    The body of the <rw:objects> tag isn't evaluated since the Reports Builder needs to be able to open and load the <rw:objects> tag. As the Reports builder doesn't run the .jsp on open, it only parses it, the <rw:objects> tag can't have values that need to be evaluated.

  • Using custom classes that are not beans

    Hi folks,
    Is it possible to use java classes that are not beans. I mean, on a page, could you say Customer cust = new Customer("Jones", 25);
    if you had a Customer class with a constructor that took a name and age (String and int).
    If so, how do you go about this- do you need to import the class, or put it in a standard location? I'm using Tomcat, and would guess that this would go in WEB-INF/classes?
    I hope it's not a stupid question, all the literature seems to be focused on JavaBeans
    Any advice on this would be great!

    Beans are used as putting Java code into a JSP is generally considered bad practice. The advantage of the bean pattern is that you use things like:
    <jsp:setProperty name="laBean" property="someSetter" value="someValue" />so that you aren't embedding Java directly into the JSP. I'm not very religious about this particular topic personally and will throw a line or two in here and there.
    Having said that though, you can easily use any Java class in a JSP. You'll have to import it first:
    <%@ page import="java.util.*" %>And then you can easily use it like in a real Java program.

Maybe you are looking for

  • ESS & MSS Team Calendar Customization

    Hi Team, We are implemented ESS & MSS &  configured Team Calendar  but in that we are facing bellow issues Can we do customization Team calendar? If it is possible how? Reporting structure showing wrongly displaying.     please help me Regards, Ajay

  • How to find out whether the transaction logs are being truncated or not

    Hi, We are using Veritas Backup tool for Backups and restores on our MS SQL 2000. One of our Veritas Tech has disabled the Truncation of Transaction Log Backup using the Job setup in Veritas. We want to confirm whether the Truncation is happening or

  • Compilation never ends

    I tried to compile my project for iOS devices (adt.exe tool), but compilation lasts forever (I waited many hours). Only one swf (3Mb, using Starling framework). The same swf compiles in 20 seconds for Android or Windows package. I tried different pac

  • Passing Dimension Members to Logic Task in SSIS

    I have a package that pulls data from a source and loads it into BPC. As a part of the package, if data is loaded into prior periods (I identify this through a query and put the prior periods and accounts into variables), we then need to run a piece

  • Can't see menu items in Pro Tools

    While using a few applications on my recently updated Mac Pro my Pro Tools and Illustrator menus are no longer visible until I mouse over them.  So if I want to change a font in Illustrator CS6 I click the font drop menu and it's basically blank unti