03-23-2017 2:56 AM
Hi Experts,
I Need to retrieve the radio button value (Which radio button is selected) from excel and code in ABAP program.
I am trying this using OLE automation.
Below is my Macro coding
'PO Status
If (Sheet6.OptionButton1.Value = True) Then
POStatus = "Ack"
ElseIf (Sheet6.OptionButton2.Value = True) Then
POStatus = "Rejected"
End If
How to convert the above to OLE. I used the coding as below, but I am not getting any value.
CREATE OBJECT e_button 'EXCEL.OPTIONBUTTON'.
CALL METHOD OF e_button 'OPTIONBUTTONS' = e_option1.
CALL METHOD OF e_option1 'NAME'
EXPORTING
#1 = 'OPTIONBUTTON1'.
GET PROPERTY OF e_option1 'Value' = p_val.
Kindly help on this.
By the way, Is there any other way to get the radio button value from Excel ??
Thanks.
03-16-2018 12:27 PM
hey sri,
suppose there are 5 radio button in 5 rows , so for those 5 radio button only 1 radio button will be selected automatically ,
now acc to the logic
FORM SUB_SELECT_CELL USING P_ROWID TYPE ANY
P_COLID TYPE ANY.
CALL METHOD OF WA_EXCEL 'CELLS' = WA_SCELL
EXPORTING
#1 = P_ROWID
#2 = P_COLID.
* Handle error
PERFORM ERR_HDL.
ENDFORM.
****************************************************************************************************
PERFORM SUB_SELECT_CELL USING OP_SIDE E.
SET PROPERTY OF WA_SCELL 'Value' = 1.
****************************************************************************************************
in op_side select your row no. acc to the logic then set value to 1 for that particular row and coloumn.