‎2009 Jul 29 8:24 PM
Hello,
I am very new to the ABAP world. I have been given a task to call a method if_hrbas_plain_infotype_access~read_single from the class CL_HRBAS_PLAIN_INFOTYPE_ACCESS in a program to see if we can use it to display some employee information. I don't know how to call a method in a program. Can somebody please provide me some pseudo code or instructions?
Thanks.
‎2009 Jul 29 8:33 PM
Hi,
in the source code screen in se37 or se38 --> Press Ctrl+F6 or pattern
next>select ABAP object pattern and execute>enter calss "CL_HRBAS_PLAIN_INFOTYPE_ACCESS"
under enter method "if_hrbas_plain_infotype_access~read"
and enter
Prabhudas
‎2009 Jul 29 8:26 PM
In the same way you call a FM. Click on button Pattern, then give the method name you want to call.
Kuntal
‎2009 Jul 29 8:28 PM
Thanks for the response. However, I don't know how to call a FM as well. I am looking for some syntax or pseudo code. Sorry, if it is a basic question.
Thanks.
‎2009 Jul 29 8:35 PM
As I have said, press the pattern button from your editor. Their you will get the option. Or search net to get step by step details.
Kuntal
‎2009 Jul 29 8:33 PM
Hi,
in the source code screen in se37 or se38 --> Press Ctrl+F6 or pattern
next>select ABAP object pattern and execute>enter calss "CL_HRBAS_PLAIN_INFOTYPE_ACCESS"
under enter method "if_hrbas_plain_infotype_access~read"
and enter
Prabhudas
‎2009 Jul 30 6:53 AM
Hi Shan,
go to your program Se38 or from where you want to call method.
then in application tool bar, one pushbutton called 'PATERN ' is there. click that.
then one pop-up will come, within pop-up select 'abap object patern', radio button. then enter.
select call method radiobtton & then give the class name & method of that class which you want to called.
for class see tr. se24.
Regards,
Tutun
‎2009 Jul 30 7:08 AM
Hi,
Either you can use the patterns, or if you can simply type
CALL METHOD (CLASS_NAME)=>(METHOD NAME)
EXPORTING
IMPORTING .
Use F1 on 'Call method' to get more details.
Thanks
‎2009 Jul 30 7:12 AM
Hello Shan,
Just follow the navigation provided below to call method from program.
Go to se38 transaction---> Open your program----> press ctrl+f6 (or) PATTERN button on the toolbar--->select ABAP OBJECT PATTERNS----> select CALL METHOD---> enter the method you want to call and hit enter.hope this solves your problem.
Regards,
Pavan.
‎2009 Jul 30 7:53 AM
Hi,
Click on the Pattern button (or ctrl+f6) in se38, choose "ABAP Object Patters" and click on u201Centeru201D button.
It will open an other window
Enter the Class as if_hrbas_plain_infotype_access and
enter the method as read
and again press enter...
The code is ready
Hope this helps.
Thanks
Sindhu
‎2009 Jul 30 8:08 AM
hi shan ,
you can try this wiki link as reference , to get the idea of your problem
https://wiki.sdn.sap.com/wiki/display/ABAP/7stepstocreateOOPS+ALV
Regards
Saurabh Goel
‎2009 Jul 30 10:15 AM
Hi Shan,
here is the code to call a method. while calling the method Instance as 'r_info' which is the type reference to class as specified.
pass the values to exporting parameters plvar,otype,objid...etc according to the requirement
infotypes: 0002. " creates an internal table p0002.
data:
r_info type ref to CL_HRBAS_PLAIN_INFOTYPE_ACCESS.
TRY.
CALL METHOD r_info->if_hrbas_plain_infotype_access~read
EXPORTING
plvar =
otype =
objid =
istat =
infty =
* SUBTY =
begda =
endda =
no_auth_check = 'X'
message_handler =
IMPORTING
PNNNN_TAB = P0002
* HRTNNNN_TAB =
* IS_OK =
.
CATCH CX_HRBAS_VIOLATED_ASSERTION .
ENDTRY.
LOOP AT P0002.
WRITE:/
P0002-VORNA,
P0002-NCHMC,
P0002-NACHN.
ENDLOOP.
Regards
‎2009 Jul 30 10:43 AM
Hi,
From the ABAP editor (SE38) press the PATTERN button or press Control+F6.
Then select the radiio-button ABAP Object Patterns and then continue.
Next put in the Class/Interface name as - CL_HRBAS_PLAIN_INFOTYPE_ACCESS
and the Method name as - if_hrbas_plain_infotype_access~read_single and then click continue.
‎2009 Jul 30 3:18 PM
‎2025 Feb 24 1:14 PM - edited ‎2025 Feb 24 1:15 PM