Quantcast
Channel: SCN : Discussion List - SAP Business Explorer (SAP BEx)
Viewing all articles
Browse latest Browse all 4032

Query to display data from current month to next 12 months

$
0
0

Dear all,

 

Good day,

 

I need a Query to display the data from current month to next 12 months. no user input is required.

This restriction is done on a Customized info object. hence no option of using CMONTH variable and using offset.

 

Created variable on Info object-->IO_NAME. which holds only month and year (like yyyymm).

 

created a variable VAR1:

with Processing type: Customer exit,

       variable represents as : Multiple single values,

       Variable is mandatory.

        Uncheck variable is ready for input.

 

 

I have wriiten a customer exit to fill it will next 12 months data.

when  execute i am not getting the proper output in query.

But i have debugged it and checked it, the E_T_RANGE consists of correct mmyyyy values for next 12 months.. Could you pls check the below and suggest me???

 

if i_step = 1.

IF i_vnam = 'VAR1'.
     data: LOC_VAR_RANGE LIKE RRRANGEEXIT,
           zyear type /BI0/OICAlyear.


     clear l_s_range.
     month = sy-datum+0(6).

     L_S_RANGE-low = month.
     L_S_RANGE-opt = 'EQ'.
     L_S_RANGE-sign = 'I'.
     APPEND L_S_RANGE to E_T_RANGE.

     Do 12 times.

       if month+4(2) ge 12.
         month+4(2) = '01'.
         month+0(4) = month+0(4) + 1.
         clear l_s_range.
         L_S_RANGE-low = month.
         L_S_RANGE-opt = 'EQ'.
         L_S_RANGE-sign = 'I'.
         APPEND L_S_RANGE to E_T_RANGE.
        else.
         month = month + 01.
         clear l_s_range.
         L_S_RANGE-low = month.
         L_S_RANGE-opt = 'EQ'.
         L_S_RANGE-sign = 'I'.
         APPEND L_S_RANGE to E_T_RANGE.
        ENDIF.
     ENDDO.
   endif.
endif.


Viewing all articles
Browse latest Browse all 4032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>