on 11-16-2016 2:20 PM
Hi Users,
I am writing a bit of VBA code for BPC 10 NW for a yes / no box.
So if the user selects yes the value saves else it does nothing or refresh's the sheet
This is my code.
Function BEFORE_SAVE()
MsgBox "ARE YOU SAVING TO THE CORRECT MONTH", vbYesNo
If answer = vbYes Then
EAA.SaveAndRefreshWorksheetData
End If
If answer = vbNo Then
EAA.RefreshActiveSheet
End If
End Function
When the user selects no it still gives the option to save the data.
Any advice will be appreciated.
KR
Ups, missed another error in your code! You are not assigning answer variable! Have to be:
answer = MsgBox("ARE YOU SAVING TO THE CORRECT MONTH", vbYesNo)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim,
Many thanks for your help.
No working
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please read http://go.sap.com/community/about/rules-of-engagement.html
"8. Be responsive."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Incorrect code!
The function is triggered by "Save"
The code have to be:
Function BEFORE_SAVE()
MsgBox "ARE YOU SAVING TO THE CORRECT MONTH", vbYesNo
If answer = vbYes Then
BEFORE_SAVE = True
ElseIf answer = vbNo Then
BEFORE_SAVE = False
End If
End Function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
15 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.