Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to read specific fields from EKKO table by using RFC_READ_TABLE

Former Member
0 Likes
2,435

Hi All,

Can any one send me the code for to retrieve specific field(EBELN) from EKKO table by using RFC_READ_TABLE. When I tried with RFC_READ_TABLE i got DATA_BUFFER_EXCEPTION.

Please suggest the correct code.

Regards,

Rajesh.

Hi All,

Can any one send me the code for to retrieve specific field(EBELN) from EKKO table by using RFC_READ_TABLE. When I tried with RFC_READ_TABLE i got DATA_BUFFER_EXCEPTION.

Please suggest the correct code.

Regards,

Rajesh.

6 REPLIES 6
Read only

Former Member
0 Likes
1,296

Hi

That fm store the data in an internal table with a string field long 512 char, if the table you need to read has a structure longer than 512 char that error message is raised.

So if you don't need to read whole EKKO, you should specify which field you need to read. If you need to read all EKKO you can apply the note 758278, here it's explained how to create a new fm using a buffer long 4000 char

Max

Read only

andreas_mann3
Active Contributor
0 Likes
1,296

Hi,

use fm TABLE_ENTRIES_GET_VIA_RFC

*

fil  wheretab 
  refresh wtab.
  name = 'EKKO'.

    concatenate 'EBELN = ' key-ebeln into wtab-zeile
            separated by space.

  append wtab.

  CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
     destination dest
    EXPORTING
      LANGU                     = SY-LANGU
      TABNAME                   = name
    TABLES
      SEL_TAB                   = wtab
*   NAMETAB                   =
      TABENTRY                  = tab
   EXCEPTIONS
     INTERNAL_ERROR            = 1
     TABLE_HAS_NO_FIELDS       = 2
     TABLE_NOT_ACTIV           = 3
     NOT_AUTHORIZED            = 4
     OTHERS                    = 5 .

A.

Read only

0 Likes
1,296

Hi max,

My requirement is like this, I want only 10 or 15 fields from ekko table by uing the fm RFC_READ_TABLE. Please send me code as early as possible.

Regards,

Rajesh.

Read only

Former Member
0 Likes
1,296

Hi Rajesh,

Pass the name of the fields you want from EKKO in table FIELDS (a parameter of FM)

Eg:

data: it_fields type RFC_DB_FLD occurs 0 with header line.

it_fields-fieldname = 'EBELN'.

append it_fields.

CALL FUNCTION 'RFC_READ_TABLE'

EXPORTING

QUERY_TABLE = 'EKKO'

  • DELIMITER = ' '

  • NO_DATA = ' '

  • ROWSKIPS = 0

  • ROWCOUNT = 0

TABLES

OPTIONS = it_option

FIELDS = it_fields

DATA = it_data

  • 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

.

Regards,

Vaibhav

Message was edited by:

Vaibhav Modi

Read only

0 Likes
1,296

Hi vaibhav,

But we are passing EKKO Table in JCO CODE NOT IN ABAP,

Please can you send the JCO CODE for this.

When I am passing ZSTU(user defined table contains 4 fields) to RFC_READ_TABLE.

I am getting the result. But when I tried with EKKO(contains 78 fields) I got DATA_BUFFER_EXCEED Exception occur.

Please send me the JCO CODE as early as possible.

Regards,

Rajesh.

Read only

Former Member
0 Likes
1,296

Hi,

Also please tell me about how to declare DATA & OPTIONS tab. Am getting the error.

Thanks

Dan