"-Begin-----------------------------------------------------------------
Program ZFBSL.
"-Constants---------------------------------------------------------
Constants CrLf(2) Type c Value %_CR_LF.
"-Variables---------------------------------------------------------
Data oFBSL Type OLE2_OBJECT.
Data Buffer Type String Value ''.
Data rc Type i.
Data RetVal Type i.
"-Macros------------------------------------------------------------
Define _.
Concatenate Buffer &1 CrLf Into Buffer.
End-Of-Definition.
Define Flush.
Call Function 'AC_SYSTEM_FLUSH' Exceptions Others = 1.
End-Of-Definition.
"-Main--------------------------------------------------------------
Create Object oFBSL 'FbslX'.
If sy-subrc <> 0 Or oFBSL-Handle = 0 Or oFBSL-Type <> 'OLE2'.
Call Function 'ZFBSL_WININC'.
Call Function 'ZFBSL_DLL'.
Call Function 'ZFBSLX'.
Create Object oFBSL 'FbslX'.
EndIf.
If sy-subrc = 0 And oFBSL-Handle > 0 And oFBSL-Type = 'OLE2'.
Call Method cl_gui_frontend_services=>get_sapgui_workdir
Changing SAPWORKDIR = WorkDir Exceptions Others = 1.
Concatenate '#Include "' WorkDir '\Windows.inc"' Into WinInc.
"-FBSL script begin-----------------------------------------------------
_ WinInc
_ '#Option Strict'.
_ '#AppType GUI'.
_ 'Dim %rc'.
_ 'rc = Msgbox(Null, "Message", "Title", MB_ABORTRETRYIGNORE)'.
_ 'Return rc'.
"-FBSL script end-------------------------------------------------------
"-Here we execute the script------------------------------------
Call Method Of oFBSL 'ExecuteScriptBuffer' = rc
Exporting #1 = Buffer.
Flush.
"-Here we get the return value of the script--------------------
Call Method Of oFBSL 'GetReturnValueInteger' = RetVal.
Flush.
Write: RetVal.
Free Object oFBSL.
EndIf.
"-End-------------------------------------------------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 |