cancel
Showing results for 
Search instead for 
Did you mean: 

Variable on calendarear/month

Former Member
0 Kudos
40

Hi All,

I have a issue:

I need to create a variable on 0calmonth which is ready for input and is a range. but should by default have the values lower range as January of current calendar year and higher range as December of current calendar year.

Can anyone plz help me with the process and code to do this?

Thanks

Prasad

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Manoj,

Steps to follow,

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

Set the following attributes:

Type of Variable: Characteristic Value

Variable name: ZCEMONT

Variable Description: Month

Processing by: Customer Exit (Drop down combo box)

Characteristic: Calendar Month/Year

Press Next

Variable Represents: Range Value

Variable Entry is: Mandatory

Do 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

DATA: zyear(4) like char.

DATA: zmonth(2) like char.

CASE I_VNAM.

WHEN 'ZCEMONT'.

IF i_step = 1.

zyear = sy-datum(4).

zmonth = '01'.

concatenate zyear zmonth to l_s_range-low

zmonth = '12'.

concatenate zyear zmonth to l_s_range-high

l_s_range-sign = 'I'.

l_s_range-opt = 'BT'.

APPEND l_s_range TO e_t_range.

ENDIF.

ENDCASE.

Activate the project. This is very important.

3) TO test now, use that variable ZCEMONT in query some where by going to BEx designer.save the query.Don;t run it.

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

Hope i m clear.

Regards,

San!