whats the functionality event preprocessing brings about.
Re: event propagation
Re: Combine "hide empty rows" with EPM pane member selection
Hi Marc,
Unfortunately no! I tested CreateReport, AddMemberToRowAxis,... etc and was unable to find the string parameter that will work as "context" - only real member names accepted.
But please, explain your business requirements (and better in a new discussion).
B.R. Vadim
Display Missing Appointment Times in a Daily Schedule
Here is a code example to use in Crystal Reports for displaying missing appointments times in printing a daily schedule where the appointments are coming from a database table, which only has rows for actual appointment times and nothing for the empty appointment times.
After reviewing an example of how to display missing dates, which was posted by James Wiseman on an SAP forum in December 2011, I adapted it to print missing times for a single day's appointment schedule. This involves creating Crystal Reports Custom Functions.
To create Custom Functions in Crystal Reports
Select Reports from Menu
Select Formula WorkShop
Right mouse click on Report Custom Functions
Create New
You will create 3 custom Functions (see attachment for actual code in the Functions )
1) ApptsBeginDay - this will print appointment times from the beginning of the day up to the first actual appointment for the day
2) ApptsBetween - this will print missing appointment times between actual appointments
3) ApptsDaysEnd - this will print missing appointment times after the last actual appointment up to the end of day
To use these Functions you will need to create 4 detail sections (a-d) in your report to reference these Functions
a) Add a Formula to invoke Function ApptsBeginDay - (Code Formula below)
Code: if OnFirstRecord then ApptsBeginDay ({AnAppointmentDateTime}, {?DayStartTime}, 'hh:mm tt', {?ApptLength})
b) The objects to print for an actual appointment
c) Add a Formula to invoke Function ApptsBetween - (Code Formula below)
Code: ApptsBetween ({AnAppointmentDateTime}, next({AppointmentDateTime}), 'hh:mm tt',{?ApptLength})
d) Add a Formula to invoke Function ApptsDaysEnd - (Code Formula below)
Code: if OnLastRecord then ApptsDayEnd ({AnAppointmentDateTime}, {?DayEndTime}, 'hh:mm tt',{?ApptLength})
After placing the Formulas referencing these Functions in their respective detail sections, be sure to format the Formula objects and on
the common tab, check mark 'Can Grow'
The Formulas invoking these Functions each take several arguments which are more clearly identified by reviewing the Functions code
in the attached example.
Please make any modifications you wish to adapt the Functions to your requirements.
copying the same serial number from halb to fert
Hi Experts ,
My requirement is that I need to assign the serial number generated for semi-finished material to my finished product.
Is there any standard functionality or User Exit needs to be used (IQSM.....)..??...How it can be done
Regards,
Re: How to make SAP Script/Macro run in background like xl macros
Hello.
In my knowledge there is no Option from SAP GUI Scripting.
When you run this from VBA you can use USER32-API function
Public Declare Function LockWindowUpdate Lib "user32" _ (ByVal hwndLock As Long) As Long
Call function via public Sub:
Public Sub DisableScreenUpdating(xhWnd&) If xhWnd <> 0 Then LockWindowUpdate xhWnd End Sub Public Sub EnableScreenUpdating() LockWindowUpdate 0& End Sub
And call this whenever you have a new handle during your script:
Session.FindById("wnd[0]/usr/btn%_STAE1_%_APP_%-VALU_PUSH").Press DisableScreenUpdating Session.FindById("wnd[1]").Handle Session.FindById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,0]").Text = "DLFL" Session.FindById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,1]").Text = "INAC" Session.FindById("wnd[1]/tbar[0]/btn[8]").Press DisableScreenUpdating Session.FindById("wnd[0]").Handle Session.FindById("wnd[0]/usr/btn%_STRNO_%_APP_%-VALU_PUSH").Press DisableScreenUpdating Session.FindById("wnd[1]").Handle Session.FindById("wnd[1]/tbar[0]/btn[24]").Press Session.FindById("wnd[1]/tbar[0]/btn[8]").Press
When your script is completed call
EnableScreenUpdating
Of course People can get nervous at it seems like nothing happen. May they kill this session as they think it´s crashed.
Hope this help.
Br, Holger
Re: Help!!! SAP report extraction through pdf(Print Option) using Macro
Hi Holger,
I have used this code which is similar to yours, however it runs perfect with file names when I do F8, but when I just give F5 and run the code, it just clicks on save automatically with the default file name.
Is there anything wrong in the code.
Public Sub pdfsave()
On Error GoTo Whoa
Dim timeout As Date
SP = Worksheets("Input").Range("N1").Value
Ret = FindWindow(vbNullString, "Save PDF File As")
timeout = Now + TimeValue("00:00:50")
Do
Ret = FindWindow(vbNullString, "Save PDF File As")
' hwnd = FindWindow("#32770", "File Download")
DoEvents
Sleep 200
Loop Until Ret Or Now > timeout
SendKeys ("%{tab}")
If Ret <> 0 Then
'MsgBox "Main Window Found"
'~~> Get the handle of the Button's "Window"
ChildRet = FindWindowEx(Ret, ByVal 0&, "Button", vbNullString)
If ChildRet = 0 Then
MsgBox "Child Window Not Found"
Exit Sub
End If
'~~> Get the caption of the child window
strBuff = String(GetWindowTextLength(ChildRet) + 1, Chr$(0))
GetWindowText ChildRet, strBuff, Len(strBuff)
ButCap = strBuff
'~~> Loop through all child windows
Do While ChildRet <> 0
'~~> Check if the caption has the word "Save"
If InStr(1, ButCap, "Save") Then
'~~> If this is the button we are looking for then exit
OpenRet = ChildRet
Exit Do
End If
'~~> Get the handle of the next child window
ChildRet = FindWindowEx(Ret, ChildRet, "Button", vbNullString)
'~~> Get the caption of the child window
strBuff = String(GetWindowTextLength(ChildRet) + 1, Chr$(0))
GetWindowText ChildRet, strBuff, Len(strBuff)
ButCap = strBuff
Loop
'~~> Check if we found it or not
If OpenRet = 0 Then
MsgBox "The Handle of Save Button was not found"
Exit Sub
End If
'~~> Retrieve the dimensions of the bounding rectangle of the
'~~> specified window. The dimensions are given in screen
'~~> coordinates that are relative to the upper-left corner of the screen.
GetWindowRect OpenRet, pos
'~~> Move the cursor to the specified screen coordinates.
SetCursorPos (pos.Left - 10), (pos.Top - 10)
'~~> Suspends the execution of the current thread for a specified interval.
'~~> This give ample amount time for the API to position the cursor
Sleep 200
SetCursorPos pos.Left, pos.Top
Sleep 200
SetCursorPos (pos.Left + pos.Right) / 2, (pos.Top + pos.Bottom) / 2
'~~> Set the size, position, and Z order of "File Download" Window
SetWindowPos Ret, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
Sleep 200
'~~> Simulate mouse motion and click the button
'~~> Simulate LEFT CLICK
mouse_event MOUSEEVENTF_LEFTDOWN, (pos.Left + pos.Right) / 2, (pos.Top + pos.Bottom) / 2, 0, 0
Sleep 700
'~~> Simulate Release of LEFT CLICK
mouse_event MOUSEEVENTF_LEFTUP, (pos.Left + pos.Right) / 2, (pos.Top + pos.Bottom) / 2, 0, 0
Wait 5
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' START OF SAVEAS ROUTINE '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Ret = FindWindow(vbNullString, "Save PDF File As")
' timeout = Now + TimeValue("00:00:50")
' Do
' Ret = FindWindow(vbNullString, "Save PDF File As")
'' hwnd = FindWindow("#32770", "File Download")
' DoEvents
' Sleep 200
' Loop Until Ret Or Now > timeout
'
If Ret = 0 Then
MsgBox "Save As Window Not Found"
Exit Sub
End If
'~~> UNCOMMENT this if using IE6 and COMMENT the code for "DUIViewWndClassName"
'~~> "DirectUIHWND" and "FloatNotifySink"
' '~~> Get the handle of the Main ComboBox
' ChildRet = FindWindowEx(Ret, ByVal 0&, "ComboBoxEx32", "")
'
' If ChildRet = 0 Then
' MsgBox "ComboBoxEx32 Window Not Found"
' Exit Sub
' End If
ChildRet = FindWindowEx(Ret, ByVal 0&, "DUIViewWndClassName", "")
If ChildRet = 0 Then
MsgBox "DUIViewWndClassName Not Found"
Exit Sub
End If
ChildRet = FindWindowEx(ChildRet, ByVal 0&, "DirectUIHWND", "")
If ChildRet = 0 Then
MsgBox "DirectUIHWND Not Found"
Exit Sub
End If
ChildRet = FindWindowEx(ChildRet, ByVal 0&, "FloatNotifySink", "")
If ChildRet = 0 Then
MsgBox "FloatNotifySink Not Found"
Exit Sub
End If
'~~> Get the handle of the Main ComboBox
ChildRet = FindWindowEx(ChildRet, ByVal 0&, "ComboBox", "")
If ChildRet = 0 Then
MsgBox "ComboBox Window Not Found"
Exit Sub
End If
'~~> Get the handle of the Edit
ChildRet = FindWindowEx(ChildRet, ByVal 0&, "Edit", "")
If ChildRet = 0 Then
MsgBox "Edit Window Not Found"
Exit Sub
End If
'~~> COMMENT the below 3 lines if you do not want to specify a filename
Wait 5
SendMess SP, ChildRet
Wait 5
'~~> Get the handle of the Save Button in the Save As Dialog Box
ChildRet = FindWindowEx(Ret, ByVal 0&, "Button", vbNullString)
'~~> Check if we found it or not
If ChildRet = 0 Then
MsgBox "Save Button in Save As Window Not Found"
Exit Sub
End If
'~~> Get the caption of the child window
strBuff = String(GetWindowTextLength(ChildRet) + 1, Chr$(0))
GetWindowText ChildRet, strBuff, Len(strBuff)
ButCap = strBuff
'~~> Loop through all child windows
Do While ChildRet <> 0
'~~> Check if the caption has the word "Save"
If InStr(1, ButCap, "Save") Then
'~~> If this is the button we are looking for then exit
OpenRet = ChildRet
Exit Do
End If
'~~> Get the handle of the next child window
ChildRet = FindWindowEx(Ret, ChildRet, "Button", vbNullString)
'~~> Get the caption of the child window
strBuff = String(GetWindowTextLength(ChildRet) + 1, Chr$(0))
GetWindowText ChildRet, strBuff, Len(strBuff)
ButCap = strBuff
Loop
'~~> Check if we found it or not
If OpenRet = 0 Then
MsgBox "The Handle of Save Button in Save As Window was not found"
Exit Sub
End If
'~~> Save the file
SendMessage OpenRet, BM_CLICK, 0, ByVal 0&
Wait 5
Else
MsgBox "File Download Window Not found"
End If
Exit Sub
Whoa:
MsgBox Err.Description
End Sub
Re: No control data maintained for checking group 04 and checking rule 03?
Looks like in your material master is availability checking group 04 maintained.
But this is not present in OVZ9
Re: Retrieving Variables and Values using EPM Functions
Hi Ariel,
To my mind the mentioned functions are not applicable for BPC.
B.R. Vadim
Re: Help!!! SAP report extraction through pdf(Print Option) using Macro
Is this running in same instance which control SAP session?
Re: Error while logon
Do you have a AL_Version table in repo?
Re: Integration SAP TM 9.0 and SAP CC/CI
Thanks - Frank.
Re: Change datasource for xml and xsd in runtime
Hi Andrew,
Do you have Saved Data checked on in the Report?
What happens if you refresh the data?
If you manually set the data source in CR Designer does that work, no mapping UI pop up and/or message like Data up to date if you verify the database also?
Try this also:
bool IsRpt = true;
CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc;
rpt.Load(rptName.ToString(), OpenReportMethod.OpenReportByTempCopy);
rptClientDoc = rpt.ReportClientDocument;
System.Data.DataSet ds = new System.Data.DataSet();
ds.Tables.Add(dt1);
ds.Tables.Add(dt2);
ds.WriteXml(@"D:\Atest\list_of_workflows.xml");
ds.WriteXmlSchema(@"D:\Atest\list_of_workflows.xsd");
ds.ReadXml(@"D:\Atest\Dev Element\data_ReplicateCRIssue.xml", XmlReadMode.ReadSchema);
ISCRDataSet DS1 = (ISCRDataSet) CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.Convert(ds);
// uses this for OLE DB DS record set
rptClientDoc.DatabaseController.SetDataSource(DS1, "FunctionSales", "FunctionTotalPrice");
IsRpt = true;
Requires using RAS and ReportClientDocument
Then view the RCD also:
try
{
if (!IsRpt)
{
crystalReportViewer1.ReportSource = rptClientDoc.ReportSource;
}
else
{
crystalReportViewer1.ReportSource = rpt;
}
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
}
Don
Re: Cleaning up space on Windows server
You can uninstall older SP and patches, since latest 4.1, includes all the older SP and patches. Refer forwardfit plan what is included.
Item Details : Configuration
All,
I went through the forum and found couple of posts explaining how to populate BAPI :BAPI_CONTRACT_CREATEFROMDATA structures to create characteristics. I tried all the options and still when I am creating Contract, the characteristics are not getting populated. Any help would be highly appreciated.
I am populating the following 3 structures.
- CONTRACT_CFGS_REF
POSEX 000010
CONFIG_ID 000001
ROOT_ID 00000001
- CONTRACT_CFGS_INST
- CONFIG_ID 000001
- INST_ID 00000001
- OBJ_TYPE MARA
- CLASS_TYPE 300
- OBJ_KEY 30064
- CONTRACT_CFGS_VALUE
- CONFIG_ID 000001
- INST_ID 00000001
- CHARC AUTORENEW
- VALUE Y
Any idea, what is being missed?
Regards
Salil
Re: BPC Statistics cubes
Hi Mallesh,
Can you explain what you want to achieve?
B.R. Vadim
Condition action fails to error out
Hi Experts,
We are using SAP MII 12.2.6 Build(44) on NW 7.3.
We are having a vague behavior of "Conditional" action in one of the transactions. Though the previous action fails with execution, the subsequent condition check throws an exception and halts without performing the next action in the transaction.
- [ERROR] Uncaught exception from DBDatetime (SQL Query template), Cannot create a connection to the database.
The same conditional action works on other transaction without any error and performs the subsequent actions very well. Can you please pinpoint, if am doing any thing wrong?
Thanks
Re: IDOC_AAE sender channel shows Commit fault: ASJ:ejb 005043 [Failed in component error]
Hi Jane,
Please check the below threads
regards,
Harish
Error currency invalid when execute Calculates Charges
Re: Auto update Freight Bookings
Thanks Marcelo, For some reason the strategy didn't work, within FB the schedule update change works, I"ll check again.
Re: windows 8 sybase IQ odbc driver
Hi Sanjay,
Please check on the IQ SCN:
http://scn.sap.com/community/developer-center/analytic-server
You should have better luck over there.
Cheers,
-Paul