Regarding class builder(SE24)
Hi to all,
I want to know how to create classes and its interfaces and methods using <b>SE24</b> transactions. Is there any documentation for this?
Hi,
Just check the following links.
1) http://help.sap.com/saphelp_46c/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
2) http://help.sap.com/saphelp_46c/helpdata/en/d6/0db357494511d182b70000e829fbfe/frameset.htm
3) http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm
4) http://www.sapgenie.com/abap/example_code.htm ABAP example code
5) http://www.geocities.com/SiliconValley/Campus/6345/abapindx.htm
6) http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
7) http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm SAP Online Help.
9) http://www.sap-img.com/abap-function.htm ABAP Function Modules
10) http://www.sapgenie.com/abap/code/abap19.htm
11) http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm ABAP Quest
12) http://www.planetsap.com/Tips_and_Tricks.htm Tricks & TIps for ABAP
13) http://help.sap.com/saphelp_40b/helpdata/ru/d6/0dc169494511d182b70000e829fbfe/applet.htm SAP Online Help.
14) http://www.henrikfrank.dk/abapexamples/SapScript/symbols.htm symbols & Controls commands
15) http://www.henrikfrank.dk/abapexamples/index.html ABAP Examples
16) http://sap.ittoolbox.com/documents/document.asp?i=752 SAP Introduction to ABAP Helps
17) http://members.aol.com/_ht_a/skarkada/sap/ SAP and ABAP Goodies
18) http://sappoint.com/abap/ SAP/ABAP Technical site.
19) http://members.tripod.com/abap4/SAP_Functions.html SAP Functions-ABAP Hints and Tips
20) http://members.ozemail.com.au/~anmari/sap/index.html SAP R/3 Configurations
21) http://www.planetsap.com/Userexit_List.htm All User-Wxirs
22) http://www.planetsap.com/Tips_and_Tricks.htm
23) http://www.kabai.com/abaps/q.htm
24) http://www.planetsap.com/Userexit_List.htm User-Exits
25) http://help.sap.com/saphelp_bw21c/helpdata/en/c4/3a8090505211d189550000e829fbbd/frameset.htm bakground jobs
26) http://www.sapgenie.com/abap/bapi/example.htm BAPI step by step
27) http://help.sap.com/saphelp_45b/helpdata/en/65/897415dc4ad111950d0060b03c6b76/content.htm SAPscript: Definition of borders, lines, and shading
28) http://www.sap-basis-abap.com/index.htm SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips
29) http://help.sap.com/saphelp_40b/helpdata/en/fc/eb2c46358411d1829f0000e829fbfe/frameset.htm SAP Online help Dialog
30) http://help.sap.com/saphelp_46c/helpdata/en/aa/aeb23789e95378e10000009b38f8cf/frameset.htm Dilaog Prog.
31) http://www.geocities.com/ResearchTriangle/1635/system.html System fields
32) http://www.sapdesignguild.org/resources/MiniSG/3_Managing/3_Functions_Table_Control.htm Function of table control
33) http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm Defining table control
34) http://www.sapfans.com/sapfans/repos/saprep.htm SAP Repository
35) http://www.planetsap.com/howdo_a.htm ABAP
36) http://help.sap.com/saphelp_util464/helpdata/en/69/c2516e4ba111d189750000e8322d00/content.htm Table Maintenance Dialog
37) http://www.sapgenie.com/abap/smartforms_detail.htm smart forms
38) http://www.sap-img.com/abap.htm Sample ABAP Codes
3 9) http://help.sap.com/saphelp_46c/helpdata/en/fc/eb2d67358411d1829f0000e829fbfe/content.htm Processing Blocks in ABAP Programs
40) http://www.geocities.com/victorav15/sapr3/abap.html ABAP/4 compendium.
41) http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm SAP SCRIPT IMP
42) http://abap4.tripod.com/Other_Useful_Tips.html Additional useful Tips
43) http://help.sap.com/saphelp_45b/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm Searach Helps
44) http://www.sap-basis-abap.com/sapmm.htm SAP MM (Materials Management) Configuration Hints and Tips
45) http://sap.ittoolbox.com/nav/t.asp?t=303&p=448&h1=303&h2=322&h3=448
46) http://sapfans.com
Similar Messages
-
How to define event hander interface in Class Builder (se24)?
Hello,
I've got the following local interface defined.
INTERFACE lif_alv_grid_event_handler.
METHODS:
handle_button_click FOR EVENT button_click OF cl_gui_alv_grid
IMPORTING es_col_id es_row_no,
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column es_row_no,
handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id e_column_id es_row_no,
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDINTERFACE.
Now I want to define it as a dictionary object using se24.
My problem is I could not find the quivalent of "FOR EVENT"
word in it.
Is there any chance to do that in Class Builder?
Best regards
PawelHello Pawel
Display your class with the event handler methods in SE24 / SE80 and choose the DETAIL button (above the table control with the methods).
Here you can define a method as "event handler for" an event of another class.
On SAP release >= 6.20 you can right-click on a method in the tree view and choose context menu function Display -> Definition (tabstrip Attributes ).
Regards
Uwe -
How to assign the events in a specific method in class builder(se24)
i have declared one event in event part.i want to asign the event to one method .can any one help me .i have to do it in se24.pls
hi,
create a class in se24.
<b>click the <b>EVENTS</b> tab, define an event.</b>
<b>click the <b>METHODS</b> tab, define a method to trigger/ raise the event</b>
<b>define one more method as an event handler method for the event.</b>
for a method to be an event handler, click on the detail view,
select the check box <b>Event Handler for</b> give the classname where the event is defined and the event name, click on Change button.
<b>event can be in the same class or different from that of the event handler method.</b>
don't forget to <b>register the event handler method in the program.</b>
click the code button of ur trigger method(meth2 in my example) and write there,
raise event evt1.
now your class is ready.
now in se38 program,
declare a reference variable to ur class,
create an object,set the handler for ur event,
call the trigger method
<b>data:oref type ref to zsowcl1.
create object oref.
set handler oref->meth1 for oref. handler method
call method oref->meth2. raise evnt method</b>
hope it gives you clear idea,
Regards,
Message was edited by:
sowjanya s -
Forward Declaration in Class Builder
Hi All,
In the Class Builder (SE24)when i create a new Class, There is an option of Forward declaration in the Property Tab. In this, we can add Type Group Interface and Class. What is the Purpose of this forward declaration?
The F1 help does not provide any help.
Regards,
Kapil.in addition to above replies, it can be used for classes and interfaces in that case Forward declaration is equivalent to
CLASS <class_name> DEFINITION LOAD.
interface <interface_name> load
statements which are normally used in Program ( case for local classes )
use of Load from SAP docu
... LOAD
Effect
The variant with the LOAD addition loads a global class class from the Class Library. This statement was needed before Release 6.20 if you wanted to access one of the static components of class from within a program, or to declare an event handler for class before class had been loaded automatically. From Release 6.20 onwards, the LOAD addition is only needed if the compilation of an ABAP program fails because it includes recursive accesses of a globa l class. In such cases, you may be able to make the program compilable by explicitly loading the class before recursion.
Thanks,
kranthi. -
To use logical database PNP in class builder
Hi
Inside the class builder (SE24), i have a created a method.
Now while implementing that method, that is between method and endmethod
statement can i implement logical database PNP or PNPCE.
If 'yes' how to use it.
if 'no' what is the other way to implement authorization.
Pls help meHello,
assume that the routines GET_ITnnnn are written by yourself. For reading infotypes ABAP Objects provides us with same very helpful classes as shown below:
* define data
DATA:
gif_employee type ref to if_pt_employee,
go_employee type ref to cl_pt_employee,
gt_infotypes TYPE tim_tmw_itlist_tab,
go_control TYPE REF TO if_pt_td_control,
go_data TYPE REF TO if_pt_td_base,
go_pnnnn TYPE REF TO if_pt_td_itnnnn,
gt_p0001 TYPE TIM_P0001_TAB,
gt_p0002 TYPE TIM_P0002_TAB,
gt_p0003 TYPE TIM_P0003_TAB.
start-of-selection.
GET pernr.
<b>* Create employee instance</b>
gif_employee = cl_pt_employee=>get_employee( pernr ).
go_employee ?= gif_employee.
<b>* Get master infotypes (0001, 0002)</b>
CALL METHOD go_employee->get_master_data
EXPORTING
im_begda = id_fromdate
im_endda = id_todate
IMPORTING
* EX_I0000 =
EX_I0001 = gt_p0001
EX_I0002 = gt_p0002
* EX_I0007 =
* EX_I0008 =
<b>* Append all other required infotypes to itab</b>
APPEND '0003' TO gt_infotypes.
CALL METHOD go_employee->get_infotypes
EXPORTING
i_itlist = gt_infotypes
i_fromdate = id_fromdate " start date
i_todate = id_todate " end date
* I_FILTER =
i_noauthcheck = 'X'
IMPORTING
e_result = gt_infty_request
e_retcd = gd_retcd.
* Please see documentation of parameter e_retcd...
LOOP AT gt_infty_request INTO go_control.
go_data = go_control->data. <b>" get data object</b>
* Casting
TRY.
go_pnnnn ?= go_data.
CATCH cx_sy_move_cast_error.
CONTINUE.
ENDTRY.
<b>* Convert infotype (semi-transparent -> transparent)</b>
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = lo_pnnnn->prelp
IMPORTING
pnnnn = gs_p0003.
APPEND gs_p0027 TO gt_p0003.
ENDLOOP.
The class CL_PT_EMPLOYEE provides us already with very easy access to so-called master infotypes (000, 0001, 0002, 0007 and 0008). All other infotypes can be read using method GET_INFOTYPES.
Using these classes we have a very convenient and standardized way of accessing all kinds of infotypes.
Vasanth -
OO ABAP - Retrieve source from Class Builder?
Hi. Is there a way to display the source code for a class or interface definition that was created with the class builder (se24).
I looked through the drop downs, but I didn't see anything to display the source.
Thanks in advance.
BrendanA class is distributed upon several includes. The Se24 in my 45b system offers to view the source via button on the bottom of the method list.
If you like you can try the following sample program also. Just paste the source and create the Pf-Status 'STA_MAIN' (line 135) and add the commands PICK(f2),Back, Exit, My_Edit(any key).
PS: double clicking on a include navigates forward ( if PICK is set to F2 ).
PPS: If you experience trouble with pasting the code and lost line termination, please paste into wordpad an save as text file.
[code]
report: Ze80Lite
created: 17.aug.2000
purpose
this report displays various informations of report-source files
Change History
#nn - dd.mmm.yyyy - Author
short description
#00 - 17.aug.2000 - KZI
initial
report Ze80Lite
no standard page heading
line-size 120
message-id sx.
*$ external types & constants =====================
*======================================================================
*$ local types ========================================================
*======================================================================
types:
typ_source type string,
typ_source_tab type standard table of typ_source,
begin of typ_file_info,
lsind type syst-lsind,
isvalid type flag,
r3state type d010sinf-r3state,
prgnam type programm,
srcnam type programm,
prgtyp type d010sinf-subc,
end of typ_file_info,
begin of typ_line_info,
flag_newline type flag,
flag_comment type flag,
text type string,
end of typ_line_info,
begin of typ_method_info,
methodname type tmdir-methodname,
methodindx type tmdir-methodindx,
end of typ_method_info,
typ_method_info_tab type standard table of typ_method_info,
typ_line_tab type standard table of typ_line_info.
selection-screen begin of block sel1 with frame title text-s01.
parameter:
p_prgnam type programm obligatory,
p_state type d010sinf-r3state default 'I',
p_typprg radiobutton group 0001 default 'X',
p_typcla radiobutton group 0001,
p_typifc radiobutton group 0001,
p_typfct radiobutton group 0001,
p_typmod radiobutton group 0001,
p_typool radiobutton group 0001.
selection-screen end of block sel1.
constants:
begin of gcr_rep,
typ_prg type i value 1,
typ_cla type i value 2,
typ_ifc type i value 3,
typ_fct type i value 4,
typ_mod type i value 5,
typ_pool type i value 6,
max_modi type syst-lsind value 5,
max_width type i value 80,
mem_prg type memoryid value 'ST22_PRGNAME',
mem_typ type memoryid value '91A', " missuse
mem_dir type memoryid value '91B', " missuse
mem_sta type memoryid value '91C', " missuse
end of gcr_rep.
data:
goa_file type standard table of typ_file_info.
=====================================================================
*$ report eventing ====================================================
=====================================================================
initialization.
perform sub_init.
at selection-screen.
perform sub_check.
start-of-selection.
perform sub_main.
at line-selection.
perform sub_click.
at user-command.
perform sub_command
using sy-ucomm.
sy-ucomm = ''.
=====================================================================
*$ subroutines ========================================================
=====================================================================
form : sub_main
purp. : main entry point for procecssing
param : <global> from selectio screen
rcode : ---
hist. : #00 - KZI - created
form sub_main.
data declaration
data:
lon_error type i,
lon_srctyp type i,
loc_srcnam type programm,
lor_file type typ_file_info.
init
set pf-status 'STA_MAIN'.
clear:
lor_file,
goa_file.
do 10 times.
append lor_file to goa_file[].
enddo.
get the type
" keep in sync with parameter, sub_check, sub_init
case 'X'.
when p_typprg.
lon_srctyp = gcr_rep-typ_prg.
when p_typcla.
lon_srctyp = gcr_rep-typ_cla.
when p_typifc.
lon_srctyp = gcr_rep-typ_ifc.
when p_typfct.
lon_srctyp = gcr_rep-typ_fct.
when p_typmod.
lon_srctyp = gcr_rep-typ_mod.
when p_typool.
lon_srctyp = gcr_rep-typ_pool.
when others.
lon_srctyp = gcr_rep-typ_prg.
endcase.
get true name
perform sub_get_srcnam
using
lon_srctyp
p_prgnam
changing
lon_error
loc_srcnam.
perform sub_dsp_source
using
p_prgnam
loc_srcnam.
the end
exit. " form
endform. "sub_main
form : sub_click
purp. : entry point for line selection
param : <global> sy-lisel
rcode : ---
hist. : #00 - KZI - created
form sub_click.
data declaration
data:
lon_error type i,
loc_prgnam type programm,
loc_srcnam type programm.
get possibly program name
if ( 0 eq lon_error ).
perform sub_get_word_from_list
changing
loc_prgnam.
if ( '' eq loc_prgnam ).
lon_error = 1.
else.
translate loc_prgnam to upper case.
endif.
endif.
get source name
if ( 0 eq lon_error ).
case loc_prgnam.
when 'METHODS'.
perform sub_dsp_methods.
when others.
perform sub_get_srcnam
using
gcr_rep-typ_prg
loc_prgnam
changing
lon_error
loc_srcnam.
if ( 0 eq lon_error ).
perform sub_dsp_source
using
loc_srcnam
loc_srcnam.
endif.
endcase.
endif.
the end
exit. " form
endform. "sub_click
form : sub_command
purp. : entry point for user command
param : ---
rcode : ---
hist. : #00 - KZI - created
form sub_command
using
value(poc_cmd) type syst-ucomm.
data declaration
data:
lon_error type i,
lon_lsind type syst-lsind,
lor_file type typ_file_info.
try to catch a valid file info
if ( 0 eq lon_error ).
read table goa_file[]
into lor_file
with key lsind = sy-lsind.
if ( 0 ne sy-subrc ).
lon_error = 1.
elseif ( 'X' ne lor_file-isvalid ).
lon_error = 1.
endif.
endif.
dispatch work
if ( 0 eq lon_error ).
case poc_cmd.
when 'MY_EDIT'.
editor-call for report lor_file-srcnam display-mode.
when 'MY_HELP'.
perform sub_dsp_help.
when others.
" nop
endcase.
endif.
endform. "sub_command
form : sub_get_word_from_list
purp. : get the word clicked on
param : <global> sy-lisel
rcode : ---
hist. : #00 - created
#01 - fixed a problem with words starting in first column
form sub_get_word_from_list
changing
prc_srcnam type programm.
data:
loc_cmp(1) type c,
lon_bgn type i,
lon_end type i,
lon_len type i.
get fundamental data
lon_len = strlen( sy-lisel ).
lon_bgn = sy-cucol.
lon_end = sy-cucol.
find begin/end of word
do.
loc_cmp = sy-lisel+lon_bgn(1).
if
'' eq loc_cmp or
'"'',.' ca loc_cmp
exit." do
endif.
lon_bgn = lon_bgn - 1.
if ( 0 GT lon_bgn ).
exit. " do
endif.
enddo.
lon_bgn = lon_bgn + 1.
do.
loc_cmp = sy-lisel+lon_end(1).
if
lon_len le lon_end or
'' eq loc_cmp or
'"'',.' ca loc_cmp
exit.
endif.
lon_end = lon_end + 1.
enddo.
lon_end = lon_end - 1.
if end >= begin give it back
if ( lon_end ge lon_bgn ).
lon_len = lon_end - lon_bgn + 1.
prc_srcnam = sy-lisel+lon_bgn(lon_len).
endif.
endform. "sub_get_word_from_list
form : sub_get_srcnam
purp. : builds sourcename according to selection screen settings
param : pon_prgtyp distinquish the various program types
pon_prgnam the program name used to build the source file
rcode : prn_error 0 success, else failure
prc_srcnam name of sourcefile
hist. : #00 - KZI - created
form sub_get_srcnam
using
value(pon_prgtyp) type i
value(poc_prgnam) type program
changing
prn_error type i
prc_srcnam type programm.
data declaration
data:
lon_error type i, " local errorflag
x type i, " simple counter
y type i, " simple counter
lor_tfdir type tfdir. " prog info tab.
build the true filename dependend on prg type
" keep this source in sync with parameter, sub_check, sub_init
case pon_prgtyp.
when gcr_rep-typ_prg.
" simple program
prc_srcnam = poc_prgnam.
when gcr_rep-typ_cla.
" class
prc_srcnam = poc_prgnam.
x = strlen( poc_prgnam ).
if ( 30 > x ).
y = 30 - x.
prc_srcnam+x(y) = '=============================='.
endif.
prc_srcnam+30(2) = 'CP'.
when gcr_rep-typ_ifc.
" interface
prc_srcnam = poc_prgnam.
x = strlen( poc_prgnam ).
if ( 30 > x ).
y = 30 - x.
prc_srcnam+x(y) = '=============================='.
endif.
prc_srcnam+30(2) = 'IP'.
when gcr_rep-typ_fct.
" function pool
concatenate
'SAPL'
poc_prgnam
into prc_srcnam.
when gcr_rep-typ_mod.
" function module
select
single *
into lor_tfdir
from tfdir
where funcname = poc_prgnam.
if ( 0 eq sy-subrc ).
concatenate
'L'
lor_tfdir-pname+4
'U'
lor_tfdir-include
into prc_srcnam.
else.
lon_error = 1.
endif.
when gcr_rep-typ_pool.
" type pool
concatenate '%_C' poc_prgnam into prc_srcnam.
when others.
" unknown type
lon_error = 1.
endcase.
the end
if ( 0 eq lon_error ).
prn_error = 0.
else.
prn_error = 1.
prc_srcnam = p_prgnam.
endif.
endform. "sub_get_srcnam
form : Sub_Dsp_Methods
purp. : displays methods of a Class
param : prc_ClassName the name of the class to display methods from
rcode :
hist. : #00 - KZI - created
form sub_dsp_methods.
data declaration
constants:
c_Num_Index type i value 35,
c_Num_Modulo type i value 36,
c_Index(37) type c
value '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ?'.
data:
lon_Fraction type i,
lon_Modulo type i,
lon_Index type i,
lon_Offset type i,
loa_methods type typ_method_info_tab,
loc_Class_Name type tmdir-classname,
loc_include_Name type programm,
lor_file type typ_file_info,
loc_Index(3) type c.
field-symbols:
<lor_method> type typ_method_info.
init &_ precheck
lor_file-isvalid = ''.
lor_file-prgtyp = ''.
lor_file-lsind = sy-lsind + 1.
modify goa_file[] from lor_file index lor_file-lsind.
read table goa_file[] index sy-lsind into lor_file.
if ( 0 ne sy-subrc or 'X' ne lor_File-isValid ).
exit.
endif.
loc_Class_Name = lor_File-PrgNam.
if ( loc_class_name cs '=' ).
loc_Class_Name = loc_class_name(sy-fdpos).
endif.
get all methods
select methodname methodindx from tmdir
into corresponding fields of table loa_methods[]
where
classname = loc_class_name AND
methodname <> ''
order by
methodindx.
if ( 0 ne sy-subrc ).
write:
'could not be loaded!'(e04),
/ 'No entry in TMDIR,' , loc_class_name.
exit.
endif.
put em on the list.
Format: Reset.
loc_Include_Name = loc_Class_Name.
concatenate
loc_Include_Name
'=================================================='
into loc_Include_Name.
loc_Include_Name+30 = 'CM'.
loop at loa_methods[] assigning <lor_method>.
loc_Index = '000'.
lon_Offset = 3.
lon_Modulo = <lor_Method>-MethodIndx mod c_Num_Modulo.
lon_Fraction = <lor_Method>-MethodIndx div c_Num_Modulo.
while ( ( lon_Fraction > 0 or lon_Modulo > 0 ) and lon_Offset > 0 ).
lon_Offset = lon_Offset - 1.
loc_Indexlon_Offset(1) = c_Indexlon_Modulo(1).
loc_Include_Name+32 = loc_Index.
lon_Modulo = lon_Fraction mod c_Num_Modulo.
lon_Fraction = lon_Fraction div c_Num_Modulo.
endwhile.
write: /
loc_include_name intensified,
at 40 <lor_method>-methodname(40).
endloop.
endform. "sub_Dsp_Methods
form : sub_Dsp_Source
purp. : loads source file from database and displays its contents
with write
param : prc_srcnam name of source piece to display
rcode : <hide> name of occasional included files
hist. : #00 - KZI - created
form sub_dsp_source
using
value(poc_prgnam) type programm
value(poc_srcnam) type programm.
data declaration
data:
lon_error type i,
lon_warn type i,
loa_source type standard table of typ_source,
loa_lines type typ_line_tab,
loc_line type string,
loc_print type string,
lon_tmp type i,
lon_tabix type syst-tabix,
lor_d010sinf type d010sinf,
lor_file type typ_file_info.
field-symbols:
<lof_source> type typ_source,
<lof_line> type typ_line_info.
init &_ precheck
format:
reset.
if ( gcr_rep-max_modi lt sy-lsind ). " limit modes
sy-lsind = gcr_rep-max_modi.
endif.
lor_file-srcnam = poc_srcnam.
lor_file-prgnam = poc_prgnam.
lor_file-lsind = sy-lsind + 1.
lor_file-r3state = p_state.
poc_srcnam = ucase( poc_srcnam ).
check existance
if ( 0 eq lon_error ).
select *
from d010sinf up to 1 rows
into lor_d010sinf
where
prog = poc_srcnam
order by
r3state
cdat.
if ( lor_d010sinf-r3state eq p_state ).
exit. " loop
endif.
endselect.
if ( 0 ne sy-subrc ).
lon_error = 1.
write:
'could not be loaded!'(e04),
/ 'No entry in D010SINF,' , poc_srcnam.
endif.
endif.
get report text
if ( 0 eq lon_error ).
read report poc_srcnam into loa_source[] state p_state.
if ( 0 ne sy-subrc and 'I' eq p_state ).
read report poc_srcnam into loa_source[] state 'A'.
lon_warn = 1.
endif.
if ( 0 ne sy-subrc ).
lon_tmp = strlen( poc_srcnam ).
write: / 'Program'(e01).
format inverse on. format color col_negative on.
write at (lon_tmp) poc_srcnam.
format inverse off. format color col_negative off.
write: /
'Cannot load source info, sy-subrc= '(e02),sy-subrc.
endif.
endif.
create display
if ( 0 eq lon_error ).
perform sub_dsp_source_lines
using
poc_prgnam
0
0
loa_source[]
changing
lon_error.
endif.
update internal memory
if ( 0 eq lon_error ).
lor_file-isvalid = 'X'.
if ( 0 eq lon_warn ).
lor_file-r3state = p_state.
else.
lor_file-r3state = 'A'.
endif.
lor_file-prgtyp = lor_d010sinf-subc.
else.
lor_file-isvalid = ''.
lor_file-prgtyp = ''.
endif.
modify goa_file[] from lor_file index lor_file-lsind.
the end
if ( 0 ne lon_warn ).
message s777 with
'There is no inactive version => no upload possible!'(i01).
endif.
exit. " form
endform. "sub_dsp_source
form : sub_dsp_source_lines
purp. : loads source file from database and displays its contents
with write
param : poc_prgnam name of source piece to display
pra_source source to display
rcode : prn_error 0 success
hist. : #00 - KZI - created
form sub_dsp_source_lines
using
value(poc_prgnam) type programm
value(pon_lwr_ndx) type i
value(pon_upr_ndx) type i
pra_source type typ_source_tab
changing
prn_error type i.
data declaration
data:
lon_Strlen type i,
lon_Tabix(5) type n,
loa_lines type typ_line_tab,
loc_line type string,
lon_error type i,
lon_tmp type i,
lon_lwr_ndx type syst-tabix,
lon_upr_ndx type syst-tabix.
field-symbols:
<lof_source> type typ_source,
<lof_line> type typ_line_info.
init &_ precheck
format:
reset.
lon_error = 0.
describe table pra_source[] lines lon_tmp.
if ( 1 gt pon_lwr_ndx or lon_tmp lt pon_lwr_ndx ).
lon_lwr_ndx = 1.
else.
lon_lwr_ndx = pon_lwr_ndx.
endif.
if ( 1 gt pon_upr_ndx or lon_tmp lt pon_upr_ndx ).
lon_upr_ndx = lon_tmp.
else.
lon_upr_ndx = pon_upr_ndx.
endif.
create display
if ( 0 eq lon_error ).
format: reset.
loop at pra_source[]
assigning <lof_source>
from lon_lwr_ndx
to lon_upr_ndx.
lon_tabix = syst-tabix.
loc_line = <lof_source>.
perform sub_cut_text_comment
using
loc_line
'X'
changing
loa_lines[].
loop at loa_lines[] assigning <lof_line>.
if ( 'X' eq <lof_line>-flag_newline ).
if ( 0 ne lon_tabix ).
write:
/(5) lon_tabix intensified color col_normal.
else.
write:
/(5) ' .' intensified color col_normal.
endif.
write at 6 ''.
lon_tabix = 0.
endif.
lon_Strlen = strlen( <lof_Line>-Text ).
if ( 'X' eq <lof_line>-flag_comment ).
write: at (lon_Strlen)
<lof_line>-text intensified no-gap.
else.
write: at (lon_Strlen)
<lof_line>-text no-gap.
endif.
endloop.
endloop.
endif.
the end
if ( 0 ne lon_error ).
prn_error = 1.
else.
prn_error = 0.
endif.
exit. " form
endform. "sub_dsp_source_lines
form : sub_chk_input
purp. : (en) validate input data
(de) validieren der eingabewerte
param : ---
rcode : ---
hist. : #00 - initial
form sub_dsp_help.
data declaration
data:
lon_error type i,
loa_tline type standard table of tline,
loc_docnam type syst-repid.
show help about ?
if ( 0 eq lon_error ). " Help
loc_docnam = sy-repid.
call function 'HELP_OBJECT_SHOW'
exporting
dokclass = 'RE'
dokname = loc_docnam
tables
links = loa_tline[]
exceptions
object_not_found = 1
sapscript_error = 2
others = 3.
if ( 0 ne sy-subrc ).
lon_error = 1.
message w777 with 'No Help Available'(w00).
sy-subrc = 0.
endif.
endif.
endform. "sub_dsp_help
form : sub_init
purp. : initializes the selection screen
param : ---
rcode : ---
hist. : #00 - KZI - created
form sub_init.
data declaration
data:
loc_memory(256) type c,
lon_memory type i.
memory id logic
" get prog
get parameter id gcr_rep-mem_prg field p_prgnam.
if ( 0 ne sy-subrc or '' eq p_prgnam ).
p_prgnam = sy-repid.
endif.
set parameter id gcr_rep-mem_prg field p_prgnam.
" get prog type ( keep in sync with parameters sub_check and
" sub_get_srcnam )
get parameter id gcr_rep-mem_typ field loc_memory.
condense loc_memory.
loc_memory = loc_memory(4).
if ( loc_memory co ' 0123456789' ).
lon_memory = loc_memory.
else.
lon_memory = gcr_rep-typ_prg.
endif.
clear:
p_typcla,
p_typfct,
p_typifc,
p_typmod,
p_typool,
p_typprg.
case lon_memory.
when gcr_rep-typ_prg.
p_typprg = 'X'.
when gcr_rep-typ_cla.
p_typcla = 'X'.
when gcr_rep-typ_ifc.
p_typifc = 'X'.
when gcr_rep-typ_fct.
p_typfct = 'X'.
when gcr_rep-typ_mod.
p_typmod = 'X'.
when gcr_rep-typ_pool.
p_typool = 'X'.
when others.
" default
p_typprg = 'X'.
endcase.
" get status ( keep in sync with sub check ).
get parameter id gcr_rep-mem_sta field p_state.
if ( 'A' ne p_state ).
" only 'I' or 'A' is allowed
p_state = 'I'.
endif.
set parameter id gcr_rep-mem_sta field p_state.
endform. "sub_init
form : sub_check
purp. : at the selection screen
param : ---
rcode : ---
hist. : #00 - KZI - created
form sub_check.
data declaration
data:
loc_memory(4) type c,
lon_rcode type i.
memory id handling
case p_state.
when 'A' or 'I'.
" ok
when others.
message e777 with
'Only ''A'' and ''I'' are allowed for state'(se1).
endcase.
set parameter id gcr_rep-mem_prg field p_prgnam.
set parameter id gcr_rep-mem_sta field p_state.
" multiple choice
" keep in sync with parameters and sub_check, sub_main
case 'X'.
when p_typprg.
loc_memory = gcr_rep-typ_prg.
when p_typcla.
loc_memory = gcr_rep-typ_cla.
when p_typifc.
loc_memory = gcr_rep-typ_ifc.
when p_typfct.
loc_memory = gcr_rep-typ_fct.
when p_typmod.
loc_memory = gcr_rep-typ_mod.
when p_typool.
loc_memory = gcr_rep-typ_pool.
when others.
" if bugfree this should never happen, sync source if you
" expierience this source to be executed
loc_memory = gcr_rep-typ_prg.
endcase.
if ( '' ne loc_memory ).
set parameter id gcr_rep-mem_typ field loc_memory.
endif.
endform. "sub_check
form : sub_split_comment
purp. : splits a line into a comment and command part.
param : poc_line to source line
poc_command the command part
poc_comment the comment part
rcode : <hide> name of occasional included files
hist. : #00 - KZI - created
form sub_split_comment
using
value(poc_line) type typ_source
changing
prc_command type typ_source
prc_comment type typ_source.
data declaration
data:
loc_First_Char(1) type c,
lon_len_old type i,
lon_len_new type i,
lon_pos_cmt type i,
loc_buf1 type string,
loc_buf2 type string,
loc_cmtbuf(240) type c.
init & precheck
clear:
prc_command,
prc_comment.
computation
loc_First_Char = poc_Line.
if ( '*' eq loc_First_Char ).
prc_command = ''.
prc_comment = poc_line.
else.
if ( poc_line ca '"' and poc_line np '''"''' ).
split poc_line at '"' into loc_buf1 loc_buf2.
if ( '' eq loc_buf1 ).
prc_command = ''.
prc_comment = poc_line.
else.
lon_len_old =
strlen( poc_line ).
lon_len_new =
strlen( loc_buf1 ) +
strlen( loc_buf2 ).
lon_pos_cmt = lon_len_old - lon_len_new - 2.
if ( 0 gt lon_pos_cmt or 240 lt lon_pos_cmt ).
lon_pos_cmt = 0.
endif.
loc_cmtbuf+lon_pos_cmt = '"'.
prc_command = loc_buf1.
concatenate loc_cmtbuf loc_buf2 into prc_comment.
endif.
else.
prc_command = poc_line.
prc_comment = ''.
endif.
endif.
the end
exit. " form
endform. "sub_split_comment
form : sub_cut_text_comment
purp. : splits a line into a comment and command part.
param : poc_line to source/text line
poc_cmt 'X' chk for comments
rcode : pra_lines filled with line info ( reset )
hist. : #00 - KZI - created
form sub_cut_text_comment
using
value(poc_line) type string
value(poc_cmt_check) type flag
changing
pra_lines type typ_line_tab.
data declaration
data:
loc_buf1 type string,
loc_buf2 type string,
loc_comment type string,
loc_command type string.
data:
loc_First_Char(1) type c,
loc_new_line type flag,
lon_cur_pos type i,
lon_new_pos type i.
init & precheck
clear:
pra_lines[],
loc_command,
loc_comment.
computation
loc_First_Char = poc_Line.
if ( '' eq poc_cmt_check or '' eq poc_line ).
loc_command = poc_line.
loc_comment = ''.
else.
if ( '*' eq loc_First_Char ).
loc_command = ''.
loc_comment = poc_line.
else.
if ( poc_line ca '"' and poc_line np '''"''' ).
split poc_line at '"' into loc_buf1 loc_buf2.
if ( '' eq loc_buf1 ).
loc_command = ''.
loc_comment = poc_line.
else.
loc_command = loc_buf1.
concatenate '"' loc_buf2 into loc_comment.
endif.
else.
loc_command = poc_line.
loc_comment = ''.
endif.
endif.
endif.
cvt text
lon_cur_pos = 0.
loc_new_line = 'X'.
if ( '' ne loc_command ).
perform sub_cut_text_width
using
loc_command
loc_new_line
lon_cur_pos
gcr_rep-max_width
changing
pra_lines[]
lon_new_pos.
lon_cur_pos = lon_new_pos.
loc_new_line = ''.
endif.
if ( '' ne loc_comment ).
perform sub_cut_text_width
using
loc_comment
loc_new_line
'X'
lon_cur_pos
gcr_rep-max_width
changing
pra_lines[]
lon_new_pos.
lon_cur_pos = lon_new_pos.
loc_new_line = ''.
endif.
if ( '' ne loc_new_line ).
perform sub_cut_text_width
using
loc_new_line
lon_cur_pos
gcr_rep-max_width
changing
pra_lines[]
lon_new_pos.
lon_cur_pos = lon_new_pos.
loc_new_line = ''.
endif.
the end
exit. " form
endform. "sub_cut_text_comment
form : sub_cut_text_width
purp. : splits text info into several lines to make them
fit to a max-width
param : poc_line to source/text line
poc_cmt 'X' chk for comments
rcode : pra_lines appended ( no reset ) line info.
hist. : #00 - KZI - created
form sub_cut_text_width
using
value(poc_text) type string
value(poc_new_line) type flag
value(poc_typ_cmt) type flag
value(pon_cur_pos) type i
value(pon_max_width) type i
changing
pra_lines type typ_line_tab
prn_new_pos type i.
data declaration
data:
lor_text_info type typ_line_info,
lon_cnt_loop type i,
lon_tmp type i,
lon_pos_cur type i,
lon_len_cur type i,
loc_buf_cur type string,
loc_new_line type flag.
init & precheck
loc_buf_cur = poc_text.
loc_new_line = poc_new_line.
lon_pos_cur = pon_cur_pos.
do.
if ( '' eq loc_buf_cur and '' eq loc_new_line or
1000 lt lon_cnt_loop ).
exit. " do
else.
lon_cnt_loop = lon_cnt_loop + 1.
clear:
lor_text_info.
lor_text_info-flag_comment = poc_typ_cmt.
if ( '' ne loc_new_line ).
loc_new_line = ' '.
lor_text_info-flag_newline = 'X'.
lon_pos_cur = 0.
endif.
lon_len_cur = strlen( loc_buf_cur ).
lon_tmp = lon_pos_cur + lon_len_cur.
if ( lon_tmp le pon_max_width ).
" all fits in currentline
lor_text_info-text = loc_buf_cur.
loc_buf_cur = ''.
lon_pos_cur = lon_pos_cur + lon_len_cur.
else.
" we need to split
lon_tmp = pon_max_width - lon_pos_cur.
if ( 0 gt lon_tmp ).
" should not happen
lor_text_info-text = loc_buf_cur.
loc_buf_cur = ''.
else.
lor_text_info-text = loc_buf_cur(lon_tmp).
loc_buf_cur = loc_buf_cur+lon_tmp.
endif.
lon_pos_cur = 0.
loc_new_line = 'X'.
endif.
append lor_text_info to pra_lines[].
endif.
enddo.
the end
prn_new_pos = lon_pos_cur.
exit. " form.
endform. "sub_cut_text_width
[/code] -
Screen shots for creating class in se24(class builder)
HI
i am a beginner in abap objects...
can anyone give me the screen shots for creating a class in se24.
plz dont give links...
only screenshots....
useful answer wil be rewarded.
Regards,
jyothsnahi,
Follow this link for step by step tutorials.....cant paste screen shots here, so u will have to follow link to see it.
http://www.****************/Tutorials/OOPS/MainPage.htm
or use this PPT file
http://www.esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder
Hope this helps, Do reward.
Edited by: Runal Singh on Mar 26, 2008 3:45 PM -
I am new to ABAP. I tried creating abstract class and found that class builder allows development of abstract final class. What is the use of such class in ABAP?
Hi,
Does not compile:
This one do:
Inheritance:
Regards. -
Very Urgent: how to define field symbols in class using se24 Points assured
hi all
I am new to abap oo programming. I am using se24 to build a class
where some methods have code which involves working with field sybmols but i am not able to figure out way for how to define field symbols in the attributes section.
I tried defining like : fld_sym type ref to dbtab-fld
but in the method implementation if i try to use it like assign fld to <fld_sym> there it says fld_sym is not defined as a field symbol.
So can anyone please guide me how to define field symbols in se24.
Also what should be the general steps while creating a class using se24.
Points assured
thanksHi
Global classes are like Global fun modules in which the Methods and code is already written and is mainly used for Reusability purpose.
Goto SE24 tcode and see the std global classes like
CL_ABAP_CHAR_UTILITIES
see the links
chk out the links below:
General Tutorial for OOPS
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
Have a look at these links for OO ABAP.
http://www.sapgenie.com/abap/OO/
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
http://www.allsaplinks.com/
http://www.sapgenie.com/abap/controls/index.htm
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
SDN Series:
https://www.sdn.sap.com/irj/sdn/developerareas/abap?rid=/webcontent/uuid/35eaef9c-0b01-0010-dd8b-e3b0f9ed7ccb [original link is broken]
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
Basic concepts of OOPS
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
http://www.henrikfrank.dk/abapuk.html
http://www.erpgenie.com/abap/OO/
Reward oints if useful,
Aleem. -
How to write a class from se24
Dear Abap sirs,
I want to write an abap class using the transaction se24.
What is the step to write a simple class..
Thanks.Hi Deniz,
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
<b>Reward if helpful.</b>
Best Regards,
Ram. -
Use of Friend class in Class builder
HI
Can someone tell me how to use a friend class In class Builder
SRidharHi,
Please check this link
http://help.sap.com/saphelp_nw04/helpdata/en/b5/693ec8185011d5969b00a0c94260a5/frameset.htm
Defining Relationships Between Object Types
http://help.sap.com/saphelp_nw04/helpdata/en/ca/c035b7a6c611d1b4790000e8a52bed/frameset.htm
Examples
http://help.sap.com/saphelp_nw04/helpdata/en/47/5f643a7c5dd813e10000000a114084/frameset.htm
Best regards,
raam -
Detailed example for ABAP mapping in XI7.0 with code in class builder
hi experts,
will any one one send me the detailed example(including navigation steps) for ABAP mapping in XI7.0 with code in class builder.
Thankin u,Hi,
Just go through the below link.It will guide you how to do abap mapping:
The guide is on XI 3.0 but the same can be used in 7.0 also.
The How-to-guide
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
This link will provide more information regarding program point of view.
http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/content.htm
Thanks,
Kishore.
Edited by: Kishore on Mar 14, 2008 4:35 AM -
To change the string in Class Builder "New Method"
HI friends,
Im using the std program of "RFDOPR10"...(changed into my customised program as ZRFDOPR10).....
Here i want to change the strings of Id_type eq 4 availble under the class builder "New Method".
"id_ruler_string = '2.13.24.29|43|58|73|88|103|118|'" (for 24...i want to give 38.....then 45...)
Pls help me how to change the std method function for my z program...
FYR:
RFDOPR10 is the std program for tcode :"s_alr_87012178", Customer analysis.If u want to c the example report, in this tcode...give OI:1, Summ level:6, OI list:1 and Company CD:2 under Output control tab in selection screen with Company code.Now, u able to see the reports in the screen.There, after Customer number....I've to give some more spaces(length) for Sort field.
Thanks & regards
Sankar.No, but I suggest using a different editor which does allow a different text option and just pasting it in.
-
Tochange the string in Std Class Builder "New Method"
HI freinds,
Im using the std program of "RFDOPR10"...(changed into my customised program as ZRFDOPR10).....
Here i want to change the strings of Id_type eq 4 availble under the class builder "New Method".
"id_ruler_string = '2.13.24.29|43|58|73|88|103|118|'" (for 24...i want to give 38.....then 45...)
Pls help me how to change the std method function for my z program...
FYR:
RFDOPR10 is the std program for tcode :"s_alr_87012178", Customer analysis.If u want to c the example report, in this tcode...give OI:1, Summ level:6, OI list:1 and Company CD:2 under Output control tab in selection screen with Company code.Now, u able to see the reports in the screen.There, after Customer number....I've to give some more spaces(length) for Sort field.
Thanks & regards
Sankar.Associated with the text box there will be some kind of event handler. Maybe it's an action event on the text box (when the user clicks return) or maybe you have a separate button that the user clicks.
Either way, in the event handler, get the text from the text box, and then call the sendData method, passing the text as an argument. -
Hi,
when I'm looking a class in the Class Builder, I see a cogwheel and other signs in a colunm in the "Aliases" tab. What ist the meaning of the signs?
Regards,
Adalberthttp://help.sap.com/saphelp_nw70/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
this is from SAP help
Using Alias Names
You can use the ALIAS statement in interface definitions to assign alias names to the components of component interfaces. This makes these components visible in the interface definition.
INTERFACE i2.
INTERFACES i1.
ALIASES alias21 FOR i1~comp1.
ENDINTERFACE.
INTERFACE i3.
INTERFACES i2.
ALIASES alias31 FOR i2~alias21.
ALIASES alias32 FOR i2~comp2.
ENDINTERFACE.
Maybe you are looking for
-
How do I download a trial version of only CS6 Design - not web version?
How do I download a trial version of only CS6 Design - not web version?
-
E71, Firmware 210, MfE 2.9 - Unable to Connect
HELP!! Upgraded Firmware on my Nokia E71 to version 210, and needed to reinstall Mail For Exchance which went to version 2.9. Using Exchange 2003 and never had any issues before! While in push mode the phone drops connection after a varying period o
-
Mac OS 10.5.8 issue
I have Mac OS 10.5.8 and I want a trial of Adobe apps, but I cannot download any of them because I cannot open the installer (I also suspect the apps will have problems on my computer). What are my options? Can a try Adobe CS5 apps?
-
Dear Experts, We have repeatitive manufacturing Scenario & during backflushing REPRO is allowed. Now we want to stop REPRO so that booking (MFBF) can not be dode if any component is in error (Non REPRO Allowed). What necessary steps/precautions has
-
Raw fine tuning reverts back to older version
HI I've spent the last couple of days editing several hundred files, they were originally imported before AP2 was released, so would have been using RAW file tuning version 1.1. However I selected each one individually Removed all adjustments, which