SAP DotNet Connector INT4 Data Conversion issue C#

Posted on 2004-11-14
Last Modified: 2013-12-08
I have written an few RFC Servers that extract data from external data and bring them back into the SAP are to store.
Earlier examples were using DataReaders with the DotNet C# and GetInt32 from the data reader for one SAP Field defined as an INT4 Length 10 in SAP.
That example worked. The same field type I filled from the data reader is now in a new process that does not work.

Now I am working with a Stored Procedure that is using OBJECTNATIONS stored procedure wrapper for DotNet,
During development I can write the data from the Stored Procedure  wrapper with the ToString conversion. There are two fields that are both INT4 on the SAP side and both values are returning from the RFC Server with Garbage.

The Stored Procedure wrapper DataType is SqlInt32 which I convert to String, and the put that result into an INT32.Parse to assign the value into the SAP Structure which says it is an INT. I can write the string representation of the source value and after it is assigned, and in the console window the data values are good, but when I look at the values in the record layout from the SE37 test of calling the RFC Server,
the two fields in the layout defined as INT4 Length 10 - I am seeing    ###(#    as a number? which should be 10000

There are three tables passed to the RFC Server, and the test right now is passing back single rows of data - the rest of the data looks right.
I have checked the structure lengths, hoping for some kind of weird offset of earleir fields but have not seen one.

Anyone got an idea here?
Question by:mitchellm44
    LVL 23

    Expert Comment


    Refer these links... 657/sappress_interface_programming.pdf

    i hope it may gives some idea....

    LVL 2

    Author Comment

    I tried many differnt things, and finally, I wrote a little app to take the field and write it out for presentation... and the numbers were displayed correctly.
    I had been relying on the display of SE37 to show me the numbers.
    The INT4 fields, were looking like garbage on the SE37 display when drilling into the tables returned.
    The SE37 apparently does not handle this INT4 field in a way that makes sense.
    The fields are there, and can be accessed programatically and shown with valid values.

    So in the end, Test your functions with something other than SE37 if the fields are not displaying.
    If you can write the values out with either a report or a BSP test page, then you should be able to determine if the data is usable or not.

    LVL 10

    Accepted Solution

    Just a note about Se37.

    SAP uses something called a display format.
    When some fields are written to the screen ie date fields, currency fields - they are converted to a display format which is not necessarily the same as the internal representation of the data.
    This is very usefull when you are writing reports but can cause problems when you are developing as you can't actually see the exact data - use a program as a wrapper so that you can see the values in the debugger where you will see the real numbers and can even see the HEX ....


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Supply Chain Event Management Supply chain visibility is the ability of a company to track its products and business processes in supply chain towards building operational excellence. The goal of supply chain visibility is to improve and strength…’s Console is a great tool to view activities, leads, contacts, accounts and opportunities all in one screen. It is particularly effective during call blocks and working numerous activities at a time in a quick, repetitive fashion (suc…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now