Problem passing a table parameter in rfc call using the function control

I try to pass a Table as parameter to a Function Module using the SAP.Functions library (part of SAP frontend controls) from a Visual Basic (VBA) program.
The function module has been verified to work when invoked from SAP FrontEnd Function Builder.
The SAP RFC Control is created with
Set sapFunctions=CreateObject("SAP.Functions")
Following code snippet shows how I attempt to set exports and add a table row before calling the function module:
sapFunctions.Connection = sapConnection
Set sapMaterialUpd = sapFunctions.Add("Z_SD_BAPI_SALES_DATA_UPD")
With sapMaterialUpd
<i>'set exports</i>
     .Exports("PA_GLPUPDLEVEL") = "S"
     .Exports("PA_VKORG") = "FI14"
<i>'append table row</i>
     .Tables("IT_SALES_DATA_UPD").AppendRow
     .Tables("IT_SALES_DATA_UPD")(1, "VKORG") = "FI14"
     .Tables("IT_SALES_DATA_UPD")(1, "MATNR") = "W_3100"
     .Tables("IT_SALES_DATA_UPD")(1, "DATBI") = "99991231"
     .Tables("IT_SALES_DATA_UPD")(1, "DATAB") = "20041231"
     .Tables("IT_SALES_DATA_UPD")(1, "KBETR") = "2222"
     .Tables("IT_SALES_DATA_UPD")(1, "KONWA") = "EUR"
End With
<i>'call the function module</i>
If sapMaterialUpd.Call() = True Then
    <i>'do something with the return tables here...</i>Else
    Debug.Print sapMaterialUpd.Exception
End If
The Call() returns <b>FALSE</b> and the exception is <b>"SYSTEM_FAILURE"</b>. The connection also resets.
The local logfile that the control generates shows that an exception occurs at the point of the call:
<i>10.02.2005  17:54:20.766 Packing Parameters for Z_SD_BAPI_SALES_DATA_UPD
Packing Parameter PA_GLPUPDLEVEL.
Packing Parameter PA_VKORG.
Packing Table 0.
Packing Table 1.
  10.02.2005  17:54:20.766 *** Calling  RFC Function 'Z_SD_BAPI_SALES_DATA_UPD'
  10.02.2005  17:54:20.986 RFC CALL status = RFC_SYS_EXCEPTION
  10.02.2005  17:54:20.986 RFC Error: RFC_IO27
  -Status:CODE=CM_DEALLOCATED_NORMAL STATUS=CM_NO_STATUS_RECEIVED DATA=CM_COMPLETE_DATA_RECEIVED ID=69415076
  -Message:connection closed
  -Internal Status:IO HANDLE=23 DRV=EXT LINE=1420 CODE=27 : GET ID=ffff LINE=861 CODE=7
  10.02.2005  17:54:20.986 Function call finished.</i>
Seen next code snippet. If the Table object is not touched, the function call goes through without any problems:
sapFunctions.Connection = sapConnection
Set sapMaterialUpd = sapFunctions.Add("Z_SD_BAPI_SALES_DATA_UPD")
With sapMaterialUpd
'set exports
    .Exports("PA_GLPUPDLEVEL") = "S"
    .Exports("PA_VKORG") = "FI14"
    'do <b>not</b> append a table row, for testing only ;-)</b>
End With
<i>'call the function module</i>
If sapMaterialUpd.Call() = True Then
<i>    'do something with the return tables here...</i>
Else
    Debug.Print sapMaterialUpd.Exception
End If
This code works perfectly when calling the function. It returns TRUE and behaves normally. The function module returns descriptive response text in a table telling that the table was empty, according to the BAPI implementation.
So is there something special needed here <i>after</i> appending the table row and <i>before</i> making the Call to properly attach the table as a parameter for the function module?
Can this be a bug in the SAP RFC Control? The version of the wdtfuncs.ocx is 6206.6.45.54.
Any hints are welcome!

hi All partner,
who solved this problem , I meet it too and
can't clear it.
SAPfunc := sapfunctions1.Add('z_get_sfcs_dn_mo');    
SAPitab := sapfunc.tables.item ('I_DNMO');
SAPitab.appendrow;                                       SAPitab.value(1,'MANDT') := '220'; 
SAPitab.Value(1,'VBELN') := '2150000001';
SAPitab.Value(1,'POSNR') := '50';
SAPitab.value(1,'MATNR') := '19-99999-00'; 
SAPitab.value(1,'AUFNR') := '921241512001';
SAPitab.value(1,'DEDAT') := '2005/09/09';
SAPitab.value(1,'LFIMG') := '100';  
IF  SAPfunc.call = true then
  begin
  end
else
    begin
    showmessage('call fail!!') ;
    end;
end;
RFC source code as below
FUNCTION z_get_sfcs_dn_mo.
""Local interface:
*"  TABLES
*"      I_DNMO STRUCTURE  ZDN_MO
  data: wa type zdn_mo.
  LOOP AT i_dnmo.
    wa-mandt = i_dnmo-mandt.
    wa-vbeln = i_dnmo-vbeln.
    wa-posnr = i_dnmo-posnr.
    wa-matnr = i_dnmo-matnr.
    wa-aufnr = i_dnmo-aufnr.
    wa-dedat = i_dnmo-dedat.
    wa-lfimg = i_dnmo-lfimg.
   modify  zdn_mo from wa.
    insert into zdn_mo values wa.  --dump at here
    commit work.
  ENDLOOP.
T/C: ST22 error message say at
  insert into zdn_mo values wa. ---dump at here
the sapfunc.call returns fail.
Message was edited by: jorry wang

Similar Messages

  • Problem passing an export parameters in rfc call using the function control

    Hello,
    I use SAP Remoute Function Control (wdtfuncs.ocx) in my C++ application. I can execute remote functions, if they don´t need any export parameters:
    CSAPFunctions m_Functions;
    CFunction f;
    f.m_lpDispatch = m_Functions.Add("RFC_CREATE_DOCUMENT_MASTER");
    f.Call();
    How can I set the export parameters?
    Any help appreciated.
    regards,
    Vladimir

    check out this thread
    Re: Sample code in ASP to connect SAP?
    Regards
    Raja

  • Problem passing a table in an RFC wrapper in ECC to a FM in SRM?

    I am creating a wrapper around FM 'TEXT_CONVERT_XLS_TO_SAP' in ECC, because I cant find a FM in SRM to convers an excel file into an itab. I pass an excel sheet from SRM to this wrapper to convert the values into an Itab and pass then back to SRM. The problem is the parameter "i_tab_converted_data = i_converted" from 'TEXT_CONVERT_XLS_TO_SAP' is of type STANDARD TABLE. So when I created the Itab = i_itab_converted_data in my program using a type I declared in my program, I can't use the type to create the exporting parameter in the FM to pass the itab back to SRM.

    >
    DEMVIL wrote:
    > What I was saying was tthe I_TAB_CONVERTED_DATA is of type "STANDARD TABLE" therefore if I create type and create a table of that type, in this case table I_CONVERTED, it works, but can't use the type to create an export parameter.
    >
    > CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    >     EXPORTING
    > *   I_FIELD_SEPERATOR      =
    > *      i_line_header       = 'X'
    >       i_tab_raw_data       = i_raw
    >       i_filename           = l_filename
    >     TABLES
    >       i_tab_converted_data = i_converted
    >  EXCEPTIONS
    >    conversion_failed       = 1
    >    OTHERS                  = 2.
    It should work. how have you defined i_converted? Below is what I have used and it works fine for me.
    TYPES: BEGIN OF ty_datatab,
      matnr          TYPE char18,  "Material Number
      short_text     TYPE char40,  "Short Text
      quantity       TYPE char13,  "Purchase Order Quantity
      unit           TYPE char3,   "Purchase Order Unit of Measure
      delivery_date  TYPE eeind,   "Delivery Date
      ekgrp          TYPE char3,   "Purchasing Group
      stge_loc       TYPE char4,   "Storage Location,
      matl_group     TYPE char9,   "Material Group
      agreement      TYPE char10,  "Agreement Number
      ag_item_num    TYPE char5,   "Agreement Item Number
      vendor_mat_no  TYPE char35,  "Vendor Material Number
      gl_account     TYPE char10,  "G/L Account Number
      costcenter     TYPE char10,  "Cost Center
      fund           TYPE char10,  "Fund
      func_area      TYPE char16,  "Functional Area
      item_txt       TYPE char70,  "Item Text
      created_by     TYPE char12,  "Created By
    END OF ty_datatab.
    it_record TYPE STANDARD TABLE OF ty_datatab INITIAL SIZE 0,
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_tab_raw_data       = it_raw
          i_filename           = p_pfile
        TABLES
          i_tab_converted_data = it_record
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.

  • Problem passing a table in an RFC wrapper?

    I am creating a wrapper around FM 'TEXT_CONVERT_XLS_TO_SAP' in ECC, because I cant find a FM in SRM to convers an excel file into an itab. I pass an excel sheet from SRM to this wrapper to convert the values into an Itab and pass then back to SRM. The problem is the parameter "i_tab_converted_data = i_converted" from 'TEXT_CONVERT_XLS_TO_SAP'  is of type STANDARD TABLE. So when I created the Itab = i_itab_converted_data in my program using a type I declared in my program, I can't use the type to create the exporting parameter in the FM to pass the itab back to SRM.

    Hi,
    Well if thats your requirement, then you will have to copy the FM to a Z FM & then tweak it as per your requirement.
    Thanks,
    Best regards,
    Prashant

  • Consuming an RFC Call Using the BAPI eWay

    Greetings all,
    We are trying to set up a scenario in which we have a custom RFC function that we are calling synchronously using the BAPI eWay. Here, an ABAP program calls an RFC which is like a proxy on the JCAPS server. On the JCAPS side, we are wanting to map the RFC onto a Web Service call and pass the results back as the exporting parameters of the RFC. While the examples demonstrate the use of an asynchronous function module such as IDOC_INBOUND_ASYNCHRONOUS, it is not clear to me how to work with synchronous calls. Any information would be greatly appreciated. Thanks.
    Best Regards,
    James Wood
    Bowdark Consulting, Inc.
    [email protected]

    I have a similar (if not identical) problem. Chris, your reply to James is talking about the process originating within JCaps. In my scenario (and it sounds like James' too), the process is originating from SAP. What I'm trying to do is this:
    SAP calls to my JCD - this is the part that I'm having trouble with
    My JCD does something with the data sent to it from SAP (call a database or whatever)
    The JCD responds back to SAP so that the request/reply cycle can complete and the SAP program has what it needs
    When I create an OTD object in JCaps using my RFC, there doesn't seem to be a way to make the JCD that I want to create use that OTD as a source for the input message.
    James, if I'm way off base here, let me know and I'll go get my own thread. :)
    Any help or direction would be appreciated. I've Googled this to death and have come up short.

  • My iPhone 5 pairs with my automobile except it does not allow me to "pickup" calls using the car facility.  I've contacted Acura RDX 2013 about this problem.  It referred me Apple for a fix. My iPhone 4 worked with the car technology.

    My iPhone 5 pairs with my automobile except it does not allow me to "pickup" calls using the car facility.  I've contacted Acura RDX 2013 about this problem.  It referred me Apple for a fix. My iPhone 4 worked with the car technology.  Is there a fix for the iPhone 5 to allow call pickup via the Acura?
    Thanks

    HI Friend,
    Probably the problem it is because your iPhone 4 and your car have the same Bluetooth technology ( 2.1 ), but iPhone 5 has new Bluetooth technology ( 4.0 ).
    http://www.apple.com/iphone/compare-iphones/

  • Facetime call using the same APpLe Id on iPad and Mac

    The FaceTime call using the same apple ID with the new iPad and iMac cannot put through to myself. In this case I do not want to get a new apple ID for FaceTime what can I do? I want to use the current apple Id.

    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime: Set-up, Use, and Troubleshooting Problems
    http://tinyurl.com/32drz3d
    I saw one post where a user said dust got inside the small microphone hole. Using a vacuum cleaner removed the dust and restored the audio.
     Cheers, Tom

  • A Runtime error: Generation successful, but you must call up the function

    I used Professor Jim Menching's AIS materials in fall 2009 before ECC 6.04 was installed and everything worked plug-n-play without too many problems.  I tested assigned client after my client provider migrated SAP from ECC 6.0 to 6.04. 
    I tried to proceeded "receive the product from the vendor" on page 13u2019s step 11 after creating an purchase order, as following:
    Logistics> Materials Management > Purchasing > Purchase Order > Follow-on Functions > Logistics Invoice Verification  (MIRO)
    I tried to save it.  However, I got an error message: "Generation successful, but you must call up the function".  After I did it one more time, it becomes a runtime error!  I am not savvy for dealing with unknown technical problem.  Can anyone provide me with a solution to fix problem?
    Thanks in advance.

    Picheng,
    Thanks for the post.  I forwarded your question to your hosting site for resolution since this is a technical issue ... and the technical team informed me the issue was already resolved.  If you have further issues related to this specific issue please contact the UCC directly.
    Best Regards,
    Heather

  • Can't answer iphone 4s calls using the button on the steering wheel of my Buick 2009 Enclave.

    My iphone 4s is hooked up to my Buick Enclave 2009 using Blueetooth.  I can activate Bluetooth via the button on the steering wheel and make voice calls with no problem. However when someone calls me, I can hear the phone ringing through the speakers and can see the number on the display but I can't answer the call using the answer button on the steering wheel.  I have to reach over and touch answer on the phone and then I can continue the conversation via Bluetooh. Appreciate any help.  Thanks.

    The exact same issue is happening with my iphone 5. I don't believe it is the Life Proof case because I have had the pnone for several months and this just recently started happening, I took it to an Apple store and they claimed that this issue is new, that they have never seen it before. After about an hour of trouble shooting, they gave me a new phone.
    The new phone worked fine (in the case) for about a week and then started having the same problem. I am on the Sprint network. I have an iphone 4s for work in the same case on the AT&T network and do not have any problems.
    I am going to go back to the Apple store at my first opportunity. I wish I would have kept my old 4s which I had no problems with.

  • My table of contents does not use the entry style I select for words in the paragraph that have character styles applied to them in the chapter, so some of the letters are showing up as green, which is fine in the chapter but not in the TOC.

    My table of contents does not use the entry style I select for words in the paragraph that have character styles applied to them in the chapter, so some of the letters, specifically parameters, are showing up green, which is fine in the chapter but not in the TOC. I can manually fix this in the TOC by changing the character style to none after the toc  has been generated, but I don't want to do this.

    What application are you running? Please ask this in the forum of the product you're using.

  • When using the new controls of CVI 7 in my DLL it crash on the DisplayPanel call

    I have a CVI DLL that was build under CVI 6. When I recompile it in CVI 7 everything works fine when I load the DLL from my application. But If I add a button on my uir file with the new CVI 7 style (no event code associated, just a plain button) my DLL crash and hang my main application on the DisplayPanel call. If I don't use the new controls (use the classic-style controls) everything works fine. I use LoadPanelEx to load my uir file. The returned panel handle is good (> 0) But when I call DisplayPanel it doesn't show me any error but just crash my DLL and jump back in the DLLMain function saying that my process is detaching and hang my main application.
    I am running on Win2k. I have
    LabVIEW 7 and LabVIEW 6.0.2 installed also. The main application that calls the DLL is made in Delphi 6.
    I have re-installed the run-time engine from the CDs but this didn't do the trick. Is there something else that I must include with my DLL to use thoses new controls styles. The DLL is running from the same place where it was build.

    Hi,
    I have created another cvi DLL and it create the same behavior in my application (crash on DisplayPanel). But if I do a standalone CVI executable with thoses new buttons everything is fine. Also I have created another application(in Delphi) to load the cvi-dll and it works fine in that one. So I would tend to say that it is in my application but on the other hand everything works fine if I don't put thoses LabStyle controls...Weird I know...
    In shorts It is just crashing with a specific application but for any UI project that I create. If I don't put thoses buttons everything is ok...Any other advises would be helpful because I'm kind of out of ideas...
    Gilles Hache

  • Hi fellow apple guys, i have this problem. Hope you can help me. I don't know how to use the function keys (F1 to F12) on my macbook air. Pls help

    Hi fellow apple guys, i have this problem. Hope you can help me. I don't know how to use the function keys (F1 to F12) on my macbook air. Pls help

    Out of the box, to use the function keys as function keys, hold down the fn key when you press the key. Otherwise, you get the picture function on the key. You can reverse this behavior in the Keyboard system prefs.

  • I have a problem in using the function 'WS_DELIVERY_UPDATE'

    I want to update the delivery document at the batch field (CHARG = '0000000605') by using the function 'WS_DELIVERY_UPDATE'.
    Before update, this batch field is initial.
    After having completely updated this delivery, I try to update this batch field again. However, I found the error message showing that 'Confirmed batch 0000000621 is different from batch 0000000605 for main item'.
    How can I solve this problem to update this batch again? This error occurs when I use function 
    'WS_DELIVERY_UPDATE', 'BAPI_OUTB_DELIVERY_CONFIRM_DEC', and 'BAPI_OUTB_DELIVERY_CHANGE'.

    Check OSS 674567.

  • I have installed Adobe Reader 11.0.07 for Mac OS 10.9.3. Have asked this question numerous time without results. The problems I am having are: I cannot scroll using the side slider on downloaded PDF files, nor can I fill in fillable files. Also, and this

    I have installed Adobe Reader 11.0.07 for Mac OS 10.9.3. Have asked this question numerous time without results. The problems I am having are: I cannot scroll using the side slider on downloaded PDF files, nor can I fill in fillable files. Also, and this is extremely irritating, I cannot re-initialize the same file or initialize and another PDF file after I have initialized the first file. If you cannot help please let me know if should use an earlier  version of Reader or find anther company that has the appropriate software.

    Perhaps you missed that you started a discussion at I have OS 10.9.2 and have downloaded latest version of Reader 11. I can no longer fill in form or scroll using the side bar. and you did not respond to the last post there.

  • How to make a SOAP call using the PI 7.1

    Hi All,
    Can you please tell me how can we make a SOAP call using the PI 7.1?
    Thanks in advance

    Hello Shweta,
    Could you please clarify your question? Do you mean you need to call some business system from PI via SOAP? Or do you need to test integration model using SOAP client?
    If the requirement is to make a SOAP call to PI (send SOAP request to PI system), please refer to the guide which Stefan suggested in his post. The general procedure is the following:
    1. generate concrete WSDL in PI (you can do it via PI's Integration Directory);
    2. import generated WSDL to SOAP client (e.g. XML Spy described in the guide or soapUI which is free SOAP client);
    3. create SOAP request message in the SOAP client and send it to the endpoint (in this case, it will be sent to PI).
    This is general procedure for making SOAP calls to SAP PI using external SOAP clients. Please advise if specified steps should be described in more details or if there are any questions from your side regarding them.
    If the question is about calling business system from PI via SOAP, then please refer to SAP Help, configuration of SOAP receiver::
    http://help.sap.com/saphelp_nw04/helpdata/en/29/5bd93f130f9215e10000000a155106/frameset.htm
    My regards,
    Vadim

Maybe you are looking for