RFC return table
Hi,
I have created RFC function module with import, export and return parameters.
How can we display multiple error messages in Return table.
I am getting only one error message in return table.
Can you please reply for this. as I need to deliver it today.
thanks&Regards
Rama Devi
I think within ur FM for each validation ur checking the sy-subrc value and if it not euals to 0 u r populating the Return table and exit from FM. If i am correct then pl. remove the exit statement and use a flag and set this flag when an error occurs.Finally check the flag value and based on that do the final processing.
Ex:
FUNCTION 'XXXX'.
if val1 is initial.
l_error = 'X'.
i_return-msgty = 'E'.
i_return-text = 'Error message'.
append i_return.
endif.
if val2 is initial.
l_error = 'X'.
i_return-msgty = 'E'.
i_return-text = 'Error message'.
append i_return.
endif.
if l_error is initial.
do final processing.
endif.
ENDFUNCTION.
Regards,
Joy.
Similar Messages
-
RFC Lookup - Best Approach To Parse Returned Tables
Hi Everyone,
We are doing some RFC Lookups at a header node that are returning tables for all of the items (for performance reasons). I am trying to figure out what the best way to extract the values from the table, which is most of time has more than 1 key column. At the moment I am doing this through DOM, but I have also heard about using arrays, and have even seen an example of using a hashtables with all of the values concatenated together to later parse out using substrings. I'm looking for the best approach to:
1) Store this data as some kind of global object to lookup during the header
2) Search and Parse from the global object during linte items.
As an example, I have the following lines in my table:
Key1,Key2,Value1,Value2,Value3
A,A,1,2,3
A,B,1,2,4
A,C,3,4,2
B,A,2,4,6
And during line item processing I may want to find the value for Key1=A, Key2=C.
Thanks
PeterHi Peter,
Please take a look at these...
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-code-samples/xi%20mapping%20lookups%20rfc%20api.pdf
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
cheers,
Prashanth
P.S Please mark helpful answers -
Web Service XML Changes Return Table Field Names
I am writing a Web service to return a employee information from SAP using .Net Connector. My Webservice XML changes return table column names with few escape characters. Does anyone know why this happens? and How to prevent it?
Every column name is changed: e.g. PERS_NO to PERS_--5fNO
NCo -> 2.0
RFC- > Custom Function module
RFC Return Type -> ZFPSYNC
VS.Net -> VS Studio 2003, ( C# Web service)
Here is part of XML document:
<?xml version="1.0" encoding="utf-8" ?>
- <ArrayOfZFPSYNC xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
- <ZFPSYNC>
<PERS_5fNO>00100001</PERS_5fNO>
<PDS_5fEMPID>00054740</PDS_5fEMPID>
<SSN>001380261</SSN>
<NAME_--5fPFX />
<FIRST_5fNAME>Tuesday</FIRST_5fNAME>
<LAST_5fNAME>October</LAST_5fNAME>
<NAME_--5fSFX />
<PRIOR_5fNAME>Tuesday October</PRIOR_5fNAME>
<NICKNAME />
<CO_5fCODE>TAX</CO_5fCODE>
<CO_5fCODE_5fT>Tax LLP</CO_5fCODE_5fT>
<CO_5fCTRY>US</CO_5fCTRY>
<ORG_5fUNIT>50191687</ORG_5fUNIT>
<ORG_5fUNIT_5fT>Northeast Region Lead Tax</ORG_5fUNIT_5fT>
<EE_5fLEVEL>C1</EE_5fLEVEL>
<EE_5fLEVEL_5fT>Firm Director</EE_5fLEVEL_5fT>
<SRV_5fAREA>TAX</SRV_5fAREA>
<SRV_5fAREA_5fT>Tax</SRV_5fAREA_5fT>
<JOB_5fFAM>CS-TAX</JOB_5fFAM>
<JOB_5fFAM_5fT>CS - Tax</JOB_5fFAM_5fT>
<PER_5fAREA>BOSX</PER_5fAREA>
<PER_5fAREA_5fT>Boston-Berkeley St-TAX</PER_5fAREA_5fT>
<PER_5fADDR>200 Berkeley Street</PER_5fADDR>Please install patch from OSS note 506603. This should correct the problem.
-
Read RFC output table contents using com.sap.mw.jco.* API
Hi,
I have a requirement where I need to call an RFC in JSPDynpage component.
In doInitialization method, I wrote following code: -
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentContext myContext = request.getComponentContext();
IPortalComponentProfile myProfile = myContext.getProfile();
String sapSystem = myProfile.getProperty("SystemIdentifier");
ISystemLandscapeWrapper landscapeWrapper = (ISystemLandscapeWrapper) UMFactory.getSystemLandscapeWrappers().get(0);
ISystemLandscapeObject systemLandscapeObject = landscapeWrapper.getSystemByAlias(sapSystem);
IJCOClientService clientService = (IJCOClientService) PortalRuntime.getRuntimeResources().getService(JCO_CLIENT);
request.getNode().putValue(LOCALE_NODE_KEY, Locale.ENGLISH);
IJCOClientPoolEntry poolEntry = clientService.getJCOClientPoolEntry(sapSystem,request);
JCO.Client client = poolEntry.getJCOClient();
client.connect();
IRepository repository = JCO.createRepository("repository", client);
IFunctionTemplate functionTemplate = repository.getFunctionTemplate(Z_BAPI_EMP_GBU_GET);
JCO.Function function = new JCO.Function(functionTemplate);
JCO.ParameterList importList = function.getImportParameterList();
importList.setValue("US", "OBJTYP");
importList.setValue(request.getUser().getUniqueName(), "USRID");
client.execute(function);
Now, this RFC returns two tables.
I want to know how do I read a table and iterate over its contents to read all fields.
(Till now, I only used getString("GBU") method that just reads an export type of String parameter)
Please help.
Thanks & Regards,
AmeyAmey,
If I understood the problem correctly. A snippet will be something like
JCO.Table itemList = function.getTableParameterList().getTable("QUALIFICATION");
Vector qualItems = new Vector();
QualItemBean qualItem;
for (int i = 0; i < itemList.getNumRows(); i++) {
itemList.setRow(i);
qualItem = new QualItemBean();
qualItem.setQual(itemList.getString("TBJID").trim());
qualItem.setQualText(itemList.getString("TTEXT").trim());
qualItem.setVBDate(itemList.getString("VBEGD").trim());
qualItem.setSBDate(itemList.getString("SBEGD").trim());
qualItem.setSEDate(itemList.getString("SENDD").trim());
qualItem.setVEDate(itemList.getString("VENDD").trim());
qualItem.setProfText(itemList.getString("PROFC_TEXT").trim());
qualItems.add(qualItem);
qualBean.setQual(qualItems);
Ofcourse you need to change the variable names based on your scenario.
Thanks
Prashant -
HTTP - Xi - RFC : Handle rfc return in bpm
Hi,
I have configured receiver RFC and calling synchronous BAPI works perfectly.
Now the response message in RFC is containing results in return table and even if it's a error message the xi message is in ok status (sxmb_moni). My request is how can i force the error in sxmb_moni. I thought of adding a branch according to return type but then how to force error message when return type is A or E in return table?
Thanks,
Laurent.Hi,
Probably you could create the Smart exception with the use of UDFs based on the response return type A or E.
/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
smart sync processing exception is similar to your scenario
smart sync processing exception
No need of BPm for this..you will get this exception in SXMB_MONi as you are looking for.
Thanks
Swarup -
I am having difficulty passing tables as parameters using an RFC function defined in SE37 and an RPG ILE program running on a separate iSeries.
I have successfully passed import/export parameters, however tables are proving to be difficult.
The function builder will test with no errors, but does not pass or return tables.
A trace performed with the server side of the RFC shows the message "discarding unrequested T:" along with the table names.
Any help would be appreciated.I am using a multiple occurring data structure to define the tables.
DRFC_TABLES DS ALIGN OCCURS(3)
D TNAME * INZ(*NULL)
D TNLEN 10U 0 INZ(0)
D TTYPE 10U 0 INZ(0)
D TLENG 10U 0 INZ(0)
D TITHANDLE * INZ(*NULL)
D TITMODE * INZ(*NULL)
D TNEWITAB 10I 0 INZ(0)
I then fill occurrences 1 & 2 with the defining parameters, and occurrence 3 with *NULL in TNAME.
Then I do the following to get data, with a similar routine to send data.
C 1 occur RFC_TABLES
C EVAL TBPTR = %ADDR(TNAME)C EVAL Rcge = RfcGetData(hRfc : POINT : TBPTR) -
Facing problem for inserting the RFC return response in JDBC
Hi
Can any one share views for resulting my problem,
This is my scenrio(JDBC>RFC>JDBC) logic follows like this:
Design:
1. MT--X(request from JDBC(A))
2. MT--Y(Response to JDBC(A))
3. Defined Outbound Sync MI(Z) and given request as 'X' and response as 'Y'
4. Imported BAPI--B
5. Done MM between X and B-->request mapping(Zmap1)
6. Done MM between B.Response and Y--->response mapping(Zmap2)
7. Defined the IM between Z and B
a. Zmap1 given as request
3. Zmap2 given as response
And according to that i have confgured CCs,SA,RA,RD,ID.
It seems to be working fine..request map posting data properly in BAPI and also getting response as payload only, but it is not updating in JDBC column, which i mapped as response!it seems to be everry thing is ok..but i dint understand why it is not updating the return response in JDBC side?
Note: Here i'm not using BPM, without BPM i made synchronous.
In SxMB_MONI ..i'm getting response as E or S based on rfc return structure.
Regards
RambarkiHi,
I think there is a mistake in your messaage type to insert into JDBC. The format should be,
<MT>
<statement>
<test action="insert">
<table> </table>
</test>
<access>
<row1> </row1>
<row2> </row2>
</access>
</statement>
</MT>
Your action is an attribute of <test>.
Likewise in your case, you Message should be something like,
<root>
<statement>
<Invoice action="insert">
<table> nameoftable <table>
<access>
<f1> </f1>
<f2> </f2>
</access>
</statement>
</root>
Check out these links on the various options avaiable for the JDBC adapetr and how the action attribute can be used,
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Also, check this simple file to jdbc blog for your reference on JDBS adapter,
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
Hope this clarifies and solves a part of your problem,
Regards,
Bhavesh -
Adobe Interactive Forms displaying returned tables
can anyone help me display returned tables in adobe
interactive forms
i have an 2 adobe interactive forms, one for input
the other for output on 2 different views
the input form takes a few parameters, calls the
back end RFC and the
output form displays okay, but i just get the last
row from the table
i've tried binding 1 of the output table parameters to a drop down box and subform,the drop down box displays
one of the return parameters but will not drop down
whenever i include a subform i get a java error on
the output form with no display
i know there are several rows returned from testing the rfc inside abap workbenchHi Dennis,
To display table in Adobe forms.
Follow these steps :
1. Insert one sub furm.
2. make its type to flow content and flow direction to Table in object property.
3. Insert another subform in above sub form and makes its type to flow content and flow direction to Table row.
4.In binding tab for this subform check the checkbox for "Repeat subform for each Data Item" and in min count you can specify at a time how much rows you want to display.
5. Now place your UI Elements for Data view into this sub form.
6. format these ui elements as you required.
Run application now u can see multiple rows in adobe forms, if you have multiple elements in your table node.
Let me know the status.
Regards,
Bhavik -
Rfc return values that do not match input parameters
Hi, all.
We have File-RFC-File scenario in PI7.1
Here we have OM with request-response mappings, RFC, where we have request-response structures... Standart.
We have RFC channel and Receiver Agreement...
But when we start it.. We can send any request - RFC return the same response. And we found that this response is the same response, that we have when test Functional Module in SE37. When we change input parameters in SE37 we have another response - response when we run it from XI with another request!.
Why RFC doesn't react on input parameters?
Thanks!Is your RFC receiver pointing to the correct system?
Yes, it's fine. RFC works and return request from tables that defined in output parameters of Functional Module. But values of these output parameters correspond not for request parameters of RFC, but for parameters that we set in SE37.
Maybe it is ABAP issue, i don't know.. Maybe problem in Functional Module.
Request:
<?xml version="1.0" encoding="UTF-8" ?>
<ns1:ZO_FM_GTM xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
<PA_BEGDA>20120201</PA_BEGDA>
<PA_ENDDA>20120129</PA_ENDDA>
<PA_VIEW>1</PA_VIEW>
<PA_WERKS>
<WERKS>0010</WERKS>
</PA_WERKS>
<RB_STATUS>1</RB_STATUS>
<REPORT_XLS>1</REPORT_XLS>
<RP_BEGDA>20120201</RP_BEGDA>
<RP_ENDDA>20120207</RP_ENDDA>
<ZOT_PM100049_REPORT />
</ns1:ZO_FM_GTM>
response:
<?xml version="1.0" encoding="UTF-8" ?>
<ns1:MT_Response_Report xmlns:ns1="http:/Reports_GTM_49">
<PM_HEADER>
<STARTDATE>2011-01-01</STARTDATE>
<ENDDATE>2011-01-15</ENDDATE>
<REPTYPE>2</REPTYPE>
<PA_JOBT1 />
<PA_NAME1 />
<STARTDATE>2011-01-01</STARTDATE>
<ENDDATE>2011-01-15</ENDDATE>
<REPTYPE>2</REPTYPE>
Edited by: ChizzT on Feb 7, 2012 11:11 AM
Edited by: ChizzT on Feb 7, 2012 11:16 AM -
Hi all,
Greetings!
I am facing a probelm with return table, i.e it is adding body record and workarea record also to the data target. so, it is adding the actual record to data target including the workarea record to with the key figure and year values as zeros and spaces. I worked with Return table one or two times, but this time amazing it is adding extra record.
Please guide me..
Thanks and Regards
ChandHi Chand,
Adding extra rows is kind of strange. It must be either, the records in the data request being duplicated or the logic in the RETUN table must be messed up. If possible just have a snapshot of pseud code may be it could help analyzing the error.
Regards,
Praveen -
Problem with return table(adding extra record)
Hi,gurus,
I am facing a probelm with return table, i.e it is adding body record and workarea record also to the data target. so, it is adding the actual record to data target including the workarea record to with the key figure and year values as zeros and spaces. It's quite strange.
Please help me out, thanks a lot.Hi,
I have an ODS with the keys fields(ZPS_TXMID,ZPS_NODE,ZPS_NODE) and data fields(ZAU_C108,ZAU_C109,0PROJECT). I have to split one record from datasource to 6 records into my ODS. I'm updating ZAU_C109 with a routine with return table. Here is the code, please check it for me:
<i> data: prj like /BIC/PZPS_TXMID-PROJECT.
data: ls_icube_value like ICUBE_VALUES.
clear ls_icube_value.
select single PROJECT into prj from /BIC/PZPS_TXMID
where /BIC/ZPS_TXMID = COMM_STRUCTURE-/BIC/ZPS_TXMID.
ls_icube_value-/BIC/ZPS_TXMID = COMM_STRUCTURE-/BIC/ZPS_TXMID.
ls_icube_value-/BIC/ZAU_C108 = COMM_STRUCTURE-/BIC/ZAU_C108.
ls_icube_value-/BIC/ZPS_NODE = '1'.
ls_icube_value-/BIC/ZPS_SNODE = '0'.
ls_icube_value-PROJECT = prj.
ls_icube_value-/BIC/ZAU_C109 = COMM_STRUCTURE-/BIC/ZPS_HJHSJ.
APPEND ls_icube_value TO RESULT_TABLE.
ls_icube_value-/BIC/ZPS_NODE = '1'.
ls_icube_value-/BIC/ZPS_SNODE = '1'.
ls_icube_value-PROJECT = prj.
ls_icube_value-/BIC/ZAU_C109 = COMM_STRUCTURE-/BIC/ZPS_HPSJ.
APPEND ls_icube_value TO RESULT_TABLE.
ls_icube_value-/BIC/ZPS_NODE = '1'.
ls_icube_value-/BIC/ZPS_SNODE = '2'.
ls_icube_value-PROJECT = prj.
ls_icube_value-/BIC/ZAU_C109 = COMM_STRUCTURE-/BIC/ZAU_C101.
APPEND ls_icube_value TO RESULT_TABLE.
ls_icube_value-/BIC/ZPS_NODE = '2'.
ls_icube_value-/BIC/ZPS_SNODE = '0'.
ls_icube_value-PROJECT = prj.
ls_icube_value-/BIC/ZAU_C109 = COMM_STRUCTURE-/BIC/ZPS_TJHSJ.
APPEND ls_icube_value TO RESULT_TABLE.
ls_icube_value-/BIC/ZPS_NODE = '2'.
ls_icube_value-/BIC/ZPS_SNODE = '1'.
ls_icube_value-PROJECT = prj.
ls_icube_value-/BIC/ZAU_C109 = COMM_STRUCTURE-/BIC/ZPS_TDSJ.
APPEND ls_icube_value TO RESULT_TABLE.
ls_icube_value-/BIC/ZPS_NODE = '2'.
ls_icube_value-/BIC/ZPS_SNODE = '2'.
ls_icube_value-PROJECT = prj.
ls_icube_value-/BIC/ZAU_C109 = COMM_STRUCTURE-/BIC/ZAU_C102.
APPEND ls_icube_value TO RESULT_TABLE.
ABORT = 0.</i>
After loading, I checked the contents of ODS, there are 6 records(0project, ZAU_C108 are blank, other fields are correct) + 1 more record(ZPS_TXMID,0project, ZAU_C108 are correct, other fields are blank), what I expect is only 6 records with all fields being filled properly, no blanks, no extra records. Is it strange? or am I doing sth. wrong?
Your help is appreciated. -
Currency unit in return tables
Hi @ all,
I'm working with a return table in the update rules to calculate a key figure. Is it possible, that the currency unit of the key figure is not filled automatically? The currency units in source system and target system are the same.
Thank you for your help!
ClemensHallo Clemens,
yes, you're right; are you sure as well to not have more COMP_CODES then 0009 and 0010?
perhaps it would be wiser to lookup the comp_code-currency from the master data of 0COMP_CODE (0CURRENCY is one of its attributes) in order to avoid having it empty and always hardcode it... This is of course if you want to derive the company code currency...
hope this helps....
let us know if you question is answered by closing the thread!
Olivier. -
Return Table empty in Web Service response
Hi All,
My Question is more of related to Web Service. I have created a Web Service from ABAP for BAPI_PO_GETDETAIL. This BAPI is working fine in R/3.
I am using this particular Web Service in Adobe Form (using only ADOBE LIVECYCLE Designer). It's is working fine If i pass the correct Data(Purchase order no.) I'll get the O/p. In case I put a wrong PO number I am not getting the values in return Table in response. (If i test the BAPI in R/3 i m getting a message in Return table that PO no. doesn't exist)
Any Help will be appreciated.
PS; I m using Adobe liveCycle designer 7.1 and Acrobat Professional 9.
Regards,
SachinHi,
It is sufficient to make changes in the WebService Definition.
I communicated wrong entries, do make changes like: follow the previous steps and goto the se80 to respective webservice and do make changes in both External View and Internal View, as when you go into these views you'll find under some node "Input" and "Output", here need to do changes in tables present in the "input" and "output" as when you go into "input" or "output" to a respective table there you'll find two sections "External" and "Abap" do edit in Section "External" as Check the checkbox "Exposed" and Uncheck the checkbox "Optional" also "Min Occurr" should be "1" and "Max occurr" should be unbounded.
Make sure in the Adobe Form, for the button which you are calling the webservice, goto the object pallette of that button and goto execute tab and there check the checkbox "Re-merge form data" or if you are invoking the webservice through scripting then you make change the script like"......execute(1)...".
Regards
Pradeep Goli -
JCo issue - return table is null
Hi,
I am trying to read the return table from a function module using
JCoParameterList jplExport = function.getTableParameterList();
This works fine in the development environment, however in QA I am getting jplExport as null.
I have debugged it in QA using an external debugger and the return table has rows.
We have also ruled out the possibility of it being a authorization issue after checking with the security team.
I have debugged the FM using the JCo user and it has the return table, also if I run it from within SAP GUI it returns values in the return table.
To re-iterate the same code works fine in Dev.
In QA the import is good as I can see the values in the return table.
I am unable to understand what the issue is here. Why will it return null inspite of having values ?
Please suggest.
Thanks,
Veena.Hi Veena,
-> Check if you can call any other function modules in the QA environment. If not, something is wrong with JCo configuration.
->Do you see any differences in function modules signatures from Dev and QA?
Cheers,
~kranthi -
Sort/filter datablock based on procedure that return table type
Hi All,
I’ve got datablock based on procedure that return table type. In the form I have to provide ‘filter and sort records’ functionality. Previously, using tables/views based datablocks, I’ve done that by using:
-- filter
SET_BLOCK_PROPERTY (L_BLOCK_NAME, DEFAULT_WHERE, L_WHERE_CLAUSE);
-- sort
SET_BLOCK_PROPERTY(L_BLOCK_NAME ,ORDER_BY, L_ORDER_BY_CLAUSE);
-- and then
EXECUTE_QUERY;
It doesn’t work with procedure that return table type. How I can do that?
BartekI agree with Andreas, from the sample you have given us, I don't see any reason why you could not merge these queries into a single UNION/UNION ALL query. Also, I would add your summation query to your main query to eliminate this extra step. The result would look something like:
SELECT DISTINCT
pih.id
,d.document_id
,pih.doc_serial_no
,pih.purch_invoice_date
,oh.company_name
,(SELECT NVL(SUM(amount),0)
FROM "YOUR TABLE HERE" yth
WHERE yth."YOUR COLUMN HERE" = pih.id) AS sum_amount
FROM "YOUR TABLES HERE"
WHERE "YOUR JOIN CONDITIONS HERE"
UNION ALL
SELECT DISTINCT
sih.id
,d.document_ind
,sih.doc_serial_no
,sih.sales_invoice_date
,sih.company_name
,(SELECT NVL(SUM(amount),0)
FROM "YOUR TABLE HERE" yth
WHERE yth."YOUR COLUMN HERE" = sih.id) AS sum_amount
FROM "YOUR TABLES HERE"
WHERE "YOUR JOIN CONDITIONS HERE"
[/code]
Hope this helps.
Craig...
+If a response is helpful or correct, please mark it accordingly+
Edited by: CraigB on Feb 23, 2010 1:39 PM
It appears the CODE tags are not working as well as the URL tags. :(
Maybe you are looking for
-
Since the last mozilla/firefox update whenever I go online, google and mozilla/firefox open at the same time and I can not see google since mozille/firefox (a big orange window) opens on top of google. I read everything in the window but there doesn'
-
Cannot reate online images in Thunderbird 24.6.0 under Win 8.1
13.7.2014 Thunderbird 24.6.0 Windows 8.1 Hello, I cannot create an inline image using the add graphic menu. I unclick the Append box in the menu. The image appears in the originating mail, but when I send it only a box is received.. However when I op
-
Text boxes drop downs on my IMac are flickering
I cannot log into some websites because the login box keeps flickering and will not allow me to type in the box.
-
How do I install Adobe Reader on my Mac Computer?
How do I install Adobe Reader on my MAC Computer?
-
Camera Raw not found and so it won't install the update
I have PSE 6 and did have camera working - now I can't seem to figure out how to install updates. I don't see the app listed in the directory that is mentioned in the instructions.