cancel
Showing results for 
Search instead for 
Did you mean: 

Checking If a Radio Button is Set in Item Master form

Former Member
0 Kudos

I am trying to check if the User has set an item to Inactive in the UI and I've got the following code:

10002050 is the ID for the Active radio button. I don't have a lot of experience with the UI API, but anyways, this code gave mean error converting to IOptionButton, which I'm assuming is an interface being implemented by that control. However when I search the SDK Help for IOptionBtn I don't find anything, and I can't seem to find anything in google either. I'm sure checking a radio button in SAP is simpler than this. Where in the documentation should I be looking for how to check the value of a radio button (or option button?)

                    If CStr(oForm.Items.Item("10002050").Specific) = "" Then
                        ClearChannelMaxAnalysisFieldsForItem(boItem)
                        DeleteSKUFromChannelMax(currentSku)
                        UpdateRequiresOutputFile = True
                   

End If

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Cynthia,

Many questions in a single thread...

Yes IOptionButton is an interface, but none are documented: only the classes. In fact, all objects are described by interface, so if you look in the SDK's help file for the class, you 'll find de facto the definition of the interface.

.Specific returns an object, not a string; and the return object in your case is an OptionButton; and you have to do an explicite cast to use it.

On the OptionButton, you have a property which is named Selected and wil give you the value you want.

Regards,

Eric

edy_simon
Active Contributor
0 Kudos

Hi Cynthia,

To translate Eric's answer :


Dim oOpt as SAPbouiCOM.OptionBtn

oOpt = oForm.Items.Item("10002050").Specific     'You do not need an explicit cast here ... it is VB..

if oOpt.Selected then

     ClearChannelMaxAnalysisFieldsForItem(boItem)

     DeleteSKUFromChannelMax(currentSku)

     UpdateRequiresOutputFile = True

End If

Cheers

Edy

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks guys!