cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic filling of 0fiscyear depending on 0fiscper

Former Member
0 Kudos

Hi Folks,

This is related to Variables. We have a variable screen which has 0fiscper & accepts value from user. How can we have a global variable to all queries that reads 0fiscper and fills 0fiscyear ?

Regards,

Manoj.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Manoj,

Steps to follow,

1) In bex, Create a new variable of 0fiscyear characteristic.

Set the following attributes:

Type of Variable: Characteristic Value

Variable name: ZVCPERI2

Variable Description: Fisccal Year using Customer exit

Processing by: Customer Exit (Drop down combo box)

Characteristic: Fiscal Year

Press Next

Variable Represents: Single Value

Variable Entry is: Mandatory

Don’t Check out Ready for Input

And Press Next

Press Finish.

2) Transaction CMOD

Create a new project, maintain the short text, and assign a development class.

(It’s better to ask somebody senior in our project about this, because every project have one main project and development class)

If you have project say Zproject. Choose option components. Click Change.

Double-click on EXIT_SAPLRRS0_001.Then double-click on ZXRSRU01.

Enter the coding .Save and activate the coding.

----


  • INCLUDE ZXRSRU01 *

----


DATA: L_S_RANGE TYPE RSR_S_RANGESID. 'In global area

DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT. 'In global area

CASE I_VNAM.

WHEN 'ZVCPERI2'.

IF i_step = 2.

LOOP AT i_t_var_range INTO loc_val_range

WHERE vnam = '0fiscper'.

EXIT.

ENDLOOP.

IF sy-subrc EQ 0.

l_s_range-low = loc_val_range-low(4).

ENDIF.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

ENDIF.

ENDCASE.

Activate the project. This is very important.

3) TO test now, use that variable ZVCPERI2 in query some where.

4) First test it in RSRT(Tran cOde).

Hope i m clear.

Regards,

San!

Former Member
0 Kudos

Hi Manoj,

have a look at the How-to guide "How to... Derive a Variable value from another variable".

You'll find that under https://service.sap.com/bi and there in the left-side navigation block under

Services & Implementation -> HOW TO... Guides -> Guide List SAP BW 2.x

This one describes a derivation of a variable from 0CALMONTH. We actually use the logic described there at our department and it works fine.

Regards,

Philipp

Former Member
0 Kudos

once you have variable on 0fiscper. it is global which is available for all queries uses 0fiscper.

using customer exit you can fill 0fiscyear using 0fiscper.