-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path05-call-advanced.php
59 lines (45 loc) · 1.15 KB
/
05-call-advanced.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Call a RFC function
*/
if (! extension_loaded('sapnwrfc')) {
throw new \Exception('Extension "sapnwrfc" not loaded. Please see https://github.com/piersharding/php-sapnwrfc#installation');
}
// @see the available connection paraemters here
// http://help.sap.com/saphelp_nwpi711/helpdata/en/48/c7bb09da5e31ebe10000000a42189b/content.htm
$config = [
'MSHOST' => '...',
'CLIENT' => '...',
'R3NAME' => '...',
'GROUP' => '...',
'CODEPAGE' => '...',
'LANG' => 'en',
'LCHECK' => true,
'TRACE' => true,
'user' => '...',
'passwd' => '...'
];
$conn = new sapnwrfc($config);
$fds = $conn->function_lookup('STFC_DEEP_STRUCTURE');
$fdt = $conn->function_lookup('STFC_DEEP_TABLE');
$parms = [
'IMPORTSTRUCT' => [
'I' => 123,
'C' => 'AbCdEf',
'STR' => 'The quick brown fox ...'
]
];
$results = $fds->invoke($parms);
var_dump($results);
$parms = [
'IMPORT_TAB' => [
[
'I' => 123,
'C' => 'AbCdEf',
'STR' => 'The quick brown fox ...'
]
]
];
$results = $fdt->invoke($parms);
var_dump($results);
$conn->close();