This is the first time I used PHP to call a SAP function. Ran into this problem that I couldn’t figure until someone with experience helped me.
The SAP function SAP_FUNCTION had one input that expects a length of 10.
I did not realize that that meant that the input has to be a length of 10. The examples the SAP analyst gave me had inputs with 9 and I kept trying it with 9 and was not getting anything back.
In PHP, a fellow developer told me I had to pad the input so the length is 10.
str_pad($vartopad, 10,”0″, STR_PAD_LEFT)
Spent most of the morning trying to figure out the problem and never found anything online about the need for padding. Maybe it’s a problem with the SAP function but either way maybe it’ll help someone with input errors using PHP to connect to SAP.