Here are the basic steps needed to use your own ActiveX control in SAP. It is assumed that the control is registered as kksap1.Control1 in Windows.
STEP 1: Create a custom container named as “PARENT”.
STEP 2: Put this code into your programs PBO:
ctrl_name(80) type c.
if not cl_gui_object=>activex is initial.
ctrl_name = ‘kksap1.Control1’.
call method super->constructor
clsid = ctrl_name
shellstyle = shellstyle
parent = parent
lifetime = lifetime
name = m_name
cntl_system_error = 1
others = 2.
call method cl_gui_cfw=>subscribe
ref = me
shellid = me->h_control-shellid
others = 1.
STEP 3: Here is an example method call:
CALL METHOD OF H_CONTROL-OBJ ‘setLabel1’ NO FLUSH
EXPORTING #1 = TEXT.
Leave a Reply