gorfc icon indicating copy to clipboard operation
gorfc copied to clipboard

How to add the tables parameter

Open eugenefoxx opened this issue 4 years ago • 1 comments

In changes v0.1.0 says - Table parameter accepts also array of variables. Because this method https://github.com/SAP/gorfc/issues/17 now work, I'm trying to put an array of variables params := map[string]interface{}{ "ATHDRLEVELS": []string{"000001000825"} } r, _ := c.Call("Z_IEXT_PRODORDCONF_CREATE_HDR", params)

This parameter is substituted only for the ORDERID field. Could you explain how to use an array of variables in the tables parameter. Thanks.

eugenefoxx avatar Feb 05 '22 06:02 eugenefoxx

This way can work in my test when you want to add table param:

table_data := map[string]interface{}{
  "BLDAT": time.Date(2024, 2, 14, 0, 0, 0, 0, time.Local),
  "EBELN": "4500000003",                                  
  "EBELP": "00010",                                      
}
params := map[string]interface{}{
  "IV_ZWMSLX": "A",                      
  "IV_BWART":  "101",                    
  "IV_CODE":   "01",                     
  "ITAB":      []interface{}{table_data}, // table param
}
r, e := conn.Call("ZMM_001", params)

chajiuqqq avatar Apr 17 '24 03:04 chajiuqqq