Skip to Content

Problems to send a internal table with SAPNWRFC PHP

I am sending an internal table to an ABAP function with SAPNWRC but I have problems with it. For example, if I send one array to my itab with 3 values, it works but if I send one array with 4 values or more it does not work. This is my code:

The following piece of code works:

$input_parameters = [
            'S_PSPID' => $strctr_project,
            'T_PPTOBASE' => [
                [
                'PSPNR' => '30964',
                'PSPHI' => '394',
                'WLGEV' => '0'
                ],
                [
                'PSPNR' => '30965',
                'PSPHI' => '394',
                'WLGEV' => '0'
                ],
                [
                'PSPNR' => '30966',
                'PSPHI' => '394',
                'WLGEV' => '0'
                ]
            ]
        ];

        $function  = $connection -> function_lookup('ZFUNCTION');
        $itab_proj = $function -> invoke($input_parameters);
        $itab_proj = $itab_proj['T_TABLE'];<br>

On the other hand this does not:

$input_parameters = [
            'S_PSPID' => $strctr_project,
            'T_PPTOBASE' => [
                [
                'PSPNR' => '30964',
                'PSPHI' => '394',
                'WLGEV' => '0'
                ],
                [
                'PSPNR' => '30965',
                'PSPHI' => '394',
                'WLGEV' => '0'
                ],
                [
                'PSPNR' => '30966',
                'PSPHI' => '394',
                'WLGEV' => '0'
                ],
                [
                'PSPNR' => '30966',
                'PSPHI' => '394',
                'WLGEV' => '0'
                ]
            ]
        ];

        $function  = $connection -> function_lookup('ZFUNCTION');
        $itab_proj = $function -> invoke($input_parameters);
        $itab_proj = $itab_proj['T_TABLE'];

Error: SapnwrfcConnectionException An invalid handle was passed to the API call

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 23 at 06:13 AM

    Thanks guys, I solved my problem installing SAP NW RFC SDK extension for PHP7.

    Add comment
    10|10000 characters needed characters exceeded