Table parameter in FM
Hi,
i would like to create a function module that takes a list of messages(BAL_S_MSG) and a log object (BAL_S_LOG) (basically it will be used to add log messages in different programs)
I can't put directly the type BAL_S_MSG in the table definition tab because it is not defined as a table.
Do i have to create a table with the same structure as BAL_S_MSG or is there some other trick i could do ?
Thanks a lot.
Tom
Just create a table type with the structure 'BAL_S_MSG' and use that. You should also use the importing or exporting parameters instead of the tables parameter. Just do:
IMPORTING
X_parameter TYPE your_table_type
or
EXPORTING
y_parameter TYPE your_table_type
This will create an import or export table.
Hope that helps,
Michael
Or just use an existing table type which uses structure BAL_S_MSG (e.g. BAL_T_MSG).
Edited by: Michael Wackerbauer on Dec 16, 2008 11:02 AM
Similar Messages
-
How to call a function with generic table parameter
Hi everybody
I need to call function module RSAR_ODS_API_GET (from BW). It recive an internal table with request ids and should return in E_T_DATA "unstructured" data from the psa and in E_T_RSFIELDTXT the description of the data structure, I guess
from sap help only thing I have reggarding how to use the function module is :
"You can call up the function module RSAR_ODS_API_GET with the list of request IDs given by the function module RSSM_API_REQUEST_GET. The function module RSAR_ODS_API_GET no longer recognizes InfoSources on the interface, rather it recognizes the request IDs instead. With the parameter I_T_SELECTIONS, you can restrict reading data records in the PSA table with reference to the fields of the transfer structure. In your program, the selections are filled and transferred to the parameter I_T_SELECTIONS.
The import parameter causes the function module to output the data records in the parameter E_T_DATA. Data output is unstructured, since the function module RSAR_ODS_API_GET works generically, and therefore does not recognize the specific structure of the PSA. You can find information on the field in the PSA table using the parameter E_T_RSFIELDTXT."
unfortunately I when running de report bellow, I get a dump which says:
Function parameter "E_DATA" is unknown
in the definition of the interface E_DATA has no type, which means it can recive any table type, right?
So I have two questions?
1) How to get the code working
2) How do I use the parameter E_T_RSFIELDTXT to parse the data returned in E_DATA
by debuging RSSM_API_REQUEST_GET for this code I found it try to put an internal table with the struct of the database table /BIC/B0000151000 in E_DATA
Thanks a lot for any help
rgds
my test report is:
REPORT ZTEST_PSA_API.
TABLES: /BIC/B0000151000 .
TYPE-POOLS: RSSM.
TYPES: BEGIN OF STC_REQ_LINE,
sign(1),
option(2),
low TYPE rsa_request,
high TYPE rsa_request,
END OF STC_REQ_LINE,
IT_REQUEST TYPE STC_REQ_LINE OCCURS 0.
DATA: lit_request TYPE RSSM_T_API_REQUEST_GET WITH HEADER LINE,
lc_system TYPE RSSM_T_API_LOGSYS,
lit_request1 TYPE IT_REQUEST WITH HEADER LINE.
DATA: lc_dtarget_name TYPE RSA_ODSNAME,
lit_meta_data TYPE RSARC_T_RSFIELDTXT.
DATA: lt_psa_data LIKE /BIC/B0000151000 OCCURS 0.
CALL FUNCTION 'RSSM_API_REQUEST_GET'
EXPORTING
I_SOURCE = '2LIS_13_VDITM'
I_TYP = 'D'
I_DATEFROM = '20060627'
IMPORTING
E_T_REQUEST = lit_request[]
E_T_LOGSYS = lc_system
EXCEPTIONS = 1.
READ TABLE lit_request.
lit_request1-sign = 'I'.
lit_request1-option = 'EQ'.
lit_request1-low = lit_request-request .
APPEND lit_request1 .
break-point .
CALL FUNCTION 'RSAR_ODS_API_GET'
EXPORTING
I_T_REQUEST = lit_request1[]
IMPORTING
E_ODSNAME = lc_dtarget_name
E_T_RSFIELDTXT = lit_meta_data
TABLES
E_DATA = lt_psa_data
EXCEPTIONS
NO_DATA_FOUND = 1
PARAMETER_FAILURE = 2
REQUEST_NOT_AVAILABLE = 3
NO_REQUEST_FOUND = 4
NO_FIELDS_TO_ODS = 5
NO_ODS_FOUND = 6
PACKAGE_LOCKED_BY_LOADING = 7 .Try to pass table parameter without "[]" :
CALL FUNCTION 'RSAR_ODS_API_GET'
EXPORTING
I_T_REQUEST = lit_request1
IMPORTING
E_ODSNAME = lc_dtarget_name
E_T_RSFIELDTXT = lit_meta_data
TABLES
E_DATA = lt_psa_data -
Passing table parameter from dynpro for java to sap r/3
I am sending table parameter from WebDynpro to sap r/3,but the table is not populating.
Hi,
In 7.3:
// models
RFCModel1 modeloGral = new RFCModel1();
Zfmfi_Certificado_Ret_Pdf_Input modeloRfc = wdContext.currentZfmfi_Certificado_Ret_Pdf_InputElement().modelObject();
// clean
if(modeloRfc.getIt_Tipo_Ret_Pobl()!=null && modeloRfc.getIt_Tipo_Ret_Pobl().size()>0){
modeloRfc.getIt_Tipo_Ret_Pobl().removeAll(modeloRfc.getIt_Tipo_Ret_Pobl());
//fill
IEt_RetencionesElement retElem;
int cant = wdContext.nodeEt_Retenciones().size();
for(int i=0; i<cant; i++){
retElem = wdContext.nodeEt_Retenciones().getEt_RetencionesElementAt(i);
Zfie_Tipo_Retencion_Poblacion retencion = new Zfie_Tipo_Retencion_Poblacion(modeloGral);
retencion.setTipo_Ret(retElem.getTipo_Ret());
modeloRfc.addIt_Tipo_Ret_Pobl(retencion); -
How to read JCO Table parameter
Hello
I am calling Java function from ABAP side (JCO outbound call). Right now, in the java program I can get the import parameter data, but not the table parameter data. I am using the famous example5.java and the ABAP code is like below:
PARAMETERS: requtext LIKE sy-lisel.
DATA: echotext LIKE sy-lisel,
resptext LIKE sy-lisel,
rfctest TYPE TABLE OF rfctest,
wa_rfctest TYPE rfctest.
wa_rfctest-rfcdata1 = requtext.
wa_rfctest-rfcdata2 = 'Hello World'.
APPEND wa_rfctest TO rfctest.
CALL FUNCTION 'STFC_CONNECTION'
DESTINATION 'JCO'
EXPORTING
requtext = requtext
IMPORTING
echotext = echotext
resptext = resptext
TABLES
rfctest = rfctest.
In the java side it is defined as:
JCO.MetaData fmeta = new JCO.MetaData("STFC_CONNECTION");
fmeta.addInfo("REQUTEXT", JCO.TYPE_CHAR, 16, 0, 0, JCO.IMPORT_PARAMETER, null);
fmeta.addInfo("ECHOTEXT", JCO.TYPE_CHAR, 255, 255, 0, JCO.EXPORT_PARAMETER, null);
fmeta.addInfo("RESPTEXT", JCO.TYPE_CHAR, 255, 512, 0, JCO.EXPORT_PARAMETER, null);
fmeta.addInfo("RFCTABLE", JCO.TYPE_TABLE, 144, 0, 0, 0, "RFCTEST");
Also RFCTEST structure is defined ( omitted here)
In the handleRequest(JCO.Function function), the following code:
if (function.getName().equals("STFC_CONNECTION")) {
output.setValue(input.getString("REQUTEXT"),"ECHOTEXT");
JCO.Table tab = tables.getTable("RFCTABLE");
System.out.println("RFCTABLE rows = " + tables.getTable("RFCTABLE").getNumRows());
I always get 0 rows in the table RFCTABLE. I checked the trace file in the Java side, I can see the table data are indeed passed to Java side, the JCO just can't pass the data through the API.
Any one has idea of it?
Thank you very much.
JaysonAndre
I have read the function Structure of J_1B_NFE_XML_OUT and i don't find the TableParameter or ExportParameter for this FM.
How do you actually get your return parameter?
I don't think here the table type is JCO.Table.
And i don't know how to use this Function . So i can't test my assumption.
JCO.Table tab = function.getImportParameterList().getTable( "XML_ITEM_TAB" );
normally people use the JCO.Table tab=function.getTableParameterList().getTable();
But XML_ITEM_TAB is not a Table parameter.
I don't know if table type from importParmeter can convert themself like that.But you still can try it.
hope that be helpful! -
Hi All,
Im developing a File->XI->R/3 interface.
The Flat File content looks like this :
0001,0001,03.05.2003
0001,0002,03.05.2006
0001,0003,03.05.2006
I need to insert the data to an R/3 table ZTEST, and if the interface runs well I imagine that the table content will look like this :
ZTEST
Header ID Item ID Posting Date
0001 0001 03.05.2003
0001 0002 03.05.2006
0001 0003 03.05.2006
Ive designed and configured all the required objects, and the data successfully received by the R/3.
The payload on R/3s SXMB_MONI looks like this :
<?xml version=1.0 encoding=UTF-8 ?>
<ns0:Data1 xmlns:ns0=http://mycomp.com/data1>
<Data>
<HeaderID>0001</HeaderID>
<ItemID>0001</ItemID>
<PostingDate>03.05.2003</PostingDate>
</Data>
<Data>
<HeaderID>0001</HeaderID>
<ItemID>0002</ItemID>
<PostingDate>03.05.2006</PostingDate>
</Data>
<Data>
<HeaderID>0001</HeaderID>
<ItemID>0003</ItemID>
<PostingDate>03.05.2006</PostingDate>
</Data>
</ns0:Data1>
But when I check my ZTEST table, it only contains the first row :
0001 0001 03.05.2003
I suppose this because my implementation on the proxy only runs once, and the parameter type is a structure.
Can we define a table parameter for ABAP Proxy instead of flat structure parameter ? So that I can loop through the
internal table and insert the row one by one.
Or is there a more common way to do this kind of interfacing ? Please advise me on this matter.
Thanks in advance,
AndyHi All,
Thanks for the advices......
I've tried to set the occurence before, but I guess I forgot to regenerate the proxy, that's why it's not working and I began to think that setting the occurence won't solve the problem.
After reading your answers, I set the occurence again and regenerate the proxy, all works fine now.....
Thanks for the help.
Regards,
Andy -
Table parameter does not contain values in RFC call
Hello Experts,
I created RFC in R/3 with table parameter I_CUSTOMER. This RFC will be called by the CRM to pass all the customers data to R/3. The RFC was triggered by CRM passing 20 entries in I_CUSTOMER. However, when the debugger jumps in R/3 the table I_CUSTOMER in R/3 is empty. Can anyone help me to resolve the issue? any idea? thanks in advance!
Best Regards,
AlezandroHi Alezandro ..
what is the type of table parameter I_CUSTOMER u have declared??
if CRM is passing 20 values through I_CUSTOMER, u must take
type <b>TABLE TYPE</b> which is to be created in dictionary.
if it doesn't helps u ...can u be more clear??
Ram -
File to RFC - Missing data in table parameter
Hello,
I have a file-to-rfc scenario. My RFC function contains both inbound parameters and a table parameter.
When the RFC function is called, my data is passed correctly to the inbound parameters, however the
table is empty. I have tested my mapping and it is working properly. I have also check the
payload and all the data is there including the table data.
Has anyone run across this before?
I would appreciate any help.
Thank you.in MONI you have any error??
in the R3 side, insert this code:
DATA: i_aux type i Value 1.
While i_aux = 1.
endwhile.
execute your scenario. later go to SM50 ans look for your process and debug it. now in debug mode check wether the parameters from PI reach to RFC.
if the parameters does not reach and there no any connection problem you have configure bad your connection parameters. check wether the connection parameter of RFC adapter are rigth in ID: Client,Server
is it Clear??
Thanks
Rodrigo
Thanks
Rodrigo. -
How to set the tables parameter to a BAPI using adaptive RFC model
Hi,
I have a BAPI ZBAPI that has a tables parameter ZPernr of type ZTable with two elements pernr and name.
I used adaptive RFC model and created model classes for the BAPI.
My question how do i set list of pernr and name to the tables parameter in the webdynpro for java.
I have the following methods available
ZBAPI input = new ZBAPI();
1.ZTable table = new ZTable();
table.setPernr(pernr);
table.setname(name);
input.addZPernr(table);
how do i set the table parameter for multiple pernr and name
2.
add all the pernr and name to list and set that list to input in the following way
input.setZPernr(list) and list of typecom.sap.aii.proxy.framework.core. AbstractList
out of two methods mentioned which one is correct.
Please let me know the solution
Thanks
Bala DuvvuriHi Bala,
In your code:
List pernrList = new ArrayList();
pernrList should be declared as the type of class HROBJECT ( The structure name in the model e.g. the node PERFWARN type is Zhrecmfm_002_Perfrat_Warning_Input )
Try this:
HROBJECT pernrList = new HROBJECT();
pernrList.setPernr(pernr);
input.setPernr_List(pernrList);
// call BAPI execute method
If you want to pass list of pernrs, you can pass in alternate way
IPrivate<viewname>.I<nodeame>Node prNode = wdContext.node<node>();
IPrivate<viewname>.I<nodeame>Element prEle;
for (int i = 0; i < table.size(); i++) {
HROBJECT pernrList = new HROBJECT();
pernrList.setPernr(pernr); // Set the pernr from current record
prEle = prNode.create<nodeame>Element(pernrList);
prNode.addElement(prEle);
// call BAPI execute method
Once I execute the BAPI how do i iterate thru second table parameter PERNR_PERFRAT to get pernr and performance rating text
Say your node name is PERNR_PERFRAT
for (int i = 0; i < wdContext.nodePERNR_PERFRAT().size(); i++) {
wdContext.nodePERNR_PERFRAT().getPERNR_PERFRATElementAt(i).getPernr();
wdContext.nodePERNR_PERFRAT().getPERNR_PERFRATElementAt(i).getPerfrat();
Regards,
Siva -
Table Parameter Values Are Input To RFC?
Hi,
My Requirement is Table Parameter Values are Input RFC.
We have Table Parameter With Project ID Column and Multiple Rows.
User Need To Enter Project id's in Table And Submit.The Result can be displayed.
In My Scenario User Need to enter the values in table.
I Developed Webdynpro Application and Deployed.
When i am trying to enter values into a table,table is not taking values.
Because in My Requirment is the user enter morethan one project id in table.
Thanks
SubbaRao ChintaHi,
Can you please explain more clearly that what is the meaning of "Table not taking values"?
Did you take the ColumnCellEditor(inputfield) for table column as input field.
For example, You need to create a value node as below
ProjectIdsNode (Value node with cardinality 0..n & selection 0...n)
---> ProjectId (Attribute)
And bind this ProjectIds node to table UI element. And bind ProjectId attribute to ColumnCellEditors(inputfield) value property.
Now in submit action loop though this node and get all the values entered in ProjectId attribute.
And set all these values into input of your RFC while executing to store in backend.
Regards,
Charan -
Syntax Error with Table Parameter (type: ANY) when Creating Function Module
Hello experts,
I want to create a function module with a table parameter and table type is ANY. But when I check (Ctrl+F7) this function module, syntax error occurs - "In this statement, the internal table "MSG_TABLE_ITEM" must have the type "STANDARD TABLE"."
Could anyone tell me what the wrong is? And how can I fix it?
Thanks,
ShelwinHi,
For table parameters, you can only pass
MSG_TABLE_ITM TYPE STANDARD TABLE
or
MSG_TABLE_ITM ( don't fill other columns TYPING ASSOCIATED TYPE ).
For reference check FM 'GUI_UPLOAD' - Table parameters
Regards,
DPM -
How to register PL/SQL index table parameter in OracleCallableStatement ?
Hello ,
I am using Oracle release 8.1.6.0.0 . I need to call a PL/SQL procedure through JDBC, which specifies an INDEX TABLE OUT parameter(e.g. TYPE type_name IS TABLE OF VARCHAR2(10) INDEX BY BINARY_INTEGER) .
I found that with Oracle8i release 8.1.7, the Oracle JDBC OCI driver supports PL/SQL index-by tables using the registerIndexTableOutParameter method . But I have Oracle 8.1.6 and our client has 8.1.2!
Is there any way that I can read INDEX TABLE PARAMETER from PL/SQL procedure with Oracle release 8.1.2 and 8.1.6?
Another question is - Is it possible to do this with Oracle thin driver also ?
Regards,
Mukuli got the same problem? did you find the way to do it yet?
thks a lot
regards. -
TABLE parameter in FUnction module
Hi Experts
Iam modifying a FM, i have 10 fileds in export parameters,
filed1
filed2
filed3
filed 10.
as per the requirement i need to display the same parameters in table form
suppose the rows of table is like
filed1filed2filed3
filed4filed5filed6
filed7filed8filed9filed10
so iam planing to create internal table and pass it TABLE parameter option in FM
please tell me is it make sense and how to define TABLE parameter in FM, and how to pass data to it
thanks
vasaviinside the fm you can declare some thing like this.. have a table parameter name some thing don't reference to any data type.
and also you have 10 importing parameters.
function ztest_function.
data: begin of itab occurs 0,
field1 type <datatype>,
field2..
field10,
end of itab.
"passing importing parameters
itab-field1 = i_field1. "these are importing parameters
itab-field2 = i_field2.
itab-field10 = i_field10.
append itab.
table_parameter[] = itab[].
endfunction. -
Dear all,
I noticed that in SAP ECC 6.0 the tables parameter is obsolete (warning about it).
After trying some things out and reading on the forum, i found that u can pass an internal table as a changing parameter for example, but the parameter has to be of type tabletype, as in.
CHANGING mytab type mytabletype.
Is it possible to define the mytabletype in a function group, or does it have to be defined in the dictionary?
apparantly you cant use changing mytab type mara if u want to pass an internal table with the same structure as mara.
So can i define in an include of the function group?
Types: mytabletype type mara. ( or something like that)
Or is it possible to define in my function module interface:
CHANGING mytab type standard table mara (or something like that) So i can make use of the tables allready in the dictionary...
Kind regards,
JorenHi,
got this from help.sap.com.
The interface parameters can be typed. You can do so either by referring to ABAP Dictionary types or elementary ABAP types.
this means that you can only use global types for your parameters, and none you defined in your top. Kinda makes sence, if you consider the fact that you will also need the type when you implement the fm to pass the parameters
this is where I found it.
<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db98ef35c111d1829f0000e829fbfe/content.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db98ef35c111d1829f0000e829fbfe/content.htm</a> -
Table Parameter IX_BAPIADDR1 of FM SD_ORDER_CREATE
Hi,
i used the FM SD_ORDER_CREATE to create sales orders. i want to change the addresses from master data for the partners.
can i use the table parameter IX_BAPIADDR1 of FM SD_ORDER_CREATE ? if it is possible, how can i fill up this table for fm?
can somebody help me please?
thanks.
best regards.You can use the bapi BAPI_SALESORDER_CHANGE
please check the links below if you need further info search forum
Re: BAPI_SALESORDER_CHANGE
Re: BAPI SALESORDER CHANGE
change customer address in sales order
Help with BAPI_SALESORDER_CHANGE
Regards
Satish Boguda -
Table parameter of RFC FM in background task
hi
I have a RFC FM in system A which has two table parameters, first table parameter table1 will have the data and the second table parameter table2 will be filled with in the FM with the error and success messages. Now i am calling this RFC FM in a program in system B in background task. I am passing the values to the first table paramter table1. after the call i am using commit work. now my question is can i read the values in the second table parameter table2?
report
call function 'ABC' destination dest in background task
tables
table1 = itab1
table2 = itab2
commit work
will the values be populated in itab2.?
thanksHi,
yes u can surely read the values of the second table ,
what ever parameters you pass to the FM whether it is an RFC enabled or simple FM they can be accessed by the report in which you r calling it.
Call Function <FM>.
Tables
table1 = itab1
table2 = itab2
loop at itab1 into wa.
write: wa-field1. " Read the values of table1
endloop.
loop at itab2 into wa1.
write: wa1_field1. " Read the values of table2
endloop.
thanks
ravi -
Tables-Parameter in Function module
Hello together,
i created a new function module in CRM with one "Tables"-Parameter. The parameter will be filled in debugging but if i call the fm in SAPRFC test script the table is empty. Do have any idea how i could solve this?
Best regards
SaschaChanging parameters can be used as work areas as well as tables, tables can not be used as work areas.
Reference Difference between changing and table parameters in Function Modules SAP ABAP - Modularization techniques in SAP ABAP | at SAPNuts.com
Maybe you are looking for
-
Is there a way to change the PSI settings of scanned papers w/o losing information?
Hello - We have gotten a Kodak scanner and a program that it came with to scan old files (real files, not computer files) for storage, so we could free up some space. We've just started using this, but I have a question about the PDF files that we're
-
Remote desktop policy works on Windows 7, but not on Windows 8
Hey all, We have a mixed environment of Windows 7 and Windows 8.1 machines. Our standard policy enables remote desktop on all machines (and another part of the policy sets the groups allowed to remote access). On windows 7, we are able to
-
Link to collections in Adobe Acrobat 7.0 Professional
I have lost the link to my collection of document in the organizer. I have check that the file is still present on my disk. How can I restore the link ? Hope you can help me.
-
Same but a little different problem with iPod
I installed my iPod shuffle and everything worked great. Then I tried to recharge it and now I have the same blinking light problem that everyone else has described. My difference is that my iPod is recognized in iTunes, but not recognized by Windows
-
OdiReadMail - extract field from and subject in file
Tool odiReadMail extract the body of the message in to file. I wont extract in this file fields form e-mal "from" and "subject". How i can do it?