cancel
Showing results for 
Search instead for 
Did you mean: 

Key Figure pattern Generation in report

Former Member
0 Kudos

Hi Experts,

  I am looking for generating following pattern for a report:

  Fiscal Qtr | Sales Region | Sales | Profit | %

  Q1/2012 | S101 | 50000 | 5000 | 10

  Q1/2012 | S102 | 70000 | 3500 | 5

  Q1/2012 | S103 | 60000 | 12000 | 20

  Q1/2013 | S101 | 50000 | 2500 | 5

  Q1/2013 | S102 | 50000 | 5000 | 10

  Q1/2013 | S103 | 60000 | 3000 | 5

So the idea is once a user enters a Qtr value in selection screen, it generates result for the selected Qtr and also for the next year Qtr.(Ex. Q1/2012 will also display output for Q1/2013)

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Zubin,

1. Create 1 structure in rows.

2. Create 2 selections in the structure.

3. In the 1st selection, put fiscal qtr restricted with ur manual entry variable.

4. In the 2nd selection, put fiscal qtr restricted with ur manual entry variable + 4 (as offset).

5. To get the fiscal qtr value in the query output, use text variable -> Replacement Path on fiscal qtr in 1st selection.

6. And same text variable in the 2nd selection.

7. U can use all ur characteristics in this structure only.

Hope this is clear and works out.

Thanks,

Shreya J

former_member199691
Active Contributor
0 Kudos

You can try this:

Create a dummy selection which will Fiscal Year/Period variable and this dummy KF can be always hidden. This dummy KF will give the selection for Fiscal Year/Period.

Now, you need to create a Customer Exit Variable on Fiscal Year/Period and restrict query on that.

In the code for this customer exit variable, read the selection variable and add 1 to the year and return 2 values as output, Quarter for Current Year and Next Year.

Regards,

Gaurav

Former Member
0 Kudos

Hi,

you have to create two Exit variable for current quarter & next quarter . i will suggest to take  input variable as date . Please go through sample code returns quarter period depending upon date if date does not fall in iiird quarter it will null. You can modify it  should quarter depending upon date .

WHEN 'ZC00000N75'.                      " RETURNS current Fiscal Yr Ist quarter April-Report Date  "

     IF i_step = 2 .

       CLEAR :lv_date1,

              lv_date2,

              lv_year1.

       LOOP AT i_t_var_range INTO loc_var_range

         WHERE vnam = 'ZC00000N51'.               *  here  ( sys-date - 1 )

         CLEAR l_s_range.

************************************added

         v_datef1 = loc_var_range-low .

         CALL FUNCTION 'UMC_CALDAY_TO_FISCPER'

           EXPORTING

             i_periv   = 'V3'

             i_calday  = v_datef1

           IMPORTING

             e_fiscper = v_per_day

           EXCEPTIONS

             invalid   = 1

             OTHERS    = 2.

         IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

         ENDIF.

*********************************

         lv_year1 = v_per_day(4) .

         CONCATENATE lv_year1 '04' '01' INTO lv_date1 .      "Qrtr Start Date

         CONCATENATE lv_year1 '06' '30' INTO lv_date2 .      "Qrtr End Date

         "If given date <  qrtr strat date, return nothing.

         "If given date >= qrtr END date, return FULL QUARTER.

         "If given date >=  qrtr strat date AND given date < qrtr END date, return from

         "period from qrtr start date to the given date.

         IF lv_date1 <= loc_var_range-low .

           l_s_range-low  = lv_date1.

           l_s_range-sign = 'I'.

           l_s_range-opt  'BT'.

           IF lv_date2 <= loc_var_range-low.

             l_s_range-high = lv_date2.

           ELSE.

             l_s_range-high = loc_var_range-low.

           ENDIF.

           APPEND l_s_range TO e_t_range.

         ELSE.

           exit.

         ENDIF.

       ENDLOOP .

     ENDIF.

Hope it will help you.

Regards,

Anand Mehrotra.