Exchanging itabs between C and ABAP using RFC

Hello,
how can I send an internal table from ABAP to a C or C++ client, modify it here and send that modified table back to ABAP?
Thx for your help!
Thomas

Here is my coding. Does anybody have an idea why the pointer in line 151 is = NULL ?
Thx
Tom
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <saprfc.h>
#include <sapitab.h>
static RFC_RC remote_function (RFC_HANDLE handle);
static RFC_RC install (RFC_HANDLE handle);
RFC_HANDLE handle;
typedef struct RFCSTRUCT {
  RFC_INT   seq;
  RFC_FLOAT m;
  RFC_FLOAT si;
  RFC_FLOAT sl;
  RFC_INT   id;
  RFC_INT   lo;
  RFC_FLOAT re;
} rfcstruct;
static RFC_TYPEHANDLE handleRFCSTRUCT;
static RFC_TYPE_ELEMENT typeRFCSTRUCT[] = {
  /* name /         / type /  / length /        / decimals */
  { "SEQ",        TYPINT,     sizeof(RFC_INT),    0 },
  { "M",          TYPFLOAT,   sizeof(double),     16 },
  { "SI",         TYPFLOAT,   sizeof(double),     16 },
  { "SL",         TYPFLOAT,   sizeof(double),     16 },
  { "ID",         TYPINT,     sizeof(RFC_INT),    0 },
  { "LO",         TYPINT,     sizeof(RFC_INT),    0 },
  { "RE",         TYPFLOAT,   sizeof(double),     16 },
#define ENTRIES( tab ) ( sizeofR(tab)/sizeofR((tab)[0]) )
Main
int main (int argc, char ** argv)
  RFC_RC rc;
  handle = RfcAccept(argv);
  rc = install(handle);
  if (rc != RFC_OK)
    RfcAbort(handle,"Initialization error");
    return(1); }
  do{
    rc = RfcDispatch(handle);
  } while (rc == RFC_OK);
  RfcClose(handle);
  return(0); }
install()
static RFC_RC install(RFC_HANDLE handle) {
  RFC_RC rfc_rc;
  rfc_rc = RfcInstallFunctionExt( handle,
                                 "FUNC",
                                 (RFC_ONCALL)remote_function,
                                  "nodocu" );
  if (rfc_rc != RFC_OK)
    return rfc_rc;
  return RFC_OK;
remote function
static RFC_RC remote_function (RFC_HANDLE handle) {
  RFC_RC rfc_rc;
  ITAB_H itab_handle;
  RFC_PARAMETER Exporting[0];
  RFC_PARAMETER Importing[0];
  RFC_TABLE Table[1];
  Exporting[0].name = NULL;
  Importing[0].name = NULL;
rfc_rc = RfcInstallStructure(  "rfcstruct",
                                typeRFCSTRUCT,
                                ENTRIES(typeRFCSTRUCT),
                                &handleRFCSTRUCT);
  itab_handle = ItCreate("ITAB", sizeof(rfcstruct), 0, 0);
  Table[0].name = "ITAB";
  Table[0].nlen = strlen("ITAB");
  Table[0].type = handleRFCSTRUCT;          
  Table[0].leng = sizeof(rfcstruct);
  Table[0].itmode = RFC_ITMODE_BYREFERENCE; 
  Table[0].ithandle = itab_handle;
  Table[1].name = NULL;
  rfc_rc = RfcGetData(handle, Importing, Table);
  if (rfc_rc != RFC_OK)
    return (rfc_rc);
  modify_table(itab_handle, handle);   
  rfc_rc = RfcSendData(handle, Exporting, Table);  
  return(rfc_rc);
  ItFree(itab_handle);
  RfcClose(handle);
modity itab...
modify_table(ITAB_H itab_handle, RFC_HANDLE handle) {
  int linenr;
  int lineleng;
  char table_data[8192]; 
  struct RFCSTRUCT *ptr=NULL;
  RFC_FLOAT a;
  RFC_FLOAT s;
  RFC_FLOAT sl;
  RFC_INT id;
  RFC_INT lo;
  lineleng = ItLeng(itab_handle);
  for (linenr = 1; ; linenr++)
    ptr = ( struct RFCSTRUCT  *) ItGetLine(itab_handle, linenr);
    /* HERE: POINTER IS ALWAYS == NULL - WHAT'S WRONG ??? */
    if (ptr == NULL) break;
    memcpy(table_data, ptr, lineleng);
  return; }

Similar Messages

  • Users mapping between EP and ABAP system

    Hello
    I'd like to ask for some guidance in my quest
    Current situation looks like this:
    I've configured UME in AS Java to work with LDAP as read only data source. Then I've configured SPNego to run SSO - It works, users from MS AD can log into portal.
    Now I have application in WD which authorizes via EP/AD - works fine.
    And next step is users mapping between AD and ABAP backend (serving some BAPI's for WD app)
    I've found a bunch of help pages starting from
    http://help.sap.com/saphelp_nwce711/helpdata/en/0b/d82c4142aef623e10000000a155106/frameset.htm
    But somehow it's quite complicated to achieve this mapping. I've tried to set RFC destinations logon type to user mapping but without succes.
    Can anyone point me to some more clear example or give path to configure this scenario? Is there a way of configuring this with NWA or some XML file editing is required?
    Any help will be appreciated.
    BTW: whole environment is in version 7.11
    Best regards
    Maciej

    There is no equivalent to SPNEGO on the ABAP side.
    If your goal is to propagate the user, then possible options are:
    -> Wait for SAML 2.0 or invest now in a SAML 1.0 provider.
    -> Use the same kerberos ticket for the EP as what your ABAP system will accept: route = SNC and 3rd party libraries.
    -> Issue SAP logon tickets for the ABAP system from the EP, and use these in your WDA.
    Another option is to expose the service with saved logon data in the ICF. If the service is just a wrapper for the BAPI, then you can also consider using trusted RFC between the service and the backend, but this might not be acceptable for your service.
    I have only done experimental stuff with this and some of the above is not released yet. Also consider the consequences, even if it "does work"...
    Cheers,
    Julius

  • ESS/MSS sso configure between java and abap instance

    Dear Gurus,
    I want to configure sso between java and abap instance for ESS/MSS. I couldnt find any guide for it, could you please help me gurus ?
    Other question is, is there any specific role for ESS/MSS users in JAVA instance. I want to create users and assign this role to them.
    Best Regards

    Hi Kemal,
    Hope you are doing good.
    There should be a / in the ITS path before SAP.
    Basically the entry that you have mentioned here should be accessible via browser as well. For eg in your case:
    http://<its hist name>/sap/bc/gui/sap/its/webgui should be accessible over browser.
    I also think you have put in a extra space in "w  ebgui". It should be "webgui".
    If the connector settings are working, then we can be sure that system connection is fine. You do not need to configure ITS settings.
    Also for SSO, refer the SAP note:1083421 and configure the SS0 settings again.
    Please run the SSO2 wizard and then make the automatic connection to
    the abap server. This will solve any inconsistencies on the server
    due to manual interventions.
    Most likely reason for the error is that certificates were loaded
    manually rather than using SSO wizard.
    More help:
    <http://wiki.sdn.sap.com/wiki/display/EP/Troubleshooting+SSO+between+AS-ABAP+and+AS-JAVA>
    The SSO enabling parameters should be set on the R/3 server.
    SSO Logon Ticket-> login/accept_sso2_ticket and login/create_sso2_ticket
    More info:
    <http://help.sap.com/saphelp_nw04/Helpdata/EN/22/41c43ac23cef2fe10000000a114084/frameset.htm>
    Thank you and have a nice day :).
    Kind Regards,
    Hemanth
    SAP AGS

  • I need help syncing my contacts between Outlook and iPhone using iTunes. I followed the steps given and ended up with just email addresses showing in my contacts even though I have phone numbers and snail mail in my Outlook Contacts. Using  Windows 7

    I need help syncing my contacts between Outlook and iPhone using iTunes. I used the knowldge document and set it up to transfer my Outlook contacts to the iphone using itunes.
    In contacts on the iphone I only see the email addresses.
    Yet in Outlook I have email, snail mail and phone numbers.
    I followed the knowledge document from iphone.
    I did it once, didn't work so deleted all the contacts from the phone and tried again. Same result. I have a PC using Windows 7 64 bit.

    You can't access an Exchange account via ActiveSync with the Address Book and iCal on your Mac.
    You can access a MM account with Outlook on your PC at work and keep your MM email account server stored mailboxes synced between your PC at work, your iPhone, and the MM "cloud". Not sure about syncing MM contact info and calendar events with Outlook at the same time with an Exchange account.
    This will not provide for syncing your Exchange account contact info and calendar events with the Addresss Book and iCal on your Mac because the accounts are separate.
    You can access an Exchange account and a MM account at the same time with the iPhone's mail client, and sync contact info and calendar events over the air with both accounts at the same time. You can view combined contact info or separately for each account, and the same for calendar events.

  • Is there a way to sync my saved user ids and passwords between Mac and iPhone using iCloud?

    Is there a way to sync my saved user ids and passwords in Safari between Mac and iPhone using iCloud? Like I can do using Chrome for Mac and iOS...

    You three would do better to sync to google directly.  Google has a blackberry app that will allow you to sync your contacts and calendars.  The app isn't perfect, but it works reasonably well, especially if you're just using one calendar to sync.
    Then there's plenty of ways to sync those to your iPad using Google, including Exchange, or simply adding it as a google account.
    As for iCloud, there really isn't any supported or unsupported method to do what you're trying to do, at least at this time.  If there is, it would definitely be a hack and I would be wary of risking your contact or calendar data on it..

  • Exchange Messages Between Foreground and Background Tasks

    I'm working on an Application where I use background task for handling Bluetooth communication. For that, I'm trying to exchange messages between foreground and background tasks when the Bluetooth device sends
    something and want to notify the foreground about it. Similarly, I want the foreground to send messages to background when the user activates something. I've started doing that using event handlers but it is not reliably working. Looks like the problem is
    coming from the synchronization between these two tasks. I found the class BackgroundMediaPlayer which does what I really want , except controlling the media player. What are the options of doings that?

    Hi Rob,
    Thank you for your reply. So in this case, I guess each process shall keep reading the file and see if there are commands to be processed. Is there a way to raise an event when the content of the file get changed? Are there existing file handling classes
    that support this?

  • Error while creating connection between Java and ABAP

    Experts
    I am getting the following error message when I am trying to test the connection between JAVA and ABAP systems.
    1. The system ID is valid
    2. The system was retrieved.
    3. The system object represents an SAP system
    4. The following parameters are valid: Web AS Protocol (http) Web AS Host Name (s09f71v06.svr.bankone.net:8100)
    5. The host name s09f71v06.svr.bankone.net was resolved successfully.
    6. The server s09f71v06.svr.bankone.net *could not be pinged* successfully.
    I have JAVA and ABAP on the same system. I am trying to establish a connection. I have checked all the settings and they looks fine. I have also pinged from other system to this server and the Ping works fine.
    Please do let m eknow where do I need to check for the errros or logs for the above error message.
    Appreciate your quick help.
    Mahesh

    Check the relevant services are test are active on the Backend system through SICF trransaction.
    Also make sure that default icm services are running.See note 517484.
    More important the connector test in the portal system should work properly,recheck the WAS path etc are correct.
    Regards
    Ajay

  • Data Replication Between Sqlserver and Oracle11g using materialized view.

    I have Sqlserver 2005 as my source and oracle11g as my target.I need to populate the target daily with change data from source.
    for that we have created a dblink between sqlserver and oracle and replicated that table as a Materialized view in Oracle.
    problem we are getting here is Fast refresh option is not available.each day it will pick full data from the source.
    is there any way to use Fast refresh in this scenario??
    Thanks in advance.
    Regards,
    Balaram.

    Pl do not post duplicates - Data Replication Between Sqlserver and Oracle11g using materialized view.

  • How to use CVI or VC function to exchange data between 78xxR and CVI or MFC exe

    with the Labview FPGA module,I write down th FPGA program on the 78xxR,and then use Labview to program for the data exchange between the host PC and the FPGA board. the question is that I have many programs written in CVI or MFC, I think if some c function can access the FIFO of the 78xxRunder under CVI or VC,for example, some functions available to copy data to or from the FIFO, then the old program can easily be change to use 78xxR board. can someone tell me?
    now I use "Call Library Function Node" to load a dll that open shared memory created in CVI or MFC exe, use "Call Library Function Node"to read data from the shared memory and then use LV function to write data to FPGA; use LV "read/write control" node to Read data from the FPGA and then use "Call Library Function Node" to write data to shared memory. and a CVI or MFC exe read or write data to or from the shared memory, it works but isn't a good method, can some one has better method?

    Hi, david2K:
         As there is no FPGA module supported for CVI or MFC, using "Call library Function node" is the only way to solve your problem until now.
        You have many programs written in CVI or MFC, so you can build the LabVIEW program as dll, and call it in CVI.
        Hope it helpful!
    Jing Zhang
    Application engineer.
    [email protected]

  • Communicate link between Java and ABAP Stack for https

    I have configured https in both the java and abap stacks (we have a double stack configuration).  Due to our future configuration I have changed the hostnames to fully qualified hostnames per SAP instructions. 
    The question I have is does anyone know what RFC destinations or JCo settings I need to change to make https complete?
    I have the problem where when I fire off the Integration Builder from within the ABAP stack (SXMB_IFR) I get a straight hostname (no domain name).  Where is this configured?  Any help is appreciated..

    Check the exchange profile (Administratio tab in /rep/start/index.jsp page; you will have to enter it manually since it is throwing error from SXMB_IFR).
    Regards,
    Henrique.

  • GSS4480 and CSS using RFC 1918 addressing

    We are in the process of testing out a load balancing/redundancy setup using the GSS4480 and a CSS11506. Right now the CSS is setup with RFC 1918 addressing and we NAT out to the internet using a Checkpoint firewall. If I setup my VIP answer file to poll the 1918 address of the CSS, then that will be the answer that is given out when a client requests a name lookup which won't work. There has to be a way to configure this or then all diagrams I have seen are using internet routable name spaces. Looking at the docs and playing with the GUI I don't see any way of configuring it to use RFC 1918 addressing behind the firewall and still give out internet routable domain names. The docs show's the GSS and CSS being behind firewalls. I guess I am just missing something. Can the CSS be configured to link the RFC1918 address to a public address for KAP-AP purposes? Also is there any issues with NATing to RFC 1918 addresses for the health probes to other GSS's. We would like the health probes to go out over the internet not over our back end. Thanks

    our issue really isn't the DNS request as more it is the APP session between the GSS and CSS. We have 2 GSS devices that will be located at different data centers. Going by how the GSS docs say they work, the primary GSS synchronizes its database to the secondary when it comes online. With this the case we can't give our GSS(s) 1918 addresses since they'll be in different locations the secondary won't be able to reach the 1918 address of the primary. We have not proven this, but going on what the documentation says this is how it works. Now if we can configure our GSS(s) with 1918 addresses and just NAT their connection as they go out the FW and that's how they learn of each other then that issue becomes moot.
    Going with our current problem here's the rest. Since the GSS(s) are outside the firewall they are polling CSS(s) that are located behind the firewall. All NAT is done on the FW so the CSS is completely 1918 addressed. The GSS is polling the circuit IP of the CSS which is a real address that the FW NATs to the 1918 address. The problem arises when the GSS queries the CSS the request is received, however it's for a real address and not a 1918 address.
    We thought about duplicating all the content rules with the real addresses as the VIP; this works, but since the users aren't going through those rules the GSS is never going to get anything more than 2 on the load.

  • Question about load balancing between Portal and ABAP

    Hi,
    I have the problem whit load balancing between Portal and ECC (ERC) ABAP
    Exist two system:
    1) ECC (ERP) ABAP = Backend     Module = HR
    2) EP (JAVA) = Frontend
    The users (9000 users) logon in the EP and run query (data personal) in the ECC.  The problem to all user connect in Central Instance and not in the Dialog Instance.
    How can balancing the conecction HTTP (EP) to ECC (ABAP)??
    I need balancing in the ECC to Dialog Instance

    Jco -> right. Another possibility is that you use iviews that point to the backend in this case you will need to use a load balanced entry for the backend system in the [system landscape|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/8c1e438d7017fce10000000a42189c/frameset.htm] -> SAP_R3_LoadBalancing
    If you have ESS deployed on your portal, you will most probably need to do both.
    Cheers Michael

  • How to exchanging data between SAP and P3?

    could use BAPI directly between SAP and P3? And if we use XI as middleware, which protocols or methods should we use?
    any answer should be appreciated.

    Hi,
    U havent mentioned what exactly ur P3 system is.
    Considering it to be Primavera P3 system, the integration could not be done directly using a BAPI since the structure of Projects (as well as the rules to define the projects) are different in SAP and Primavera P3.
    Thats y XI is required. U have to use Idoc/RFC interfaces. Have a look about what Primavera wants to say about this integration
    http://www.primavera.com/newsroom/primavera_sap_051007.asp
    Regards,
    Prateek

  • Reliable messaging between XI and BizTalk using SOAP

    I came across this document describing how reliable messaging between XI and BTS can be implemented using the SOAP extensions. This document has been authored by
    - André Fischer, Project Manager CTSC, SAP AG
    - Matthias Allgaier, Consultant XI, SAP Deutschland AG & Co.
    - KG Jürgen Daiberl, SAP Program Manager CTSC, Microsoft Corporation
    Does anyone know if the prototype code is available for download from SDN or elsewhere? A search on SDN did not produce any results...
    Thanks.
    - KishenM

    Larry,
    Let me see if I understood this - You need to use the SOAP adapter to integrate with BizLink. Bizlink Provides its own SOAP Header and hence you are not sure how to do this.
    Got a few questions,
    1. Has Bizlink given you a XSD / WSDL. Does this have the entire SOAP Payload including the SOAP Header and SOAP body? If yes, create the mapping as needed and instead of the SOAP adapter use the HTTP adapter or use the SOAP adapter and in the SOAP adapter select option Do Not Use SOAP Envelope.
    2. If you do not have a XSD that contains the entire SOAP Enevelope - SOAP header and body then use XSL or Java Mapping that creates this output structure and use the SOAP adapter with the DoNotuseSOAP Envelope option or the HTTP adapter.
    The SOAP adapter in the DONotUseSOAP Emvelope mode basically becomes a http adapter.
    Regards
    Bhavesh

  • ITunes 7 - syncing between Mac and PC using network

    I thought there was an announcement today that Apple had made it easier to copy your iTunes library between Mac and PC with or without using an iPod.
    I have not been able to find such an option in the iTunes 7 menus on my mac or pc. I could copy the library using standard network file copy, but then I would lose the playlists and settings.
    Anybody know the new way to copy/sync a mac and pc itunes library while keeping playlists and settings?
    Intel iMac 20" stock mem & drive   Mac OS X (10.4.6)   OS & apps are excellent; hardware could use some QA

    Welcome to Apple Discussions, saucyandbossy
    If your family uses Windows® and has or will add the latest version of AIM® to their PC, launch iChat on your Mac, add their buddy name(s) (AIM Screen Name) to your iChat Buddy List, and contact them like you would any other iChat contact. If you need help adding buddy names, search your Mac's iChat > Help for "Adding people to the buddy list" (without the quotation marks).
    If your family has problems setting up or using AIM®, or if they choose not to use it, both you and your family can download and install your respective versions of Skype and use Skype as your cross-platform video chat application. Skype offers comprehensive help at their website, including a dedicated Skype Forum. For those who have trouble connecting iChat and AM® (some do), Skype currently seems to offer the easiest to use, free, cross-platform video chat connections.
    EZ Jim
    PowerBook 1.67 GHz w/Mac OS X (10.4.11) G5 DP 1.8 w/Mac OS X (10.5.2)  External iSight

Maybe you are looking for

  • Using rman to backup a remote database

    I am after a good guide or advice on how (what) to install and (how to) run Oracle RMAN to backup a remote Oracle database. RMAN must be installed and run on a Solaris (SunOS 5.8) box remote from the Solaris box (also SunOS 5.8) running the Oracle da

  • XMP Files from MAC Not Reading On PC

    My question is two-fold, so I apologize that this is long, but it will be best with the backstory: I shoot Raw on a Canon 5DMIII and import my images into Lr5 on my PC as CR2 files. I am beginning to work with an editor for the post production of my

  • WS-C3560 - SRW2048 - WS-C3560

    Hi there! I've got a pretty strange problem.. I get connectivety to one of my networks from a Cisco WS-C3560 (according to CDP) that are connected to my Linksys SRW2048 switch port g47. Then I apply dot1q vlan tag 170 to all incomming traffic on that

  • Guitar cuts out while recording

    Hi All, I'm using Garageband and the Griffin guitar connect cable and when I try to record my guitar, the recording cuts out after a few bars. Useful stuff: -original iPad and fully up to date iOS. -cut out is random, though the most I've been able t

  • E-TDS and WCT Deduction

    Hello friends, can anyone suggest me how to apply ETDS in SAP Buisiness One as well as  WCT Tax (Work Contract Deduction Tax). If possible please provide me notes regarding this.