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

Function RFC_GET_TABLE_ENTRIES

Former Member
0 Likes
7,393

Someone could help me use this function?

How do you get "WHERE"?

call function 'RFC_GET_TABLE_ENTRIES'

destination rfc

exporting

BYPASS_BUFFER = ?

FROM_KEY = ?

gen_key = ?

MAX_ENTRIES = 10

table_name = 'QALS'

TO_KEY = ?

IMPORTING

NUMBER_OF_ENTRIES = ?

tables

entries = T_RETURN

exceptions

internal_error = 1

table_empty = 2

table_not_found = 3

others = 4.

12 REPLIES 12
Read only

uwe_schieferstein
Active Contributor
0 Likes
3,005

Hello Carlos

You are probably looking for another function module: TABLE_ENTRIES_GET_VIA_RFC

Here you can define the WHERE condition using the TABLES parameter SEL_TAB.

Example:


      CONCATENATE 'MATNR = ''' IV_MAT_NUMBER '''' INTO LT_SEL_TAB.
      APPEND LT_SEL_TAB TO LT_SEL_TAB.

      CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'
        DESTINATION
          IV_RFC_DEST
        EXPORTING
          LANGU                     = SY-LANGU
          TABNAME                   = 'MARA'
        TABLES
          SEL_TAB                   = LT_SEL_TAB
          NAMETAB                   = LT_NAMETAB
          TABENTRY                  = LT_TABENTRY
        EXCEPTIONS
          COMMUNICATION_FAILURE     = 1 MESSAGE LV_MSG_TEXT
          SYSTEM_FAILURE            = 2 MESSAGE LV_MSG_TEXT
          INTERNAL_ERROR            = 3
          TABLE_HAS_NO_FIELDS       = 4
          TABLE_NOT_ACTIV           = 5
          NOT_AUTHORIZED            = 6
          OTHERS                    = 7.

Regards

Uwe

Read only

Former Member
0 Likes
3,005

Generating this dump. Tell when the structure of the table executed normally, but if I do not tell returns an error.

What I am ranch's wrong?

Thank you for your attention!

Read only

Former Member
0 Likes
3,005

If the structure of the table is informed executed normally, but if I do not, generates a dump.

Where this the problem?

Thank you for your attention!

Read only

0 Likes
3,005

Hello Carlos

If you run the function module locally with TABNAME = ' ' you will raise an exception (either due to missing authorizations or that the table was not found).

Calling the fm via RFC results in a dump if you do not handle the exceptions.

However, even though TABNAME has a default value (= ' ') it is a mandatory parameter for this function module.

Regards

Uwe

Read only

Former Member
0 Likes
3,005

I am running on SE37, the parameters are: LANGU = "PT", ONLY = '', TABNAME = 'PROJ'.

And shows the following message:

"UNICODE_TYPES_NOT_CONVERTIBLE

The types of operands "dbtab" and "itab" cannot be converted into one another.

Error in the ABAP Application Program

The current ABAP program "SAPLBDCH" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

In a Unicode system, the type of the operand "dbtab" must be convertible

into that of the operand "itab" for the statement "SELECT * FROM dbtab INTO

TABLE itab". Regardless of the

length of a Unicode character, both operands must have the same structure layout.

In this case, this condition has not been met."

Read only

0 Likes
3,005

Hello Carlos

Apparently your remote system is a Unicode system.

Thus, you cannot use fm TABLE_ENTRIES_GET_VIA_RFC to read table entries on the UC-system because the TABLES parameter TABENTRY has line structure BDI_ENTRY (unstructured Char2048) which is - on a Unicode system - not convertible into the DB table structure.

For more details please refer to: [ABAP and Unicode|http://help.sap.com/saphelp_nw04/helpdata/en/62/3f2cadb35311d5993800508b6b8b11/content.htm]

Regards,

Uwe

Read only

Former Member
0 Likes
3,005

You have another alternative?

Read only

0 Likes
3,005

Check note 886640.

Rob

Read only

Former Member
0 Likes
3,005

Hi, Carlos

Try this

l_tab =<TableName>.

CONCATENATE 'NUM_RESERVA' '=' '''' INTO wa_i_opt-text SEPARATED BY ' '.

CONCATENATE wa_i_opt-text guid_string ''''

INTO wa_i_opt-text.

APPEND wa_i_opt TO i_opt.

CLEAR wa_i_opt.

wa_i_fld-fieldname = 'TIPO_DOC'.

wa_i_fld-offset = '000000'.

wa_i_fld-length = '000006'.

APPEND wa_i_fld TO i_fld.

CLEAR wa_i_fld.

CALL FUNCTION 'RFC_READ_TABLE' DESTINATION lc_rfc_dest_crm

EXPORTING

query_table = l_tab

TABLES

OPTIONS = i_opt

fields = i_fld

data = i_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.

But be careful that the function is not oficial release

Hope it help's

Regards

Jaime

Read only

Former Member
0 Likes
3,005

I am running on SE37 the function RFC_READ_TABLE, with the parameters:

QUERY_TABLE = 'QALS'

DELIMITER = '|'

NO_DATA = ' '

ROWSKIPS = '0'

ROWCOUNT = '0'

OPTIONS = PRUEFLOS = '010000000054'

FIELDS = 'OBJNR'

And shows the following message:

"ASSIGN_BASE_WRONG_ALIGNMENT

Error in the ABAP Application Program

The current ABAP program "SAPLSDTX" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

In the current program "SAPLSDTX", an error occurred when setting the

field symbol "<WA>" with ASSIGN or ASSIGNING (maybe in the combination with

the CASTING addition).

When converting the base entry of the field symbol "<WA>" (number in base

table: 34136), it was found that the target type requests a memory

alignment of 8.

However, the source data object has an invalid memory alignment, that is

an alignment not divisible by 8."

Read only

0 Likes
3,005

Did you look at the note I suggested?

Rob

Read only

Former Member
0 Likes
3,005

The notes were all applied ...