Regarding OOABAP
Hi
I was created 1 class and in attributes I was given:
AI_DEFAULTS type YFIIF_EFUND_INPUT.
The Problem is while executing the report which uses this class, I am getting the error message that :
The following syntax error was found in the program
ZCL_FI_EFUND_LINE_MAPPER======CP :
""AI_DEFAULTS" has already been declared."
Can u please guide me where i was wrong.
<b>Points are assured for Correct answers.</b>
Regards,
Sree
Hello Sree
Apparently the attribute has been declared already. The class builder should not allow you to define duplicate attributes having the same name.
If you do not see where the first definition of AI_DEFAULTS is simply use the following approach:
1. Rename your second implementation, e.g. _AI_DEFAULTS.
2. Use the AI_DEFAULTS attribute in one of your method
3. Double-click on AI_DEFAULTS within your method -> should jump to the attribute definition
Regards
Uwe
Similar Messages
-
METHOD onactionshow .
DATA:
Node Info
rootnode_info TYPE REF TO if_wd_context_node_info,
Context Nodes
dyn_node TYPE REF TO if_wd_context_node,
tabname_node TYPE REF TO if_wd_context_node,
String (for table name)
tablename TYPE string.
get node info of context root node
rootnode_info = wd_context->get_node_info( ).
Get the name of the table to be created
tabname_node = wd_context->get_child_node( name = 'INPUT' ).
tabname_node->get_attribute( EXPORTING name = 'TABLENAME'
IMPORTING value = tablename ).
TRANSLATE tablename TO UPPER CASE.
create sub node named TEST1 of structure (tablename)
<b>cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = rootnode_info
node_name = tablename
structure_name = tablename
is_multiple = abap_true ).</b>
<b>DATA: stru_tab TYPE REF TO data.
FIELD-SYMBOLS:
<tab> TYPE table.</b>
create internal table
<b>CREATE DATA stru_tab TYPE TABLE OF (tablename).</b>
<b>ASSIGN stru_tab->* TO <tab>.</b>
Get table content
<b>SELECT * FROM (tablename) INTO CORRESPONDING FIELDS OF TABLE <tab>.</b>
get instance of new node
dyn_node = wd_context->get_child_node( name = tablename ).
Bind internal table to context node.
dyn_node->bind_table( <tab> ).
Please explain me the above statements which are in bold.
if u feel anything more to explain please tell me.
I am facing a lot of problem in undrestsnding those.
points will be rewarded immediately
with Regards,
lokesh@EDShi ,
if u r chosing a single database table ,u will create a node name and its attribute in component controller or in view controller.example mara as node name and its attribute as matnr ersda and ernam.then right clicking on the UI element click create binding and select ur mode of display by selecting text view or dropdownbyindex.but in dynamic case, at runtime user will give any table name and any filter condition of selecting its field .so it is impossible to create 88000 table as node and select all fields. so now give child node name as 'tablename' with type string .
in component controller it has one parent node by default.if we create a new node it comes as child of patent node 'context'.
class cl_wd_dynamic_tool contain 4 methods in that method create_nodeinfo_from_struct has all importing parameter
1. give the reference parent node name which is stored in a varible rootnode_info.
(rootnode_info = wd_context->get_node_info( ). if u go to attribute column, u can found 3 interfaces with respective data refernces like wd_this,wd_context. if u dblclick if_wd_context_node u can find all info regarding the name of context, and any other newly created parameters.)
2.give structure name or table name which is is given at runtime.
3. for accepting many fields or with only one field.
in abap oops dynamic condition is attained by 2 ways 1. data reference and 2.field symbols.
data reference alias name is "address of".
field symbol alias name is "value at".(place holder)
DATA: stru_tab TYPE REF TO data.
this means u r creating a variable stru_tab which is having a properties of data.
assume "data" is a type or class , .here only u declare only variable ,it has no content till the statement create data.(memory space will allocate only after the execution of create data.)
FIELD-SYMBOLS:
<tab> TYPE table.
u can declare a field symbol with generic type "any " keyword or "table" keyword.
dynamic means u should mention within parenthesis (table name).
conventiontional way of declaring internal table is
data: <internal table name > type table of <table name>.
here u dont know the type table u r going to pass.
but definetly ,it contain data, so declare stru_tab as data .
DATA: stru_tab TYPE REF TO data.
in this step only variable name name is create not space.
CREATE DATA stru_tab TYPE TABLE OF (tablename).
in this step space is create for variable but only internal table name is declared.but no space
ASSIGN stru_tab->* TO <tab>.
internal table is of table format .so u declared field symbol as table.
stru_tab is address of data
<tab> is value at table.
then select query
thanx
zenthil -
hi ..i assigned for regarding ooabap.i have no knowledge regarding oops ..
please send me material regarding oops and ooabap..
thanks,
karthik.MHi Karthik,
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
Check this cool weblog:
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
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.sap-img.com/
http://www.sapgenie.com/
http://help.sap.com
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
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://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
these links
http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
For funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
Regards,
Satish -
Hi Experts,
This is siri,I am ABAP Fresher. Please can any one provide me the information regarding OOABAP.
1) What is OO ABAP.?
2) How to start it from starting?
3) Where to find all predeifined methods and classes?
4) How to use exactly those prdefined methode and classes?
Please help me out for sharing the your valuable information..
Thanks in Advance.
Thanks and Regards
Siri..Hi Abinava sri..please go thry these for complete understanding of OOABAP
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
Check this cool weblog:
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/sap.user72/blog/2005/05/10/a-small-tip-for-the-beginners-in-oo-abap
/people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action
/people/thomas.jung3/blog/2005/09/08/oo-abap-dynpro-programming
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
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.sap-img.com/
http://www.sapgenie.com/
http://help.sap.com
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
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://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
these links
http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
For funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
Reward if useful -
Not triggering PBO in OOABAP ALV grid
Hi all.
I want to create drop down for Document type BSART.for that iam using OOABAP but my program is not triggering PBO module itself.I have seen so many examples but iam unable to fetch data.what are the changes i have to do here.i have reduced some code here.i have written my final internal table select query before this stataement.
loop at it_git_final into wa_git_final.
APPEND wa_git_final TO it_git_final.
ENDLOOP.
*Call to ALV
CALL SCREEN 600.
MODULE status_0600 OUTPUT.
SET PF-STATUS 'DISP'.
SET TITLEBAR 'ALVF4'.
ENDMODULE. " STATUS_0600 OUTPUT
calling the PBO module ALV_GRID.
MODULE pbo OUTPUT.
*Creating objects of the container
* SET field for ALV
if g_custom_container is initial.
perform create_and_init_alv changing it_git_final
gt_fieldcat.
PERFORM alv_build_fieldcat.
endif.
* Set ALV attributes FOR LAYOUT
PERFORM alv_report_layout.
CHECK NOT c_alvgd IS INITIAL.
Call ALV GRID
CALL METHOD c_alvgd->set_table_for_first_display
EXPORTING
is_layout = it_layout
i_save = 'A'
CHANGING
it_outtab = it_git_final
it_fieldcatalog = it_fcat
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. " PBO OUTPUT
MODULE PAI INPUT *
MODULE pai INPUT.
ENDMODULE. "pai INPUT
*subroutine to build fieldcat
FORM alv_build_fieldcat changing pt_fieldcat type lvc_t_fcat..
DATA lx_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'IT_GIT_FINAL'
CHANGING
ct_fieldcat = gt_fieldcat.
* To assign dropdown in the fieldcataogue
LOOP AT gt_fieldcat INTO lx_fcat.
DATA : lx_fcat TYPE lvc_s_fcat.
lx_fcat-row_pos = '1'.
lx_fcat-col_pos = '1'.
lx_fcat-fieldname = 'CHECK1'.
lx_fcat-ref_field = 'CHECK1'
lx_fcat-EDIT = 'X'.
lx_fcat-coltext = 'Check Box'.
lx_fcat-seltext = text-c01.
APPEND lx_fcat TO Gt_fieldcat.
CLEAR lx_fcat.
lx_fcat-row_pos = '1'.
lx_fcat-col_pos = '15'.
lx_fcat-fieldname = 'BSART'.
lx_fcat-ref_field = 'BSART'.
lx_fcat-ref_table = 'T161P'.
lx_fcat-coltext = 'Document Type'.
lx_fcat-drdn_hndl = '1'.
lx_fcat-outputlen = 15.
lx_fcat-edit = 'X'.
append lx_fcat to gt_fieldcat.
CLEAR lx_fcat.
DATA: lt_dropdown TYPE lvc_t_drop,
ls_dropdown TYPE lvc_s_drop.
ls_dropdown-handle = '1'.
ls_dropdown-value = '01 ZFC Vesselchart Contract'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '02 ZQTY QTY Contract(SESA)'.
APPEND ls_dropdown TO lt_dropdown. ls_dropdown-handle = '1'.
*method to display the dropdown in ALV
CALL METHOD g_grid->set_drop_down_table
EXPORTING
it_drop_down = lt_dropdown.
LOOP AT it_fcat INTO lx_fcat.
CASE lx_fcat-fieldname.
To assign dropdown in the fieldcataogue
WHEN 'BSART'.
lx_fcat-drdn_hndl = '1'.
lx_fcat-outputlen = 15.
MODIFY it_fcat FROM lx_fcat.
ENDCASE.
ENDLOOP.
endform.
form ALV_OUTPUT .
*Create object for container
CREATE OBJECT g_custom_container
EXPORTING container_name = 'CCONT'.
*create object for grid
CREATE OBJECT g_grid
EXPORTING i_parent = g_custom_container.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
is_layout = it_layout
CHANGING
it_fieldcatalog = gt_fieldcat
it_outtab = it_git_final.
endform. " ALV_OUTPUT
form ALV_REPORT_LAYOUT .
it_layout-cwidth_opt = 'X'.
it_layout-col_opt = 'X'.
it_layout-zebra = 'X'.
endform. " ALV_REPORT_LAYOUT
form CREATE_AND_INIT_ALV changing p_it_git_final
p_gt_fieldcat.
create object g_custom_container
exporting container_name = g_container.
create object g_grid
exporting i_parent = g_custom_container.
endform.Hello Raj
Actually all the code is described in PBO module, so you need to invoke this module in PBO when defining the screen.
For example, access transaction SE51, start in Change mode and inser line
MODULE PBO.
Then activate the object
Best regards
Carlos Machad o -
Regarding "Friend Function" in Object oriented Abap.
Hi! Every Body,
I need to know about this friend function in ooabap.
1. Clear Definition.
2. i need program too.
3. What is the use Of friend function?
4. wht is the difference from java and ooabap using this function.
if any body replies for my query , i really thank full to u.
regards,
M.swapna.
[email protected]Hi Swapna,
Usually private components of a class can be accessed by methods of that class only..Sometimes, it is necessary for two classes to work so close to each other that one class needs to access the private attributes of the other.
In that case, you can make the former class, a friend of the latter class.
Suppose class A is made as a friend of class B.
Then A and its subclasses can access the private or protected components of the class B.
But they cannot access the private or protected components of subclasses of class B.
You can refer this link for more help.
http://help.sap.com/saphelp_nw2004s/helpdata/en/b5/693ec8185011d5969b00a0c94260a5/content.htm
Award points if found useful.
Regards,
SP. -
Regarding applyingb oops in reports
hi
i would like to implement report using classes, methods
can any body suggest which parts of the report( declaration, display, select, loop stmts,perform....)
using methods..
can anybody give guidliness to improve performance & readbility, reusability of report using classes.
Thanks & Regards
Spandana.Hi Spandana,
U can find more examples in SE38
Go to Se38 --> Input BCALV* and press F4. You will get a list ALV reports which are developed based on OO ABAP.
Please check this form
OOABAP
Object Oriented ALV-Sample program to insert Logo in ALV
*&amp; Report Z_OOALV_LOGO
REPORT z_ooalv_logo.
****DECLARATION FOR LOGO INSERT
CONSTANTS: cntl_true TYPE i VALUE 1,
cntl_false TYPE i VALUE 0.
DATA:h_picture TYPE REF TO cl_gui_picture,
h_pic_container TYPE REF TO cl_gui_custom_container.
DATA: graphic_url(255),
graphic_refresh(1),
g_result LIKE cntl_true.
DATA: BEGIN OF graphic_table OCCURS 0,
line(255) TYPE x,
END OF graphic_table.
DATA: graphic_size TYPE i.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module PICTURE OUTPUT
* text
MODULE picture OUTPUT.
DATA: l_graphic_xstr TYPE xstring,
l_graphic_conv TYPE i,
l_graphic_offs TYPE i.
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = 'GRAPHICS'
p_name = 'EDS'"IMAGE NAME - Image name from SE78
p_id = 'BMAP'
p_btype = 'BCOL'
RECEIVING
p_bmp = l_graphic_xstr
EXCEPTIONS
not_found = 1
OTHERS = 2.
graphic_size = XSTRLEN( l_graphic_xstr ).
CHECK graphic_size > 0.
l_graphic_conv = graphic_size.
l_graphic_offs = 0.
WHILE l_graphic_conv > 255.
graphic_table-line = l_graphic_xstr+l_graphic_offs(255).
APPEND graphic_table.
l_graphic_offs = l_graphic_offs + 255.
l_graphic_conv = l_graphic_conv - 255.
ENDWHILE.
graphic_table-line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).
APPEND graphic_table.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'image'
subtype = cndp_sap_tab_unknown " 'X-UNKNOWN'
size = graphic_size
lifetime = cndp_lifetime_transaction "'T'
TABLES
data = graphic_table
CHANGING
url = graphic_url
EXCEPTIONS
* dp_invalid_parameter = 1
* dp_error_put_table = 2
* dp_error_general = 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.
EXIT.
ENDIF.
CREATE OBJECT h_pic_container
EXPORTING container_name = 'LOGO'.
CREATE OBJECT h_picture EXPORTING parent = h_pic_container.
CALL METHOD h_picture->load_picture_from_url
EXPORTING
url = graphic_url
IMPORTING
RESULT = g_result.
ENDMODULE. " PICTURE OUTPUT
Best regards,
raam
Edited by: Kodandarami Reddy.S on Jun 6, 2008 11:02 AM -
Are there any GOOD standard programs / REPORTS to refer for OOABAP done already in SAP ?
Rgds,
ÖHi
ABAP Objects is a new concept in R/3 Release 4.0. The term has two meanings. On the one hand, it stands for the entire ABAP runtime environment. On the other hand, it represents the object-oriented extension of the ABAP language.
The following is a simple example shows the object-oriented aspect of function groups in the simple case of a counter.
Suppose we have a function group called COUNTER:
Create an abap program with this code :-
FUNCTION-POOL COUNTER.
DATA COUNT TYPE I.
FUNCTION SET_COUNTER.
Local Interface IMPORTING VALUE(SET_VALUE)
COUNT = SET_VALUE.
ENDFUNCTION.
FUNCTION INCREMENT_COUNTER.
ADD 1 TO COUNT.
ENDFUNCTION.
FUNCTION GET_COUNTER.
Local Interface: EXPORTING VALUE(GET_VALUE)
GET_VALUE = COUNT.
ENDFUNCTION.
End of program code
The function group has a global integer field COUNT, and three function modules,
- SET_COUNTER,
- INCREMENT_COUNTER, and
- GET_COUNTER, that work with the field.
Two of the function modules have input and output parameters. These form the data interface of the function group.
Any ABAP program can then work with this function group. For example:
REPORT ZABAPOO.
DATA NUMBER TYPE I VALUE 5.
CALL FUNCTION 'SET_COUNTER' EXPORTING SET_VALUE = NUMBER.
DO 3 TIMES.
CALL FUNCTION 'INCREMENT_COUNTER'.
ENDDO.
CALL FUNCTION 'GET_COUNTER' IMPORTING GET_VALUE = NUMBER.
WRITE: / 'After processing NUMBER is :- ', NUMBER.
End of program code
After this section of the program has been processed, the program variable NUMBER will have the value 8.
The program itself cannot access the COUNT field in the function group. Operations on this field are fully encapsulated in the function module. The program can only communicate with the function group by calling its function modules.
Regards,
Santosh -
I want to learn more about OOABAP(Object Oriented ABAP)
Hi All,
Please could anybody help me in sending some of material or suggestion in learning(Exploring) the Object Oriented ABAP. Right now I am an ABAP/4 Developer.
Please if anybody having any such material please send it to my mail-id i.e <u>[email protected]</u> or else please tell me the resources to learn the OOABAP please.
Now I have to work on that project. Thanks in advance.
By
ASHOK
If anything PDF format material please could you upload to my mail ID <u>[email protected]</u>
Message was edited by: ashok vangaHi ashok,
check this link....
http://www.intelligententerprise.com/channels/applications/feature/archive/heymann.jhtml?_requestid=304802
http://www.henrikfrank.dk/abapuk.html
http://sap.ittoolbox.com/documents/document.asp?i=982
reward points for helpfull answers and close the thread if your question is solved.
regards,
venu. -
Report programming using OOABAP
hi sdns,
I have learnt OOABAP.
and now i am trying to implement those concepts in report programming.
can anyone provide me some good stuff for practicing them.
I want Excercises or else if any one have PDFs do mail me to [email protected]
Please do support me in this regard.
points awarded fastly.
Thanks & Regards,
Lokesh@EDS.Hi,
Check this,
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
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.sap-img.com/
http://www.sapgenie.com/
http://help.sap.com
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com.
http://www.sapgenie.com/abap/OO/index.htm
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://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
some more materials.
Go through the following Documents Links & Materials for ABAP Objects
check the below links lot of info and examples r there
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
Check this cool weblog:
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/sap.user72/blog/2005/05/10/a-small-tip-for-the-beginners-in-oo-abap
/people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action
/people/thomas.jung3/blog/2005/09/08/oo-abap-dynpro-programming
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
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.sap-img.com/
http://www.sapgenie.com/
http://help.sap.com
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
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://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
these links
http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
For funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/07/09/understandingABAPObjects&
Thanks,
Reward If Helpful. -
Issue regarding ABAP/4 language.
Dear All,
Can any body tell me that ABAP is fully object oriented language? Plz explain.
Regards,
Chandramohan.NHi,
ABAP is not Fully object oriented programming.
You can add normal procedural programming with Object oriented programming i.e. you can combine classical ABAP with ABAP Objects.
ABAP Objects is not entirely a new language, it is just an enhancement or added functionalities with in ABAP.
Below LINK would also helps you..
OOABAP
Thanks,
Sreekanth -
Difference between ooabap and java
eventhough both java and ooabap are oops languages there may be some difference between them as c++ and java in using the oops concepts or may be there is an advantage in using ooabap than java .
any one pls reply to the above asked question.
<REMOVED BY MODERATOR>
Edited by: rahul nuthi on Feb 26, 2008 1:10 PM
Edited by: Alvaro Tejada Galindo on Feb 26, 2008 11:19 AMhi
OOPs ABAP uses Classes and Interfaces which uses Methods and events.
If you have Java skills it is advantage for you.
There are Local classes as well as Global Classes.
Local classes we can work in SE38 straight away.
But mostly it is better to use the Global classes.
Global Classes or Interfaces are to be created in SE24.
SAP already given some predefined classes and Interfaces.
This OOPS concepts very useful for writing BADI's also.
So first create a class in SE 24.
Define attributes, Methods for that class.
Define parameters for that Method.
You can define event handlers also to handle the messages.
After creation in each method write the code.
Methods are similar to ABAP PERFORM -FORM statements.
After the creation of CLass and methods come to SE38 and create the program.
In the program create a object type ref to that class and with the help of that Object call the methods of that Class and display the data.
Example:
REPORT sapmz_hf_alv_grid .
Type pool for icons - used in the toolbar
TYPE-POOLS: icon.
TABLES: zsflight.
To allow the declaration of o_event_receiver before the
lcl_event_receiver class is defined, decale it as deferred in the
start of the program
CLASS lcl_event_receiver DEFINITION DEFERRED.
G L O B A L I N T E R N A L T A B L E S
*DATA: gi_sflight TYPE STANDARD TABLE OF sflight.
To include a traffic light and/or color a line the structure of the
table must include fields for the traffic light and/or the color
TYPES: BEGIN OF st_sflight.
INCLUDE STRUCTURE zsflight.
Field for traffic light
TYPES: traffic_light TYPE c.
Field for line color
types: line_color(4) type c.
TYPES: END OF st_sflight.
TYPES: tt_sflight TYPE STANDARD TABLE OF st_sflight.
DATA: gi_sflight TYPE tt_sflight.
G L O B A L D A T A
DATA: ok_code LIKE sy-ucomm,
Work area for internal table
g_wa_sflight TYPE st_sflight,
ALV control: Layout structure
gs_layout TYPE lvc_s_layo.
Declare reference variables to the ALV grid and the container
DATA:
go_grid TYPE REF TO cl_gui_alv_grid,
go_custom_container TYPE REF TO cl_gui_custom_container,
o_event_receiver TYPE REF TO lcl_event_receiver.
DATA:
Work area for screen 200
g_screen200 LIKE zsflight.
Data for storing information about selected rows in the grid
DATA:
Internal table
gi_index_rows TYPE lvc_t_row,
Information about 1 row
g_selected_row LIKE lvc_s_row.
C L A S S E S
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
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.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar.
Event handler method for event toolbar.
CONSTANTS:
Constants for button type
c_button_normal TYPE i VALUE 0,
c_menu_and_default_button TYPE i VALUE 1,
c_menu TYPE i VALUE 2,
c_separator TYPE i VALUE 3,
c_radio_button TYPE i VALUE 4,
c_checkbox TYPE i VALUE 5,
c_menu_entry TYPE i VALUE 6.
DATA:
ls_toolbar TYPE stb_button.
Append seperator to the normal toolbar
CLEAR ls_toolbar.
MOVE c_separator TO ls_toolbar-butn_type..
APPEND ls_toolbar TO e_object->mt_toolbar.
Append a new button that to the toolbar. Use E_OBJECT of
event toolbar. E_OBJECT is of type CL_ALV_EVENT_TOOLBAR_SET.
This class has one attribute MT_TOOLBAR which is of table type
TTB_BUTTON. The structure is STB_BUTTON
CLEAR ls_toolbar.
MOVE 'CHANGE' TO ls_toolbar-function.
MOVE icon_change TO ls_toolbar-icon.
MOVE 'Change flight' TO ls_toolbar-quickinfo.
MOVE 'Change' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_user_command.
Handle own functions defined in the toolbar
CASE e_ucomm.
WHEN 'CHANGE'.
PERFORM change_flight.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMETHOD.
ENDCLASS.
S T A R T - O F - S E L E C T I O N.
START-OF-SELECTION.
SET SCREEN '100'.
*& Module USER_COMMAND_0100 INPUT
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module STATUS_0100 OUTPUT
MODULE status_0100 OUTPUT.
DATA:
For parameter IS_VARIANT that is sued to set up options for storing
the grid layout as a variant in method set_table_for_first_display
l_layout TYPE disvariant,
Utillity field
l_lines TYPE i.
After returning from screen 200 the line that was selected before
going to screen 200, should be selected again. The table gi_index_rows
was the output table from the GET_SELECTED_ROWS method in form
CHANGE_FLIGHT
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines > 0.
CALL METHOD go_grid->set_selected_rows
EXPORTING
it_index_rows = gi_index_rows.
CALL METHOD cl_gui_cfw=>flush.
REFRESH gi_index_rows.
ENDIF.
Read data and create objects
IF go_custom_container IS INITIAL.
Read data from datbase table
PERFORM get_data.
Create objects for container and ALV grid
CREATE OBJECT go_custom_container
EXPORTING container_name = 'ALV_CONTAINER'.
CREATE OBJECT go_grid
EXPORTING
i_parent = go_custom_container.
Create object for event_receiver class
and set handlers
CREATE OBJECT o_event_receiver.
SET HANDLER o_event_receiver->handle_user_command FOR go_grid.
SET HANDLER o_event_receiver->handle_toolbar FOR go_grid.
Layout (Variant) for ALV grid
l_layout-report = sy-repid. "Layout fo report
Setup the grid layout using a variable of structure lvc_s_layo
Set grid title
gs_layout-grid_title = 'Flights'.
Selection mode - Single row without buttons
(This is the default mode
gs_layout-sel_mode = 'B'.
Name of the exception field (Traffic light field) and the color
field + set the exception and color field of the table
gs_layout-excp_fname = 'TRAFFIC_LIGHT'.
gs_layout-info_fname = 'LINE_COLOR'.
LOOP AT gi_sflight INTO g_wa_sflight.
IF g_wa_sflight-paymentsum < 100000.
Value of traffic light field
g_wa_sflight-traffic_light = '1'.
Value of color field:
C = Color, 6=Color 1=Intesified on, 0: Inverse display off
g_wa_sflight-line_color = 'C610'.
ELSEIF g_wa_sflight-paymentsum => 100000 AND
g_wa_sflight-paymentsum < 1000000.
g_wa_sflight-traffic_light = '2'.
ELSE.
g_wa_sflight-traffic_light = '3'.
ENDIF.
MODIFY gi_sflight FROM g_wa_sflight.
ENDLOOP.
Grid setup for first display
CALL METHOD go_grid->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
is_variant = l_layout
i_save = 'A'
is_layout = gs_layout
CHANGING it_outtab = gi_sflight.
End of grid setup
Raise event toolbar to show the modified toolbar
CALL METHOD go_grid->set_toolbar_interactive.
Set focus to the grid. This is not necessary in this
example as there is only one control on the screen
CALL METHOD cl_gui_control=>set_focus EXPORTING control = go_grid.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0200 INPUT
MODULE user_command_0200 INPUT.
CASE ok_code.
WHEN 'EXIT200'.
LEAVE TO SCREEN 100.
WHEN'SAVE'.
PERFORM save_changes.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Form get_data
FORM get_data.
Read data from table SFLIGHT
SELECT *
FROM zsflight
INTO TABLE gi_sflight.
ENDFORM. " load_data_into_grid
*& Form change_flight
Reads the contents of the selected row in the grid, ans transfers
the data to screen 200, where it can be changed and saved.
FORM change_flight.
DATA:l_lines TYPE i.
REFRESH gi_index_rows.
CLEAR g_selected_row.
Read index of selected rows
CALL METHOD go_grid->get_selected_rows
IMPORTING
et_index_rows = gi_index_rows.
Check if any row are selected at all. If not
table gi_index_rows will be empty
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines = 0.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
textline1 = 'You must choose a line'.
EXIT.
ENDIF.
Read indexes of selected rows. In this example only one
row can be selected as we are using gs_layout-sel_mode = 'B',
so it is only ncessary to read the first entry in
table gi_index_rows
LOOP AT gi_index_rows INTO g_selected_row.
IF sy-tabix = 1.
READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
ENDIF.
ENDLOOP.
Transfer data from the selected row to screenm 200 and show
screen 200
CLEAR g_screen200.
MOVE-CORRESPONDING g_wa_sflight TO g_screen200.
LEAVE TO SCREEN '200'.
ENDFORM. " change_flight
*& Form save_changes
Changes made in screen 200 are written to the datbase table
zsflight, and to the grid table gi_sflight, and the grid is
updated with method refresh_table_display to display the changes
FORM save_changes.
DATA: l_traffic_light TYPE c.
Update traffic light field
Update database table
MODIFY zsflight FROM g_screen200.
Update grid table , traffic light field and color field.
Note that it is necessary to use structure g_wa_sflight
for the update, as the screen structure does not have a
traffic light field
MOVE-CORRESPONDING g_screen200 TO g_wa_sflight.
IF g_wa_sflight-paymentsum < 100000.
g_wa_sflight-traffic_light = '1'.
C = Color, 6=Color 1=Intesified on, 0: Inverse display off
g_wa_sflight-line_color = 'C610'.
ELSEIF g_wa_sflight-paymentsum => 100000 AND
g_wa_sflight-paymentsum < 1000000.
g_wa_sflight-traffic_light = '2'.
clear g_wa_sflight-line_color.
ELSE.
g_wa_sflight-traffic_light = '3'.
clear g_wa_sflight-line_color.
ENDIF.
MODIFY gi_sflight INDEX g_selected_row-index FROM g_wa_sflight.
Refresh grid
CALL METHOD go_grid->refresh_table_display.
CALL METHOD cl_gui_cfw=>flush.
LEAVE TO SCREEN '100'.
ENDFORM. " save_changes
chk this blog
/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid
/message/4447073#4447073 [original link is broken]
Difference between ABAP an OOABAP
http://en.wikipedia.org/wiki/Comparison_of_ABAP_and_Java
hope it will help you
regards
sreelatha gullapalli -
Required OOABAP and BSP documents
Hi All,
i am begineer in OOABAP.
i Required OOABAP and BSP documents.
my requirement is on BSP.
Please send those documents to this mailID.
[email protected]
Thanks
NareshHi naresh,
thanks for ur responce. just now i found one link on BSP's
link is [http://****************/Tutorials/BSP/BSPMainPage.htm]
please go through this link u found nuber of example with screen shots ,ok .hope this will help u lot. pls reward point
any queries revert me ok. happy surffing ....
Regards
fareedas -
Hi all,
I have a problem in displaying a grid in using OOABAP.
myrequirement is once display output using OOABAP and after displaying my ALV output if i select a particular row and click
my custom button (which i created in application tool bar) that record only display the output.
my problem is after displaying my output i select the row and that particular row is not displaying.
i checked my internal table it has only one row but it will display all the records please help me.
Thanks,Check this WIKI by Joyjit:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/display%2btotal%2btext%2bin%2boo-alv
Regards,
Naimesh Patel -
Regarding sy-index and sy-tabix
Hi,
What is the major difference between sy-index and sy-tabix ,
can you give me one good example with code..
Regards,
Reddy.Hi,
SY-TABIX - Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH FOR sets SY-TABIX to the index of the table line in which the search string is found.
SY_INDEX - In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
sy-tabix is the tab index - the index of the record in the internal table you are accessing,
sy-index is the loop counter.
If you use a condition in LOOP the sy-index will go from 1 to n, but sy-tabix will refer to the line in the internal table.
Hope this helps u.
Thanks,
Ruthra
Maybe you are looking for
-
Oracle report to Microsoft excel
Hello friends, I want to send the data from oracle report to Microsoft Excel from the report builder it self or from the Form Builder.so plz elp me out from this situation Regards, Sourav...
-
I see from the list of functions available that there is one called "renameDevices". I have been unable to make this work. I tried setting the CDATA with CSV Version 3.0 formatted data (includig the device_identity of the device I wanted to rename),
-
Splitting Date Picker applet input over multiple fields
I have created three text fields to collect date information (MM-DD-YYYY). I did so in order to allow entering dates in manually while applying a format mask to the entry along with a jumping cursor to jump from the MM field to the DD field to the YY
-
Supervisor desktop:- Display current skill
Hi All, In supervisor desktop application, i would like to know, when an agent is in talking mode, the current skill to which he is actually mapped to. a sample code for the same would be of great appreciation. Regards Suhas
-
Hello, I have been using ES2 LC Designer to create XFA forms. More users want to use iPads to open these forms. I understand forms created on ES2 are not compatible with iPads. I also understand that ES4 Designer will allow rendering of these for