View parameters in a class Method
Hi,
Pl tell me wht is the best way one can view parameters of a Method in a class.
Regards,
Rushikesh
Have a look at the below material for Class & Methods..
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
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/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
<b>Check this cool weblog:</b>
/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
Raja T
Similar Messages
-
Passing internal tables as parameters to a class method.
Hai,
I have a requirement to pass an internal table(not structure) as a parameter to a method of a class.Are there ways to do it?
Plz reply.
Thanks in advance.
HemaHI
GOOD
GO THROUGH THIS LINK
http://www.abapforum.com/forum/viewtopic.php?t=1962&language=english
THANKS
MRUTYUN -
How to pass importing parameter of super class method to subclass method?
hi all,
i have defined a class
CLASS CUST_REPORT DEFINITION.
PUBLIC SECTION.
METHODS:DATA_RETRIVE IMPORTING CUSTID_LOW TYPE ZCUSTOMER-ZCUSTID
CUSTID_HIGH TYPE ZCUSTOMER-ZCUSTID.
DATA:IT_CUST TYPE TABLE OF ZCUSTOMER,
WA_CUST TYPE ZCUSTOMER.
ENDCLASS. "cust_report DEFINITION
The method DATA_RETRIVE in this class has two importing parameters named CUSTID_LOW and CUSTID_HIGH.
then i have defined subclas of this clas.
LASS CUST_ORD DEFINITION INHERITING FROM CUST_REPORT.
PUBLIC SECTION.
DATA:IT_ORD TYPE TABLE OF ZORDER.
METHODS:DATA_RETRIVE REDEFINITION,
DISPLAY.
ENDCLASS. "cust_ord DEFINITION
Method DATA_RETRIVE is redefined.
So how to pass importing parameteres of super class method to sub class method with the same name.
Thanks and Regards,
ArpitaHi,
I tried like this.
METHOD DATA_RETRIVE.
CALL METHOD SUPER->DATA_RETRIVE
EXPORTING
CUSTID_LOW = I_CUSTLOW
CUSTID_HIGH = I_CUSTHIGH.
ENDMETHOD.
But parameters I_CUSTLOW and I_CUSTHIGH are not getting values after call to method.
Thanks and Regards,
Arpita -
Can we chagne Super class method parameters in Sub class
Hi,
I created a super class. In that class i created a method. That method is having 4 input parameters and 4 export parameters.
I created a sub class for that super class. I need to use only 2 input parameters in this class rather than 4 parameters. I want to delete 2 Input parameters in the sub class of the super class method. Is it possible.
If possible. can we give an simple code or pseudo code?
regards,
krishnaHi,
I think you can not.
Because, only public attributes can be inherited and they will remain public in the subclass.
for further detail check,
http://help.sap.com/saphelp_nw70/helpdata/en/1d/df5f57127111d3b9390000e8353423/content.htm
regards,
Anirban -
Access fo Method parameters to Anonymous Class ?
Can somebody please provide some more information on the statement below? I am also searching for some sample code implementations of it. It would help the cause better.
+"Methods of the object of the anonymous class need access to final local variables and method parameters belonging to the method in which the anonymous class is defined. "+
Thanks in AdvanceWe're concerned here with "local" classes, i.e. classes defined inside methods (not all anonymous classes are local, and not all local classes are anonymous).
The thing about local classes is that, unlike local variables etc., instances of a local class may survive the method returning. For example a local class might be a listener which gets added to a swing component, it could be a Runnable that get's launched as a thread.
Local classes get to access local variables and parameters of the method in which they are declared but the variables or parameters have to be declared final because, since the class needs to be able to access the value of the local variable even after the method exits, and the variable ceases to exist, what actually happens it that the value of the variable is copied into a special field of the anonymous class, and if the variable could be changed after the class was defined, the two copies would then disagree. -
Unable to view the details of BAdi method
Guys,
Using SE18, I was able to view the different methods inside a particular BAdi. I had double clikced on a Method name and was able to view method parameters. However, I am not able to view the details of this method by double clikcing on it.Can I go much deeper at this level and just view the code with out an access code ?
IV_PAREAID Importing Type /SAPAPO/TS_PAREAID
IV_INFOPROV Importing Type RSINFOPROV
IV_VERSIOID_TO Importing Type /SAPAPO/VRSIOID
IV_KEYFIGURE_FR Importing Type RSDIOBJNM
IV_RELEASE_TYP Importing Type /SAPAPO/MSDP_RELEASE_TYP
IT_FREE_CHARVALUES Importing Type /SAPAPO/TS_SEL_OBJECT_TAB
IT_TAB Importing Type /SAPAPO/TS_TAB_EXT_TAB
IT_COLS Importing Type /SAPAPO/TS_COLS_EXT_TAB
IT_LINES Importing Type /SAPAPO/TS_LINES_EXT_TAB
ET_MSG_TAB Exporting Type /SAPAPO/TS_BAL_MSG_TAB
CT_MATLOC_TAB_DETAIL Changing Type /SAPAPO/TS_MATLOC_TAB_TAB
CT_PLOB_VALUES Changing Type /SAPAPO/TS_PLOB_VALUES_TAB
CV_CHANGE_SPLIT Changing Type FLAG
Further, what does the prefix IV, IT, ET, CT, CV stand for and whats their significance ?
ThanksIts just a naming convention :
Subcomponent name
Name of a subcomponent of an object type, that is, a parameter or an
exception. The name can consist of alphanumeric characters and the
special characters underscore (_) and forward slash (/).
The name may only contain uppercase letters. The Class Builder
automatically converts lowercase letters into uppercase. However, if you
use the Class Library API to insert a name, there is no automatic
conversion, and an error occurs.
Yes you can define internal table in Method and its same has writing a program in SE30 like can call function module etc in method.
You can debug BAPI method by entering into mehtod and type /h (where you write transaction code ) and enter , it will take you to debug mode.
Manish -
Loading and viewing XML when a class object is created..Help Please
Hello,
I have writing a simple class which has a method that gets invoke when the object of the class is created. I am able to view the loaded XML content when I trace it with in my class method, but cannot assign the content to a instance variable using the mutator method. So the process goes like this:
Class object is instantiated
Class construtor then calls the loadXML method which laods the XML
And then assigns the XML to a class instance variable.
So now if I would like to access the loaded XML through class object, I should be able to see the loaded xml content which I am not able to see. I have spent over few hours and cannot get the class object to display the loaded XML content. I would highly appreciate it if someone can help in the right direction, please.
[code]
package com.as3.app
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
public class Cars extends MovieClip {
public var _CarList:Object;
public function Quiz()
super();
loadCars();
// ===========================================================
// CARS GETTER SETTER
// ===========================================================
public function set Cars(val:XML):void
this._CarList = val;
public function get Cars():XML
return this._CarList;
// ===========================================================
// LOAD QUESTIONS FROM XML
// ===========================================================
public function loadcars()
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("xml/cars.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
myXML = new XML(e.target.data);
Cars = myXML; // Assigning the loaded xml data via mutator method to the _CarList;
//=============================================================
INSTANTIATING THE CLASS OBJECT
//=============================================================
package com.as3.app
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import com.as3.app.*;
public class DocumentClass extends MovieClip {
public var c:Car;
public function DocumentClass()
super();
c = new Cars();
trace(c.Cars);
[/codewhere you have:
super();
c = new Cars();
trace(c.Cars);
c.Cars will not trace as the loaded xml, because it will not have loaded in time. After some time it should presumably have the correct value.
loading operations in actionscript are asynchronous, so your nested function which is acting as the listener ( function processXML(e:Event):void) only ever executes when the raw xml data has loaded and that is (I believe, not 100% sure) always at least one frame subsequent to the current one.
In general I would consider it bad practise to use nested functions like that, but I don't think its contributing to your issues here. I think its just a timing issue given how things work in flash....
Additional observation:
your Cars constructor calls loadCars() and your loadCars method is defined as:
public function loadcars()
I assume its just a typo in the forum that the uppercase is missing in the function name.... -
Type for SENDER parameter in Class Method
Hi all,
I have an import parameter declared in a Class method .
in SE38 program i want to retrieve through export parameter .
But i am not able to figure how to defind the type of SENDER parameter . Please suggest if my perception is wrong or the point that i am missing here .
Regards,
Ry.Hi Vijay,
Thank you for your reply . the problem i am having is the functionlaity of this report is it displays three grids and when ever i double click on a grid it should identify the particluar grid . i have highlighted in bold where i am encountering the problem. i am enclosing the class details and the report source code. Please suggest after going through it . thanks in advance.
Class details that i have created :
the class has a method handle_double_event with event handler double_click of CL_GUI_ALV_GRID . i have defined this in the method section.
in public section section :
public section.
types GO_GRID1 type ref to CL_GUI_ALV_GRID .
class-methods HANDLE_DOUBLE_CLICK
for event DOUBLE_CLICK of CL_GUI_ALV_GRID
importing
ES_ROW_NO
E_COLUMN
E_ROW
SENDER .
in handle_double_event code :
DATA:
go_grid1 TYPE REF TO cl_gui_alv_grid,
go_grid2 TYPE REF TO cl_gui_alv_grid,
go_grid3 TYPE REF TO cl_gui_alv_grid.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1,
gt_vbak TYPE STANDARD TABLE OF vbak,
gt_vbap TYPE STANDARD TABLE OF vbap.
define local data
DATA:
ls_knb1 TYPE knb1,
ls_vbak TYPE vbak,
ls_vbap TYPE vbap.
DATA: es_row_no type lvc_s_roid,
e_column type lvc_s_col,
e_row type lvc_s_row.
*CASE sender. - here when i double click on the first grid go_grid1 it should go inside the go_grid1 . but it is not entering .*
WHEN 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( 'ORDERS' ).
WHEN go_grid2.
READ TABLE gt_vbak INTO ls_vbak INDEX e_row-index.
CHECK ( ls_vbak-vbeln 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( 'ORDER_DET' ).
WHEN go_grid3.
READ TABLE gt_vbap INTO ls_vbap INDEX e_row-index.
CHECK ( ls_vbap-matnr IS NOT INITIAL ).
SET PARAMETER ID 'MAT' FIELD ls_vbap-matnr.
CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
WHEN OTHERS.
RETURN.
ENDCASE.
endmethod.
Code for the Report that is accessing the class.
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_splitter_2 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_cell_left TYPE REF TO cl_gui_container,
go_cell_right TYPE REF TO cl_gui_container,
go_grid1 TYPE REF TO cl_gui_alv_grid,
go_grid2 TYPE REF TO cl_gui_alv_grid,
go_grid3 TYPE REF TO cl_gui_alv_grid,
list type ref to zcl_eventhandler,
es_row_no type lvc_s_roid,
e_column type lvc_s_col,
e_row type lvc_s_row,
sender(8) type c.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1,
gt_vbak TYPE STANDARD TABLE OF vbak,
gt_vbap TYPE STANDARD TABLE OF vbap.
PARAMETERS : p_bukrs TYPE ekko-bukrs default '1000'.
START-OF-SELECTION.
create object list.
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = p_bukrs.
Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 50
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 = 1
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_left.
container = go_cell_top.
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = go_cell_right.
Create 2nd splitter container
CREATE OBJECT go_splitter_2
EXPORTING
parent = go_cell_left
parent = go_cell_top
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_2->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_top.
CALL METHOD go_splitter_2->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.
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.
CREATE OBJECT go_grid3
EXPORTING
i_parent = go_cell_right
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.
CALL METHOD ZCL_EVENTHANDLER=>HANDLE_DOUBLE_CLICK
EXPORTING
ES_ROW_NO = ES_ROW_NO
E_COLUMN = E_COLUMN
E_ROW = E_ROW
SENDER.
Set event handler
SET HANDLER: list->handle_double_click FOR go_grid1.
SET HANDLER: list->handle_double_click FOR go_grid2.
SET HANDLER: list->handle_double_click FOR go_grid3.
Display data
CALL METHOD go_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'KNB1'
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.
REFRESH: gt_vbak.
CALL METHOD go_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAK'
CHANGING
it_outtab = gt_vbak
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.
REFRESH: gt_vbap.
CALL METHOD go_grid3->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAP'
CHANGING
it_outtab = gt_vbap
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:
*PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Form CUSTOMER_SHOW_ORDERS
text
--> p1 text
<-- p2 text
FORM customer_show_orders .
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 vbak INTO TABLE gt_vbak
WHERE kunnr = ls_knb1-kunnr.
REFRESH: gt_vbap.
ENDFORM. " CUSTOMER_SHOW_ORDERS
*& Form ORDER_SHOW_DETAILS
text
--> p1 text
<-- p2 text
FORM order_show_details .
define local data
DATA:
ld_row TYPE i,
ls_vbak TYPE vbak.
CALL METHOD go_grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_vbak INTO ls_vbak INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT * FROM vbap INTO TABLE gt_vbap
WHERE vbeln = ls_vbak-vbeln.
ENDFORM. " ORDER_SHOW_DETAILS
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "ORDERS"
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.
Refresh display of detail ALV list
CALL METHOD go_grid3->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.
move sy-ucomm to gd_okcode.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
User has pushed button "Display Orders"
WHEN 'ORDERS'.
PERFORM customer_show_orders.
WHEN 'ORDERS_DET'.
PERFORM order_show_details.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
endmodule.
Regards,
Ry -
Pass 2 different parameters from 2 different methods to 1 method
Hi all,
To the method "renameFile" my parameter is "File dst" and
to the method "renameCode" my parameter is "String name".
But I need to get both the parameters "File dst" and "String name" into a single method. Could anyone please help me with this. My code is:
public static void renameFile(File dst) throws IOException
public static void renameCode(String name) throws IOException
But I need both the parameters into the following method as:
public static void filename(File dst, String name) throws IOException
}The following is my entire class code:
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
public class filesMove
/** Creates a new instance of filesMove */
public filesMove()
public void copyDirectory(File srcDir, File dstDir) throws IOException
copyFile(srcDir, dstDir);
public static void copyFile(File src, File dst) throws IOException
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);
byte[] buf = new byte[1024];
int len;
while((len = in.read(buf)) > 0)
out.write(buf, 0, len);
in.close();
out.close();
renameFile(dst);
public static void renameFile(File dst) throws IOException
combined(code);
public static void renameCode(String name) throws IOException
combined(code);
public static void combined(File dst, String name) throws IOException
//Please tell me how do I get both the parameters "File dst, String name" from the above two methods. Presently its throwing an error
} -
Exporting Tables from BSP to Class Methods
Afternoon Everybody,
in true SAP OSS Message style I post this question on it's own thread to enable maximum value from the reward points.
Question:
I have a BSP, in an event in my BSP I call a method in my class.
I have mastered Exporting parameters to the methods from the BSP and Importing parameters back to the BSP from the methods, but now, I need so Export a table to the method and I don't know how to.
Also, in combination with this, when I create the method I am able to setup the importing parameters, but how can create/define the importing table ?
If this is not clear I will add more info.
Thanks for your help,
Tomas.Tomas,
The key to problem is always to learn a few "nice" things defined in the system. So let me see. The first problem you have is that methods are declared of the form:
method <parm> <direction> TYPE [REF TO] <t>
parm = the name of the paramter
direction = IMPORTING|EXPORTING|CHANGING|RETURNING
t = type of parm
However, in this type it is not possible to write that you want "type of table". You can only use predefined types (either internal or indictionary).
Having said this, most people with extensive ABAP experience before the OO-wave, tend to use character types all the time. However, we nearly always use only type string. And exactly for this type there is a type string_table.
So the code would be:
<u>Declaration:</u>
method lines changing type string_table
<u>Calling:</u>
DATA: t TYPE string_table.
APPEND 'Hello' TO t.
APPEND 'World' TO t.
class=>method( CHANGING lines = t ).
<u>Method Implementation:</u>
DATA: line LIKE LINE OF lines.
LOOP AT lines INTO line.
TRANSLATE line TO UPPER CASE.
MODIFY lines FROM line. " write back
ENDLOOP.
<u>Better Method Implementation (works directly on row):</u>
FIELD-SYMBOLS: <line> LIKE LINE OF lines.
LOOP AT lines ASSIGNING <line>.
TRANSLATE <line> TO UPPER CASE.
ENDLOOP.
These two types <b>string</b> and <b>string_table</b> goes a long way. The other two types that I often use are <b>ihttpvnp</b> and <b>Tihttpvnp</b> (table): they are good for name/value pairs of strings.
Now is the time that you should invest 30 minutes reading each time that you run into a problem. You have the framework, just check up on one aspect each time. (I usually use online help, for example to understand MODIFY for writing this text.) -
For getting the roles assigned to a user ,I connect to OIM .I am getting the following exception on executing the operation on the JBOSS console -
16:04:10,218 WARN [DATABASE] Trying to get the connection count : 4
16:04:10,218 ERROR [DATABASE] Class/Method: DirectDB/getConnection encounter some problems:
Error while retrieving database connection.Please check for the follwoing
Database srever is running.
Datasource configuration settings are correct.
16:04:10,234 ERROR [AUDITOR] Class/Method: AuditEngine/finishTransaction encounter some problems: {1}
java.lang.NullPointerException at com.thortech.xl.util.JDBCUtils.prepareStatement(Unknown Source)
at com.thortech.xl.dataaccess.tcDataBase.writePreparedStatement(UnknownSource)
at com.thortech.xl.dataobj.PreparedStatementUtil.executeUpdate(Unknown Source)
Any pointers as to why this exception occurs will be helpful.
Thanks !user11957197 wrote:
Hi,
I am getting this error in my log files when I run our custom Role add schedule task:
Class/Method: tcReconciliationOperationsBean/ignoreEventAttributeData encounter some problems: Data Not Found.
BUt with error I cannot figure out where is the problem. Whether the user account is not present in IDM or user role data in not present in Child view data. Please help if anybody have faced such error before.
Thanks,
Kalpana.Which OIM version do you work with? -
Hi,
In classical report we click on the pattern and write the funciton module name there to get the import and export parameter of the fucntion.
Can somebody tell me how to call the class method in the program with the parameters coming automatically .
Thankshi Arvind,
Click on pattern.
Choose ABAP object pattern radio button and press enter.
You have four radio button-the first one call method is for your requirement.
Enter the object instance name, class name and method name and press enter.
You will get the call method for this instance of the class.
Hope this helps.
Regards,
Richa -
Hi Friends,
i am facing one problem while preparing code in proxy class method. i need to use same code so many places in my class method for that purpose i was trying to use perform statements but system is giving syntax error 'Forms can not be defined in a class pool For this reason, there are no perform statements for internal FORM'S'.
With out perform statements how to handle the repetative logic in same program. Any help will be highly appreciated.
Thanks a lot in advance.If you are talking about global classes,
then go to SE24 and create your class.
In the class go to Methods tab, give a name to your method, Define it as a static method, if you want the values to be persisted and not specific to the instances that are created based on your class.
Give the visibility as private, becuase you want these private methods only to be called in your class only.
Then click on parameters and define your exporting and importing parameters.
Double click on the method name and have your repetitive code there.
YOu can call this method in other methods of the class using
call method <method name>statement.
Regards,
Ravi -
Access global data of report in global class methods?
Hi all,
I have defined one global class in SE24 and i am using methods of this class in report program.
Can i access global data of my report program in class methods directly without declaring it as IMPORT
parameter?
Thanks,
ApitaHi,
Well, now you did confuse me: first you asked about using global data of a report program in global class (created in SE24), and the answer is: no, you can't directly access the global data of another program in a method of global class (yes, you should pass them via importing parameters), and you shouldn't even consider using indirect means of doing so via special form of ASSIGN statement reserved for internal use by SAP. The ASSIGN will not work if someone reuses the global class elsewhere in the system without loading your report. Don't ever program such atrocious dependencies in global class...
And now you ask about the use "in method implementation in report program"..? Just to be sure - you can't program the implementation of a global class method in a report program.
You can program a local class inheriting from a global class and redefine/re-implement methods of such global super-class in a report program. Global data of report program, including the selection screen, would be directly accessible to such local class. It would still not be a good idea to use this access:
Conversely, within an encapsulated unit, that is, within a class, you should avoid accessing more global data directly. Within methods, you should generally modify attributes of the class only. Write access to global data outside the class is not recommended. Accessing data in this way should only be done using specially marked methods, if at all. The use of methods of a class should not evoke any side effects outside the class itself.
cheers
Jānis
Message was edited by: Jānis B -
What is class method for a float
What is a class method for a float, and can I use it with a timer?
X- Developer wrote:
What is a class method for a float, ...
A float is a simple data type that just stores one real number. Other simple data types are, for example, char, int, long, double, etc. None of these is a class. None have member variables, instance methods or class methods.
The methods of some classes certainly use floats, and some methods have "float" in their name. For example, \[NSString floatValue\] will convert numeric text into a float value. Let us know if your question relates to a method like that. If so, remember to always specify which class you're asking about.
can I use it with a timer?
Any method can set up a timer which fires some other method once or repeatedly. However I don't understand what it means to use a float with a timer. In fact I don't know what it might mean if an int or a string or a view were used with a timer. Maybe it would help if you described what you're trying to do, ok?
\- Ray
Maybe you are looking for
-
With Intel and Nokia working together on a new Mobile OS, where does this put Maemo updates for the n900 in the future? It will start to come out in Q2 2010, so will it work on the n900 as it stands? If tnis post is a cure to your issue, please MARK
-
Repeated Frames at the end of clips
I have a MacBook Pro with the adobe premiere pro cc 14, but I noticed this problem is CS6 also. The problem is this: Say I have two clips in the timeline that are connected (Clip A, Clip B). If I alter Clip B in anyway (change scale or position, or s
-
Stock in hand vs Stock requirements - using Sceduling aggrements with MRP
Hi SAP Guru's, 1.Currently on 4.6C and client requires a report to view similar to MD04 with capability of multiple materials and vendors and way of summarizing the future requirements and current receipts? Right now with MD04 we can see for one mate
-
I have an unlocked iphones 4s that works with tmoble can i update to ios 7 7
i had metro pcs unlock my iphone 4s and im runing on t-mobile can i update to ios 7
-
How to import transport of copies to productive systems
Hello, I have been experiencing a problem that even the guys from admin could not solve (yet). I should say I work in a development team. Imagine you have two landscapes, one DEV-QAS(1) to develop big projects and a normal DEV-QAS-PRD(2) landscape wh