TABLE_ENTRIES_GET_VIA_RFC

I am using this function to read DD02L in R/3 from BW.  The table layout is returned in <b>nametab</b>.  However, all the byte counts are doubled.  For instance, TABNAME is the usual CHAR 30, but it is 60 bytes in nametab.  And so it goes for each field.  I am able to deal with it, of course, by dividing by 2 before I parse the returned data.
But does anyone know why things are doubled?
Both BW and R/3 are UNICODE and 2004S.
  CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC' DESTINATION 'R3CLNT100'
    EXPORTING
      langu               = sy-langu
      only                = ' '
      tabname             = 'DD02L'
    IMPORTING
      rc                  = l_subrc
    TABLES
      sel_tab             = l_t_sel_tab
      nametab             = l_t_nametab
      tabentry            = l_t_tabentry
    EXCEPTIONS
      internal_error      = 1
      table_has_no_fields = 2
      table_not_activ     = 3
      not_authorized      = 4
      OTHERS              = 5.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Hi,
i had the same think of u, but i used another FM (and it worked very well form me ).
'RFC_READ_TABLE'.
Example :
  CALL FUNCTION 'RFC_READ_TABLE'
   DESTINATION 'X51400'
    EXPORTING
      query_table                = 'YT301'
  NO_DATA                    = ' '
    TABLES
   fields                     =
      data                       = tdata
   EXCEPTIONS
     table_not_available        = 1
     table_without_data         = 2
     option_not_valid           = 3
     field_not_valid            = 4
     not_authorized             = 5
     data_buffer_exceeded       = 6
     OTHERS                     = 7.
To access to a record of tdata
    READ TABLE tdata WITH KEY wa+3(3) = ifile-ist.
Hope it helps
Bye
Andrea
Pls reward if it helps

Similar Messages

  • Problems w. RFC_READ_TABLE and TABLE_ENTRIES_GET_VIA_RFC  - 4.6c to 4.7

    Hello,
    i've used, although it's not recommended, RFC_READ_TABLE successfully with 4.6c to read various QM tables, like 'QALS', 'QAVE' etc.
    Now the company migrated from 4.6c to 4.7 and my modules stopped working partially.
    When trying to read 'QALS', the function now throws back the following error: "Message:Error in ASSIGN-statement in program SAPLSDTX". While some other tables work flawlessy (like 'QAVE'). I'm pretty sure it's something related to floating point fields or some unicode transition, though i don't know any solution yet.
    I tried to use TABLE_ENTRIES_GET_VIA_RFC instead, but this function throws another quite strange error, after the call: "Message:The types of the Operators dbtab and itab are not convertable into each other". Again, only with some tables.
    Can anyone point me into the correct direction? Any help is very appreciated. By the way: writing own FMs is NOT an option.
    Regards
    Julian

    Resolved myself

  • TABLE_ENTRIES_GET_VIA_RFC doesn't return all data for table VBRP

    Hi guys,
    I'm trying to import data from table VBRP using fm TABLE_ENTRIES_GET_VIA_RFC in Microsoft access.
    However it only seem to import first few fields of table and then nothing !
    Am I missing something. It works fine for other tables, i tries EKPO and it works a treat. ???!!
    Many thanks
    SA
    PS: Points will be awarded.

    According to note 881127:
    Reason and Prerequisites
    The function module is only intended for internal use in the ALE area, and only for reading numerical tables.
    Solution
    Use another or a customer-specific function module.
    Rob

  • TABLE_ENTRIES_GET_VIA_RFC issue

    Some tables work and some tables don't for this function module. The ones that don't work say there is a unicode conversion issue where they are not mutually convertible. This is an example of one of the tables that gives me an error:
    comm_info is type LFA1 in the tables tab of my FM
    Data: comm_info_output type table of bdi_entry.
    CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
        EXPORTING
          tabname               = 'LFA1'
    *      langu                 = 'EN'
    *      only                  = 'X'
        TABLES
          tabentry              = comm_info_output
          nametab               = gt_output2
          sel_tab               = gt_output3
        EXCEPTIONS
          system_failure        = 1  MESSAGE l_mes
          communication_failure = 2
          OTHERS                = 3.
    comm_info[] = comm_info_output[].
    Before you point out that comm_info and comm_info_output are different types, I know that. I read that the reason some fail and some don't is because of the "DEC" data type in the table structure. How do I get around this issue? I can't make comm_info_output type LFA1 because the imported table has to be of type bdi_entry or else it will fail. Is there a different function module I can call or is there a different way of going about this using the same FM (TABLE_ENTRIES_GET_VIA_RFC)

    Hello Mark
    The note mentioned by Rob is [Note 881127 - Dump in function module TABLE_ENTRIES_GET_VIA_RFC|https://service.sap.com/sap/support/notes/881127]:
    The function module is only intended for internal use in the ALE area, and only for reading numerical tables.
    Regards
      Uwe

  • TABLE_ENTRIES_GET_VIA_RFC in unicode system

    Hi all,
    I know this is going to be a long initial post, but please please take the time to read it. Otherwise there would be many unnecessary questions.
    We are using a middleware for mobile devices that reads connects to SAP for reading table data (via a.m. RFC) and posting RFCs/BAPIs.
    Now we try to connect to an unicode SAP system (6.20). The statement
    SELECT * FROM (TABNAME) INTO TABLE TABENTRY WHERE (SEL_TAB)
    where TABENTRY is a table of type char(2048) does not work any more as in unicode systems the structure of the db table and the internal table have to be the same.
    So we found the fm CRM_CODEX_GET_TABLE_VIA_RFC in CRM which is built from a copy of the a.m. fm and solves this problem by
    1.) creating dynamically an internal table of the same type as the db table.
    2.) select the data into this new internal table
    3.) loop over the internal table and converting each field of its structure to a char variable and then appending it to a the result char(2048).
    Theoretically everything's ok. The fm works now and returns correct data. But there's still one problem, the middleware doesn't convert the data correctly, as the values of fields of type 'p' are passed differently.
    non unicode (standard fm):
    1000000000000280401011000COMPDL              200408 ###E8##############################
    unicode (changed fm):
    1000000000000280401016000COMPDL              200504 10.000       0.000        0.000        0.000
    As you can see, the select statement from the top of this post just puts the data into the string without actually converting the numbers in fields of type p (or QUAN, CURR in db).
    The changed fm with converting every field also converts the number values, now they appear as char fields.
    The middleware tries to convert the number values, but always returns 0 (I can only the results as the actually programming is a black box for me).
    Has anyone any idea how to solve this problem? (beside getting help from the middleware vendor, which is difficult, as there is a new release working with unicode systems. But we will stay on the old release for some months from now...)

    Hi Raja,
    thanks for your answer.
    I had already searched the forum and found your document about RFC_READ_TABLE which I think is quite interesting and a good solution.
    But unfortunately, I cannot change the middleware's RFC logic, e. g. change the BAPI or make changes to the in-/output streams.
    I now live with a workaround:
    I modified the RFC to convert all p type fields to character fields and also changed the metadata RFCs accordingly, which works OK.
    For all RFCs I use to post data to SAP, I write a wrapper RFC with character only structures and convert them to the internal RFCs inside SAP.
    This is not my preferred solution, but I am very short of time and it works pretty well.
    Regards,
    Hans

  • Call Function Destination in a background job

    I am having a problem using:
      CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
             DESTINATION p_dest
    in a background job.
    I am working on a program that would compare the same table in 2 different systems and write the differences.  It works when I run it in the foreground.  However, I want to run this in a nightly background job.  However, it is failing and I beleive that it is the result of the program needing a user to interactively logon to the remote system.
    How can I bypass the logon screen or enter information into the logon screen using a background job?
    Thanks.
    Jon

    Hi Jonathan,
    Would you like to reward some points to the poster to thank them as a part of SDN Contributor Recognition Program?
    You can click on the yellow star on the right of each post header to reward points.
    For more information:
    https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
    John.

  • Creating RFC Function Module

    I am trying to use PHP and SAPRFC to pull out some information from our SAP database.  I've been reading documentation and I've stumbled across this in the SAP documentation:
    There are two restrictions on writing remote functions that are to be called transactionally:
                    + Transactional calls cannot return parameter values. As a result, the interface for these functions should not specify any EXPORT parameters.
                    + Functions that run transactionally may not perform call-backs: the caller's context does not necessarily still exist when the call-back is relayed back to the original system.
    If this is true then how am I suppose to receive any data back from the RFC?  I am trying to pull a couple of variables out of a few tables using basic select statements like this:
    FUNCTION Z_RFC_COMMISSION_INDIVIDUAL.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(COMM_ACCOUNT) TYPE  LIFNR DEFAULT 000000
    *"  EXPORTING
    *"     VALUE(NAME) TYPE  LFA1-NAME1
    SELECT SINGLE name1 FROM lfa1 INTO name
      WHERE lifnr = comm_account.
    ENDFUNCTION.
    I can connect to the SAP database but I am still not clear on the best way to pull out single values instead of a whole table from SAP using PHP.  Does anyone have any example function module source code they could share?

    Hi Mark,
    I used this code (copy of you)
    DATA: comm_info_output TYPE TABLE OF bdi_entry.
    DATA: comm_info TYPE TABLE OF lfa1.
    DATA: nametab TYPE TABLE OF bdi_mfgrp.
    DATA: sel_tab TYPE TABLE OF bdsel_stat.
    CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
        EXPORTING
          tabname               = 'LFA1'
        TABLES
          tabentry              = comm_info_output
          nametab               = nametab
          sel_tab               = sel_tab
        EXCEPTIONS
          system_failure        = 1  MESSAGE l_mes
          communication_failure = 2
          OTHERS                = 3.
    comm_info[] = comm_info_output[].
    and I get no error message. Where exactly do you get error message. Resp. is it going to short dump? (if so please attach list from st22).
    I think the problem is not in function module but in setting of unicode / non unicode systems. Probably with FM you get some not allowed characters.
    I found following thread:
    RFC Lookup after unicode conversion of target R/3
    Is it suitable for you?
    Sorry I am not expert for this. Maybe if you identify exact problem and you don't know solution create a new thread with good description in the title and you will find unicode issues experts.
    Regards,
      Karol
    Edited by: Karol Seman on Jul 30, 2008 2:18 PM

  • RFC CALL VIA EXCEL VBA

    Hello,
    Hope someone call help with the following.
    I am trying to retrieve data from a table within SAP by using the following Excel VBA code.
    Sub retrieve_table_contents()
    Dim R3, MyFunc, App As Object
    Dim SEL_TAB, NAMETAB, TABENTRY, ROW As Object
    Dim Result As Boolean
    Dim iRow, iColumn, iStart, iStartRow As Integer
    iStartRow = 4
    Worksheets(1).Select
    Cells.Clear
    'Create Server object and Setup the connection
    Set R3 = CreateObject("SAP.Functions")
    R3.Connection.System = "QA2"
    R3.Connection.client = "900"
    R3.Connection.user = "mbrough"
    R3.Connection.password = "st34lh"
    R3.Connection.language = "EN"
    If R3.Connection.logon(1, False) <> True Then
       Exit Sub
    End If
    'Call RFC function TABLE_ENTRIES_GET_VIA_RFC
    Set MyFunc = R3.Add("TABLE_ENTRIES_GET_VIA_RFC")
    Dim oParam1 As Object
    Dim oParam2 As Object
    Dim oParam3 As Object
    Dim oParam4 As Object
    Set oParam1 = MyFunc.exports("LANGU")
    Set oParam2 = MyFunc.exports("ONLY")
    Set oParam3 = MyFunc.exports("TABNAME")
    Set oParam4 = MyFunc.Tables("SEL_TAB")
    oParam1.Value = "E"
    oParam2.Value = ""
    oParam3.Value = "LAGP"
    If frmQuery.txtSelect <> "" Then
        oParam4.Rows.Add
        oParam4.Value(1, "ZEILE") = frmQuery.txtSelect
    End If
    Result = MyFunc.CALL
    If Result = True Then
      Set NAMETAB = MyFunc.Tables("NAMETAB")
      Set SEL_TAB = MyFunc.Tables("SEL_TAB")
      Set TABENTRY = MyFunc.Tables("TABENTRY")
    Else
        MsgBox MyFunc.EXCEPTION
        R3.Connection.LOGOFF
        Exit Sub
    End If
    Result = R3.TABLE_ENTRIES_GET_VIA_RFC(EXCEPTION, LANGU:="E", ONLY:="", TABNAME:="LAGP", SEL_TAB:=SEL_TAB, NAMETAB:=NAMETAB, TABENTRY:=TABENTRY)
    'Quit the SAP Application
    R3.Connection.LOGOFF
    If Result <> True Then
      MsgBox (EXCEPTION)
      Exit Sub
    End If
    'Display table header
    iColumn = 1
    For Each ROW In NAMETAB.Rows
        Cells(iStartRow - 1, iColumn) = ROW("FIELDNAME")
    '   For C and N datatypes, explicitly set the cell to TEXT format, otherwise leading zeroes will be lost
    '   when numbers are imported from a SAP text field
        If ROW("INTTYPE") = "C" Or ROW("INTTYPE") = "N" Then
            Range(Cells(iStartRow - 1, iColumn), Cells(iStartRow - 1 + TABENTRY.Rowcount, iColumn)).Select
            Selection.NumberFormat = "@"
        End If
        Cells(iStartRow, iColumn) = ROW("FIELDTEXT")
        iColumn = iColumn + 1
    Next
    Range(Cells(iStartRow - 1, 1), Cells(iStartRow, NAMETAB.Rowcount)).Font.Bold = True
    'Display Contents of the table
    iColumn = 1
    For iRow = iStartRow + 1 To TABENTRY.Rowcount
        For iColumn = 1 To NAMETAB.Rowcount
            iStart = NAMETAB(iColumn, "OFFSET") + 1
    '       If this is the last column, calculate the length differently than the other columns
            If iColumn = NAMETAB.Rowcount Then
                iLength = Len(TABENTRY(iRow, "ENTRY")) - iStart
            Else
                iLength = NAMETAB(iColumn + 1, "OFFSET") - NAMETAB(iColumn, "OFFSET")
            End If
    '       If the fields at the end of the record are blank, then explicitly set the value
            If iStart > Len(TABENTRY(iRow, "ENTRY")) Then
                Cells(iRow, iColumn) = Null
            Else
                Cells(iRow, iColumn) = Mid(TABENTRY(iRow, "ENTRY"), iStart, iLength)
            End If
        Next
    Next
    'Format the Columns
    Range(Cells(iStartRow, 1), Cells(iStartRow + TABENTRY.Rowcount, NAMETAB.Rowcount)).Select
    Selection.EntireColumn.AutoFit
    End Sub
    However when I run the code I get the following exception message. 'SYSTEM_FAILURE' and nothing is returned.
    Does anyone know why this is?
    Thanks,
    Mike

    You can send data from excel to the MII message listener with a simple http post.
    Message format requirments can be found here:
    [http://help.sap.com/saphelp_xmii120/helpdata/en/45/6a86ac88130dece10000000a11466f/content.htm|http://help.sap.com/saphelp_xmii120/helpdata/en/45/6a86ac88130dece10000000a11466f/content.htm]
    Edited by: Christian Libich on Aug 10, 2009 10:14 PM

  • Nobody answering my question,Please reply its very urgent???

    Hello Experts,
    I want to fecth the Supplier information from SAP server to PDM server (non sap) using RFC call.But the LFA1 have some customised fields..
    1) I want the RFC or BAPI which Gives the supplier details with customised fields in LFA1.
    2) How Can I code In the PDM server??I mean How can I call In the PDM script??
    Please send me how to write a script and code of the script??
    I know that Bapi_vendor_getdetails,but it will not give the customized LFA1..
    Please Help...
    Thanks In Advance
    Preethi

    hi,
    try fm TABLE_ENTRIES_GET_VIA_RFC
    look here
    /people/gregor.wolf3/blog/2004/09/05/access-sap-r3-from-external
    A.
    Message was edited by:
            Andreas Mann

  • FM in eCATT

    Hi all
    I am programming ABAP in eCATT. I have plant and Company code in Solution Manager from my log. Using these details, I need to find the Sales org from T001W that is available in the target system
    For this I chose the Function Modules,
    GET_TABLE_RFC,
    TABLE_ENTRIES_GET_VIA_RFC,
    RFC_GET_TABLE_ENTRIES
    But I am not aware as how to use these function modules and get my requirement out of this. Please guide me
    Thanks
    Tharani

    Is ur target a SAP system? If yes u need to create a custom function module in the target system with import parameters plant and comp code and Export parameter as Sales org. Inside this function u need to write the logic for deriving sales org from the import parameters.
    mark the function as remote enabled in the atributes tab,
    Call the function in the eCATT script as below
    CALL FUNCTION 'UR_FUNC_NAME' DEST 'RFC destination of target'
    exporting
      cocode = 0001
      plant  = 0002
    importing
      sales_org = XXXX
    If the target is not SAP then u will have to work with the middleware team and the target team to implement web services to meet ur requirement.
    -Kiran
    Message was edited by: Kiran Raorane

  • How-to extract data in chunks from one R3 to another R3 system

    Does anybody know how to extract data in chunks from one system to another? Imagine you would like to extract 1M records in chunks of 10K records, how would you do it between 2 different R3 systems? A cursor (even with hold) doesn't work
    Any suggestion appreciated
    Thanks
    Ioan

    Hi Ioan,
    I'd do it with fm : TABLE_ENTRIES_GET_VIA_RFC (with where clause-tab)
    or fm GET_TABLE_RFC (get all items)
    regards Andreas

  • Call Function with RFC  dynamic table

    Hi all
    I create a function compare TABLE_ENTRIES_GET_VIA_RFC and CTVB_COMPARE_TABLES, everything is.dynamic
    it works well but, how could i create a dynamic output parameter for table.
    the system show me that RFC and dynamic table don't work.
    i don't want line by line i would like to have the real structure inside of the Function i have everything but i can't move the data to the output parameter table .
    could somebody help ?

    Thx RE (and Mani) for the feedback.
    I think that this URL is sufficient to understand how to pass dynamic internal table via RFC function module, whatever it is input or output. This URL says to use a STRING to store the table content in XML format, via CALL TRANSFORMATION ID, and pass this string as parameter. In the calling program, we have to "decode" the XML back into abap data, Just notice that we don't need to create an XSLT, ID is sufficient.
    For any other information, open a new thread, or ask a precise question.

  • Read r/3 table tinc

    Hi Experts,
    I want to display all the incoterms present in TINC table with the description. I'm using FM TABLE_ENTRIES_GET_VIA_RFC., but the entries are coming with concatenation of all the fields in table. Please help me out and reply me. Its urgent.
    Thanks in advance.

    Hi Anoop,
    Here is the code which i'm using in webDynpro for calling RFC...
    bapiDocumentInco = repositoryInco.getFunctionTemplate("RFC_READ_TABLE").getFunction();
              if (bapiDocumentInco != null)
                   inputParameterInco=bapiDocumentInco.getImportParameterList();
                   inputParameterInco.setValue("TINC","QUERY_TABLE");
                   inputParameterInco.setValue(",","DELIMITER");
                   clientInco.execute(bapiDocumentInco);
                   Inco_table =bapiDocumentInco.getTableParameterList().getTable("DATA");
                   IPrivateTestView.IIncoTermsNode incoNode = wdContext.nodeIncoTerms();
                   IPrivateTestView.IIncoTermsElement incoElement;
                   incoElement = wdContext.nodeIncoTerms().createIncoTermsElement();
                   for(int i=0;i<Inco_table.getNumRows();i++)
                        incoElement = wdContext.nodeIncoTerms().createIncoTermsElement();     
                        incoElement.setIncoValue(Inco_table.getString("<String_Name>"));     
                        incoNode.addElement(incoElement);     
                        Inco_table.nextRow();
    Regards,
    Ali

  • Sample code in ASP to connect SAP?

    Hello,
    Can Anyone give me ASP(VBScript) sample code to connect to R/3?
    Not Visual basic!
    I appreciate that

    Hi Durairaj,
    Ignore the previous question.
    I read some doucument. I was able to pass parameters how to do it.
    Could you check the following which added to the example?
    set myfunc = fns.add("TABLE_ENTRIES_GET_VIA_RFC")
    Dim t_parameter1
    Dim t_parameter2
    Dim t_parameter3
    set t_parameter1 = myfunc.exports("LANGU")
    set t_parameter2 = myfunc.exports("ONLY")
    set t_parameter3 = myfunc.exports("TABNAME")
    t_parameter1.Value = "E"
    t_parameter2.Value = ""
    t_parameter3.Value = "USR01"
    result = myfunc.Call
    the_exception = myfunc.exception
    dim users
    if result = true then
       set NAMETAB = myfunc.Tables("NAMETAB")
       set TABENTRY = myfunc.Tables("TABENTRY")
       response.write "<table border=1>"
       response.write "<tr>"
       for each row in NAMETAB.rows
          response.write "<td>"
          response.write trim(row("FIELDNAME"))
       next
       response.write "</td>"
       response.write "</tr>"
       response.write "</table>"
    Question about set myfunc = fns.add("TABLE_ENTRIES_GET_VIA_RFC")
    When I use this TABLE_ENTRIES_GET_VIA_RFC, I can get some data from table R/3 System. But I couldn't get data from tables.
    For example, table USR01(works fine), USR02 - not work
    is there any range or limitation to use TABLE_ENTRIES_GET_VIA_RFC?
    Thanks
    --Austin
    Thanks

  • File-XI-COND_A02

    I was told to use COND_A02 Idoc for posting Purchasing cost conditions. The Sender System will not be able to provide VKORG( Sales organization ) and VTWEG ( Distribution channel ) but the the destination system will have this data based on Material Number from table MVKE. What should I do to post the standard idoc COND_A02. How do I get VKORG and VTWEG into XI before using receiver IDOC adapter to post COND_A02 in R3 System?
    Please help

    Hi,
    Take a look at the blogs I have given in my previous post.
    Also take a look at this document.,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-code-samples/xi mapping lookups rfc api.pdf
    You can use either a JCO call or an RFC Lookup to get the data out of your R3 system. If you are using an RFC Lookup, you will use a RFC Communication channel for this purpose.
    If your data is available in some R3 table, then you can use the standard RFC .. TABLE_ENTRIES_GET_VIA_RFC.
    Regards,
    Bhavesh

Maybe you are looking for

  • Combined pdf files with garbage fonts

    I need help with creating a combined pdf document.  I start with word 2013, and use the styles to create a linked table of contents.  Then Save As to a pdf.  I deselect the Options to allow the links to work in the pdf format.  Then I add other pdf's

  • How to get a new ipod with ipod's warranty

    My ipod nano is a total loss. The screen is totally unfanctuanal. Its a Technical problem. What are the steps to get a new ipod with the warranty?

  • Event entered on iPhone not making it to mobileme and iCal

    Since the 2.1 update, events entered in my iphone are not making it to mobileme or my laptop. Nor is it going the other way (laptop to me and iphone.) Any suggestions appreciated.

  • Disappearing content in glyphs panel

    I am using InDesign CS3 and make huge use of the Glyphs panel for accented characters in French, Spanish, etc. Yesterday I opened this panel to convert some French and to my dismay found no glyphs in the display at all, and all the commands blanked o

  • How to play you own movies on i PAD2

    peoeple i cant seem to sync my own movies from my hardrive or etc. please if you know how and if it is possible assist