Reg:classes

Hi,
in the following code im not getting the output.plz tell me why
tables:mara.
data:obj type ref to cl_gui_alv_grid.
data:cust type ref to cl_gui_custom_container.
data:itab like mara occurs 0 with header line.
select-options:s_matnr for mara-matnr.
start-of-selection.
select matnr matkl mtart from mara into corresponding fields of table itab where matnr in s_matnr.
CREATE OBJECT CUST
  EXPORTING
   PARENT                      =
     CONTAINER_NAME              = 'CUST'
   STYLE                       =
   LIFETIME                    = lifetime_default
   REPID                       =
   DYNNR                       =
   NO_AUTODEF_PROGID_DYNNR     =
EXCEPTIONS
   CNTL_ERROR                  = 1
   CNTL_SYSTEM_ERROR           = 2
   CREATE_ERROR                = 3
   LIFETIME_ERROR              = 4
   LIFETIME_DYNPRO_DYNPRO_LINK = 5
   others                      = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT OBJ
  EXPORTING
   I_SHELLSTYLE      = 0
   I_LIFETIME        =
     I_PARENT          = CUST
   I_APPL_EVENTS     = space
   I_PARENTDBG       =
   I_APPLOGPARENT    =
   I_GRAPHICSPARENT  =
   I_NAME            =
   I_FCAT_COMPLETE   = SPACE
EXCEPTIONS
   ERROR_CNTL_CREATE = 1
   ERROR_CNTL_INIT   = 2
   ERROR_CNTL_LINK   = 3
   ERROR_DP_CREATE   = 4
   others            = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD OBJ->SET_TABLE_FOR_FIRST_DISPLAY
  EXPORTING
   I_BUFFER_ACTIVE               =
   I_BYPASSING_BUFFER            =
   I_CONSISTENCY_CHECK           =
     I_STRUCTURE_NAME              = 'MARA'
   IS_VARIANT                    =
   I_SAVE                        =
   I_DEFAULT                     = 'X'
   IS_LAYOUT                     =
   IS_PRINT                      =
   IT_SPECIAL_GROUPS             =
   IT_TOOLBAR_EXCLUDING          =
   IT_HYPERLINK                  =
   IT_ALV_GRAPHICS               =
   IT_EXCEPT_QINFO               =
   IR_SALV_ADAPTER               =
  CHANGING
    IT_OUTTAB                     = ITAB[]
   IT_FIELDCATALOG               =
   IT_SORT                       =
   IT_FILTER                     =
EXCEPTIONS
   INVALID_PARAMETER_COMBINATION = 1
   PROGRAM_ERROR                 = 2
   TOO_MANY_LINES                = 3
   others                        = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Hi Mahesh,
pls note the changes I have made in your code..Now it will work.
FIRST - Design a screen '100' which contains the ALV container and the ALV Grid with the name 'CUST'
SECOND - Include the object , grid creation and the set_table_for_first_display in the PBO method.
THIRD -  CALL THE SCREEN 100
Please reward points if found useful.
tables:mara.
data:obj type ref to cl_gui_alv_grid.
data:cust type ref to cl_gui_custom_container.
data:itab like mara occurs 0 with header line.
select-options:s_matnr for mara-matnr.
start-of-selection.
select matnr matkl mtart from mara into corresponding fields of table itab where matnr in s_matnr.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
CREATE OBJECT CUST
EXPORTING
PARENT =
CONTAINER_NAME = 'CUST'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT OBJ
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = CUST
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
I_FCAT_COMPLETE = SPACE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD OBJ->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'MARA'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = ITAB[]
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE.                    " STATUS_0100  OUTPUT

Similar Messages

  • Reg : Classes And Methods In ABAP HR

    Hii...
    Can anyone tell me what are the standard OOPS classes and Interfaces related to ABAP HR Technical. I want to know the detailed view of all the classes and interfaces which can be used in HR technically.
    Or is there any way I can find.
    Your suggestions will be helpful for me. So, Kindly help me with this.
    Thanks,
    Regards,
    Rahul Gupta

    Venkat,
        Try look for any SAP Note or create Customer Message to SAP. It's clearly Program Error. We can't collect  "lcl_transform" class into Transport Request Independently as it was local Class not Global Class.
    Try transporting Transformations again, if it still gives problem. Contact SAP.
    Let us know if you implement any SAP Notes.
    all the best.
    Regards,
    Nagesh Ganisetti.
    Assign Points if it helps.

  • Reg: Classes and memory IDs

    Hi All,
            I have a class which has 5 methods and around 15 attributes.
    DATA: lr_document TYPE REF TO zcl_ps_pricing_document,
    " Retrieve the Document Object
      lr_document = gr_runtime_context->get_document( ).
    in this example, lr_document is refferencing to class zcl_ps_pricing_document.
    Now Can I export and Import lr_document  to memory IDs?
    Regards,
    Selva M

    Hello friend,
    please refer to statement in ABAP on line help if you want to export a reference object to ABAP memory.
    To export objects, which are referenced by reference variables, use the statement CALL TRANSFORMATION to serialize and export these objects if the class of these objects implements the interface IF_SERIALIZABLE_OBJECT.
    Best Regards,
    Jerry

  • Reg classes and methods

    hi all
    how to find the use or purpose  of CL_RECA_DDIC_DOMA  and the methods declared in it.

    Hi,
    actualy constructor is a special method in OOABAP which is used for initialisation and it is always named as constructor.
    Constructors are of 2 type 1. CLASS or Static Constructor
                                    and 2 . Method Constructor.
    Check the following code for the use and effect of both types of constructors
    REPORT  demo_constructor_ANIRBAN.
          CLASS cl1 DEFINITION
    CLASS cl1 DEFINITION.
      PUBLIC SECTION.
        METHODS:
          add,
          constructor IMPORTING v1 TYPE i
                                v2 TYPE i,
          display.
        CLASS-METHODS:
         class_constructor.
      PRIVATE SECTION.
        DATA:
        w_var1   TYPE i,
        w_var2   TYPE i,
        w_var3   TYPE i,
        w_result TYPE i.
    ENDCLASS.                    "cl1 DEFINITION
          CLASS cl1 IMPLEMENTATION
    CLASS cl1 IMPLEMENTATION.
      METHOD constructor.
        w_var1 = v1.
        w_var2 = v2.
      ENDMETHOD.                    "constructor
      METHOD class_constructor.
        WRITE:
        / 'Tihs is a class or static constructor.'.
      ENDMETHOD.                    "class_constructor
      METHOD add.
        w_result = w_var1 + w_var2.
      ENDMETHOD.                    "add
      METHOD display.
        WRITE:
        /'The result is =  ',w_result.
      ENDMETHOD.                    "display
    endclass.
    " Main program----
    data:
      ref1 type ref to cl1.
    parameters:
      w_var1 type i,
      w_var2 type i.
      start-of-selection.
      create object ref1 exporting v1 = w_var1
                                  v2 = w_var2.
       ref1->add( ).
       ref1->d isplay( ).

  • Reg: Class copy to Custom one

    Hi,
    We want to copy the CL_RSTRAN_TRFN class interface to custom class (Z class) and want to do change in method if_rso_tlogo_maintain~prepare.
    Copied the CL_RSTRAN_TRFN to custom one. When i am trying to activate it giving error message as "You cannot access private method "CHECK_RECORDMODE(". not allowed." Not only for this Mehtod, for remaining methods under this class also i am getting same error message
    What is the issue here? i am vey new to classes, Is there any check needed to copy the SAP class to custom class.
    Please share any ideas on this.
    Thx
    Raj

    Hi Aaron Morden ,
    Thx very much for the answer.
    So how can i make it work. Please suggest me some steps to copy that class into custom one.
    since after copying that class, need to chage in one class, but i am facing problem in initial step only, that is at copying.
    can pls help me in this.
    Thx
    Raj

  • Reg Class lcl_event_receiver

    hi friends
    class lcl_event_receiver definition deferred.
    In alv sample we have this statement, what is purpose of this statement ?
    Exactly what it mean in the program ?
    Regards
    Deva

    This is used so you can refer to this class BEFORE you have  actually defined the class. This is particularly useful where you split a program up into a number of includes
            program A.
             include A_TOP
             include  A_CL
             include A_FORMS
          etc.
    so if in the A_TOP include you refer to the class in the A_CL   you waon't get a syntax error.
    for example  in A_TOP you have
    include <icon>.
    field-symbols: <fs>   type any,
                   <fsa>,
                   <fsb>.
    *class lcl_event_handler definition deferred. " Event handler*
    then rest of your data
    data:  go_handler  type ref to lcl_event_handler,   "<==================  syntax error if the definition deferred stmt missing
    etc
    The class is in your include A_CL 
    class lcl_event_handler definition.
    * add other methods etc here at will depending on the
    * application --such as new buttons on toolbars etc.
      public section.
        methods:
          handle_double_click for event double_click of cl_gui_alv_grid
        importing
               e_row
               e_column
               es_row_no
               sender,
    etc etc.
    cheers
    jimbo

  • Reg : class for creating table control

    hi everyone,
                 is there any class for creating table control?my requirement is
                  created 2 custom containers,one for alv display and other for table control display.
    For alv i used cl_gui_alv->set_table_first_display,likewise any class for creaitng table control?????????
    pleas find me a solution......
                      thanks in advance......

    Hi,
    You can use the class CL_TABLECONTROL for creating table control and the method SET_VALUES shall be used to fill values for tha tabcntrl.
    Else, you can use the Table Control Wizard to create the tabcntrl easily.
    Regards,
    Renjith Michael.

  • Reg To MOF question

    I'm using V3 of RegToMof to inventory a specific registry setting on workstations.  I added the MOF to hardware inventory in client settings.  When I create collections, during my query rule creation I can see the class name of the registry settings
    as one of the options to select however I do not see any values in the database.  This tells me the clients have not inventoried the registry settings.
    I have ran policy and hardware inventory numerous times.  I have also waited a few days.  Is there something I am missing in order to inventory a reg setting on clients?

    last hardware scan was yesterday.  I added the MOF file to hardware inventory a few days prior to that.
    On the client hardware inventory, I see this (MAIN is the name of the reg class
    Collection: Namespace = \\.\root\cimv2; Query = SELECT __CLASS, __PATH, __RELPATH, KeyName, Anchor_Visitation_Horizon, ApplicationTileImmersiveActivation, AssociationActivationMode, AutoHide, Cache_Percent_of_Disk, Default_Page_URL, Default_Search_URL, Default_Secondary_Page_URL,
    Delete_Temp_Files_On_Exit, DoNotTrack, Enable_Disk_Cache, ExtensionsOffPage, LocalPage, Placeholder_Height, Placeholder_Width, SearchPage, SecurityRiskPage, StartPage, Use_Async_DNS, x86AppPath FROM
    Main
    and right under that I see
    Collection: Class "Main" does not exist.
    it appears that \\root\cimv2 doesn't have a MAIN class.  shouldn't the addition of the MOF file in hardware inventory have created that class on all of the clients?

  • Using an interface as a parm in a methods

    Greetings I have an interface class that has a bunch of get methods. Then in another class I call the interface as a parameters. But what information do I put in it as I use it? the gets?
    [code
    //interface class
    public interface FillData {
              public String getTrader();
              public String getAccount();
    //Reg class
    public boolean insertData(FillData data){
    return true
    //Where I set the methods
    setTrader((String)table.getValueAt(i,0));
    importit.setAccount((String)table.getValueAt(i,1));
    insertData (//what goes in here???){
    Any more information needed lemme know? Thanks for any help!

    I have an interface public interface FillData {
    public String getTrader();
    public String getAccount();
    }I have a class with the interface as a parameter of a method
    public boolean insertData(FillData data){
    //do stuff
    return true
    }When I call the method what do I put in the parameter part of the method when I implement it?
    insertData(//what information do I put in here?)I guess my question is how do you use an interface??? I read the tutorial about implementing it in a class and all but how about when u use it as a method?
    Message was edited by:
    h2opologirly69

  • Reg Dynamic class instance creation

    Hi all,
    I want to create a instance for a class inside the program, but i know class name dynamically that reside inside a table.
    select Classname from <table name> into <classname>.
    create object <classname>->variable that got form select query.
    we have any alternative solution for this.
    Reg,
    Hariharan

    Hi Hariharan,
    DATA:
       L_INST_ASY_CALL TYPE REF TO OBJECT.
    As the type of L_INST_ASY_CALL is known in runtime so declare it as of type OBJECT.
    Hope this would help you.
    Good luck
    Narin

  • How to populate class based on value of seed class attribute instead of doing reg/script discovery again?

    I have a seed class. I populate that seed class using script discovery and it has attribute 1,2 and 3. Those 3 attributes are all populated via the script discovery too.
    Now I created a new application class which use the seed class as target. The criteria is if attribute 1 equal to a certain value. Here comes the question, how to create this discovery? In authoring console the options are registry discovery, script discovery
    and custom discovery. Since attribute 1 is already populated in seed class using script, I think I can use that instead of doing another script discovery for the new application class. 
    However I didn't find a way to do that. Any suggestions?

    I pasted the base seed MP as following.
    The base MP has two classes: "MyBaseMP.MyApps.Candidates" and "MyBaseMP.MyApps".
    "MyBaseMP.MyApps.Candidates" is created from "Windows.Computer" class. Then it is discovered by "MyBaseMP.MyApps.Candidates.RegDiscvoery". 
     "MyBaseMP.MyApps" is created from "Windows.Local.Application" class. It is then discovered by "MyBaseMP.MyApps.ScriptDiscovery". This script discovery is targeting on "MyBaseMP.MyApps.Candidates" class. The script
    also populated 5 attribute for  "MyBaseMP.MyApps" and they are APPLICATION, LOB, GROUP, ENVIRONMENT and STATE.
    This base MP works as expected.
    Now I want to create a new custom MP. The new MP has a new class "MyFinanceApps" created from  "MyBaseMP.MyApps". The service model is very simple just like following
      <TypeDefinitions>
        <EntityTypes>
          <ClassTypes>
            <ClassType ID="MyFinanceApps" Accessibility="Internal" Abstract="false" Base="MyBaseMP!MyBaseMP.MyApps" Hosted="true" Singleton="false" />
          </ClassTypes>
        </EntityTypes>
      </TypeDefinitions>
    I want to populate this class if LOB attribute echos to "Finance". How to make this discovery then? Sure I can create another script discovery but since those values already discovered in the seed class, is there any way I can use them?
    The MyBaseMP is as following:
    <ManagementPack ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <Manifest>
        <Identity>
          <ID>MyBaseMP</ID>
          <Version>1.0.0.0</Version>
        </Identity>
        <Name>MyBaseMP</Name>
        <References>
          <Reference Alias="SC">
            <ID>Microsoft.SystemCenter.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="Windows">
            <ID>Microsoft.Windows.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="Health">
            <ID>System.Health.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
          <Reference Alias="System">
            <ID>System.Library</ID>
            <Version>6.1.7221.0</Version>
            <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
          </Reference>
        </References>
      </Manifest>
      <TypeDefinitions>
        <EntityTypes>
          <ClassTypes>
            <ClassType ID="MyBaseMP.MyApps" Accessibility="Internal" Abstract="false" Base="Windows!Microsoft.Windows.LocalApplication" Hosted="true" Singleton="false">
              <Property ID="APPLICATION" Type="string" Key="true" CaseSensitive="false" Length="256" MinLength="0" />
              <Property ID="GROUP" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
              <Property ID="LOB" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
              <Property ID="STATE" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
              <Property ID="APP_TYPE" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
              <Property ID="ENVIRONMENT" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
            </ClassType>
            <ClassType ID="MyBaseMP.MyApps.Candidates" Accessibility="Internal" Abstract="false" Base="Windows!Microsoft.Windows.Computer" Hosted="false" Singleton="false" />
          </ClassTypes>
        </EntityTypes>
      </TypeDefinitions>
      <Monitoring>
        <Discoveries>
          <Discovery ID="MyBaseMP.MyApps.Candidates.RegDiscovery" Enabled="true" Target="Windows!Microsoft.Windows.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
            <Category>Discovery</Category>
            <DiscoveryTypes>
              <DiscoveryClass TypeID="MyBaseMP.MyApps.Candidates" />
            </DiscoveryTypes>
            <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.FilteredRegistryDiscoveryProvider">
              <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
              <RegistryAttributeDefinitions>
                <RegistryAttributeDefinition>
                  <AttributeName>FoundAppKey</AttributeName>
                  <Path>SOFTWARE\MyCompany\SystemCenter</Path>
                  <PathType>0</PathType>
                  <AttributeType>0</AttributeType>
                </RegistryAttributeDefinition>
              </RegistryAttributeDefinitions>
              <Frequency>180</Frequency>
              <ClassId>$MPElement[Name="MyBaseMP.MyApps.Candidates"]$</ClassId>
              <InstanceSettings>
                <Settings>
                  <Setting>
                    <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                    <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
                  </Setting>
                </Settings>
              </InstanceSettings>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="String">Values/FoundAppKey</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="String">true</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </DataSource>
          </Discovery>
          <Discovery ID="MyBaseMP.MyApps.ScriptDiscovery" Enabled="true" Target="MyBaseMP.MyApps.Candidates" ConfirmDelivery="false" Remotable="true" Priority="Normal">
            <Category>Discovery</Category>
            <DiscoveryTypes>
              <DiscoveryClass TypeID="MyBaseMP.MyApps" />
            </DiscoveryTypes>
            <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
              <IntervalSeconds>300</IntervalSeconds>
              <SyncTime />
              <ScriptName>MyApps.Script.Discovery.vbs</ScriptName>
              <Arguments>$MPElement$ $Target/Id$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/DNSName$ $MPElement$</Arguments>
              <ScriptBody><![CDATA[
    Option Explicit
    ' Definitions for Registry Walking
    Const HKEY_LOCAL_MACHINE = &H80000002
    Dim oReg
    Dim arrValues, arrSubKeys
    Dim strComputer, strKeyPath, subkey, strProperty, strArrValue
    ' Define where the App Subkeys are located, strKeyPath MUST end with a slash!
    strKeyPath = "SOFTWARE\MyCompany\SystemCenter\"
    strComputer = "."
    Dim WshShell, bKey
    ' Definitions for SCOM Discovery
    Dim oAPI
    Set oAPI = CreateObject("MOM.ScriptAPI")
    Dim oArgs
    Set oArgs = WScript.Arguments
    ' Check for the required script arguments.
    if oArgs.Count < 3 Then
        ' If the script is called without the required arguments,
        ' create an information event and then quit. 
        Call oAPI.LogScriptEvent(WScript.ScriptName,101,0, _
            "script was called with fewer than three arguments (" & oArgs.Count & " arguments) and was not executed.")
        Wscript.Quit -1
    End If
    Dim SourceID, ManagedEntityId, TargetComputer
    SourceID = oArgs(0) ' The GUID of the discovery object that launched the script.
    ManagedEntityId = oArgs(1) ' The GUID of the computer class targeted by the script.
    TargetComputer = oArgs(2) ' The FQDN of the computer targeted by the script.
    Dim oDiscoveryData, oInst
    Set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceID, ManagedEntityId)
    ' Functions for Registry Walking
    ' Create Shell Object
    Set WshShell = WScript.CreateObject("WScript.Shell")
    ' Create WMI Object, and check for existence
    On Error Resume Next
    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 
        strComputer & "\root\default:StdRegProv")
    Select Case Err.Number
      Case 0:
    'Error Code 0 = 'success'
    'Wscript.Echo "DEBUG:  Opened WMI"
      Case Else
    'Any other error code is a failure code
    Notify("ERROR:  Can not open WMI")
    Wscript.Quit 1
    End Select
    On Error Goto 0 'Turn error reporting back on
    ' Check to ensure first level reg key exists
    If RegistryKeyExists("HKLM\" & strKeyPath) Then
    If oReg.EnumKey(HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys) > 0 Then
    ' We have NO subkeys
    Notify("ERROR: No Subkeys defined")
    Wscript.Quit 1
    End if
    Else
    Notify("DEBUG: Key [" & strKeyPath & "] doesn't exist")
    Wscript.Quit 1
    End If
    'Check size of arrSubKeys for sub keys
    If Not IsArray(arrSubKeys) Then
    ' We have NO subkeys
    Notify("ERROR: No Subkeys defined")
    Wscript.Quit 1
    End If
    For Each subkey In arrSubKeys
    'Wscript.Echo "DEBUG: subkey = " & subkey
    strProperty = ""
    'Check to ensure Subkey Exists
    If RegistryKeyExists("HKLM\" & strKeyPath & "\" & subkey & "\") Then
    'Get Values under each key
    'Wscript.Echo "DEBUG:  Create OBJECT"
    ' Discovered the application. Create the application instance.
    Set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='MyBaseMP.MyApps']$")
    ' Define Property
    Call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
    If RegistryValueExists("HKLM\" & strKeyPath & "\" & subkey & "\ENVIRONMENT") Then
    'Wscript.Echo "DEBUG: Value " & strArrValue & " found"
    strProperty = WshShell.RegRead("HKLM\" & strKeyPath & "\" & subkey & "\ENVIRONMENT")
    Else
    'Wscript.Echo "DEBUG: value " & strArrValue & " NOT found"
    strProperty = "NONEXISTANT"
    End If
    Call oInst.AddProperty("$MPElement[Name='MyBaseMP.MyApps']/ENVIRONMENT$", strProperty)
    If RegistryValueExists("HKLM\" & strKeyPath & "\" & subkey & "\STATE") Then
    'Wscript.Echo "DEBUG: Value " & strArrValue & " found"
    strProperty = WshShell.RegRead("HKLM\" & strKeyPath & "\" & subkey & "\STATE")
    Else
    'Wscript.Echo "DEBUG: value " & strArrValue & " NOT found"
    strProperty = "NONEXISTANT"
    End If
    Call oInst.AddProperty("$MPElement[Name='MyBaseMP.MyApps']/STATE$", strProperty)
    If RegistryValueExists("HKLM\" & strKeyPath & "\" & subkey & "\APP_TYPE") Then
    'Wscript.Echo "DEBUG: Value " & strArrValue & " found"
    strProperty = WshShell.RegRead("HKLM\" & strKeyPath & "\" & subkey & "\APP_TYPE")
    Else
    'Wscript.Echo "DEBUG: value " & strArrValue & " NOT found"
    strProperty = "NONEXISTANT"
    End If
    Call oInst.AddProperty("$MPElement[Name='MyBaseMP.MyApps']/APP_TYPE$", strProperty)
    If RegistryValueExists("HKLM\" & strKeyPath & "\" & subkey & "\LOB") Then
    'Wscript.Echo "DEBUG: Value " & strArrValue & " found"
    strProperty = WshShell.RegRead("HKLM\" & strKeyPath & "\" & subkey & "\LOB")
    Else
    'Wscript.Echo "DEBUG: value " & strArrValue & " NOT found"
    strProperty = "NONEXISTANT"
    End If
    Call oInst.AddProperty("$MPElement[Name='MyBaseMP.MyApps']/LOB$", strProperty)
    If RegistryValueExists("HKLM\" & strKeyPath & "\" & subkey & "\GROUP") Then
    'Wscript.Echo "DEBUG: Value " & strArrValue & " found"
    strProperty = WshShell.RegRead("HKLM\" & strKeyPath & "\" & subkey & "\GROUP")
    Else
    'Wscript.Echo "DEBUG: value " & strArrValue & " NOT found"
    strProperty = "NONEXISTANT"
    End If
    Call oInst.AddProperty("$MPElement[Name='MyBaseMP.MyApps']/GROUP$", strProperty)
    'Set Application Name
    'Wscript.Echo "SET APPLICATION NAME: " & subkey
    Call oInst.AddProperty("$MPElement[Name='MyBaseMP.MyApps']/APPLICATION$", subkey)
    'Wscript.Echo "SUBMIT INSTANCE"
       Call oDiscoveryData.AddInstance(oInst)
    Else
    ' Registry Sub Key does not exist
    Notify("ERROR: A found registry subkey, [" & subkey & "] doesn't actually exist")
    End If
    Next
    ' Submit the discovery data for processing.
    Call oAPI.Return(oDiscoveryData) 
    ' A helper function to remove the extension from a file name.
    Function StripExtension (sFile)
    StripExtension = Left(sFile, Len(sFile) -4)
    End Function
    '* Registry Value Exists (Function)
    '* Returns a value (true / false)
    'This function checks to see if a passed registry value exists, and
    'returns true if it does
    'Requirements: The registry value you are looking for (RegistryValue)
    Function RegistryValueExists (RegistryValue)
      'Ensure the last character is NOT a backslash (\) - if it is, we aren't looking for a value
      If (Right(RegistryValue, 1) = "\") Then
        'It's not a registry value we are looking for
    'Wscript.Echo "No slash....returning false"
        RegistryValueExists = false
      Else
        'If there isnt the value when we read it, it will return an error, so we need to resume
        On Error Resume Next
        'Try reading the value
        WshShell.RegRead RegistryValue
        'Catch the error
        Select Case Err.Number
          Case 0:
            'Error Code 0 = 'success'
            RegistryValueExists = true
          Case Else
            'Any other error code is a failure code
            RegistryValueExists = false
        End Select
        'Turn error reporting back on
        On Error Goto 0
      End If
    End Function
    '* Registry Key Exists (Function)
    '* Returns a value (true / false)
    'This function checks to see if a passed registry key exists, and
    'returns true if it does
    'Requirements: The registry key you are looking for (RegistryKey)
    'Note: RegistryKey MUST end in a backslash (\), or FALSE will be returned
    Function RegistryKeyExists (RegistryKey)
       Dim errDescription
      'Ensure the last character is a backslash (\) - if it isn't, we aren't looking for a key
      If (Right(RegistryKey, 1) <> "\") Then
        'It's not a registry key we are looking for
        RegistryKeyExists = false
      Else
        'If there isnt the key when we read it, it will return an error, so we need to resume
        On Error Resume Next
        'Try reading the key
        WshShell.RegRead RegistryKey
        'Catch the error
    ' Wscript.Echo "Err.Number = " & Err.Number
    ' Wscript.Echo "Err.Message = " & Err.Message
        Select Case Err.Number
          'Error Code 0 = 'success'
          Case 0:
            RegistryKeyExists = True
            'Wscript.Echo "DEBUG: Case 0: Key Exists"
          'This checks for the (Default) value existing (but being blank); as well as key's not existing at all (same error code)
          Case &h80070002:
            'Read the error description, removing the registry key from that description
            ErrDescription = Replace(Err.description, RegistryKey, "")
            'Clear the error
            Err.clear
            'Read in a registry entry we know doesn't exist (to create an error description for something that doesnt exist)
            WshShell.RegRead "HKEY_ERROR\"
            'The registry key exists if the error description from the HKEY_ERROR RegRead attempt doesn't match the error
            'description from our RegistryKey RegRead attempt
            If (ErrDescription <> Replace(Err.description, "HKEY_ERROR\", "")) Then
              RegistryKeyExists = true
            Else
              RegistryKeyExists = false
            End If
          'Any other error code is a failure code
          Case Else:
            RegistryKeyExists = false
        End Select
        'Turn error reporting back on
        On Error Goto 0
      End If
    End Function
    Function Notify(strNotifyMessage)
    Call oAPI.LogScriptEvent(Wscript.Name,101,0, strNotifyMessage)
    End Function]]></ScriptBody>
              <TimeoutSeconds>60</TimeoutSeconds>
            </DataSource>
          </Discovery>
        </Discoveries>
      </Monitoring>
      <LanguagePacks>
        <LanguagePack ID="ENU" IsDefault="true">
          <DisplayStrings>
            <DisplayString ElementID="MyBaseMP">
              <Name>MyBaseClass</Name>
            </DisplayString>
            <DisplayString ElementID="MyBaseMP.MyApps">
              <Name>MyBaseMP.MyApps</Name>
            </DisplayString>
            <DisplayString ElementID="MyBaseMP.MyApps" SubElementID="APPLICATION">
              <Name>APPLICATION</Name>
            </DisplayString>
            <DisplayString ElementID="MyBaseMP.MyApps.Candidates">
              <Name>MyBaseMP.MyApps.Candidates</Name>
            </DisplayString>
            <DisplayString ElementID="MyBaseMP.MyApps.Candidates.RegDiscovery">
              <Name>MyBaseMP.MyApps.Candidates.RegDiscovery</Name>
            </DisplayString>
            <DisplayString ElementID="MyBaseMP.MyApps.ScriptDiscovery">
              <Name>MyBaseMP.MyApps.ScriptDiscovery</Name>
              <Description />
            </DisplayString>
          </DisplayStrings>
        </LanguagePack>
      </LanguagePacks>
    </ManagementPack>

  • Reg.Double click concept in classes

    Hello,
            I  had developed a program  which is extracting data from kna1 and vbak table.Now i am facing a problem when iam using a concept called doubleclick.In my first screen data from kna1 table is displayed.Now i want to see respective data from vbak table when i double click one particular custnumber.How can i use concept doubleclick for that.can anybody explain me in detail.

    Hello Priyanka
    The sample report ZUS_SDN_TWO_ALV_GRIDS_0 shows how to display sales orders per customer using two ALV grids.
    *& Report  ZUS_SDN_TWO_ALV_GRIDS_0
    *& Description: Display KNA1 in 1st ALV grid,
    *&              select VBAK data by double-clicking
    *& SDN: Reg.Double click concept in classes
    *& Screen '0100' contains no elements.
    *& ok_code -> assigned to GD_OKCODE
    *& Flow logic:
    PROCESS BEFORE OUTPUT.
       MODULE STATUS_0100.
    PROCESS AFTER INPUT.
       MODULE USER_COMMAND_0100.
    REPORT  zus_sdn_two_alv_grids.
    DATA:
      gd_repid         TYPE syrepid,
      gd_okcode        TYPE ui_func,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
      go_cell_top      TYPE REF TO cl_gui_container,
      go_cell_bottom   TYPE REF TO cl_gui_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid,
      gs_layout        TYPE lvc_s_layo.
    DATA:
      gs_knb1          TYPE knb1,
      gt_header        TYPE STANDARD TABLE OF kna1,
      gt_position      TYPE STANDARD TABLE OF vbak.
          CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          md_customer    TYPE kunnr  READ-ONLY.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
          CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
      define local data
        DATA:
          ls_header    LIKE LINE OF gt_header.
        CHECK ( sender = go_grid1 ).
        READ TABLE gt_header INTO ls_header INDEX e_row-index.
        CHECK ( ls_header-kunnr IS NOT INITIAL ).
        md_customer = ls_header-kunnr.
      Triggers PAI of the dynpro with the specified ok-code
       cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).  " not 4.6c
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = 'DETAIL'
         IMPORTING
           RC       =
      ENDMETHOD.                    "handle_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  kna1 INTO TABLE gt_header  UP TO 500 ROWS.
    Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL METHOD go_docking->set_extension
        EXPORTING
          extension  = 99999  " full-screen
        EXCEPTIONS
          cntl_error = 1
          OTHERS     = 2.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Create splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = 2
          columns           = 1
         NO_AUTODEF_PROGID_DYNNR =
         NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Get cell container
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_top.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 2
          column    = 1
        RECEIVING
          container = go_cell_bottom.
    Create ALV grids
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_cell_top
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Set event handler
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent          = go_cell_bottom
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Display data
      gs_layout-grid_title = 'Customers'.
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNA1'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = gt_header
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      gs_layout-grid_title = 'Sales Order per Customer'.
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'VBAK'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = gt_position  " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
         CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    NOTE: dynpro does not contain any elements
      CALL SCREEN '0100'.
    Flow logic of dynpro (does not contain any dynpro elements):
    *PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
    SET TITLEBAR 'xxx'.
    Refresh display of detail ALV list
      CALL METHOD go_grid2->refresh_table_display
       EXPORTING
         IS_STABLE      =
         I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
      User has pushed button "Display Details"
        WHEN 'DETAIL'.
          PERFORM entry_show_details.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  ENTRY_SHOW_DETAILS
          text
    -->  p1        text
    <--  p2        text
    FORM entry_show_details .
    define local data
      DATA:
        ld_title    TYPE lvc_title.
      SELECT        * FROM  vbak INTO TABLE gt_position
             WHERE  kunnr  = lcl_eventhandler=>md_customer. " Sold-to-party
      CONCATENATE 'Sales Order of customer' lcl_eventhandler=>md_customer
        INTO ld_title
        SEPARATED BY space.
      CALL METHOD go_grid2->set_gridtitle
        EXPORTING
          i_gridtitle = ld_title.
    ENDFORM.                    " ENTRY_SHOW_DETAILS
    Regards
       Uwe

  • Reg : BDC issue while updating infotype 40 inside BADI class method

    Hi Friends,
         Actually in my badi class, there is a method where i need to save the infotype fields including comment fields.. So with BDC recording i recorded screen fields and passing the pernr internal table values to recorded pernr values.. by doing this im getting error and so BDC is not upadting the data.. moreover if i pass directly pernr number within single quotes, BDC is working fine and data is getting updated..
    bdc_field        'RP50G-PERNR'   pernr.  --> Error Message while calling transaction through BDC
    bdc_field        'RP50G-PERNR'   '00001234'  ---> updating successfully..
    1. Tell me whether the issue is with BADI or wat ? means we cant able to use BDC inside badi ?
    2. I also tried changing my internal table value of pernr to type 'C' of length 8.. eventhough its showing error..
    Please tell me what i need to do .... ?

    Hi  Dilek Ersoz Adak ,
      I also tried with that, but getting same error..  Below is my error im getting while updating BDC through call transaction,
    1     PA30     SAPMP50A     1000     E     K     PBAS_SERVICE     001     HRADMIN     EPPRELE 00000121     HRAdministrator          CTU     RP50G-PERNR
              Person is treated already by the HR Administrator

  • Reg: Object class stored in CDHDR , CDPOS tables

    Hi Guys,
    we have released blocked Invoice document using transaction MRBR, it is released. we have developed manually zprogram all the invoices which are released manually. but when execute we were unable to get details manually released documents. Here we observed data is fetching from CDHDR,  CDPOS tables. Upon observation the Object class we found after released the invoice is getting saved with object class " BELEG". but in zprogram objcet class checking with " INCOMINGINVOICE".
    can you explain the which scenario object class is saved with "BELEG",  object class is saved with " INCOMINGINVOICE".
    Thanks!
    Mahendar Patha.

    Hi Steve,
    (If I understood your question correctly then) Under the Object Value Column 0350035419 is the Customer number. Also under Table key column 1st three characters are your client i.e. 050 followed by customer number 0350035419.
    -ruby

  • Reg:Table for Custom Messages and custom Messaege Classes

    Hi ,
    My requirement is to find out all custom messages . so can any one tell in which tables all custom messages and custom message classes are stored .
    Thanks & Regards,
    Lakshmi.

    hi,
    You can checkthese tables listed below,
      T100                             Messages
      T100A                            Message IDs for T100
      T100C                            Message Control by User
      T100O                            Assignment of message to object
      T100S                            Configurable system messages
      T100SA                           Application Areas for Configurable Messages
      T100T                            Table T100A text
      T100U                            Last person to change messages
      T100V                            Assignment of messages to tables/views
      T100W                            Assign Messages to Workflow
      T100X                            Error Messages: Supplements
      T100ARBGB                    Application Area
    But The main table for storing all the message classes and their numbers are stored in table
    T100

Maybe you are looking for

  • Upgrade oracle rac 10g r2 10.2.0.3 to 10.2.0.4

    Hi all, I goint to upgrade oracle rac 10g r2 10.2.0.3 to 10.2.0.4 on Solaris 9, in the README file(patchset) does not say that upgrade the OCR, but int he Doc ID 316889.1 to say; it is necessary to upgrade or nothing happens if Iit does not upgrade?

  • Created zone with defaults won't boot completely (Solaris 10, Update 1)

    If I create a zone with defaults, i.e. allowing the zone to inherit the typical package dirs, the resulting zone does not boot completely. When I attach to the zone via zlogin, the zone looks to be in an administrative state. It never boots to a poin

  • ROUTING SERVER ERROR

    Hi, I am using oc4j routing server. I created the node and edge tables as per the documents but it did not create partition table. I tried procedures sdo_router_partition.PARTITION_ROUTER but i got error that "PARTITION_ERROR" does not exists. Then i

  • IPod will only import 1-2 seconds per track. Why?

    For some months when I try to import a CD I only get a second or two of music before it skips to next track and does same. I have had 2 updates and its not been solved. I cannot find 'iPod Updater' on my screen to try to restore factory settings. Ide

  • Access Manager Authentication

    Hi every1, im using JES 2005Q4 on solaris 10 box. i have created a web application which i deployed using the application server. i successfully secured few pages in my application using <security-constraints>. i used filerealm on the application ser