‎2008 Dec 22 11:38 AM
Hi,
I have DATE format, like, YYYY/MM/DD, so, I need to convert it to DD/MM/YYYY in SAPSCRIPT.
How will u do that...
‎2008 Dec 22 11:49 AM
Hello Dorothy,
The Date can be formatted using SET DATE MASK command.
In the SAPScript editor use the following command:
/: SET DATE MASK = 'DD/MM/YYYY' Hope this is clear to you.
BR,
Suhas
‎2008 Dec 22 11:44 AM
hi
use this function in your print program 'TZ_SYSTEM_TO_LOCAL' to get the date in your local format.
alternately what you can do is that use SET DATE MASK control command like
SET DATE MASK = Walldorf, den DD.MM.YYYY
&SYST-DATUM& --> Walldorf 01.01.2008
hope this helps
regards
Aakash Banga
‎2008 Dec 22 12:01 PM
‎2008 Dec 22 12:02 PM
‎2008 Dec 22 12:10 PM
hi,,
SEARCH IN SCN with SET DATE MASK.
make habbit for search in SCN before posting
thanks
Sachin
‎2008 Dec 22 11:49 AM
Hello Dorothy,
The Date can be formatted using SET DATE MASK command.
In the SAPScript editor use the following command:
/: SET DATE MASK = 'DD/MM/YYYY' Hope this is clear to you.
BR,
Suhas
‎2015 Jun 30 6:28 PM
Hi Suhas, know it is an old post. I am trying a simple thing. In my SAPscript i want to add (date) however when it returns to SAP it uses a wrong date format.
30-06-2015
I need it to send to SAP
30.06.2015
I copied the /: SET DATE MASK = 'DD.MM.YYYY' into my script, however it gives a Error: expected statement
Hope you can help and sorry if it is a stupid question 🙂
I have added my full script here
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
/: SET DATE MASK = 'DD.MM.YYYY'
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "/nTransaction"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/txtSELECTION-SDAT").text = (DATE)
session.findById("wnd[0]/usr/txtSELECTION-STIME").text = "00:00:00"
session.findById("wnd[0]/usr/txtSELECTION-SREADTI").text = "06:00:00"
session.findById("wnd[0]/usr/txtSELECTION-SREADTI").setFocus
session.findById("wnd[0]/usr/txtSELECTION-SREADTI").caretPosition = 8
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/tbar[1]/btn[20]").press
session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").select
session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").setFocus
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "STAD_master.txt"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 15
session.findById("wnd[1]/tbar[0]/btn[7]").press
session.findById("wnd[0]/tbar[0]/btn[15]").press
‎2008 Dec 22 11:53 AM
Hi Raj,
SET DATE MASK command is for that perpose.
Regards,
Pravin
‎2008 Dec 22 11:54 AM
Hi,
/: SET DATE MASK = 'DD/MM/YYYY'
P1 &DATE&
Regards
Bala Krishna
‎2008 Dec 22 12:00 PM
Hi ,
Change the date format according to your country specific and put SET COUNTRY 'country name' statement in script editor.
‎2008 Dec 22 12:12 PM
‎2014 Mar 18 11:46 AM
This is controlled with a configuration setting the the country. Look in the IMG under SAP NetWeaver->General Settings->Set Countries.