Dynamic table in RFC function
Dear all
I like to create a dynamic table in a RFC function and pass this table to the calling programm. Is this possible?
Herbert
Hi,
check the Below FM to create Dynamic table in RFC function ..
RFC_READ_TABLE -- External access to R/3 tables via RFC
RFC_GET_TABLE_ENTRIES -- Read table entries
Prabhu
Similar Messages
-
hi,
I wrote one source code in RFC which gives output as dynamic table.
I want this dynamics table as output of RFC.
In RFC, Table parameter does not support TYPE u2018ANYu2019 to define Table as Dynamic.
During runtime, RFC Code supposed to identify and fill columns.
I want to provide output of this RFC to webservice.
Regards
Mohinder Singhhi
If your FM is RFC enabled you can't declare a generic type. that is the problem when you try to use the FM and try to pass a dynamic table name to get the data from the remote system. or you can check
Check these FM 's: RFC_READ_TABLE
RFC_GET_TABLE_ENTRIES
hope this will help
regards
Prashant -
Error in Java Program when passing table to RFC function . JCO is used
Hai All,
I developed a JAVA application to update data into SAP using JCO via RFC. When i pass table to the function module i am getting the below error
com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Conversion from type T to D not supported.
Please let me know how to solve this.
Below is my code
IRepository m_Repository;
IFunctionTemplate ftemplate;
JCO.Table PwdReq;
JCO.Function function;
m_Repository = JCO.createRepository("MYRepository", client);
ftemplate = m_Repository.getFunctionTemplate("Z_GESEFM_UPD_PWD_RESET_REQUEST");
// Create a function from the template
function = new JCO.Function(ftemplate);
// Feeding in input parameters
PwdReq = function.getTableParameterList().getTable("RESULT2");
String userid = "PATCHTEST14 ", reqDate = "",reqNo = "01",reqStatus = "03", boxID = "09",ind2 = "X",
lcode = "abcd",rem = "One record testing";
PwdReq.appendRow();
PwdReq.setValue(userid, "USERID");
PwdReq.setValue(reqNo,"REQ_NO");
PwdReq.setValue(reqStatus,"REQ_STATUS");
PwdReq.setValue(boxID,"BOX_ID");
PwdReq.setValue(ind2,"IND2");
PwdReq.setValue(lcode,"LCODE");
PwdReq.setValue(rem,"OTHER_REMARKS");
// execute the function with the input parameters
client.execute(function);
Thanks & Regards,
H.K.Hayath Basha.hi,
I am not very good in Java.
but try this code to giving input parameter.
function.getImportParameterList().setValue(userid, "USERID");
if you are not using Try and Catch blok then use Try and Catch blok,
Regards
Manoj -
Call Function with RFC dynamic table
Hi all
I create a function compare TABLE_ENTRIES_GET_VIA_RFC and CTVB_COMPARE_TABLES, everything is.dynamic
it works well but, how could i create a dynamic output parameter for table.
the system show me that RFC and dynamic table don't work.
i don't want line by line i would like to have the real structure inside of the Function i have everything but i can't move the data to the output parameter table .
could somebody help ?Thx RE (and Mani) for the feedback.
I think that this URL is sufficient to understand how to pass dynamic internal table via RFC function module, whatever it is input or output. This URL says to use a STRING to store the table content in XML format, via CALL TRANSFORMATION ID, and pass this string as parameter. In the calling program, we have to "decode" the XML back into abap data, Just notice that we don't need to create an XSLT, ID is sufficient.
For any other information, open a new thread, or ask a precise question. -
Structure of Dynamic Table in Function Module
Hi,
I'm trying to find a way to get as OUTPUT a dynamic Table from a Function Module.
I declared a table called T_DATA without a type.
And this table should have a dynamic table back.
The problem that I get the data back but, I only found a data without any field-elements.
The data is there but there's no structure, no table.
Is there any way that I can send the Data in a proper structure?Hi
Try using the following code
type-pools:slis.
data:it_fcat type lvc_t_fcat,
wa_fcat type lvc_s_fcat,
itab type ref to data.
data:it_fcat1 type slis_t_fieldcat_alv,
wa_fcat1 like line of it_fcat1.
data:cl_tab type ref to cl_alv_table_create,
wa_ref type ref to data.
field-symbols:<itab> type table,
<wa> type any,
<comp>.
create object cl_tab.
refresh:it_fcat.
wa_fcat-fieldname = 'NAME'.
wa_fcat-inttype = 'C'.
wa_fcat-intlen = '10'.
wa_fcat1-fieldname = 'NAME'.
wa_fcat1-inttype = 'C'.
wa_fcat1-intlen = '10'.
append wa_fcat to it_fcat.
append wa_fcat1 to it_fcat1.
wa_fcat-fieldname = 'NAME2'.
wa_fcat-datatype = 'CHAR10'.
wa_fcat1-fieldname = 'NAME2'.
wa_fcat1-datatype = 'CHAR10'.
append wa_fcat to it_fcat.
append wa_fcat1 to it_fcat1.
cl_alv_table_create=>create_dynamic_table(
exporting
I_STYLE_TABLE = I_STYLE_TABLE
it_fieldcatalog = it_fcat
I_LENGTH_IN_BYTE = I_LENGTH_IN_BYTE
importing
ep_table = itab
E_STYLE_FNAME = E_STYLE_FNAME
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
assign itab->* to <itab>.
create data wa_ref like line of <itab>.
assign wa_ref->* to <wa>.
do.
assign component 'NAME' of structure <wa> to <comp>.
<comp> = 'AA'.
unassign <comp>.
assign component 'NAME2' of structure <wa> to <comp>.
<comp> = 'AB'.
insert <wa> into table <itab>.
exit.
enddo.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = I_STRUCTURE_NAME
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_GRID_TITLE
I_GRID_SETTINGS = I_GRID_SETTINGS
IS_LAYOUT = IS_LAYOUT
it_fieldcat = it_fcat1
IT_EXCLUDING = IT_EXCLUDING
IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
IT_SORT = IT_SORT
IT_FILTER = IT_FILTER
IS_SEL_HIDE = IS_SEL_HIDE
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = IS_VARIANT
IT_EVENTS = IT_EVENTS
IT_EVENT_EXIT = IT_EVENT_EXIT
IS_PRINT = IS_PRINT
IS_REPREP_ID = IS_REPREP_ID
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS = IT_ALV_GRAPHICS
IT_HYPERLINK = IT_HYPERLINK
IT_ADD_FIELDCAT = IT_ADD_FIELDCAT
IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
IR_SALV_FULLSCREEN_ADAPTER = IR_SALV_FULLSCREEN_ADAPTER
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
tables
t_outtab = <itab>
EXCEPTIONS
PROGRAM_ERROR = 1
Regards -
To upload a data into SAP Table with the help of RFC function in BODS
Hi,
Please provide me step-by-step solution to upload data into any SAP table with the help of RFC function in Data Services.
I have created RFC function that upload data into SAP table. RFC Function contains one table that has same structure as my database table.
In the data services how can i filled the table of RFC function, i am using this function in query transform of data services but it gives me error.
I am also follow link http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsDataServicesTipsand+Tricks
but it did not help me.
Thanks,
AbhishekHi Abhishek,
Did you import the function module in the SAP datastore first? When you open the SAP datastore, the function should be listed in the 'functions' section. If not, import it. Make sure your function is remote executable.
Once the function is there, you can use it in a transformation. In 'Schema Out' right-click on 'Query' (top level) and choose 'New Function Call'. You can then select a datastore and a function in the datastore. The wizard will show you which output parameters are available. I believe you have to add at least one and can select as many as you like.
After confirming your selection the function and the output parameters appear in Schema Out. You can then right-click on the function and choose 'Modify function call'. A popup will appear where you can specify the input parameters.
I hope this helps.
Jan. -
How to pass Dynamic Table(s) to FM
Hello All i hv an requirement in which i need to process a block of code recursively. right now i am trying to do the same with Subroutine but its hard i know. I have an option to use FM instead but i am not sure if we can pass dynamic tables to FM, so is there anybody who had solution for the same. otherwise i can use it using TOP include to declare dynamic table in comon arae as im calling it from another FM(RFC) but i dont want to use that as it will consume more memory.
So i have 2 question
1. should i use FM instead of subroutine for recursive operation if yes how can know if i reached the maximum alloted size of memory for a program. is there any FM which can tell me about the memory used or somethign like that so that i can avoid any ABAP dump.
2.how can i pass dynamic tables as input to parameters.
Note : i allready seen https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f50dcd4e-0501-0010-3596-b686a7b51492Hello Mani
Perhaps the sample report ZUS_SDN_TABLE_READ_VIA_RFC_XML in thread
How to return back a structure of dynamic tables in a Function Module
might be a useful approach for you.
Regards
Uwe -
Hi..
when I am trying to export some paramters and tables in RFC function module, i m getting error as well as a warning message stating performance will reduce.
So please help me to solve the issue.
Thanks
VimalrajYou are getting this message because you are exporting tables 'by value'. Since this will cause the complete data in that internal table to be copied into a new memory area this might impact the performance of that function in case the table has a lot of data in it.
However - for an RFC you can only define parameters to be called by value, hence this is not an error in your case. It just lets you know that the performance will suffer when you have lots of data in your internal table compared to a function that would pass the data by reference - but you don't have that option for an RFC anyway.
Hope that helps,
Michael -
Dynamic/generic Table in RFC module
Hi All,
Need to Implement parallel processing as large amount of data is involved using RFC function modules. Not able to do so as RFC is not allowing generic data type needed for passing dynamic internal tables.
Data is in internal tables formed dynamically & this data is to be processed. How this can be done.
how to implement parallel processing using dynamic internal tables using RFC type of module.
Thanks
PratHi,
If it's RFC or not it shouldn't be a problem for passing generic data types to FM. I've just wrote and tested this code and it works. I'm using here static type (lyv_msg) but you could as well use dynamic.
TYPES lyv_msg(12) TYPE c.
data lv_msg TYPE REF TO DATA.
FIELD-SYMBOLS <fs_msg> TYPE ANY.
CREATE DATA lv_msg TYPE lyv_msg.
ASSIGN lv_msg->* TO <fs_msg>.
<fs_msg> = 'Some info'.
CALL FUNCTION 'TH_POPUP' DESTINATION 'NONE'
EXPORTING
CLIENT = 100
USER = 'USER'
MESSAGE = <fs_msg>
EXCEPTIONS
USER_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
Best regards
Marcin Choelwczuk -
Defining Dynamic structure in Remote Function module(RFC)
Team,
I got a requirement, where I need to create a dynamic structure and dynamic table in the exporting tab of Function module(RFC).
Say, I have sales request(4 fields) and sales quotation(5 fields).
Depending on the importing parameter, If it sales request I need to export 4 fields as a structure and if in the importing parameter it is sales quotation then I need to pass 5 fields as a structure.
Any help please??
Thanks,
SaiHi Manu,
Those are dummy functions.
Check out
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/047ab790-0201-0010-a9b1-e612f8b71dcd
(page 14)
regards,
Edgar -
How to declare Dynamic table in Tables Parameters of a Function Module...
Hi Gurus,
I would like to Know how to declare a Dynamic table in Tables parameters of a Function Module.
so that it should be able to hold any table data ....
I have tried all possible ways of trying to assign fields-symbol like declarations which doesnt allow here ...
plz Dont reply with the basics of creating dynamic internal tables, coz my case is not an Internal table it is FM table parameter declaration.....Hi,
If you are requirement is to create a function module with tables parameter having a generic line type i.e. no specific line type
just declare it with a name under Parameter name with out specifying the type.
A reference function module with such parameter, i would quote is the standard GUI_UPLOAD/ GUI_DOWNLOAD where the parameters specified under TABLES are generic.
If you want to process the values passed to these parameters in the source code of function module, field symbols would be a preferable option.
Regards,
Sharath Panuganti -
Dynamic Export table of a function Module
Hi Friends,
I have a requirement where fields of Export table of my function Module is dynamic. It is like the Fields to be expoerted by the Function Module would be stored in a seperate Z table
The Z table would contain the records as follows .
Table Name FieldName
=========
MARA MATNR
MARC WERKS
and So on..
. How can I define my Export table in Function module dynamically so that the structure of my Export Function Module would be same as that of the Fieldnames in Z table..
ThanksJust declare the associate type as "ANY TABLE" in the exporting parameter.
FUNCTION ZTEST.
*"*"Local Interface:
*" EXPORTING
*" REFERENCE(IT_TAB) TYPE ANY TABLE -
Rfc function with table parameter
Hey,
im trying to call a RFC function from Webdynpro where i have to give a table as parameter. When creating the table i following exception:
java.lang.IllegalArgumentException: model object must not be null
at com.sap.tc.webdynpro.progmodel.context.ModelNodeElement.<init>(ModelNodeElement.java:66)
at be.vrt.wdp.IPublicPlanning_Validation$IP_Update_TableElement.<init>(IPublicPlanning_Validation.java:3667)
at be.vrt.wdp.IPublicPlanning_Validation$IContextNode.doCreateElement(IPublicPlanning_Validation.java:87)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:854)
at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1346)
at com.sap.tc.webdynpro.progmodel.context.Node.createElement(Node.java:1365)
at be.vrt.Planning_Validation.executeRFC_Z_Whatson_Sap_Update_Transmissio_Input(Planning_Validation.java:265)
The code from Planning_Validation (controller class)
public void executeRFC_Z_Whatson_Sap_Update_Transmissio_Input( java.util.Vector nodes, java.lang.String display_value )
//@@begin executeRFC_Z_Whatson_Sap_Update_Transmissio_Input()
Z_Whatson_Sap_Update_Transmiss_Input transmiss = new Z_Whatson_Sap_Update_Transmiss_Input();
//transmiss.addP_Update_Table(new Zmm_S_Update_Status_Table());
wdContext.nodeZ_WHATSON_SAP_UPDATE_TRANSMIS().bind(transmiss);
//wdContext.createP_Update_TableElement(new Zmm_S_Update_Status_Table());
for (int i = 0; i < nodes.size(); i++){
String [] node = (String[])nodes.get(i);
IWDNodeElement el = wdContext.nodeP_Update_Table().createElement();
el.setAttributeValue("Won_Id", node[0]);
el.setAttributeValue("Won_Status", node[1]);
el.setAttributeValue("Display_Status", display_value);
try {
// Call remote function
wdContext.currentZ_WHATSON_SAP_UPDATE_TRANSMISElement().modelObject().execute();
// synchronise data in context with data in model
wdContext.nodeOutput().invalidate();
} catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Line 265 is where i call wdContext.nodeP_Update_Table().createElement();
Any ideas ?
grtz,
HannesHey, thanks .. i managed to solve it
this is the code:
//@@begin javadoc:executeRFC_Z_Whatson_Sap_Update_Transmissio_Input()
/** Declared method. */
//@@end
public void executeRFC_Z_Whatson_Sap_Update_Transmissio_Input( java.util.Vector nodes, java.lang.String display_value )
//@@begin executeRFC_Z_Whatson_Sap_Update_Transmissio_Input()
Z_Whatson_Sap_Update_Transmiss_Input transmiss = new Z_Whatson_Sap_Update_Transmiss_Input();
wdContext.nodeZ_WHATSON_SAP_UPDATE_TRANSMIS().bind(transmiss);
for (int i = 0; i < nodes.size() ; i++){
String [] node = (String[])nodes.get(i);
Zmm_S_Update_Status_Table updEl = new Zmm_S_Update_Status_Table();
updEl.setWon_Id(node[0]);
updEl.setWon_Status(node[1]);
updEl.setDisplay_Status(display_value);
transmiss.addP_Update_Table(updEl);
wdComponentAPI.getMessageManager().reportSuccess("wohoo!");
try {
// Call remote function
wdContext.currentZ_WHATSON_SAP_UPDATE_TRANSMISElement().modelObject().execute();
// synchronise data in context with data in model
wdContext.nodeOutput().invalidate();
} catch (WDDynamicRFCExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//@@end -
RFC Function module needed for getting table details in APO from R/3
Hi,
I need a RFC function module where I can write a query from R/3 to access APO server database table and get the necessary records.
Regards
MacPossible ways
1. Call fm RFC_READ_TABLE and give destination and table name ( But i am not sure how it will work SCIF enviornment of APO)
or
2. Create a custom function module in APO side and call from R/3 side using destnation option
a® -
RFC function to return number of records in a table
Hello,
I am looking for a RFC function to return just the number of records in a SAP table.
I don't want to use RFC_READ_TABLE since it takes too long when I query a big table.
Any advices?Check the following post: Link: [Re: RFC function module to count records in DB table;
Maybe you are looking for
-
How to retrieve programs ( Z) or (Y)
hi all i have a question here. How to retrieve all the Z or Y objects which were copied from the standard objects(scripts,reports,smartforms etc) and modified according to cutom requirements. thanks Sonali
-
Hi everyone i need help on Storage TeK SL500 tape Library we have it on our Data Center and since 3 year no body who managed this machine.the guy s who know something are resign since i dont know how to connect by CLI,or if there is ALom or ILOM, we
-
Multiple R/3 linked to single CRM
Hello Friends, CRM provides functionality to link to multiple R/3 through middleware. Consider we have two stand alone R/3 systems (R/3-1 & R/3-2). A master data (Customer or Product) exists in both R/3-1 and R/3-2 with the same number. E.g. Customer
-
Everytime i print from firefox my text looks grainy i can print from other internet web browsers such as internet explorer google chrome. I have tried resetting the printer defaults and settings through walkthroughs on here and i have tried the setti
-
ITunes 7 - Importing Library info
I just setup a NAS into my WLAN network and moved my iTunes library etc. onto that, as my HD was running low on the PowerBook. I wanted to do this manually rather than Consolidating the library, as I wanted to delete some duplicates etc at the same t