PHP SAP RFC Function call input not working

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.

This entry was posted in Web and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s