2007 Aug 31 8:15 AM
Hi,
I want to pass a select-option filled in the selection screen by the user to a method of my class. Since select-options are hold as an internal table with fields sign option low high, and passing internal tables to methods require typing, what should I write as the name of this internal table type?
For example;
select-options: so_carid for spfli-carrid.
I want to pass the contents of so_carid to my method defined in a class
2007 Aug 31 12:54 PM
Hi,
Create a table type for the SAME Data element that you use for your SELECT-OPTIONS.
1)Goto Se11-> Select Datatype-> Enter the name.
2) Click create select Table type in the dialog.
3) Enter the description for the tabletype.
4) Use menu Edit->Define as ranges table type.
5) Then give the Data element name there.
Then use this TABLE TYPE as your methods IMPORTING parameter's TYPE.
Regards,
Sesh
Hi,
I want to pass a select-option filled in the selection screen by the user to a method of my class. Since select-options are hold as an internal table with fields sign option low high, and passing internal tables to methods require typing, what should I write as the name of this internal table type?
For example;
select-options: so_carid for spfli-carrid.
I want to pass the contents of so_carid to my method defined in a class
2007 Aug 31 8:42 AM
hI
Triggering and Handling events
At the moment of implementation, a class defines its:
Instance events (using the EVENTS statement)
Static events (using the CLASS-EVENTS statement)
Classes or their instances that receive a message when an event is triggered at runtime and want to react to this event define event handler methods. Statement: METHODS
CLASS IC1_VEICHLE DEFINATION.
PUBLIC SECTION.
METHOD CONSTRUCTOR IMPORTING
EVENTS VEICHEL_CREATION.
ENDCLASS
CLASS LC1_VEICHLE IMPLIMENTATION.
METHOD CONSTRUCTOR
RAISE EVENT VEICHLE_CREATION.
REWARD IF USEFULL
2007 Aug 31 10:57 AM
Thanks for your answer. Unfortunately I couldn't establish the link between events and passing the parameters.
Can you send a very simle working example?
I just want to populate an internal table in a class using the restrictions taken from the select-options.
2007 Sep 01 11:30 AM
Hi Ferhat..
You cannot pass Select-options directly to a Method .
Bcoz ABAP Objects does not support internal table with Header line.
Select-options will create an internal table with Header line.
So you can declare another itab to store the select options
using the Data type.
DDSHSELOPT
then pass it to the method.
<b>reward if Helpful</b>
2007 Aug 31 12:45 PM
Hi Ferhat,
- define a tabletype object in the DDIC (SE11)
- go via menu EDIT -> Define as Range Table Type
- enter CARID as data element.
As method input parameter refer to that tabletype object
Then you can call your method:
zcl_my_class=>my_method( EXPORTING it_carid = so_carid[] ).
Didn't test it yet, but I think this works.
Regards, Uwe
2007 Aug 31 12:54 PM
Hi,
Create a table type for the SAME Data element that you use for your SELECT-OPTIONS.
1)Goto Se11-> Select Datatype-> Enter the name.
2) Click create select Table type in the dialog.
3) Enter the description for the tabletype.
4) Use menu Edit->Define as ranges table type.
5) Then give the Data element name there.
Then use this TABLE TYPE as your methods IMPORTING parameter's TYPE.
Regards,
Sesh
2007 Aug 31 1:15 PM
2007 Aug 31 1:24 PM
Forgive me for interrupting
but it also asks a structured row type for the range table.
How am I going to deal with it?
2007 Aug 31 1:48 PM
Hi,
Then you need to create the ROW TYPE , that is nothing but a Structure.
In SE11 when you are creating the table type using Edit->Define as ranges tabletype after entering the Data element, enter some name in the field "Structred row type" and click create and then activate the structure and come back to table type and activate it.
After this you can use this table type.
@Uwe: Both of us missed out mentioning the ROW-TYPE.
Regards,
Sesh
2007 Aug 31 1:55 PM
Hi Uwe,
Its important to see that we address all the problems of the poster ;-).
Regards,
Sesh
2007 Aug 31 3:52 PM
Hi Sesh,
yes, you're right !
Like I said before, I didn't test the function yet. I only recognized this new ranges table type from Toms and Richs new book (and I haven't got the book in my customers office).
Uwe
2007 Sep 01 3:22 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |