How to export local class to global class in abap ?
is there any report that can export local class to a global class ?
thanks !
Hi,
you can go to SE24 and there you can create a new class with reference to the class already created and your new class will have the same properties as your local class.
Similar Messages
-
How to Export local security setting all filed name & value against filed.
HI all,
I am trying to export local security setting from local policy using bellow scrip. but it is showing only these are configured. I need expert help which allowed me to export all filed with value where it is configure or not. Please give me.
$output=@()
$temp = "c:\"
$file = "$temp\privs.txt"
[string] $readableNames
$process = [diagnostics.process]::Start("secedit.exe", "/export /cfg $file /areas USER_RIGHTS")
$process.WaitForExit()
$in = get-content $file
foreach ($line in $in) {
if ($line.StartsWith("Se")) {
$privilege = $line.substring(0,$line.IndexOf("=") - 1)
switch ($privilege){
"SeCreateTokenPrivilege " {$privilege = "Create a token object"}
"SeAssignPrimaryTokenPrivilege" {$privilege = "Replace a process-level token"}
"SeLockMemoryPrivilege" {$privilege = "Lock pages in memory"}
"SeIncreaseQuotaPrivilege" {$privilege = "Adjust memory quotas for a process"}
"SeUnsolicitedInputPrivilege" {$privilege = "Load and unload device drivers"}
"SeMachineAccountPrivilege" {$privilege = "Add workstations to domain"}
"SeTcbPrivilege" {$privilege = "Act as part of the operating system"}
"SeSecurityPrivilege" {$privilege = "Manage auditing and the security log"}
"SeTakeOwnershipPrivilege" {$privilege = "Take ownership of files or other objects"}
"SeLoadDriverPrivilege" {$privilege = "Load and unload device drivers"}
"SeSystemProfilePrivilege" {$privilege = "Profile system performance"}
"SeSystemtimePrivilege" {$privilege = "Change the system time"}
"SeProfileSingleProcessPrivilege" {$privilege = "Profile single process"}
"SeCreatePagefilePrivilege" {$privilege = "Create a pagefile"}
"SeCreatePermanentPrivilege" {$privilege = "Create permanent shared objects"}
"SeBackupPrivilege" {$privilege = "Back up files and directories"}
"SeRestorePrivilege" {$privilege = "Restore files and directories"}
"SeShutdownPrivilege" {$privilege = "Shut down the system"}
"SeDebugPrivilege" {$privilege = "Debug programs"}
"SeAuditPrivilege" {$privilege = "Generate security audit"}
"SeSystemEnvironmentPrivilege" {$privilege = "Modify firmware environment values"}
"SeChangeNotifyPrivilege" {$privilege = "Bypass traverse checking"}
"SeRemoteShutdownPrivilege" {$privilege = "Force shutdown from a remote system"}
"SeUndockPrivilege" {$privilege = "Remove computer from docking station"}
"SeSyncAgentPrivilege" {$privilege = "Synchronize directory service data"}
"SeEnableDelegationPrivilege" {$privilege = "Enable computer and user accounts to be trusted for delegation"}
"SeManageVolumePrivilege" {$privilege = "Manage the files on a volume"}
"SeImpersonatePrivilege" {$privilege = "Impersonate a client after authentication"}
"SeCreateGlobalPrivilege" {$privilege = "Create global objects"}
"SeTrustedCredManAccessPrivilege" {$privilege = "Access Credential Manager as a trusted caller"}
"SeRelabelPrivilege" {$privilege = "Modify an object label"}
"SeIncreaseWorkingSetPrivilege" {$privilege = "Increase a process working set"}
"SeTimeZonePrivilege" {$privilege = "Change the time zone"}
"SeCreateSymbolicLinkPrivilege" {$privilege = "Create symbolic links"}
"SeDenyInteractiveLogonRight" {$privilege = "Deny local logon"}
"SeRemoteInteractiveLogonRight" {$privilege = "Allow logon through Terminal Services"}
"SeServiceLogonRight" {$privilege = "Logon as a service"}
"SeIncreaseBasePriorityPrivilege" {$privilege = "Increase scheduling priority"}
"SeBatchLogonRight" {$privilege = "Log on as a batch job"}
"SeInteractiveLogonRight" {$privilege = "Log on locally"}
"SeDenyNetworkLogonRight" {$privilege = "Deny Access to this computer from the network"}
"SeNetworkLogonRight" {$privilege = "Access this Computer from the Network"}
$sids = $line.substring($line.IndexOf("=") + 1,$line.Length - ($line.IndexOf("=") + 1))
$sids = $sids.Trim() -split ","
$readableNames = ""
foreach ($str in $sids){
$str = $str.substring(1)
$sid = new-object System.Security.Principal.SecurityIdentifier($str)
$readableName = $sid.Translate([System.Security.Principal.NTAccount])
$readableNames = $readableNames + $readableName.Value + ", "
$output += New-Object PSObject -Property @{
privilege = $privilege
readableNames = $readableNames.substring(0,($readableNames.Length - 1))
#else = $line."property"
$outputAs an alternate approach wee can preset the hash and just update it. This version also deal with trapping the errors.
function Get-UserRights{
Param(
[string]$tempfile="$env:TEMP\secedit.ini"
$p=Start-Process 'secedit.exe' -ArgumentList "/export /cfg $tempfile /areas USER_RIGHTS" -NoNewWindow -Wait -PassThru
if($p.ExitCode -ne 0){
Write-Error "SECEDIT exited with error:$($p.ExitCode)"
return
$selines=get-content $tempfile|?{$_ -match '^Se'}
Remove-Item $tempfile -EA 0
$dct=$selines | ConvertFrom-StringData
$hash=@{
SeCreateTokenPrivilege =$null
SeAssignPrimaryTokenPrivilege=$null
SeLockMemoryPrivilege=$null
SeIncreaseQuotaPrivilege=$null
SeUnsolicitedInputPrivilege=$null
SeMachineAccountPrivilege=$null
SeTcbPrivilege=$null
SeSecurityPrivilege=$null
SeTakeOwnershipPrivilege=$null
SeLoadDriverPrivilege=$null
SeSystemProfilePrivilege=$null
SeSystemtimePrivilege=$null
SeProfileSingleProcessPrivilege=$null
SeCreatePagefilePrivilege=$null
SeCreatePermanentPrivilege=$null
SeBackupPrivilege=$null
SeRestorePrivilege=$null
SeShutdownPrivilege=$null
SeDebugPrivilege=$null
SeAuditPrivilege=$null
SeSystemEnvironmentPrivilege=$null
SeChangeNotifyPrivilege=$null
SeRemoteShutdownPrivilege=$null
SeUndockPrivilege=$null
SeSyncAgentPrivilege=$null
SeEnableDelegationPrivilege=$null
SeManageVolumePrivilege=$null
SeImpersonatePrivilege=$null
SeCreateGlobalPrivilege=$null
SeTrustedCredManAccessPrivilege=$null
SeRelabelPrivilege=$null
SeIncreaseWorkingSetPrivilege=$null
SeTimeZonePrivilege=$null
SeCreateSymbolicLinkPrivilege=$null
SeDenyInteractiveLogonRight=$null
SeRemoteInteractiveLogonRight=$null
SeServiceLogonRight=$null
SeIncreaseBasePriorityPrivilege=$null
SeBatchLogonRight=$null
SeInteractiveLogonRight=$null
SeDenyNetworkLogonRight=$null
SeNetworkLogonRight=$null
for($i=0;$i -lt $dct.Count;$i++){
$hash[$dct.keys[$i]]=$dct.Values[$i].Split(',')
$privileges=New-Object PsObject -Property $hash
$privileges
Get-UserRights
A full version would be pipelined and remoted or, perhaps use a workflow to access remote machines in parallel.
¯\_(ツ)_/¯ -
How to assign local variable to global variable dynamically in adobe livecycle designer 7.1
Hi All,
i want to assign my textfield value to global variable dynamically.so that where ever i want , i will access my global variable.so it is possible in adobe livecycle designer 7.1. kindly suggest me method.Thanks in advance.
Thanks & Regards
GaneshPlease remove all adobe livecycle designer versions from your local pc.
restart your pc to be sure, that all temp data is deleted.
download the newest ald version from service.sap.com and install it.
have fun with developing adobe forms with sap transaction sfp. -
Hi,
i try to import local classes to global classes and i have error ,
in the program in se 80 (lcocal) i declare global declaration
like:
TYPE-POOLS icon.
TYPES: ty_fuel TYPE p DECIMALS 2,ty_cargo TYPE p DECIMALS 2.
and after that i declare the local class in includes .. and/// start of selection
where i put it ?
RegardsHi,
i don't build another program the declaration is in the local progarm,
and i have method that have to use icon ,
where i put this declaration i try in local types but i have error .
Explicit length specifications are necessary with types C, P, X, N, and
W in the OO context.
Regards -
Event handling in global class (abap object)
Hello friends
I have 1 problem regarding events in abap object... how to handel an event in global class in se24 .
Regards
Reema jain.
Message was edited by:
Reema JainHello Reema
The following sample report shows how to handle event in principle (see the § marks)..
The following sample report show customer data ("Header"; KNB1) in the first ALV list and sales areas ("Detail"; KNVV) for the selected customer (event double-click) in the second ALV list.
*& Report ZUS_SDN_TWO_ALV_GRIDS
REPORT zus_sdn_two_alv_grids.
DATA:
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:
gt_knb1 TYPE STANDARD TABLE OF knb1,
gt_knvv TYPE STANDARD TABLE OF knvv.
"§1. Define and implement event handler method
" (Here: implemented as static methods of a local class)
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
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_knb1 TYPE knb1.
CHECK ( sender = go_grid1 ).
READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
CALL METHOD go_grid1->set_current_cell_via_id
EXPORTING
* IS_ROW_ID =
* IS_COLUMN_ID =
is_row_no = es_row_no.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = '1000'.
* 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.
* 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.
"§2. Set event handler (after creating the ALV instance)
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1. " Or:
" SET HANDLER: lcl_eventhandler=>handle_double_click FOR all instances.
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 = 'KNB1'
is_layout = gs_layout
CHANGING
it_outtab = gt_knb1
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 = 'Customers Details (Sales Areas)'.
CALL METHOD go_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'KNVV'
is_layout = gs_layout
CHANGING
it_outtab = gt_knvv " 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
CALL METHOD go_docking->link
EXPORTING
repid = syst-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_row TYPE i,
ls_knb1 TYPE knb1.
CALL METHOD go_grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT * FROM knvv INTO TABLE gt_knvv
WHERE kunnr = ls_knb1-kunnr.
ENDFORM. " ENTRY_SHOW_DETAILS
Regards
Uwe -
Export global classes to a local file
Hi,
is it possible to export a global class with all of its attributes, types, methods and more to a local file for archiving purposes?
We are currently using ECC 6.0, btw.
MichaelSure, via [SAPlink|http://code.google.com/p/saplink/]
Regards
Marcin -
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. -
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 ManoharanHi 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. -
Create Global Class Definition using Local Class Source Code
I would like to be able to automate the creation of global class definitions using source code that is defined in a text file (one example: convert a local class def to a global class def).
Does SAP deliver this functionality? (I'm already aware of the various classes that can be used to create global classes and how those classes can be implemented in a program to generate new classes. I'm hoping to avoid having to create a custom solution.)
Thanks in advance!We have a winner!
Thanks Rich!
It's not a 100% solution - I was hoping to be able to generate global classes/interfaces using source code alone, without requiring user intervention.
It <i>is</i> however, a 90-95% solution because debugging SE24 reveals that by using a combination of the FM's SCAN_ABAP_OBJECTS_CLASSES & SEO_CLIF_MULTI_IMPORT, I should be able to <u>quickly</u> put together that custom application that I was trying to avoid.
I knew about the existance of SEO_CLIF_MULTI_IMPORT but I did not know about SCAN_ABAP_OBJECTS_CLASSES. I'm very happy to learn that I'm not going to have to write a parser! -
Hi everybody.
I want export a global class (SE24, Object Builder) to a local class in a INCLUDE, but unfortunally the Object Builder has no export function.
Does anybody know a way to change a global class to a local class?
Thx.There's no easy way. I'm at a bit of a loss why you'd want to replace a global class witha local class that you include in your programs. What do you gain?
But if you insist, you can always cut and paste the public/private/protected sections of your class (making suitable modifications and assuming you're not on an old SAP version), and then you'd have to cut and paste the method implementations in as well.
Printing a class to a the spool is a fairly good way of getting all its details. Another alternative is to search these forums for where the includes that actually make up the class are - it should be fairly simple to write a program that would take that source code and construct local classes from it. But I still don't see the point. -
Export global classes into program
Hello,
it is possible to import local classes from program into
class builder.
I would like to export global classes into program. Is there such a thing (4.6C)?
Thank you, in advance for your responses.
Best regards
SergejSure, via [SAPlink|http://code.google.com/p/saplink/]
Regards
Marcin -
How to buield global class in se24
hallow
i wont to do a global class in se 24 how i do that becose i go to metod and put metod but where i put defntion or anoter thihngs that the class work well ?
regardshi sharma
lets say i put in metod
method CLASS_CONSTRUCTOR.
a_user = sy-uname.
endmethod.
where i put the defntion of a_user or id like i do in program .
thankes
CLASS c_user DEFINITION.
PUBLIC SECTION.
CLASS-DATA: instance_count type i.
<b>DATA: id type i.</b>
METHODS: CONSTRUCTOR,
display,
get_user RETURNING value(p_user) like sy-uname.
PRIVATE SECTION.
<b>DATA: a_user like sy-uname.</b>
ENDCLASS. -
Hi Friends,
Can a local class make friend with global class???
for example i have a local class in se38 editor and this local class should access the private attribute of global class which is there in se24.
DeepakHI Deepak
Yo can define your ABAP Unit test class as a friend of the global class to be tested in the local class definition include of your global class. So, you have to add a line of code like
CLASS <name of global class to be tested> DEFINITION LOCAL FRIENDS <name of local ABAP Unit class> in the include where the definition of local ABAP Unit Class is in. Then you can call the private methods of your global class in the local abap unit class methods.
just refer these links
http://help.sap.com/saphelp_nw2004s/helpdata/en/ec/d9ab291b0b11d295400000e8353423/content.htm
local class -> global class
Regards Rk -
Local class as a friend of a global class
Hi guys,
I'm just wondering if I could make a local class which is defined in the local section of a global class to its friend. I need this to check private attriutes and methods with abap unit.
Regards ChristianHi Christian,
Yo can define your ABAP Unit test class as a friend of the global class to be tested in the local class definition include of your global class. So, you have to add a line of code like
CLASS in the include where the definition of local ABAP Unit Class is in. Then you can call the private methods of your global class in the local abap unit class methods.
Regards,
Sükrü -
Using container from another global class
There are two global classes being used by me in a program - Class A and Class B.
Class A contains the container to display ALV.
Class B contains the logic to display ALV.
class B is used as attribute class in Class A.
How is that I can use the container from Class A from class B?Like this?
class A ...
public section.
methods: get_container returining value(ref_cont) type ref to ...,
constructor.
private section.
data ref_container type ref to....
endclass.
class A impl...
method get_container.
ref_cont = me->ref_container.
endmethod.
method constructor.
create object ref_container ....
endmethod.
endclass.
class B ...
public section.
methods: constructor,
display alv.
private section.
data ref_alv type ref to....
data ref_A type ref to A.
endclass.
class B impl...
method constructor.
data lr_container type ref to ...
if ref_A is not bound.
create object ref_A.
endif.
"get container from class A
lr_container = ref_A->get_container( ).
create object ref_alv
exporting
container = lr_container
endmethod.
method display_alv.
call method ref_alv->set_table_for_first_display...
endmethod.
endclass.
If storing container's reference under local LR_CONTAINER in class B constructor causes not displaying ALV, you will have to store this under class B attribute. Alternative would be directly indicating the container reference as parent to ALV by calling functional method like
create object ref_alv
exporting
container = ref_A->get_container( )
this will however work in recent releases of SAP NW AS.
Regards
Marcin
Maybe you are looking for
-
The error message is: Server not found Firefox can't find the server at co108w.col108.mail.live.com. If I then hit "Home" it goes to the home page. Changing the home page hasn't helped. Resetting Firefox hasn't helped. This just started today. Restar
-
Report on which computers have which version of Internet Explorer?
Hi, Does anyone know of a simple report or way of reporting on which computers have which version of Internet Explorer? e.g. I expect to mostly find 7, but checking also for 6 & 8). As its integrated into the OS this isn't as easy to determine as wit
-
Current Date plus number of days script
Hi All, I have a form I am building which has a date field (currently setup to specifiy todays date on load). There is a field that slects number of days until a billing cycle (currently 0 through 13 days). I need to setup a script that takes todays
-
A sticky problem updating fields on a tabular form
I have an application where I'm trying to match skillset supply to skillset demand. We have resources and we have work for resources to do. Resources possess a set of skills. Work requires a set of skills. Skillsets are described by three fields: Dom
-
Calendar portlet - bad zip file
Please replace the zip file for the calendar portlet. CRC error - premature end of file reached. Thanks.