2006 Mar 05 7:45 AM
Hi, I have some strange problem.
I am using a function, which communicate with another system by Web Method.
The function imports parameter type c, length 255) from user through the screen. The field in the screen is type c length 17.
The value that I need to get from user is '-1'.
So, when I getting the '-1' from user through the screen, the system which gets this parameter from function didn't work.
When I send to the function '-1' hard coded it's work.
In debugger it looks the same '-1'.
How can I solve this problem?
Hi, I have some strange problem.
I am using a function, which communicate with another system by Web Method.
The function imports parameter type c, length 255) from user through the screen. The field in the screen is type c length 17.
The value that I need to get from user is '-1'.
So, when I getting the '-1' from user through the screen, the system which gets this parameter from function didn't work.
When I send to the function '-1' hard coded it's work.
In debugger it looks the same '-1'.
How can I solve this problem?
2006 Mar 05 8:41 AM
2006 Mar 05 3:21 PM
2006 Mar 05 3:47 PM
hi
u have to display a negative values in parameters then u have to create a data element for that field and set data type as int4.
2006 Mar 06 1:44 AM
if you call a function module and pass a hard-coded value to a parameter sap will convert it to the correct length.
But if you pass a parameter of the wrong type it will abend. You can move the 17 char field to an intermediate 255 variable and then pass the 255 variable to the fm.
2006 Mar 06 4:37 AM
Hi los,
1. To actually debug,
what can be done is that
create a z table
and put the value which is imported
ie. -1
into that table.
2. After calling this fm from web system,
pass hardcoded -1 and also try with
user input -1
and then check the z table
to know, what ACTUALLY the FM
is receving.
regards,
amit m.
2006 Mar 10 1:17 PM
Hi,
Pls don't forget to reward points and close the question if you find the answers useful.
Eddy
2006 Mar 11 10:24 AM
Hi!
Sorry, I was not at work, for a few days.
The problem was not solved, but the development was changed.
Thanks to everybody, I tried first six answers, and it didn't help.
2006 Mar 11 8:40 AM
Hi,
I agree with Neil's advice to move the screen input to an variable of type c with length 255 first, before calling the function.
WHEN CALLING A FUNCTION, ALWAYS MAKE SURE THAT THE ACTUAL PARAMETERS AND THE FORMAL PARAMETERS AGREE IN TYPE AND LENGTH. You will not necessarily get a runtime error, if they do not agree, but might get faulty data.
You write:
"When I send to the function '-1' hard coded it's work."
Do you mean you are assigning '-1' to a 255-byte character variable?
You write:
"In debugger it looks the same '-1'."
Do you mean that all 255 bytes look the same in hexadecimal notation?
You write:
"The field in the screen is type c length 17."
Are you sure the field in the screen is of type c and not a numerical field?
Kind regards,
Michael
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |