Application Development 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: 

Difficulty With First User Exit for Reporting

former_member205400
Active Participant
0 Kudos

I am just a bit confused with starting my first "user exits for reporting". I am on Netweaver 2004s 7.0 sp13.

I went to trans CMOD and created a project: ZBIMWH01.

I went to change mode and pressed "components" and I see the following:

Project ZBIMWH01 mwh: query cust exits

Enhancement Impl Exp RSR00001 BI: Enhancements for Global Variables in Reporting

Function exit EXIT_SAPLRRS0_001

Next to EXIT_SAPLRRS0_001 is a document icon. When I press it I get an ABAP Editor with "INCLUDE LXRSRF01"

Yeah, here I can type in some code.

I understand that here I should put in some code to call individual function modules and then create/modify those, so I'll put the following code in there like:

DATA: l_d_fname(30) TYPE c.

CASE i_step.

WHEN 1.

CONCATENATE 'Z_VAR_PRE_POPUP_'

i_vnam INTO l_d_fname.

WHEN 2.

CONCATENATE 'Z_VAR_POST_POPUP_'

i_vnam INTO l_d_fname.

WHEN 0.

CONCATENATE 'Z_VAR_AUTHORITY_'

i_vnam INTO l_d_fname.

WHEN 3.

CONCATENATE 'Z_VAR_CHECK_VALIDITY'

ENDCASE.

TRY.

CALL FUNCTION l_d_fname

EXPORTING

I_VNAM = i_vnam

I_VARTYP = i_vartyp

I_IOBJNM = i_iobjnum

I_S-COB_PRO = i_s_cob_pro

I_S_RKB1D = i_s_rkb1d

I_PERIV = i_periv

I_T_VAR_RANGE = i_t_var_range

I_STEP = i_step

IMPORTING

E_T_RANGE = e_t_range

E_MEEHT = e_meeht

E_MEFAC = e_mefac

E_WAERS = e_waers

E_WHFAC = e_whfac

CHANGING

C_S_CUSTOMER = c_s_customer

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY

NUMBER SY-MSGNO

WITH

SY-MSGV1 SY-MSGV2

SY-MSGV3 SY-MSGV4

RAISING ERROR_IN_VARIABLE.

ENDIF.

CATCH CX_SY_DYN_CALL_ILLEGAL_FUNC.

  • No exit implemented, no need to do

  • anything here

ENTRY.

I assume then that the rest of my code for the reporting should be in the individual function modules.

So now I can create a function module like 'Z_VAR_PRE_POPUP_firstvar'.

Am I getting this correct?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Michael,

If u want to check whether u code is correct or not.

U put a break-point any where in the code. It will be better if u put

break userid so that it will not disturb others.

It will reflect in the functionality by that u check.

Assign Points if useful.

Regards

(YUGANDHAR.P)

4 REPLIES 4

Former Member
0 Kudos

Hi Michael,

If u want to check whether u code is correct or not.

U put a break-point any where in the code. It will be better if u put

break userid so that it will not disturb others.

It will reflect in the functionality by that u check.

Assign Points if useful.

Regards

(YUGANDHAR.P)

former_member205400
Active Participant
0 Kudos

I found I was using the wrong include.

After I put in:

INCLUDE ZXRSRU01

instead of:

INCLUDE LXRSRF01

at least I can troubleshoot. So now the break-point gets fired off and i'm trying to understand the basic fields that get set and filled.

If you have a simple exit I can use feel free to post it.

Mike

former_member205400
Active Participant
0 Kudos

My include is executing and my function module Z_VAR_PRE_POPUP_firstvar is called.

In Z_VAR_PRE_POPUP_firstvar I have the following code:

""Local Interface:

*" IMPORTING

*" REFERENCE(I_VNAM) TYPE RSZGLOBV-VNAM OPTIONAL

*" REFERENCE(I_VARTYP) TYPE RSZGLOBV-VARTYP OPTIONAL

*" REFERENCE(I_IOBJNM) TYPE RSZGLOBV-IOBJNM OPTIONAL

*" REFERENCE(I_S_COB_PRO) TYPE RSD_S_COB_PRO OPTIONAL

*" REFERENCE(I_S_RKB1D) TYPE RSR_S_RKB1D OPTIONAL

*" REFERENCE(I_S_RKB1F) TYPE RRO01_S_RKB1F OPTIONAL

*" REFERENCE(I_THX_VAR) TYPE RRO01_THX_VAR OPTIONAL

*" EXPORTING

*" VALUE(E_T_RANGE) TYPE RSR_T_RANGESID

*" EXCEPTIONS

*" UNKNOWN_VARIABLE

*" UNEXPECTED_VARTYPE

*" INVALID_PERIV

*" VARIABLE_INITIAL

*" NO_REPLACEMENT

*"----


data: e_t_range_wa type RRRANGESID,

zdept_key type n,

firstvar type n.

break-point.

refresh e_t_range.

clear e_t_range_wa.

case i_vnam.

when 'firstvar'.

if ZDEPT_KEY = 10.

firstvar = 9999.

ELSE.

firstvar = ZDEPT_KEY.

endif.

append e_t_range_wa to e_t_range.

endcase.

firstvar is a customer exit in my query and is contained in a row.

zdept_key is a field from the infocube and is contained in a row.

When I ran the query the debugger showed e_t_range_wa, zdept_key, and firstvar as red.

Also, the output for the field firstvar was "sap_cust_exit_test1" which is the description in the query designer and there was an error message "Initial RANGE line for customer exit variable firstvar is ignored"

The output

I am thinking that the local interface needs to be changed, i.e. to the import section of the fm and I am guessing I need to do some kind of looping to fill the variable firstvar.

Any help is appreciated.

Mike

former_member205400
Active Participant
0 Kudos

I finally got this to work, albeit it is hardcoded.

In my program function module called 'Z_VAR_PRE_POPUP_firstvar' I have the following code:

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(I_VNAM) TYPE RSZGLOBV-VNAM OPTIONAL

*" REFERENCE(I_T_VAR_RANGE) TYPE RRS0_T_VAR_RANGE OPTIONAL

*" REFERENCE(I_VARTYP) TYPE RSZGLOBV-VARTYP OPTIONAL

*" REFERENCE(I_IOBJNM) TYPE RSZGLOBV-IOBJNM OPTIONAL

*" REFERENCE(I_S_COB_PRO) TYPE RSD_S_COB_PRO OPTIONAL

*" REFERENCE(I_S_RKB1D) TYPE RSR_S_RKB1D OPTIONAL

*" REFERENCE(I_S_RKB1F) TYPE RRO01_S_RKB1F OPTIONAL

*" REFERENCE(I_THX_VAR) TYPE RRO01_THX_VAR OPTIONAL

*" EXPORTING

*" VALUE(E_T_RANGE) TYPE RSR_T_RANGESID

*" EXCEPTIONS

*" UNKNOWN_VARIABLE

*" UNEXPECTED_VARTYPE

*" INVALID_PERIV

*" VARIABLE_INITIAL

*" NO_REPLACEMENT

*" NO_PROCESSING

*"----


DATA: L_S_RANGE TYPE RSR_S_RANGESID,

mydept(4) TYPE c.

case i_vnam.

when 'firstvar'.

"this code manually populates the exit with multiple values 10,14,16

"in the Qry Desiger as follows:

"General - processing by: customer exit

"Details - Variable represents: Multiple single values

" - Variable is: optional

" - Variable is ready for input - UNCHECKED

mydept = '0010'.

l_s_range-low = mydept.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

mydept = '0014'.

l_s_range-low = mydept.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

mydept = '0016'.

l_s_range-low = mydept.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

endcase.

I'd like to continue to develop it by adding code that makes a call to that table to extract value ranges that are there.

Mike