on 04-06-2011 7:10 AM
Hi Experts,
I want to compare system date(month) to next month in sap script. For this i wrote following code in text element of main window:--
/E DATA
/: IF &SY-DATUM+4(2)& EQ '04'
AS APRIL
/: ELSE
AS Not a Valid Month
/: ENDIF
bt wen i execute my report it will display ELSE condition message.
Can anyone plz solve my prob?
Thanks
Sanchita
Moderator message: please use more descriptive subject lines for your posts.
Edited by: Thomas Zloch on Apr 6, 2011 10:26 AM
check the sy-datum value when it reaches the below code in debugging in the form,then you come to know what is the issue
/E DATA
/: IF &SY-DATUM+4(2)& EQ '04'
AS APRIL
/: ELSE
AS Not a Valid Month
/: ENDIF
may be the issue is SY-DATUM doesnt contain the date value in CCYYMMDD format it may be different format.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try debugging the same and see what data it is comparing.
In SE71, put the form name and in menu options 'Utlilities' select 'Activate debugger' and execute the form.
Else try like below.
IF &SY-DATUM&+4(2) EQ '04'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.