on 04-28-2020 8:59 PM
Hi ,
In My requirement, I need to read Cell value in work book and need to pass to Input variable of Planning sequence.
By using SAPGetCellInfo, its reading cell value in lResult1 (Type variant ), but not able to pass in SAPSetPlanParameter" Planning sequence variable.
Instead of lResult1 i passed costcentre value directly eg "CC01010101" planning sequence working , but if i use IResult1 its not accepting.
Coding
Dim lResult1 As Variant
Dim lRange As Object
Call Application.Run("SAPSetRefreshBehaviour", "Off")
Call Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "On")
lResult1 = Application.Run("SAPGetCellInfo", ActiveCell, "SELECTION", lNameChar)
lResult = Application.Run("SAPSetPlanParameter", "PS_2", "ZV_ISGM_COSTCENTER_002", lResult1, "INPUT_STRING") ---- IResult variable not passing value
MsgBox IIf(Val(lResult) = 1, "Filter is applied", "No Filter") --- its throwing "No Filter" message only
Call Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "Off")
Call Application.Run("SAPSetRefreshBehaviour", "On")
lResult = Application.Run("SAPExecutePlanningSequence", "PS_2")
lResult1 = Application.Run("SAPGetCellInfo", ActiveCell, "SELECTION", lNameChar)
What do you mean by undefined variable INameChar?
Please read this blog about correct syntax:
lResult1 = Application.Run("SAPGetCellInfo", ActiveCell, "SELECTION", "DimName")
Look on lResult1 in VBA debugger!
And remove useless lines, not related to your code:
Call Application.Run("SAPSetRefreshBehaviour", "Off")
Call Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "On")
...
Call Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "Off")
Call Application.Run("SAPSetRefreshBehaviour", "On")
Not related to SAPExecutePlanningSequence
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.