2006 May 24 4:16 PM
Good day everyone,
I developed an RFC that receives data from XI. I assign this data to a BAPI, and one of the fields is a field with a data type of QUAN(length 13, decimals 3). All works fine if XI passes me a numeric value in this field.
Here's the problem: In running some test cases through XI and into the RFC, we ran a test case where the quantity field had a value of "test" (e.g. no numeric value). Incredibly, XI transforms the text value of "test" into the value of 4534 and sends it to my RFC. So my RFC thinks everything's fine when, in fact, that number was derived from a text field and is completely wrong.
What we need to do is change the field to something that will "kick out" in XI when it tries to call my RFC. I thought I could change it to a type of NUMC, but that doesn't let me use decimals. We've already sent out the file layout to vendors, so we expect them to include numeric values with decimal places if need be.
Is my best bet changing this to a character field with a length of 17, then checking to make sure it consists only of 0-9, a space, or a decimal? I then need to assign it to the BAPI's field with the data type of QUAN(13,3) -- am I going to have issues trying to do this from a character field? Do I need to worry whether or not they include a decimal (it might be implied -- in other words, they might just say quantity is "20" which becomes "20.000" to the BAPI). Is there a nifty routine I can use to do all this easily?
Thanks everyone. Points awarded as always for ALL helpful answers.
2006 May 24 4:20 PM
HI Dave,
See if the Function module NUMERIC_CHECK is hepful to you.
Regards,
Ravi
2006 May 24 4:20 PM
2006 May 24 4:33 PM
Peluka,
It looks like CURR has the same fundamental ABAP type as QUAN does, so I don't think that's going to help me.
2006 May 24 4:59 PM
Yes, both DEC, sory.
Can you do a content check of that value in XI side?
Regards.
2006 May 24 6:31 PM
Peluka, unfortunately I don't know XI, and the person who does is still learning and doesn't know how to have XI do the check.
2006 May 24 4:37 PM
How about checking using this condition
if v_amt co ' 0123456789,.'.
its a proper amount.
else.
*Its not..
endif.
Regards,
Ravi
2006 May 24 6:30 PM
Ravi, that's kinda what I was thinking, but if it's true (i.e. a proper amount) can I just move the contents directly to my QUAN field? Will SAP automatically do the conversion for me such that it ends up in the right place? I've yet to have to worry about such conversions -- this is the first time I've had to deal with it -- and I want to make sure that the right value gets assigned, whether that value is "20", "54.1", "1000.25", or "986.500".