on 03-19-2015 11:58 AM
Hi, everybody
Please have a look at the picture of Internal Reconciliation screen in SAP B1.
I want to fire up some code when the user presses the Yes button AND the Reconciliation difference is zero.In other words, when reconciliation is successful.
At present, I can fire the code when the user presses the Yes button. I need the other condition also.
Is there any way to ascertain (using SDK) whether the Reconciliation difference is zero?
Thanks
Leon
hi,
i will try to help u..
before pressing the reconcil button
u need to check it
how many check boxes u have checked in the matrix.
so, i just pick the amount to reconcil column value and then summarize the total
values in the matrix.. where u check the check boxes..
after that that amount u need to check it.
whether total value is 0.00 or greater than 0.00
have a look on below image..
i just written some code...
but i am not able to stop the from loading like
system message form...
just try it....
=================
'Delete
Try
If (pVal.FormTypeEx = 120060805 And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK And pVal.BeforeAction = False And pVal.ItemUID = "120000001" And pVal.ActionSuccess = True) Then
oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormTypeEx, pVal.FormTypeCount)
Dim omat_aa As SAPbouiCOM.Matrix
omat_aa = oForm.Items.Item("120000039").Specific
'Dim result As Double
'Dim value As String = "hy the number is (30.01)"
'value = vas
'Dim subValue() As String = value.Split("(")
'subValue(1) = subValue(1).TrimEnd(")")
'If Not Double.TryParse(subValue(1), result) Then
' 'Error handling code here
'End If
' Dim Quotae_last_amount1 As Double
Dim smaple1 As Double = 0.0
For u As Integer = 1 To omat_aa.VisualRowCount
Dim cb As SAPbouiCOM.CheckBox
cb = omat_aa.Columns.Item("120000002").Cells.Item(u).Specific
If cb.Checked = True Then
Dim vas As String = omat_aa.Columns.Item("120000027").Cells.Item(u).Specific.value
Dim result As Double
Dim value As String = "hy the number is (30.01)"
value = vas
Dim subValue() As String = value.Split("(")
subValue(1) = subValue(1).TrimEnd(")")
If Not Double.TryParse(subValue(1), result) Then
'Error handling code here
End If
' Quotae_last_amount1 = omatrix.Columns.Item("V_2").Cells.Item(u).Specific.value
smaple1 = smaple1 + result
End If
Next
If smaple1 = 990.08 Then
BubbleEvent = False
End If
SBO_Application.SetStatusBarMessage(smaple1, SAPbouiCOM.BoMessageTime.bmt_Short, True)
' SBO_Application.MessageBox("Final Amount is " & "-" & smaple1)
End If
Catch ex As Exception
' MsgBox(String.Format("Updating UDO header failed: {0}", ex.Message))
SBO_Application.MessageBox(ex.Message)
End Try
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
I have tried your code.
It works perfectly, and the total (say 990.08) is displayed as a status bar message at the bottom of the screen.
But it will only be useful to me if I can capture this total in, say a variable x, so that if x=0, my program knows that the reconciliation difference = 0.
Personally I can read the 990.08 displayed on the screen, but how can my program read this?
Do you know how this can be done?
Best Regards,
Leon
Hi Srinivas,
Let me explain what I want to do.
I have a large number of Internal Reconciliations to do everyday. So I want to computerise.
By Internal Reconciliation, I mean matching Invoices with their Credit Notes (these are posted manually)
So, I have a grid which lists all Unreconciled Invoices.
Each time the user reconciles one row, my program colors the selected row red.
In this way the user knows which items have been reconciled, and which not.
I have a button which, when clicked, opens the SAP B1 Internal Reconciliation screen (I used UI API to do this, as it cannot be done in DI API)
The User selects the items he wants to reconcile, then clicks the appropriate buttons.
If Reconciliation is successful, my program colors the row red as explained above.
If Reconciliation fails, the row is not colored.
So, my big problem is how to capture the Reconcile Successful Event in SAP ?
To capture this event, I break it into 2 parts (because I don't know how to do it at one go):
(a) Capture the event when the Yes button is clicked. (I know how to do this)
(b) Capture the event that TOTAL = 0 (This, I still don't know how)
Then my code will read essentially like this:
Color this row red IF Total = 0 AND Yes button has been clicked.
My problem is how to tell my program that Total = 0?
Best Regards,
Leon
hi,
So, my big problem is how to capture the Reconcile Successful Event in SAP ?
if u successfully complete the reconcil then
one status bar message will be appear
operations completed..
you can catch this one by using status bar event...
but reconcil form is opened or not u need to capture it...
bcz
operations completed.. will be appear in every successfully transaction...in sap b1
if recocil form is exists then
catch status bare message event.
Hi Srinivas
Yes, you have understood my problem perfectly.
If I could capture the Operations Completed Successfully event, my problem would be solved.
But this has proved to be very difficult, if not impossible.
That's why I chose to split the problem into 2 parts.
How can you capture the Status Bar Event?
Remember it is not an event in VB.NET, but an event in SAP B1.
And I cannot use System Information to discover its UID. This does not work.
So, do you still think this can be done? That would be wonderful!
Best Regards,
Leon
then u need find whether reconcil form is exists or not
u need to use below code..
Try
Dim x As Integer
Dim foundG As Boolean = False
For x = 0 To SBO_Application.Forms.Count - 1
If SBO_Application.Forms.Item(x).Type = "134" Then
foundG = True
Exit For
End If
Next
If foundG = True Then
oForm = SBO_Application.Forms.ActiveForm
add before given code....
above code will tells u whether the code is available or not....
Hi Srinivas,
It's only today that I am resuming work on my SDK project.
The solution you gave me worked perfectly!
I did not notice it at first, but I now see that smaple1 is what I have been looking for.
If I dim it as Public, I can use that variable elsewhere.
So, to know if Internal Reconciliation has been successful, the foll. 2 conditions must be satisfied:
(a) smaple1 must be = 0
AND
(b) Yes button must be clicked
I now know how to code these 2 conditions.
Thanks a lot and Best Regards,
Leon Lai
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.