on 05-26-2014 3:39 PM
Hi all,
we have created a VBA-button in an AfO mask which should run 2 planning sequences and then do a save plan data in the end.
As usual in planning, we want to run the second sequence only in case the first sequences has run succesful without any errors and the save should only be done if none of the two sequences produce any error.
we use the VBA command
lReturn = Excel.Application.Run("SAPExecutePlanningSequence", sPlanningSequence)
If lReturn = 0 Then
Call mSapErrorHandler(oErrors)
End If
but the return code which we get back from the sequence is always = 1, no matter whether ther is an error or not.
Therefore the follwoing sequence and save are started, which is not correct.
does anyone have an ides on how to run the two seqneunces and get the correct information about the success or error of the first sequence?
thanks
Cornelia
Hi Corenlia,
Did you find any solution?. I am facing exactly same issue. The SAPexecuteplanningsequnce always returns 1 even when its failed.
Thanks
NC
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Good day!
If anyone is still facing the issue with the above issue can use the below code. It works.
Sub Button1_Click()
Dim lResult As Long
Dim lResult1 As Variant
lResult = Application.Run("SAPExecutePlanningFunction", "PF_1")
lResult1 = Application.Run("SAPListOfMessages", "ERROR")
If IsArray(lResult1) Then
If UBound(lResult1) > 0 Then
MsgBox ("Planning Function ended with error")
End If
End If
End Sub
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cornelia..
I have precisely the same issue. Trying to execute planning sequences in series with a following save.
Both notes referred to in the replies seem to be in error.
If you have the correct note number,be that would be a big help.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think this will work for my needs.
Seq 1 is still running when # 2 is trying to do its work.
1 needs to be completed for 2 to start.
Using VBA to wait ?? number of seconds or minutes is not suitable due to varying system performance times [ and data sizes].
You may recall that in the old Bex world the command area for IP sequences utilized step assignments so planning sequences could be ordered and executed in that order with their respective variables and related settings. How might that functionality be replicated in BO Analysis if at all ?
Thanks.
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.