on 11-15-2007 9:36 PM
Hi Experts,
I created sap script... in my sap script one field is date... date is coming form database table like: 11/15/2007(mm/dd/yyyy) but i want to display date like
November 15, 2007
so give me suggetion.
zeni
I think we don't have any FM which can suit your requirement.
You can use the table T247 to get the Month name. and use the concatenate to build up the date.
Like:
SELECT SINGLE LTX
INTO L_LTX
FROM T247
WHERE SPARS = SY-LANGU
AND MNR = L_DATE+4(2).
CONCATENATE L_LTX L_DATE+6(2) INTO L_TXT_DATE SEPARATED BY ' '.
CONCATENATE L_TXT_DATE L_DATE+0(4) INTO L_TXT_DATE SEPARATED BY ', '.
Regards,
Naimesh Patel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh sorry,
SPRAS should be there in Where clause.
Check out this entire code:
REPORT ZTEST_NP.
DATA: L_DATE LIKE SY-DATUM,
L_LTX LIKE T247-LTX,
L_TXT_DATE(30).
L_DATE = SY-DATUM.
SELECT SINGLE LTX
INTO L_LTX
FROM T247
WHERE SPRAS = SY-LANGU
AND MNR = L_DATE+4(2).
CONCATENATE L_LTX L_DATE+6(2) INTO L_TXT_DATE SEPARATED BY ' '.
CONCATENATE L_TXT_DATE L_DATE+0(4) INTO L_TXT_DATE SEPARATED BY ', '.
WRITE: L_TXT_DATE.
Regards,
Naimesh Patel
I found some SAPScript system symbol which can directly set the date in your required format.
In your SAPScirpt write like this:
<b>/: SET DATE MAST = 'MMMM DD, YYYY'</b>
So, all your dates will print like:
REGUH - ZLDAT = '20071115'
.
®UH-ZLDAT&
will give out put as 'November 15, 2007'.
In this case no need to do all the logic, which we have already did.
Sorry for that, but I found this little late.
Regards,
Naimesh Patel
In the SAPScript, output the date like this:
&zdate(Z)&
(Where zdate is your date variable.)
Rob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Build a subroutine in Print Program and call that in your script.
use FM IDWT_READ_MONTH_TEXT to get the MONTH in Text
Search Function module like this 'CONVERSION_EXIT_DAT_OUTPUT', you may get some function module which can directly change to the required format.
Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.