‎2010 Aug 16 12:09 PM
Hi guys,
i am a beginner in abap programming. I have made a programm in Se80 which shows all the nodes of the active hierarchies (5 stk.)
in a ALV grid. Therefore i am getting the active hierarchies from table "rshiedir" and use the normal function module "RSSH_HIERARCHY_READ" to display the nodes of the hierarchie. The problem is the hierarchies do have a different techical name in the systems (development-acceptance-productive) but the descriptive nbame is the same in all systems. Because of the difference of the technical names I can use this programm in just one system. But the hierarchy content should be comparable and be displayed in all three systems. Therefore i would like to create a remoteable function module which covers the normal one. Can i do this and how can i create a remoteable function module and use it?
If not do you know any remotable functgion module which gives back all the nodes from an active hierarchy in table "RShiedir".
Thanks and kind regards,
Murat
‎2010 Aug 16 12:20 PM
Hello,
Simple, create a wrapper RFC (similar to 'RSSH_HIERARCHY_READ' ) & call the normal FM 'RSSH_HIERARCHY_READ' inside the wrapper.
Something like this:
FUNCTION z_rssh_hierarchy_read.
*"----------------------------------------------------------------------
*"*"Global Interface:
*" IMPORTING
*" VALUE(I_RSHIEDIRKEY) TYPE RSHI_S_RSHIEDIRKEY OPTIONAL
*" VALUE(I_RSHIEDIRLOG) TYPE RSHI_S_RSHIEDIRLOG OPTIONAL
*" VALUE(I_DATE) TYPE RSHI_DATE DEFAULT SY-DATUM
*" EXPORTING
*" REFERENCE(E_RSHIEDIR) TYPE RSHI_S_HIEDIR
*" REFERENCE(E_T_RSNODES) TYPE RSHI_T_HIENODE
*" REFERENCE(E_TH_RSINTERVAL) TYPE RSHI_TH_INTERVAL
*" REFERENCE(E_DUPLICATE_LEAFS) TYPE RS_BOOL
*" REFERENCE(E_T_RSNODES_LNK) TYPE RSHI_T_HIENODE
*" EXCEPTIONS
*" INVALID_HIERARCHY
*" NAME_ERROR
*" IOBJ_NOT_FOUND
*"----------------------------------------------------------------------
" Don't forget to add TYPE-POOLS rshi to the FuGr. TOP include
CALL FUNCTION 'RSSH_HIERARCHY_READ'
EXPORTING
i_rshiedirkey = i_rshiedirkey
i_rshiedirlog = i_rshiedirlog
i_date = i_date
IMPORTING
e_rshiedir = e_rshiedir
e_t_rsnodes = e_t_rsnodes
e_th_rsinterval = e_th_rsinterval
e_duplicate_leafs = e_duplicate_leafs
e_t_rsnodes_lnk = e_t_rsnodes_lnk
EXCEPTIONS
invalid_hierarchy = 1
name_error = 2
iobj_not_found = 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.Here Z_RSSH_HIERARCHY_READ is the wrapper RFC. Hope you get the point.
BR,
Suhas
‎2010 Aug 16 12:17 PM
Hi,
A normal FM can be made remote enable by selecting Remote-Enabled Module option in the attributes of the FM.
‎2010 Aug 16 12:43 PM
HI,
If you navigate to the Attribute of the function module, you will get 3 sections. Please look into the Processing Type Section. There you will find 3 options as follows.
Normal Function Module
Remote-Enabled module
Update Module
Please select the Remote enable module, then your function will be remote enabled.
Please let me know if you facing any issue regarding this.
Regards
Satrajit.
‎2010 Aug 16 12:20 PM
Hello,
Simple, create a wrapper RFC (similar to 'RSSH_HIERARCHY_READ' ) & call the normal FM 'RSSH_HIERARCHY_READ' inside the wrapper.
Something like this:
FUNCTION z_rssh_hierarchy_read.
*"----------------------------------------------------------------------
*"*"Global Interface:
*" IMPORTING
*" VALUE(I_RSHIEDIRKEY) TYPE RSHI_S_RSHIEDIRKEY OPTIONAL
*" VALUE(I_RSHIEDIRLOG) TYPE RSHI_S_RSHIEDIRLOG OPTIONAL
*" VALUE(I_DATE) TYPE RSHI_DATE DEFAULT SY-DATUM
*" EXPORTING
*" REFERENCE(E_RSHIEDIR) TYPE RSHI_S_HIEDIR
*" REFERENCE(E_T_RSNODES) TYPE RSHI_T_HIENODE
*" REFERENCE(E_TH_RSINTERVAL) TYPE RSHI_TH_INTERVAL
*" REFERENCE(E_DUPLICATE_LEAFS) TYPE RS_BOOL
*" REFERENCE(E_T_RSNODES_LNK) TYPE RSHI_T_HIENODE
*" EXCEPTIONS
*" INVALID_HIERARCHY
*" NAME_ERROR
*" IOBJ_NOT_FOUND
*"----------------------------------------------------------------------
" Don't forget to add TYPE-POOLS rshi to the FuGr. TOP include
CALL FUNCTION 'RSSH_HIERARCHY_READ'
EXPORTING
i_rshiedirkey = i_rshiedirkey
i_rshiedirlog = i_rshiedirlog
i_date = i_date
IMPORTING
e_rshiedir = e_rshiedir
e_t_rsnodes = e_t_rsnodes
e_th_rsinterval = e_th_rsinterval
e_duplicate_leafs = e_duplicate_leafs
e_t_rsnodes_lnk = e_t_rsnodes_lnk
EXCEPTIONS
invalid_hierarchy = 1
name_error = 2
iobj_not_found = 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.Here Z_RSSH_HIERARCHY_READ is the wrapper RFC. Hope you get the point.
BR,
Suhas
‎2010 Aug 16 12:22 PM
Hi,
You can check the radio button of Remote-Enabled Module in attributes tab of function module.
Regards.
‎2010 Aug 16 12:34 PM
Hi Saha,
the idea with the wrapper function module is good. But when i create a function module the function group is required. What should i enter here. Everywhere the same like the original function module. Function group "RSSHIER" should i enter this one for the wrapper function group? and you wrote that i should not forget the type pool:slis in the include. When i create a wrapper function module where can i put the include?
Thanks and kindregards,
Murat
‎2010 Aug 16 12:47 PM
Hello Murat,
You can create your own FuGr. (e.g., ZRSSHIER) & in the generated code of the FuGr. you'll have a top include.
In the top include define the TYPE-POOL. (Similar to LRSSHIERTOP line 11).
BR,
Suhas
PS: For simplicity sake & to save me time to create the prototype i gave the same names
‎2010 Aug 17 4:28 PM
Hi Saha,
Do i have to declare importing and exporting variables or exporting tables? in the wrapper Function module?
Thanks and kind regards,
Murat
‎2010 Aug 17 4:29 PM
i am wainting fo an answer from saha. but the question is answered.