cancel
Showing results for 
Search instead for 
Did you mean: 

Concatination of Two dates in customer exit Variable

Former Member
0 Kudos

HI Expert ,

I am writting customer Exit Variable to get Records from user entered Dates .

Eg. In Variable Screen of Bex report i have 2 Variable LYDate & TY Date both of them are As "Mutiple Single Value" & "Mendetory".

If we give LYDATE and TYDATE Date range as,

LYDate - 01/2013 - 06/2013

TYDate - 01/2014 - 12/2014

So I need ABAP Code which will get Value Range from 01/2013 from LYDATE and 12/2014 From TY DATE . So Query will Get data for 01/2013 TO 12/2014 (2 Years Data).

ZCALYEAR (Cusomer Exit)  = LYDATE (01/2013)  TO TY DATE(12/2104).

Please provide step by step ABAP Code to Achiev above issue. Points for Sure...

Thanks,

GB

Accepted Solutions (1)

Accepted Solutions (1)

yasemin_kilinc
Active Contributor
0 Kudos

Hi,

Some code like this will solve your issue:

CASE I_VNAM.

   WHEN 'NEWVARIABLE'.

   IF I_STEP = 2.

      READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE WITH KEY VNAM = 'LYDate'.

      If sy-subrc =0.

          CONCATENATE LOC_VAR_RANGE-LOW(4) INTO L_S_RANGE-LOW.

          READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE WITH KEY VNAM = 'TYDate'.

          If sy-subrc =0.

               CONCATENATE LOC_VAR_RANGE-HIGH(4) INTO L_S_RANGE-HIGH.

               L_S_RANGE-SIGN = 'I'.

               L_S_RANGE-OPT = 'EQ'.

          APPEND L_S_RANGE TO E_T_RANGE.

        endif.

      endif.

    endif.

endcase.

Regards

Yasemin...

Just realized that you need the year. Message was edited by: Yasemin ULUTURK

Answers (2)

Answers (2)

former_member182470
Active Contributor
0 Kudos

This requirement doesn't require any user exit. You can simply achieve with replacement path. I have made an exclusive blog on this concept.

How to derive Calmonth & Calyear from Calday easily in BEx

yasemin_kilinc
Active Contributor
0 Kudos

You are definitely right Suman

Former Member
0 Kudos

Thanks Yasemin & Suman ..Issue Resolved...

Former Member
0 Kudos

Dear GB,

As per my understanding for the given CALMONTH (Input: 09.2014) you need to pick the data from beginning of the previous year (01.2013) to date (09.2014). If this is correct why do you need two dates? You can achieve using one input variable.

If my understanding is wrong kindly explain with your scenario for my understanding to help you.

Regards,

Ragunathan.R