Passing table as an import parameter
Dear experts,
While developing an RFC,i felt a problem and though i managed it.Still some doubt resides in mind.
We have sections Import,Export,Tables,Sourcecode in SE37.
Example i wish to pass tabular structure as input to RFC.I found that in import and export parameters
i cannot take table type,i can only take table type in Tables section.
So i defined input table as well as Output table in tables section only.I gave description as Input table and Output table
for my understanding.I gave the source code and fetch data in my output tabe.
It works !.But is that the only way ?.Or i was required to declare tables in some other section in order to conclude them as
input/output table.
Hi aditya,
You can refer to any table as below try it -
Parameter Name Type Spec Associated type
ITAB LIKE MAKT
This simply means you have to use LIKE to refer to any table.
Hope this helps.
Similar Messages
-
Pass table name as a parameter to function
Is there a way to pass table name as a parameter to functions? Then update the table in the function.
Thanks a lot.
JiaxinHi, Harm,
Thank you very much for your suggestion and example. But to get my program work, i need to realise code like follows:
CREATE OR REPLACE FUNCTION delstu_func(stuno char) RETURN NUMBER AS
BEGIN
EXECUTE IMMEDIATE 'DELETE FROM student s' ||
'WHERE' || 's.student_number' || '=' || stuno;
LOOP
DBMS_OUTPUT.PUT_LINE('record deleted');
END LOOP;
END;
SELECT delstu_func('s11') FROM STUDENT;
The intention is to check if such a function can perform operations such as update, delete and insert on occurence of certain values. When executing the above statement, the system returns an error message:
ERROR at line 1:
ORA-00933: SQL command not properly ended
ORA-06512: at "SCMJD1.DELSTU_FUNC", line 3
Could you tell me where is wrong?
Jiaxin -
Is it possible to pass TABLE as the output parameter in stored procedure
Hey Experts,
Is it possible to pass TABLE as the output parameter in stored procedure.
eg
create procedure spGetData
@tableName as TABLE(intValue INT NOT NUL)
asYou can use OPENQUERY or OPENROWSET, as mentioned above, to make stored procedure results table like. There are
some limitations with these methods:
http://technet.microsoft.com/en-us/library/ms188427.aspx
In OPENQUERY this-sql-server-instance can be used instead of a linked server name. It requires setting data accces server option:
exec sp_serveroption @server = 'PRODSVR\SQL2012'
,@optname = 'DATA ACCESS'
,@optvalue = 'TRUE'
LINK: http://www.sqlusa.com/bestpractices/select-into/
Kalman Toth Database & OLAP Architect
SELECT Video Tutorials 4 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
HOW TO PASS SELECT-OPTIONS AS IMPORT PARAMETER TO A CLASS
Hi experts,how to pass select options value as a export parameters to a zclass.
can give me some idea.
Thanks
saiAs Sachin already said, selection options are stored in an internal table. You can reconstruct the table type without the corresponding input fields using the type addition RANGE OF.
So - assuming you have the following in your program:
DATA: wa TYPE sflight.
SELECT-OPTIONS so_car FOR sflight-carrid.
you can create a publically-visible type in your class using direct type entry and the code
TYPES: my_selectoption TYPE RANGE OF sflight-carrid.
and use this to define the importing parameter of the method.
The only other thing you have to remember is that select-options generates an internal table with header line. Thereore, to pass the table to the method, you would use (in the above example) so_car[], and not just the name of the select-option.
Hope this helps.
Regards
Jon. -
Table type in import parameter in rfc function module
Hi we don't have the table type in our system which exist in the other system which is the import parameter of the rfc function module.so how can we pass the parameter. shell we create the same table type in our system also.it is a table type for a deep structure.
Hello,
I donot have access to CRM box I cannot view the FM. You can verify with the CRM counterpart what exactly is the TYPE for param DATA.
Else you can define a generic internal table (TYPE TABLE) & try calling the FM.
BR,
Suhas -
Passing a table to an import parameter for a FM
Hello experts,
The goal is to update the date of a record from the database table ZSHIPM_PLAN05.
In ABAP dictionnany I define a structure ZST_SHIPM_PLAN05 based on a database table in ZSHIPM_PLAN05
Further I define a variable import in function Module(FM): IV_SHIPMENT type ZST_SHIPM_PLAN05.
But I get the following error when compiling the FM: "IV_SHIPMENT" is neither specified under "TABLES" nor defined as a internal table.
Thank you for your Help.
In the top_include I have :
TYPES: BEGIN OF tt_ZST_SHIPM_PLAN05.
INCLUDE STRUCTURE ZST_SHIPM_PLAN05.
END OF tt_ZST_SHIPM_PLAN05.
DATA: gt_outtab TYPE TABLE OF tt_ZSHIPM_PLAN05,
wa_ZSHIPM_PLAN05 LIKE LINE OF gt_outtab.
CALL FUNCTION 'Z_SHIPM_PLAN_SAVE05'
EXPORTING
iv_shipment = gt_outtab
IMPORTING
es_return = gty_bapiret2.
FUNCTION Z_SHIPM_PLAN_SAVE05.
""Local Interface:
*" IMPORTING
*" REFERENCE(IV_SHIPMENT) TYPE ZST_SHIPM_PLAN05
*" EXPORTING
*" REFERENCE(ES_RETURN) TYPE BAPIRET2
LOOP AT IV_SHIPMENT INTO wa_ZST_SHIPM_PLAN05.
settings the color
IF wa_ZST_SHIPM_PLAN05-art = 'AA02' and wa_ZST_SHIPM_PLAN05-descr = 'ci0017'.
wa_ZSHIPM_PLAN05-crea_date = sy-date.
ENDIF.
MODIFY gt_outtab FROM wa_ZST_SHIPM_PLAN05 TRANSPORTING crea_date.
ENDLOOP.
"MESSAGE 'Do you want save' type 'I'.
SET SCREEN 0.
ENDFUNCTION.Hi,
Assign IV_SHIPMENT under changing or tables Parameter because import and Export statement holds a field not structure or table.
Thanks
Arbind -
Passing table name as a parameter
Hi:
I have a question regarding passing part of a table name to crystal. I have table getting created everyday and the dynamic part being Table_<date in yymmdd format>, for e.g. - Table_20140225 for table created on 02/25/2014
I have written query like "select * form Table_{@DT}". This used to work in Crystal 11.5.8.826. but recently we upgraded to 12.2.0.290. In this version of Crystal it is not working and giving me error "com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Missing parameter values.---- Error code:-2147217394 Error code name:missingParameterValueError".
Can you please suggest to get around this problem. Running a stored procedure with REFCURSOR is not an option.
i tried another solution, where i just wrote a stored procedure to do a insert into a table handling the dynamic table in stored procedure. but to my surprise, the stored procedure doesn't execute all the time.
Any help on this is much appreciated...Please see if SP 6 helps. You are on SP 2 at this time.
https://share.sap.com/a:328ro3/MyAttachments/521c18ac-d7fd-4a58-a2dc-9d40d1951975/
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter -
How to pass import parameter it_header_guid to FM CRM_ORDER_READ
Hi,
I have an internal table with only one field GUID of type CRMT_OBJECT_GUID.
Now I need to pass this into the import parameter of the FM CRM_ORDER_READ.
I tried in many ways but getting a type conflict error.
<removed_by_moderator>
Thanks,
Madhurima
Edited by: Julius Bussche on Sep 15, 2008 12:49 PMHi Madhurima,
Post CRM Technical or Functional related queries in "Customer Relationship Management (CRM) - General & Framework" available under SAP Solutions in Expert Forums.
And regarding your question,
Your guid should be of "CRMT_OBJECT_GUID_TAB" type and not CRMT_OBJECT_GUID.
Eg,
DATA : IT_GUID TYPE CRMT_OBJECT_GUID_TAB.
APPEND '488628CFB8C600B0E1008000C0090137' TO IT_GUID.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
IT_HEADER_GUID = IT_GUID
Hope this helps.
Thanks.
Best Regards,
Arun Sankar. -
Passing TABLE NAME as parameter is possible or not?
I want develop a small/simple report like this
TABLE NAME :
WHERE :
ORDER BY :
QUERY ROWS
In the above model i want to pass all the three (TABLE NAME,WHERE and ORDER BY) as a parameter.
My doubt, is that possible to pass TABLE NAME as a parameter? If so!
When i enter any TABLE NAME it has to fetch me out the records of that table (Based on WHERE condition and ORDER BY).
Is that possible to do?
Need some help!
Edited by: Muthukumar Seshadri on Aug 10, 2012 6:19 PMYes, it is possible with lexical parameters. Look in the help for examples:
SELECT Clause
SELECT &P_ENAME NAME, &P_EMPNO ENO, &P_JOB ROLE FROM EMP
P_ENAME, P_EMPNO, and P_JOB can be used to change the columns selected at runtime. For example, you could enter DEPTNO as the value for P_EMPNO on the Runtime Parameter Form.
Note that in this case, you should use aliases for your columns. Otherwise, if you change the columns selected at runtime, the column names in the SELECT list will not match the Report Builder columns and the report will not run.
FROM Clause
SELECT ORDID, TOTAL FROM &ATABLE
ATABLE can be used to change the table from which columns are selected at runtime. For example, you could enter ORD for ATABLE at runtime.
If you dynamically change the table name in this way, you may also want to use lexical references for the SELECT clause (look at the previous example) in case the column names differ between tables.
WHERE Clause
SELECT ORDID, TOTAL FROM ORD WHERE &CUST
ORDER BY Clause
SELECT ORDID, SHIPDATE, ORDERDATE, TOTAL FROM ORD ORDER BY &SORT You have to be really careful with this approach. Dynamic SQL may cause serious performance problems.
Edited by: InoL on Aug 10, 2012 10:06 AM -
Suggestion regarding table as a import table in bapi
Hello;
Is it possible as TABLE as the import parameter in the BAPIs import parameter tab.
Thnaks and Regards,
sapdev10.
Moderator Message: Duplicate post.
Edited by: kishan P on Oct 13, 2010 1:38 PMHello;
Is it possible as TABLE as the import parameter in the BAPIs import parameter tab.
Thnaks and Regards,
sapdev10.
Moderator Message: Duplicate post.
Edited by: kishan P on Oct 13, 2010 1:38 PM -
Internal table of unknown structure as a importing parameter of FM
Hello
I need to build FM that performs the following operations :
1. gets the internal table of unknown structure on the input
Its known that table has key fields of K1 , K2 , K3 and numerical fields of N1, N1.The other fields are unknown
2. Populate fields N1, N2 with values (logic is clear and simple)
3. Return table
Can you please recommend me which way I should go. Some examples are very welcome
THanksHi,
In your tables parameter enter the name of the table with out any type. This was you may be able to use it dynamically. Next create another importing parameter as table type. there you will pass the type of the table. Now if you have these information then you should be able to define a field-symbol in the FM and do the manipulation.
Regards
Prasenjit -
Pass table name as parameter in prepared Statement
Can I pass table name as parameter in prepared Statement
for example
select * from ? where name =?
when i use setString method for passing parameters this method append single colon before and after of this parameter but table name should be send with out colon as SQL Spec.
I have another way to make sql query in programing but i have a case where i have limitation of that thing so please tell me is it possible with prepared Statment SetXXx methods or not ?
Thanks
Haroon Idrees.haroonob wrote:
I know ? is use for data only my question is this way to pass table name as parameterI assume you mean "how can I do it?" As I have already answered "is this the way?" with no.
Well, I would say (ugly as it is) String concatenation, or stored procedures. -
Problem in passing import parameter to SAP Widget
Dear experts,
I have a widget which shows me important information by passing date as a parameter
on eclipse plugin.
I am able to see data only if i give date as YYYYMMDD as standard SAP format.
I want to pass sysdate in this way ,what should i write.
Controller.showMain_View({"INPUT_DATE": });
If input_Date is import parameter then how should i pass the value. ?
Thanx in advance.hi,
First check whether you have any predefined functions in the widget library..else create a java script and call it in your widget...
you can use this Java script code and modify the output according to your usage using string functions:
use date function to get the system date...
also include the js file in your .kon file...
thanks
jaideep srinivasan -
Passing PL/SQL table type as IN Parameter to DB Adapter
Hi,
I have an requirement to pass multiple record values(array of values) to an API from BPEL process.
For this,
1) I have created a package procedure having PL/SQL table type variable as IN Parameter.
2) In the BPEL process, created a DB adpater pointing to the above API.(Created wrapper API impicitly)
When I intiated the BPEL process passing multiple values, the API is taking only the first value, ignoring rest of the values.
Any reason, why only the first value is accepted by the API ?
Thanks,
Rapp.If I understand correctly, JPublisher generates a wrapper API for an underlying API that takes a PL/SQL table as an IN parameter. The wrapper will generate and use a SQL nested table as the type for the IN parameter of the wrapper procedure.
The DB adapter DOES support nested tables, varrays, and objects as IN parameters of an API. The problem you are seeing is most likely due to the way you are modeling your BPEL process, specifically with respect to your Assign activities.
When you Assign TO an IN parameter, make sure that you drill down all the way and choose the parameter name in the InputParameters root element. Similarly, when you Assign FROM the API value, you must drill down and choose the name of the OUT parameter in the OutputParameters root element.
In a Transform activity, you would use the FOR construct on the target side to get the values of the nested table or varray from the source side. -
How to import the internal table into subroutine as parameter
how to import the internal table into subroutine as parameter, and its structure can be recognized inside the subroutine
Hi Yong,
try this:
parameters: p_tabnm like dd03l-tabname.
field-symbols: <fs_tabname> type standard table.
data: itab_ref type ref to data.
create data itab_ref type standard table of (p_tabnm)
with default key.
assign itab_ref->* to <fs_tabname>.
select * from (p_tabnm) into table <fs_tabname>.
perform subroutine tables <fs_tabname>
using p_tabnm.
*& Form subroutine
text
-->P_<FS_TABNAME> text
-->P_P_TABNM text
form subroutine tables p_tabname type standard table
using p_tabnm.
Here p_tabname already has the structure of the table you gave as input
parameter
endform. " subroutine
Maybe you are looking for
-
Some things I like to do with Acrobat 3D - how can I
Hi there, I want to do the following two things in a 3D PDF: - Disable the 3d toolbar. I want to present a Model which can be rotated, zooomed and moved by using the mouse but the viewer shouldn't be allowed to do anything else than that and the 3d t
-
POPUP LOV'S BASED ON SQL QUERY
Help! I am a beginner with APEX and SQL in general, and I need help with an issue I am experiencing. I've created a POPUP LOV with the following SQL statement: SELECT CLOCK_NUMBER || ' ' ||LAST_NAME||', '||FIRST_NAME D, EMP_ID R FROM MASTER The retur
-
Hi all, I use Oracle 8.1.6 in work a little but I'd like to learn alot more about it especially troubleshooting and system administration. Hopefully I'd like to do exams in this one day. Therefore, I'm going to download Oracle 9i for home PC to play
-
Final Cut Studio 2 serial number is not accepted for downloading updates
Hi, because of problems with AVCHD 720p50 import in FCP I wanted to upgrade from version 6.0.1 to 6.0.6. First wired thing: Why is the software update not showing any updates for FCP? There are 5!!! upgrades available, but I had to get a hint on the
-
Problem since 8.0.1 update
I installed the latest update for Coldfusion 8, and now Coldfusion is either shutting down, or not starting after the server reboots. Any one else have this issue? Answers? Russ