cancel
Showing results for 
Search instead for 
Did you mean: 

Text Variable with Outcome showing actual and previous Jahr result

former_member199448
Participant
0 Kudos

Hi Experts,

i am working on report and would like to implemet the following.

I have create a report which is using a text variable.

I would like:

to select Last year Date for (12.2008) -


> Onbtain Result for 2008 but publishing in the Column header the actual date (01.2009).

How could i realize it?

Thank you for your Input.

Pat

Accepted Solutions (1)

Accepted Solutions (1)

wen-wei_chuang2
Participant
0 Kudos

Hi,

Do you mean that when users select "2008.12", the column header should display one month later, like "2009.01", even the key figures in that column should be "2008.12"?

The way I can think of is to create another user exit variable, naming it v_newcal.

Then set v_newcal by adding one month to the original variable.

In this case you can obtain v_newcal with value "2009.01".

And when using text variable in that column header, you can assign the data source of that text variable is v_newcal.

Hope it helps.

former_member199448
Participant
0 Kudos

Hi,

thank you for replying.

Could you please sprecify?

Do you have such a code for that? I dont know how to do it.

Thank you

Cheers

former_member181964
Active Contributor
0 Kudos

Hi,

You need to craete Text Variable With Custome Exit and then use the above code in CMOD in BW need to write I_STEP = 2. To get the result also you need to use the similar logic and restrict the keyfigur with that Time Variable.

Check in SAP help

http://help.sap.com/erp2005_ehp_03/helpdata/EN/5b/30d43b0527a17be10000000a114084/frameset.htm

Thanks

Reddy

former_member199448
Participant
0 Kudos

Hi ,

Thank you very much.

Cheers

Answers (1)

Answers (1)

former_member181964
Active Contributor
0 Kudos

Hi,

Use the following Code:

ZCDAY = Input Variable on 0CALDAY.

ZCCALDAY = Text Variable .

Here Whatever you give date then that data will come. Change the code for your requirement.

****Begin*****TO get the Date (TEXT VAR) based on ZCDAY Input variable***********

    WHEN 'ZCCALDAY' .
      LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZCDAY'.
        IF sy-subrc = 0.
          CLEAR: l_s_range.
          l_s_range-low+0(2) = loc_var_range-low+6(2).
          l_s_range-low+2(1) = '/'.
          l_s_range-low+3(2) = loc_var_range-low+4(2).
          l_s_range-low+5(1) ='/'.
          l_s_range-low+6(4) = loc_var_range-low+0(4).
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          APPEND l_s_range TO e_t_range.
        ENDIF.
      ENDLOOP.

****End*****TO get the Date (TEXT VAR) based on ZCDAY Input variable*************

Thanks

Reddy