RFC in C++ to SAP doesn t transfer data

Hello,
I make in C++ a RFC call of a function module.
The RFC works but not the data transfer.
The import parameters of the function module in SAP are:
I_MANDT     TYPE     NUMC3
I_WERKS     TYPE     CHAR4
I_PROCESS     TYPE     CHAR10
I_STRING     TYPE     STRING
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The export definition in the C++ programm is:
exporting[0].name = malloc(7);
memcpy(exporting[0].name,"I_MANDT", 7);
exporting[0].nlen = 7;
exporting[0].type = RFCTYPE_NUM;
exporting[0].leng = 3;
exporting[0].addr = malloc(4);
memset(exporting[0].addr,0,4);
sprintf((char *) exporting[0].addr, "%04d", cst_mandt);
exporting[1].name = malloc(7);
memcpy(exporting[1].name,"I_WERKS", 7);
exporting[1].nlen = 7;
exporting[1].type = RFCTYPE_CHAR;
exporting[1].leng = 4;
exporting[1].addr = malloc(5);
memset(exporting[1].addr,0,5);
sprintf((char *) exporting[1].addr, "%05d", cst_werks);
exporting[2].name = malloc(9);
memcpy(exporting[2].name,"I_PROCESS", 9);
exporting[2].nlen = 9;
exporting[2].type = RFCTYPE_CHAR;
exporting[2].leng = 10;
exporting[2].addr = malloc(11);
memset(exporting[2].addr,0,11);
sprintf((char *) exporting[2].addr, "%11c", cst_process);
exporting[3].name = malloc(8);
memcpy(exporting[3].name,"I_STRING", 8);
exporting[3].nlen = 8;
exporting[3].type = RFCTYPE_CHAR;
exporting[3].leng = 5000;
exporting[3].addr = malloc(5001);
memset(exporting[3].addr,0,5001);
sprintf((char *) exporting[3].addr, "%5001c", chr_line);
rfc_rc = RfcCall( handle, cha_prog,
                          exporting,
                 tables);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Does anybody know, where the mistake is, that i don t get the data from the C++ to SAP transferred?
In the debugger in C++ I can see, that the fields are filled.
I would appreciate a quick answer, because the project has to be active in 2 weeks.
Thank you""
best regards
Jasmin Söllner

Hello,
I'm not very sure that i understand your problem but using RFC_PARAMETER data structure with export purpose you can not expect any kind of data to be returned by RfcCall().Maybe only you expect some data to be returned on the RFC_TABLE data structure.You just send some parameters to the SAP server.To receive some data you should initialize RFC_PARAMETER data structure for importing purpose and running RfcCallReceive() function.
Another issue is that you don't use one more element in your exporting array which should be initialize with NULL.In the RFC SDK documentation is written that the last element from the array should be NULL. Doesn't matter if is RFC_PARAMETER or RFC_TABLE data structure.
export[4].name=NULL;
I hope this help,
Best Regards,

Similar Messages

  • Use of SAP memory to transfer data between two different sessions.

    Hello experts,
    I wish to know how to use SAP memory to transfer data between two different sessions.
    The scenario is that when I run a report and change a variable, the value of changed variable should be availabe to another user on another terminal.
    Thanks & Regards!
    Sumit

    Hello,
    Just to add what Max has already mentioned. IMPORT TO / EXPORT FROM DATABASE statements can be used to store data in special "cluster" tables (you can't use any DDIC table) e.g., INDX.
    @OP: You can opt for Shared Memory(SHM) for this specific requirement as well. In my opinion SHM is a bit tricky to code, but it is easier to monitor. The opposite holds true for "data clusters".
    You should remember SHM is app-server specific. So if you've a load balancing scenario, using SHM can cause problems.
    Hope i'm clear.
    BR,
    Suhas
    Edited by: Suhas Saha on Nov 19, 2010 4:12 PM

  • Transfer data from File server to SAP R/3 AS

    hi, i need to transfer data from file server (http:/.....) to SAP R/3 application server. I have the HTTP Host name (http:/......) and login details. please let me know how i can resolve this.
    best regards
    Neeraj

    Hi
    You need to create a RFC Destination with the details what you have, then you can create a RFC Fucntion module to read the data, according to the destination system, you have to code that, once you
    pick the data from the destination system, later you need to convert it to SAP Format.
    To trace your fm status, there are function module availabe in sap, search with http, you can find.
    regards
    Praveen

  • RFC (or) IDOC to transfer data

    Hi! All
    How to transfer the data from server to another? i.e. I'm having two different R3 server, need to transfer data from one server to another.
    Which option is efficient?
    Is there any possibilities to use RFC.
    Kindly guide me friends.
    Thanks and Regards,
    Kv

    i.e One organization with two different server,  one server for Plant1 and another server for plant2 were Plant2 acts as a supplier for plant1.
    1. The vendor details are transferred from plant1 to plant2 through web.
    2. now, plant2 wants to perform activities with the details provided by plant1.
    3. since the plant1 details are maintained in separate server plant2 is not able to fetch the details from SAP (since supplied through web)
    4. how to transfer the data from plant1 server to plant2 server.
    any doubt revert back.
    Regards,
    Kv

  • Problem in Fetching data using RFC FM from NON SAP system

    Hi All,
    Need help from experts on data transfer using RFC from a non SAP system/database. I have creasted the destination in sm59.
    I have created a function module too which has an import parameter as a query and export parameter as an internal table.
    No when i test run this function module it returns some entries. But when I call this FM in a program it throws a dump 'rfc_external_abort' .  Here is what the call to FM looks like in my program. Please guide me on this.
    Thanks in advance,
    Saket.
    DATA : lv_query TYPE string,
           it_gddbdata TYPE ZC9_TAB_SOLMAN_XI_RFC.
    lv_query = 'SELECT *  FROM GDDB.VW_GDDB_PERSONS WHERE LASTNAME = ''''A'''''.
    CALL FUNCTION 'Z_C9_SOLMAN_XI_GDDBCON'
    DESTINATION  'D39'
      EXPORTING
        in_sql_query       = lv_query
    IMPORTING
       ET_GDDB_DATA       = it_gddbdata

    Hi,
    your question..
    DATA : lv_query TYPE string,
    it_gddbdata TYPE ZC9_TAB_SOLMAN_XI_RFC.
    lv_query = 'SELECT * FROM GDDB.VW_GDDB_PERSONS WHERE LASTNAME = ''''A'''''.
    CALL FUNCTION 'Z_C9_SOLMAN_XI_GDDBCON'
    DESTINATION 'D39'
    EXPORTING
    in_sql_query = lv_query
    IMPORTING
    ET_GDDB_DATA = it_gddbdata
    you are telling that you are fetching the data  from non sap system  using RFC function module.. how it is possible..you canot fetch the data from non SAP system using RFC FM alone.. you have to use the concept BAPI.. it will work..
    I hope this will help  you..
    Regards,
    Kiran

  • Transfer data from dot net to sap system

    Hi gurus!
    please , help me out , i wanna transfer data from dot net to sap system. i have no idea abt it.
    Points can be given sure!!!!!!
    Rahul Deshmukh

    Hi,
    You need to create a RFC(Remote Function Call) to achieve this.
    Goto Transaction SE37
    Import Parameters(What all data you are going to pass from JAVA to SAP)
    EXPORT parameters(What all data you want to pass from SAP to JAVA)
    TABLES parameters (What all tables you want to pass from JAVA to SAP)
    Goto Attributes tab & select Remote Enabled.
    Do the coding to insert records in ZTABLE.
    Activate the RFC
    Now, in JAVA code to login to sap & call the RFC with the required data.
    Best regards,
    Prashant

  • How to transfer data from legacy system  to SAP

    Hi Friends,
    I would like to know the process and the steps followed to transfer data from my legacy system to SAP.
    Suppose if i have all the data in the form of Excel sheet or doc type. How can i transfer this data into SAP.
    Please explain the steps followed.
    Appreciate your help
    Anil

    Hi ,
    Conversion of legacy data into SAP can be uploaded using a standard SAP Tool called LSMW ( TCode:LSMW).
    the below link gives a brief explanation of the LSMW tool
    http://tutorialsap.com/abap/sap-lsmw-tutorial-with-steps-to-create.html
    There are various methods to upload data within LSMW. If the number of records are very high like Article Master or  Conditions for Retail the IDOC method must be used.
    Standard IDocs
    1. Article Master - ARTMAS
    2. Conditions - COND_A
    3. Source list - SRCLST
    4. Customer Master or WRF3/WRF6 tables - DEBMAS
    5. Vendor master- CREMAS
    Etc. Use transaction code WE60 to see the structure of each of the idocs. New enhancements can be done for the idocs if the required field is not available.
    Regards
    Prabhu

  • Transfer Data from excel to text file or SAP R/3

    Hi,
    Can anyone please let me know if there is any function module to transfer data from excel to a .txt file.
    I am using a CRM 5.0 system and some standard SAP function modules are missing.
    I want to fetch data from excel to SAP R/3.
    Wish you great time.
    Best Regards
    Sid

    Hi Sid,
    extracting data from an excel sheet to SAP u can use the function module GUI_UPLOAD.
    I am providing u its parameters also as it might be useful to u.
    The mandatory fields here are FILENAME n in TABLES (in which u will be saving ur data).
    and also if u need to download from sap to any file u can use GUI_DOWNLOAD in which u can save data in both excel or txt file.
    U can also use SAP_CONVERT_TO_TEX_FORMAT function module to convert into text file.
    Rewards would be highly appreciated. Thanks.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      =
      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      =
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Transfer Data from SAP R/3 to BI - Urgent

    Hi all,
    I need to transfer data from one of my SAP R/3 server to Infocube 0FIAR_C03. How can I do that? Please tell me step by step procedure.
    Please respond.
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.
    Edited by: AI on Dec 27, 2007 9:38 AM

    HI
    Follow these threads
    Implementing Extractor / Steps to extract records from R3 to BW
    LO step by step procedure
    how the data transfer from r/3 to bw
    Transfer tax data from R/3 to BW
    Data load from R/3
    Khaja

  • Call a RFC or BAPI in SAP R/3

    Hi,
    Please give your replies.
    I written a RFC function module in SAPR/3 , my requirement is that RFC to be called from SAPXI.
    This RFC will update some SAP transactions and return back the document number back
    Whether it is possible?
    aRs

    Hai,
    <i>my requirement is that RFC to be called from SAPXI.</i>
    at design time you have to import RFC module into imported bjects
    Select Message Interface as Synchronous Type
    and do rest of the things like mapping...
    At configuration
    Under communication channel select adapter type as RFC adapter and receiver.
    and pass the SAP R/3 details
    thanks & regards
    harsha
    *********Reward points if found useful*********

  • Artwork doesn't transfer to my Kingston flash drive for use in my car.

    I am transferring songs to my Kingston flash drive for use in my car.  When I copy them from my folder and drop them in the flash drive the album artwork doesn't transfer.  I deleted the artwork from the songs of 1 CD, saved a jpg to my desktop and added to each individual song which works but would be crazy to do for all of the songs.  I am running ITunes 11.05. 
    I've looked in the communities but couldn't find anything about this.  Is there a way to revert back to ITunes 10?

    Placing your iPhone in the toilet was the correct thing to do but you should have purchased an android phone instead. That would have solved these issues. :-)

  • Transfer data from SAP TABLES to a SQL table

    Hi,
    I need to transfer data from SAP tables to a SQL table. Please suggest the best way as well as the steps please.
    Regards,
    Kamlesh

    Hi
    Step 1: Create an entry for the External database in DBCON table using Trxn: DBCA.
    Field Name Description Value (For: E.g.:)
    CON_NAME Logical name
    for database con RAJ
    DBMS Database system MSS
    USER_NAME Database user <username>
    PASSWORD Password for setting up
    the connection
    to the database <pwd>/<pwd>
    CON_ENV Database-specific MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE
    DB_RECO Availability type for an open database connect
    Then, you can define internal table and code the following way:
    DATA: BEGIN OF wa,
    c_locid(3),
    c_locname(50),
    c_locstate(5),
    END OF wa.
    EXEC SQL.
    CONNECT TO 'RAJ' AS 'V'
    ENDEXEC.
    EXEC SQL.
    SET CONNECTION 'V'
    ENDEXEC.
    < Populate SAP data into an internal table >
    Loop on itab.
    EXEC SQL.
    < code here for populating data into MS-SQL Server table>
    ENDEXEC.
    Endloop.
    Regards,
    Raj

  • RFC Import from own SAP XI results in java.lang.NullPointerException

    Hi All,
    I'm trying to do an import of a local RFC (developed in SAP XI) but this results in a java.lang.NullPointerException
    RFC import from other SAP system is no problem.
    Anyone an idea?
    Cheers,
    Frank

    Hi,
    But we are using custom RFCs from SAP XI only. We are using XI3.0 SP11.
    Could you pls check the following sap notes..
    SAP Notes 677732, 672745, 212011, and 718320.
    Have a look at the following link...
    http://help.sap.com/saphelp_nw04/helpdata/en/2b/a48f3c685bc358e10000000a11405a/frameset.htm
    Thanks,
    Sasi

  • Read Attachment from SAP inbox and Transfer to Application Server Folder

    Hi
      I have one requirement . I have to developed one background program to read the all the attachment in SAP inbox and transfer all this attachment to sap application server folder.
    Thanks and Regards
    Shyam

    Hi Rajendra ,
    please try this code snippet , here we call a selection screen that allows us to browse the file name .
    PARAMETER : p_file TYPE localfile OBLIGATORY .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file .
      data: user_action type i, filename type filetable, result type i,
            fn type file_table.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      EXPORTING
        WINDOW_TITLE            = 'SELECT FILE'
       DEFAULT_EXTENSION       =
       DEFAULT_FILENAME        =
       FILE_FILTER             =
       INITIAL_DIRECTORY       =
       MULTISELECTION          =
      CHANGING
        FILE_TABLE              = filename
        RC                      = result
        USER_ACTION             = user_action
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5
      if user_action = cl_gui_frontend_services=>action_ok.
        clear p_file.
        loop at filename into fn.
          p_file = fn-filename.
        endloop.
      endif.
    Hopefully it helps

  • MDDataSetBW.GetCellData. See RFC trace file or SAP system log for more...

    Ingo,
    I am getting below error message in BO Test environment when I refresh WebI document.
    MDDataSetBW.GetCellData. See RFC trace file or SAP system log for more details
    It was working when we migrated the objects initially. Subsequently when we try to refresh WebI document we are getting the above error message. It still works in BO Dev environment and the no of records are the same in Dev and Test.
    I am able run the underlying BEx query in SAP BW Test environment and it does return data.
    I checked ST22 and SM21 log, but no details there.
    Is it related to Authorization on the Universe or Bex Query?
    We are in the middle of UAT and not able to move forward. I would greatly appreciate your input.
    Thanks
    Ram

    Ingo,
    I ran the zip file and added the required entries to registry.
    And then I tried to reproduce the error, but the files are not generated instead I noticeed below error message on the server:
    The description for Event ID ( 7939 ) in Source ( Crystal OLAP Client ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Registry Access Error: , [HKEY_LOCAL_MACHINE]Software\Business Objects\Suite 12.0\MDA\Log\Modules: The system cannot find the file specified..
    Does tha t mean we do not have permissons to read the registry?
    I would greatly appreciate your input.
    Thanks in advance.
    Ram

Maybe you are looking for

  • Oracle XE (Universal) hangs on Windows XP

    Hi, Installed XE on Windows XP and tried installing SOA 11g schema's. Installation completed but the database hangs and I need to do hard reboot. After reboot the instance fails to start. I have uninstalled/installed 4-5 times over the weekend with n

  • AIR 2.5.1 sidecar installation failing on Windows 7

    My team is attempting to distribute the AIR runtime with our AIR application, and experiencing frequent failures on Windows 7 (64 bit). The error message is "The application could not be installed. Try installing it again. If the problem persists, co

  • Internal server reporting not working in Cap 7.0.1

    I am running Captivate 7.0.1 on a Mac and am having problems with the internal server reporting option. I have a project that is published as both an SWF and HTML5 output file. When I view the published project via SWF, the project reports fine. When

  • Send form to email address

    How do I send the "from" from online to my clients email address after a visitor has filled it out? thx

  • How to reset the Apple ID security questions?

    When applying for an apple ID I was asked to answer the three security quesitons in German! If I now try to answer these questions I'm always asked in English and the server doesn't accept my answers! Does somebody have a hint for me? I'm actually no