Closed li2575250 closed 3 years ago
There is no problem using the following code
c, _ := gorfc.ConnectionFromParams(abapSystem()) /**var t *testing.T**/ in_date1, _ := time.Parse("20060102", "20190101") in_date2, _ := time.Parse("20060102", "20190701") params := map[string]interface{}{ "I_FDATE": in_date1, "I_TDATE": in_date2, "I_RFC": "RFC", }
but add the tables parameter to feedback the error
c, _ := gorfc.ConnectionFromParams(abapSystem()) /**var t *testing.T**/ in_date1, _ := time.Parse("20060102", "20190101") in_date2, _ := time.Parse("20060102", "20190701") params := map[string]interface{}{ "I_FDATE": in_date1, "I_TDATE": in_date2, "I_RFC": "RFC", "T_BUKRS": map[string]interface{}{ "BUKRS": "1270", }, }
error info:
[root@localhost example]# go run hello_gorfc.go panic: reflect: call of reflect.Value.Index on map Value
goroutine 1 [running]: reflect.Value.Index(0x4c65a0, 0xc420068180, 0x15, 0x0, 0x15, 0xc42009a300, 0x0) /usr/local/go/src/reflect/value.go:894 +0x1a8 github.com/sap/gorfc/gorfc.fillTable(0xe221d0, 0xe1c740, 0x4c65a0, 0xc420068180, 0x0, 0xe16a10) /root/Code/go/src/github.com/sap/gorfc/gorfc/gorfc.go:245 +0x18e github.com/sap/gorfc/gorfc.fillVariable(0x5, 0xe16610, 0xc42008e420, 0x4c65a0, 0xc420068180, 0xe221d0, 0x0, 0x0) /root/Code/go/src/github.com/sap/gorfc/gorfc/gorfc.go:152 +0x769 github.com/sap/gorfc/gorfc.fillFunctionParameter(0xe15a90, 0xe16610, 0x4e065b, 0x7, 0x4c65a0, 0xc420068180, 0x0, 0x0) /root/Code/go/src/github.com/sap/gorfc/gorfc/gorfc.go:126 +0x297 github.com/sap/gorfc/gorfc.(*Connection).Call(0xc420068150, 0x4e3516, 0x19, 0x4c65a0, 0xc4200681b0, 0x0, 0x0, 0x0) /root/Code/go/src/github.com/sap/gorfc/gorfc/gorfc.go:1073 +0x3b6 main.main() /root/Code/go/src/github.com/sap/gorfc/example/hello_gorfc.go:40 +0x46c exit status 2
BUKRS type is char
Ask everybody elder brother to help have a look. tks...
Closing due to the sunset of the project.
There is no problem using the following code
but add the tables parameter to feedback the error
error info:
[root@localhost example]# go run hello_gorfc.go panic: reflect: call of reflect.Value.Index on map Value
BUKRS type is char
Ask everybody elder brother to help have a look. tks...