Using a Call statement in JavaScript: I'm trying to call an RFC function from JavaScript. The function doesn't return any value. However, it works well with the same "Call" in a GuiXT script or in VBScript. What could be the reason?
You need to put the guixt.rfc() call into a VBScript function in your HTML page. In order to continue with JavaScript afterwards, convert the VBScript array into a JavaScript array using the "VBArray" object in JavaScript (Microsoft JavaScript extension).

This is necessary since array structures and parameter passing is different in VBScript as compared with JavaScript. VBScript uses COM conventions, as does the guixt.rfc() call, but JavaScript has a totally different array implementation.

See for example


<script type=text/vbscript>

dim vb_array
Function Execute_RFC(guixt)

  ' read data via RFC / SAP searchhelp
  Call guixt.Rfc("Z_S10_SEARCHHELP", "in.SEARCHHELP", "H_TVKO",
"in.COLUMNS", "VKORG(4),VTEXT(20)", "table.DATA(WIDTH:24)",

End Function


<script type=text/javascript>

function guixt_initialize(obj){

// Set guixt object
var guixt = obj;

// Get data via RFC

// Convert VBScript array to JavaScript array
var js_array = VBArray(vb_array).toArray();

// Display it in debugger