cancel
Showing results for 
Search instead for 
Did you mean: 

Date before 30 days

Former Member
0 Kudos

Hi,

I have CURRENT DAY variable and i want to create one more variable which gives the Date before 30 days.

Is there any STD variable which gives the date before 30 days .Please tell me.

I have created one variable with Customer exit processing type and i need to develop code for this. Can anybody provide code how we will get date(dd/mm/yyyy) before 30 days .I have created variable with name "Z_CVAR". Please help me on this.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

This can be done using Query Offset option to get your required data.

If your variable is Z_CVAR then include this varaible in restrictions and Use Offset -30.

or Using code if you are declaring SY-DATUM then SY-DATUM - 30 will get your data.

Regards,

Vishnu.

Answers (2)

Answers (2)

Former Member
0 Kudos

answered and solved

former_member182516
Active Contributor
0 Kudos

use 0date variable to get the system date ... which is the SAP standard variable which pics the sy-datum.

Next restrict the KF with the 0date and right click on the 0date and click on offset and set the off set for the varaible as -30.

which gives the value -30 days.

If not as suggested in the earlier post -- create a z variable with replacement path -customer exit -- write the code ... in the code itself write the logic to get the -30 days

IF i_step = 2.

CASE i_vnam.

WHEN 'ZCURDAY-30'.

CLEAR: l_s_range.

l_s_range-low = sy-datum -30.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

ENDCASE.

ENDIF.

regards

KP

Former Member
0 Kudos

Hi guys,

I am creating Exception based on the "Sy-DATUM" and " SY-DATUM-30" On the characterstic " END DATE" In our report.

for this I made END DATE as keyfigure through formula variable and i got END DATE Key figure in exception creation.

I created two variables for SY-DATUM and SY-DATUM-30 . even my end date falls between the two dates the end date is not turning to RED.

can't we use exception on dates?.Please help me is there any solution.