Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Virtual Cube using RFC - need sample code (triggered from BW)

Former Member
0 Likes
962

Hi friends,

I got a requirement, in which we need to implement Virtual cube in BW. For this I need to write a RFC enabled function module which fetches data from R/3 tables and fills the cube. If anyone worked on similar requirement or have any details..Please reply back..Useful answers will be rewarded..

Thanks,

Suman.

9 REPLIES 9
Read only

Former Member
0 Likes
924

implemented the code for this one.

Read only

0 Likes
924

Hi Suman,

I do have similar requirement where I have to update data in a table which is in BW system using a function module developed in SRM.

Please let me know the way you have implemented this, along with the code(if possible).

TIA,

Nitin

Read only

0 Likes
924

Hi Nitin,

Develop RFC enabled function module in SRM system. Call that FM from BW to get the required data from SRM and update the table in BW table using that data.

thanks,

Suman.

Read only

0 Likes
924

Hi Suman,

Thanks for reply.

I developed a Z RFC in SRM System and acivated sucessfully and used there. But when I try to access the same RFC in BW system through pattern function, it gives me error that Function Module not found. Even though if I copy-paste the RFC from SRM to BW system, it gives Short dump. Can you give me some guidelines for getting RFC destination - the code for the same??. It would be a great help.

Waiting for your reply,

Nitin

Read only

0 Likes
924

Show me the Code you have written in BW system.

Also check whether the FM you deveoped in SRM is RFC enabled(I mean in the attributes tab of FM, did you select the RFC enabled radio button.)

thanks,

Suman.

Read only

0 Likes
924

************************Function Module in SRM****************************************

DATA : porgs TYPE bbpt_om_objtext WITH HEADER LINE,

porg_id TYPE hrtb_objkey,

uporgs TYPE hrtb_object WITH HEADER LINE,

users TYPE STANDARD TABLE OF hrbciuser WITH HEADER LINE,

wa TYPE zapes_pogusr.

CALL FUNCTION 'BBP_OM_FIND_PURCH_ORGS'

EXPORTING

preferred_langu = sy-langu

IMPORTING

porg_tab = porgs[]

porg_keys = porg_id

EXCEPTIONS

internal_error = 1

no_authority = 2

nothing_found = 3

OTHERS = 4.

IF sy-subrc <> 0.

EXIT.

ELSE.

LOOP AT porgs.

MOVE : porgs-otype TO uporgs-otype, " User ID

porgs-objid TO uporgs-objid. " Purchasing Organization ID

APPEND uporgs. CLEAR uporgs. " from wa.

ENDLOOP.

CALL FUNCTION 'BBP_OM_STRUC_GET_USER_FROM_ORG'

EXPORTING

start_objects = uporgs[]

resolve_all_orgs = 'X'

authority_check = 'X'

IMPORTING

user_tab = users[]

EXCEPTIONS

path_not_found = 1

error_reading_structure = 2

no_roots = 3

invalid_roots = 4

internal_error = 5

OTHERS = 6.

IF sy-subrc <> 0.

EXIT.

ELSE.

LOOP AT users.

MOVE : users-orgobjid-objid TO wa-zpe_porgid,

users-uname TO wa-zpe_usrid.

APPEND wa TO table.

ENDLOOP.

ENDIF.

ENDIF.

**************************Report Program in BW**************************************

REPORT zpe_pogusr_01.

TABLES : z9crprdcus.

DATA : dest TYPE z9crprdcus-zcr_parv1 .

DATA : itab TYPE zapet_pogusr. " WITH HEADER LINE.

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS : p_choice(3).

SELECTION-SCREEN : END OF BLOCK b1.

AT SELECTION-SCREEN.

TRANSLATE p_choice TO UPPER CASE.

IF NOT p_choice EQ text-003 AND NOT p_choice IS INITIAL.

MESSAGE e002(sy) WITH text-005.

ENDIF.

START-OF-SELECTION.

SELECT SINGLE * FROM z9crprdcus WHERE zcr_parcdp = 'SRM_DEST'.

dest = z9crprdcus-zcr_parv1.

IF sy-subrc EQ 0.

CALL FUNCTION 'ZSCAFM_UPDPOGUSR' DESTINATION 'BACK'

IMPORTING

table = itab

EXCEPTIONS

system_failure = 1

communication_failure = 2

cx_sy_dyn_call_illegal_type = 3

OTHERS = 4.

IF sy-subrc <> 0.

EXIT.

ENDIF.

Read only

0 Likes
924

PS: The Function Module in SRM system have attributes of Remote function Module.

Nitin

Read only

0 Likes
924

Destination should contain name of remote destination client.

Try below code:

CALL FUNCTION 'ZSCAFM_UPDPOGUSR' DESTINATION dest

IMPORTING

table = itab

EXCEPTIONS

system_failure = 1

communication_failure = 2

cx_sy_dyn_call_illegal_type = 3

OTHERS = 4.

IF sy-subrc <> 0.

EXIT.

ENDIF

Read only

0 Likes
924

Thank you for your help.