09-22-2008 11:11 AM
Hi Experts,
I have written a Se38 progarm to execute a remote function module, so as to send some data out of the system. The receiving system is an XI system. Pls see below the code and the load at the XI end, I donno why and what mistake am I doing in the se38 program part, as a result of which, only part of the data is getting send to XI.
REPORT ZRFC_ADAPTER.
Data: it_final1 type standard table of zrfc_str with header line .
it_final1-NAME = 'ARNAB'.
it_final1-ADDRESS = 'ADDRESS'.
it_final1-EMAIL = 'EMAIL'.
it_final1-ID = 'ID'.
CALL FUNCTION 'ZRFC_XI'
IN BACKGROUND TASK DESTINATION
'R32XIRFC'
EXPORTING
username = sy-uname
tables
it_final = it_final1 .
break-point.
COMMIT WORK.
Clear it_final1.
I have seen in debugging mode, after removing the "
IN BACKGROUND TASK DESTINATION
'R32XIRFC'", that the internal table " it_final1 " is working fine......
The structure used in remote Function Module is
IT_FINAL LIKE ZRFC_STR -- in tables parameter. and the structure of ZRFC_STR is as follows!
NAME ZNAME CHAR 14
ADDRESS ZADDRESS CHAR 40
TELEPHONE ZTEL CHAR 20
EMAIL ZEMAIL CHAR 40
ID ZID CHAR 10
Note that , apart from a COMMIT WORK statement, there is no other coding done in the SOURCE CODE part of the remote Function Module.
The load in XI is showing as
<?xml version="1.0" encoding="UTF-8" ?>
<rfc:ZRFC_XI xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<USERNAME>RETAILDEV</USERNAME>
<IT_FINAL>
<item>
<NAME>ARNAB</NAME>
<ADDRESS>EMAIL</ADDRESS>
<EMAIL />
<ID />
</item>
</IT_FINAL>
</rfc:ZRFC_XI>
Note that EMAIL is actually a content of field EMAIL and not ADDRESS. But I donno why, it is behaving like this,,
Pls note, this RFC has been imported completely in integration repository of XI, so we dont have to worry about any settings change or activities, left pending in XI.
I am very sure, something is missing in the se38 code, pls suggest!!
Regards,
Arnab .
09-22-2008 11:57 AM
Hi Arnab,
If I am not wrong it looks like you are not passing the data properly.
it_final1-NAME = 'ARNAB'.
it_final1-ADDRESS = 'ADDRESS'.
it_final1-EMAIL = 'EMAIL'.
it_final1-ID = 'ID'.
In this you are passing EMAIL as Text and not content. That means if you have the data in EMAIL field then it should be
it_final1-EMAIL = EMAIL similarly for Address as well.
Thanks & Regards,
Nagaraj Kalbavi
09-22-2008 12:53 PM
No No u got me wrong, initially i wanted to send the 'EMAIL' word as text.....it didnt reach!!!!
09-22-2008 1:16 PM
Hi,
Did you forget to append internam Table,
it_final1-NAME = 'ARNAB'.
it_final1-ADDRESS = 'ADDRESS'.
it_final1-EMAIL = 'EMAIL'.
it_final1-ID = 'ID'.
Append it_final1. -> Missing
I am not sure just check again.
Thanks & Regards,
Nagaraj Kalbavi
09-22-2008 3:56 PM
Rewarded u some points for the same as it was a gud observation, unfortunately, I missed out to copy paste the part in sdn, the orginal code in se38, contains the append it_final1, and the problem still persists!!
Regards,
arnab.
09-22-2008 6:27 PM
Hi Arnab
I think the data is not populating into the internal table because append statement is missing. You are populating only the Header of it_final1.
it_final1-NAME = 'ARNAB'.
it_final1-ADDRESS = 'ADDRESS'.
it_final1-EMAIL = 'EMAIL'.
it_final1-ID = 'ID'.
append it_final1.
Regards
Meshack Appikatla
09-22-2008 8:16 PM
Hi Arnab,
I am having really doubt that there is problem in field mapping.
COuld you please check the following.
In the FM structure contains 5 fields as follows,
NAME ZNAME CHAR 14
ADDRESS ZADDRESS CHAR 40
TELEPHONE ZTEL CHAR 20
EMAIL ZEMAIL CHAR 40
ID ZID CHAR 10
In the Internal Table it has got 4 fields. Check the Mapping properly
and data on each field.
t_final1-NAME = 'ARNAB'.
it_final1-ADDRESS = 'ADDRESS'.
it_final1-EMAIL = 'EMAIL'.
it_final1-ID = 'ID'.
Thanks & Regards,
Nagaraj Kalbavi
09-23-2008 6:28 AM
Nagaraj,
I agree with you, but then , whatever may be the nos of fields in the existing structure, the hard coded values must get populated in respective fields, even if I keep the field empty......what do u say??
I wonder, when i can see in debugging mode , the data is getting properly populated, why is it that I cannot see the same in XI, only fragmented, disoriented data
Arnab