cancel
Showing results for 
Search instead for 
Did you mean: 

RFC_READ_TABLE Bapi issue- limitations?

Former Member
0 Kudos

hi all,

I have a query on the limitations of the standard Bapi RFC_READ_TABLE.
I am trying to read data from the table AFKO (Process order Header table) using RFC_READ_TABLE from SAP MII through BLS.

I am passing  the,

RFC_READ_TABLE.Request{/RFC_READ_TABLE/INPUT/QUERY_TABLE} as AFKO

RFC_READ_TABLE.Request{/RFC_READ_TABLE/INPUT/DELIMITER} as ","

RFC_READ_TABLE.Request{/RFC_READ_TABLE/TABLES/OPTIONS} as

<?xml version="1.0" encoding="UTF-8"?><OPTIONS>

    <item>

<TEXT>SFCPF IN ('ZPAS') AND AUFNR IN ('000082023648','000000306116','000082023649','000000306117')</TEXT>

</item>

</OPTIONS>

RFC_READ_TABLE.Request{/RFC_READ_TABLE/TABLES/FIELDS} as

<xml version="1.0" encoding="UTF-8"?><FIELDS>

    <item>

<FIELDNAME>AUFPL</FIELDNAME>

<OFFSET>000000</OFFSET>

<LENGTH>000010</LENGTH>

<TYPE/>

<FIELDTEXT/>

</item>

    <item>

<FIELDNAME>GAMNG</FIELDNAME>

<OFFSET>000000</OFFSET>

<LENGTH>000013</LENGTH>

<TYPE/>

<FIELDTEXT/>

</item>

    <item>

<FIELDNAME>PLNBEZ</FIELDNAME>

<OFFSET>000000</OFFSET>

<LENGTH>000018</LENGTH>

<TYPE/>

<FIELDTEXT/>

</item>

</FIELDS>

RFC_READ_TABLE.Request{/RFC_READ_TABLE/TABLES/RowCount} as 100

I get the below error:

[ERROR] Unable to make RFC call Exception: [A condition specified dynamically has an unexpected format.]

If I change the

RFC_READ_TABLE.Request{/RFC_READ_TABLE/TABLES/OPTIONS} to

<?xml version="1.0" encoding="UTF-8"?><OPTIONS>

    <item>

<TEXT>SFCPF IN ('ZPAS') AND AUFNR IN ('000082023648','000000306116')</TEXT>

</item>

</OPTIONS>

It works fine.

Please assist on what exactly can be the issue for this error. Same is the scenario for other tables like MARC, AFPO, MAKT as well.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi christian,

Thanks for your reply.

I broke my where clause into below to ways:

1st option:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><OPTIONS>
<item>
<TEXT>SFCPF IN ('ZPAS') AND AUFNR IN ('000082023649')</TEXT>
<TEXT>SFCPF IN ('ZPAS') AND AUFNR IN ('000082023648')</TEXT>
</item>


</OPTIONS>

This gives me outpuit for only PO: '000082023648', whereas ECC has detials for both the PO.

2nd Option:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><OPTIONS>
<item>
<TEXT>SFCPF IN ('ZPAS') AND AUFNR IN ('000082023649')</TEXT>

</item>

<item>
<TEXT>SFCPF IN ('ZPAS') AND AUFNR IN ('000082023648')</TEXT>
</item>


</OPTIONS>

This gives the error that the data structure is not defined correctly.

Kindly suggest.

former_member185280
Active Contributor
0 Kudos

Alisha,


It looks like you are fairly new to the MII space. If so I would recommend you take some time to go thru all the MII related blogs, documents and wiki available on the scn.

Regards,
Christian

Former Member
0 Kudos

Hi Christian,

No I m not new to mii.

But ya I am calling rfc_read_table from mii for the first time.

If u can help great else thanks for ur time

former_member185280
Active Contributor
0 Kudos

Your xml format in the 2nd option looks correct but your options values will be combined by R3 into one where clause statement so you have to adjust the values you have accordingly.

Regards,
Christian

Former Member
0 Kudos

hi christian,

It worked. thank you for your help.

former_member185280
Active Contributor
0 Kudos

Your welcome. Please mark your questions as answered. It helps those searching after you for similar issues.

Regards,
Christian

former_member185280
Active Contributor
0 Kudos

I think TEXT in the OPTIONS table has a max length of 72 so you may have to break up your options into multiple rows.

Regards,
Christian