Skip to Content
author's profile photo Former Member
Former Member

Query only specific fields of a table

Hi!

I use "RFC_READ_TABLE" to query SAP tables (via JCO). Now I have to get only 2 fields of a table. Therefor I use the following code:

JCO.Table jcoTab = jcoParamTab.getTable("FIELDS");

jcoTab.appendRow();

jcoTab.setValue("ARC_DOC_ID", "FIELDNAME");

jcoTab.appendRow();

jcoTab.setValue("OBJECT_ID", "FIELDNAME");

If I execute a function with this parameters I get a table (#0) with only 1 field! I find it circuitous to parse through the String, using the table #1.

Is there a better / more elegant way?

I would be very grateful if anybody can help me.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2004 at 04:56 PM

    OK, I tried the "non-elegant" way. But the next funny thing is:

    I get a table with the design of my result table. Within this design table, there are information about the fields (name, offset, length, type). So I used this information to parse through my result. But what if e.g. field nr. 1 doesn't fill the defined length? SAP cuts the String off!

    Nothing is documented!

    This function is bulls***.

    Message was edited by: Telamon

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.