on 07-23-2008 4:07 PM
Hello,
I´m quite new in xMII.
I tried the function module with a table.
I set an OPTION and 2 FIELDS. In SAP it worked. I get an entry for DATA/WA.
When i try this in MII and put a tracer to the response of the JCO/RFC_READ_TABLE/TABLES/DATA/item/WA there is no return!
For Request-Input I use the tablename in QUERY_TABLE and a xml-document with two rows for the FIELDS. Is this right? How can I tell the function module to use 2 entries in FIELDS (e.g. ARBPL and SUBSYS).
Thanks,
Martin
Hi,
You go through the following threads:
https://forums.sdn.sap.com/click.jspa?searchID=14446038&messageID=5787244
https://forums.sdn.sap.com/click.jspa?searchID=14446038&messageID=5321255
Also search in Forum as RFC_READ_TABLE. You will get lots of thredas which may help you.
Thanks,
Manisha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot for the hints...appreciate it.
I did it like explained.
See example:
SAPJCOInterface_0.Request{/RFC_READ_TABLE/INPUT/QUERY_TABLE} = "AFRU"
SAPJCOInterface_0.Request{/RFC_READ_TABLE/TABLES/OPTIONS/item/TEXT} = "RUECK EQ '0000181547'"
SAPJCOInterface_0.Request{/RFC_READ_TABLE/TABLES/FIELDS} = Local.FIELDS{/FIELDS} (Assign xml)
The local FIELDS xml:
<?xml version="1.0" encoding="UTF-8"?><FIELDS><item><FIELDNAME>AUFNR</FIELDNAME><OFFSET/><LENGTH/><TYPE/><FIELDTEXT/></item><item><FIELDNAME>VORNR</FIELDNAME><OFFSET/><LENGTH/><TYPE/><FIELDTEXT/></item></FIELDS>
After the JCO I used a Tracer to see my return:
Tracer_0.Message = SAPJCOInterface_0.Response{/RFC_READ_TABLE/TABLES/DATA/item/WA}
But there is nothing shown. It keeps empty. But with these inputs, the RFC_READ_TABLE in SAP is working.
Martin,
There are a couple items to check.
First in the JCo action block Configure Object window, do you have Execute Function checked?
Second, go into SAP and use transaction se37, single test to execute your BAPI outside of xmii. See what results you get there first. Once successful there, try to repeat it inside xMII.
You may also want to try to use an order number rather than RUECK (Batch?) for your initial testing.
I would also suggest that your tracer bring back the whole response segment rather than just the WA results. If you are generating an error while executing, it will provide more information on the error in the RETURN segment.
Good luck,
Mike
Edited by: Michael Appleby on Jul 24, 2008 1:47 PM
Hi!
The Execute Function is checked and i tried it in SAP and it worked. There is exact one output.
I just used the example from other threads which worked.
Tracer_0.Message = SAPJCOInterface_0.Response
But the result is this:
[INFO ]: <?xml version="1.0" encoding="UTF-8"?><RFC_READ_TABLE>
<INPUT><DELIMITER>S</DELIMITER><NO_DATA>S</NO_DATA><QUERY_TABLE>AFRU</QUERY_TABLE><ROWCOUNT>0</ROWCOUNT><ROWSKIPS>0</ROWSKIPS></INPUT>
<TABLES><DATA><item><WA/></item></DATA><FIELDS><item><FIELDNAME>AUFNR</FIELDNAME><OFFSET>000000</OFFSET><LENGTH>000012</LENGTH><TYPE>C</TYPE><FIELDTEXT>Order Number</FIELDTEXT></item><item><FIELDNAME>VORNR</FIELDNAME><OFFSET>000013</OFFSET><LENGTH>000004</LENGTH><TYPE>C</TYPE><FIELDTEXT>Operation/Activity Number</FIELDTEXT></item></FIELDS><OPTIONS><item><TEXT>RUECK EQ '0000181547'</TEXT></item></OPTIONS></TABLES>
</RFC_READ_TABLE>
Still no entry in the WA section.
Try removing the S from DELIMITER and from NO_DATA. That is the only difference I can see between your output and mine. You may also want to post the Request segment so we can see what differences there are between us there.
Update: That is definitely the problem.
Mike
Edited by: Michael Appleby on Jul 24, 2008 2:09 PM
Martin,
I tried it with SPACE as the inputs to both those fields and just like you it returns empty WA segment. Without those inputs, I have a good dataset returned.
One more thing to try:
Go into the link editor for the JCo.
Highlight DELIMITER and select link type of Remove XML and hit update.
Note: You should now see "<<REMOVE>>" in the expression editor.
do the same for NO_DATA and rerun your transaction.
Good luck,
Mike
It´s also working with the assigned xml and the REMOVE.
SAPJCOInterface_0.Request{/RFC_READ_TABLE} = Local.Request{/RFC_READ_TABLE}
SAPJCOInterface_0.Request{/RFC_READ_TABLE/INPUT/DELIMITER} =
Don´t be confused by different data...but it´s the same structure.
It´s not working with the same input like in the other threads.
Then it automatically sets SPACE to DELIMITER and NO_DATA.
Very strange.
But thanks for the help...
Martin
But one more Question:
In the old transaction i got
SAPJCOInterface_0.Request{/RFC_READ_TABLE/TABLES/OPTIONS/item/TEXT} = "OBJTY = 'A ' AND ARBPL <> ' ' AND SUBSYS <> ' ' AND WERKS = '" & Transaction.Plant & "'"
How can i define in my new xml-document (which i´m now using for the Request) that the WERKS should be taken from the Transaction???
I mean i don´t want to tell him that it´s QM00 but that it´s take from Transaction.Plant
Edited by: Martin Zipp on Jul 24, 2008 2:58 PM
Edited by: Martin Zipp on Jul 24, 2008 2:59 PM
Hi Martin,
You have your xml in a Local (or perhaps Transaction) property. Prior to mapping the xml to the JCo Request segment, you can modify it with an assignment block. Since the rest of that Text segment is fixed, you can assign the fixed and dynamic at the same time. Or you can do a search and replace in the expression. Or you can break it into several separate item segments under Options and bolt on the plant number in a separate segment with a link type of Append XML. The expression would look like:
"And WERKS = "& singlequote &Transaction.Plant & singlequote
Then once you have your xml correctly built, apply it to your JCo action block.
If any of the options need more detail to be understood, let me know and I can provide some sample code or more details.
Good luck,
Mike
Hi Martin,
Welcome to the boards. The first thing I will point out is that order numbers, material numbers, batch numbers, etc. all must have their full and complete number when using this BAPI. In other words, if you have an order number like 10007098 then you need to pass it as 000010007098. SAP will not recognize it properly without its leading zeroes. Second, use GT, GE, LT, EQ instead of >, >=, <, and =. SAP sometimes interprets the operators correctly and sometimes, especially with more complex where clauses, it does not.
The second suggestion is that you do a search on RFC_READ_TABLE for this forum. There have been several message threads involving this topic and some very good insights have been presented. If you run into any specific problems, come and post again.
Good luck,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Martin,
Did you try searching the forum? There are plenty of posts on this.
This thread would be helpful for you:
https://forums.sdn.sap.com/click.jspa?searchID=14412488&messageID=5751160
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
6 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.