Skip to Content
0
Apr 28, 2020 at 07:59 PM

Facing error while passing Variable value in VB script

170 Views Last edit May 25, 2020 at 08:16 PM 2 rev

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")