Odata function import - structure as import parameter
Hello Experts,
I want to pass list of measured values (valueID, measured value) with info about temperature and date.
So i want to pass to function data like this:
- temerature
- date
- measured value table
- valueID1, measured value1
- valueID2, measured value2
- valueID3, measured value3
I am not able to find way how to do it. In function import parameters there is no option to do it (like on below screen from segw)
Thanks for help.
Lucas
I don't like this situation.
Probably its often situation when you want to pass
1) from client
2) or to client
data with structure:
- param1
- param2
- tableType1
For now i know ways:
1) concatenate values from table to one string parameter (function import apraache)
2) create update statement with table (crud update approache) and add param1 and param2 to tableType1. Its of course redundantion and its not good approache for big data.
3) and probably best one: Batch Request in Netweaver Gateway(Multiple Operations into a Single Request)
But i am disappointed that its also impossible to pass table type into function import.
Am i right ?
BR Lucas
Similar Messages
-
Odata function import - input as complex type
Hello
Is it possible to make an input as a complex type ?
for example we want to check set of values which are in table, all for one temperature .
and we will use structure:
1) -temperature
-table
-tableval1
-tableval2
-tableval3
Question is how to set such input type in segw ?
Thanks from mountains
LucasThank you for answer.
The way you create this example does not reflect relation 1:n
We know that temperature value to measured values in in relation 1:n
We don't know n , its could be 5 or 100.
As i understand you approach with complex type will be good when we know that for example for every temperature there will be 5 measured values. but we don't know this. Its dynamic value from runtime, not static.
I mixup while writing post complex type with table type. Correct valus which i want to pass are:
- temerature
- date
- measured value table (n-values, dynamic from runtime)
- valueID1, measured value1
- valueID2, measured value2
- valueID3, measured value3
- valueIDn, measured valuen
For now i know 2 ways:
1) concatenate values from table to one string parameter (function import apraache)
2) create update statement with table (crud update approache):
- temerature, date, valueID1, measured value1
- temerature, date, valueIDn, measured valuen
It makes redundantion.
Both solutions are not ideal.
Thanks for your help! -
How to put data into a RFC import parameter structure from portal
Hi, All,
I have a RFC in which an import parameter is a structure (not a table). I want to put data into that structure. I know how to put data into a table or a string. I tried to use
IRecordSet MyTABStr = (IRecordSet)structureFactory.getStructure(function.getParameter("MYTABSTR").getStructure());
MyTABStr.setString("FIELD1", value1);
MyTABStr.setString("FIELD2", value2);
importParams.put("MYTABSTR",MyTABStr);
But it works for table not structure. Is there anybody know how to do that?
Thanks in advance!
MeiyingHi,
You can try the following code -
IRecord structure = (IRecord)structureFactory.getStructure(function.getParameter("MYTABSTR").getStructure());
structure.setString("FIELD1", value1);
structure.setString("FIELD2", value2);
importParams.put("MYTABSTR",structure);
Regards,
Sudip -
JCA: how to find out that import parameter is structure?
Hello,
I'm using JCA to obtain import parameter of some function (com.sapportals.connector.metadata.functions.IParameter). Now, I'd like to switch program flow depend on kind of this import parameter (scalar, structure, table). Especially, I'm interested in finding out that import parameter is structure. In API I was only locate getStructure() method in IParameter. I tried to compare with null value, but it didn't solve my problem.
Best Regards,
Josef MotlI have come along this post so many times that now that I have solved it myself I will have to reply to it, even after 5 years.
MappedRecord output = (MappedRecord) ix.execute(ixspec, input);
//Now we want to read the output.
//If we deal with a structure, we get an IRecord Object
IRecord addressStructure = (IRecord) output.get("ADDRESS");
//Otherwise we would get an IRecordSet Object (Field)
I hope it will help all those searching as well.
BR
Sigi -
How to use select-options in the function module of import parameter ?
Hi ...
I have created a BAPI and tested in SWO1 tcode , by giving the single value for an company code ( BUKRS ) , it executed properly .
Same thing is working after implementing in a program .
so now it is working for fetching a single company code details .
My requirement is : I want to use select-options in program as well as in function module IN IMPORT PARAMETER.
Program :
REPORT ZTEST.
TABLES : T001 , ZBAPI_STR .
TYPES : BEGIN OF TY_ITEM .
INCLUDE STRUCTURE ZBAPI_STR .
TYPES : END OF TY_ITEM .
DATA :WA_ITEM TYPE TY_ITEM ,
ITEM LIKE STANDARD TABLE OF WA_ITEM INITIAL SIZE 0 .
PARAMETER : BUKRS TYPE ZBAPI_STR-BUKRS.
call function 'ZBAPI_FMT001'
exporting
bukrs = BUKRS
IMPORTING
RETURN =
tables
itemtab = ITEM
IF ITEM IS NOT INITIAL .
LOOP AT ITEM INTO WA_ITEM .
WRITE : / WA_ITEM-BUKRS , WA_ITEM-BUTXT , WA_ITEM-ORT01 , WA_ITEM-LAND1 .
ENDLOOP.
ENDIF.
FUNCTION MODULE :
FUNCTION ZBAPI_FMT001.
""Local Interface:
*" IMPORTING
*" VALUE(BUKRS) TYPE EFG_TAB_RANGES
*" EXPORTING
*" VALUE(RETURN) TYPE BAPIRET2
*" TABLES
*" ITEMTAB STRUCTURE ZBAPI_STR
SELECT BUKRS BUTXT ORT01 LAND1 FROM T001 INTO TABLE ITEMTAB WHERE BUKRS = BUKRS .
ENDFUNCTION.
Regards
Deepa.I have given a similiar example which i did
Declare a
Table type:Z_TT_PONUM
Short text : Select options PO Number
in SE11 tcode with row type eg: Z_ST_PONUM
create a structure (this will be the row type)
Structure Z_ST_PONUM
Short text Select Options Field PO number
Compenent Compent type
SIGN BAPISIGN Inclusion/exclusion criterion SIGN for range tables
OPTION BAPIOPTION Selection operator OPTION for range tables
LOW EBELN Purchasing Document Number
HIGH EBELN Purchasing Document Number
In the function module import
give as
I_PO_NUM TYPE Z_TT_PONUM opt pass value Select options PO Number
Hope this is exactly what you want to know.
So you create a structure simliar to mine but the low an high whould be your component
then a table type and then include that in the BAPI.
Then pass your select-option value to this BAPI when you call this BAPI in the program -
hi,
how to use ET_ATTACH importing parameter of Function module BBP_PD_SC_CREATE, my requirement is to create SC with attachment.
an example would really help.
Kind Regards,
Kailash.Hi,
Generally we create the SC from ITS or Portal, and there in the Create SC screen , once you add the item into the shopping cart , in the Item details, there is the section called , Documents and Attachements, where in you can upload the attachments which ever you want. Sometimes the extn .DOC, .pdf and .xls are allowed. but that also you can check which are the Authorized files extns avaialbe in Backend R/3.
Using the FM RFC_READ_TABLE, in table pass TDWP and in the i_field pass 'APPSFX' and then you can get the authorized file formats. in Backend Transaction DC30 you can verify which are the allowed file formats.
Moreover for restricting the User from uploading the attachment BADI BBP_ITEM_CHECK_BADI can be implemented for raising the error message if required.
Regarding the ET_ATTACH, it is the structure of type BBPT_PDS_ATT_T, so you have to provide the complete details for this structure. Like : GUID, P_GUID ,LOGICAL_SYSTEM, DESCRIPTION, URL, TYPE,DISP_URL, PHIO_EXT ,etc.
Once all the entries are fine.
You can create the SC, but the recommeded way for creating the SC is thru ITS or Portal.
I hope this will help. Feel Free while asking questions.
Thanks and Regards,
Ankur Goyal -
Unable to send structure data type as import parameter in RFC
I have one RFC to web service scenario.My sending RFC is as follows:
FUNCTION ZIXI_001_EMP_DET.
""Local Interface:
*" IMPORTING
*" VALUE(EMP_DET) TYPE ZIXI_EMP
*" VALUE(OFFER_DT) TYPE ZXI_OFFER_DATA
ENDFUNCTION.
Here ZIXI_EMP is a structure with following details:
EMP_ID INT4 INT4 10 0 Natural Number
NAME STRING128 CHAR 128 0 128 Lowercase and Uppercase Letters
SAL INT4 INT4 10 0 Natural Number
and ZXI_OFFER_DATA is another structure with following details:
REQ_ID STRING128 CHAR 128 0 128 Lowercase and Uppercase Letters
PRICE STRING128 CHAR 128 0 128 Lowercase and Uppercase Letters
QTY STRING128 CHAR 128 0 128 Lowercase and Uppercase Letters
After configuring everything in IR and ID, I called the RFC from R3 system with following data:
EMP_DET:
EMP_ID 15
NAME XYZ
SAL 5.000
OFFER_DT:
REQ_ID A235
PRICE 50
QTY 3
but when I am checking in sxmb_moni, payload only containing first field of each structure. i.e.,
<?xml version="1.0" encoding="UTF-8" ?>
- <rfc:ZIXI_001_EMP_DET xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
- <EMP_DET>
<EMP_ID>15</EMP_ID>
<NAME />
<SAL>0</SAL>
</EMP_DET>
- <OFFER_DT>
<REQ_ID>A235</REQ_ID>
<PRICE />
<QTY />
</OFFER_DT>
</rfc:ZIXI_001_EMP_DET>
Why this is happening I don't know. is there any constraint with SAP XI 3.0 that we can not pass values using structure?...
Or any configuration needs to be done?
Please help....Guess I got it... U should define the structure as Tables parameter and not as Import Parameter...
should be like
FUNCTION ZIXI_001_EMP_DET.
""Local Interface:
*" TABLES
*" EMP_DET STRUCTURE ZIXI_EMP
*" OFFER_DT STRUCTURE ZXI_OFFER_DATA
ENDFUNCTION.
~SaNv...
Edited by: Santhosh Kumar V on Mar 18, 2010 6:35 PM -
Create SAP RFC iView with a structure as import parameter
Hello All,
I'm creating a SAP RFC iView from Portal SAP 7.4.
I try call a RFC that have as import parameter a structure with various fields, but the portal recognizes the structure as string field, then I cannot fill the fields values, and when I do a preview the iview, the following error occurs:
Function execution failed. Exception message: class java.lang.String:null incompatible with class com.sapportals.connectors.SAPCFConnector.execution.structures.RecordWrapper:sap.com/[email protected]MultiParentClassLoader@80d4ed6@alive
And only is possible select a output object.
Exists any way of receive a structure or a table as import parameter?, and as output parameters more of a element?
Thanks for your collaboration.Hello All,
I'm creating a SAP RFC iView from Portal SAP 7.4.
I try call a RFC that have as import parameter a structure with various fields, but the portal recognizes the structure as string field, then I cannot fill the fields values, and when I do a preview the iview, the following error occurs:
Function execution failed. Exception message: class java.lang.String:null incompatible with class com.sapportals.connectors.SAPCFConnector.execution.structures.RecordWrapper:sap.com/[email protected]MultiParentClassLoader@80d4ed6@alive
And only is possible select a output object.
Exists any way of receive a structure or a table as import parameter?, and as output parameters more of a element?
Thanks for your collaboration. -
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 -
Hello GW experts,
we have defined a Function Import "CreatePOWithReference" with a parameter "Reference" which contains a string with information about a reference document which shall be used to create a new Purchase Order (PO):
Now I would like to pass not only a single reference but multiple reference all of the same type "Reference".
I tried calling the function import with two references like this:
/sap/opu/odata/sap/ZMP_ODATA_PO_SRV/CreatePOWithReference?Reference='123'&Reference='456'
But in method "/IWBEP/IF_MGW_APPL_SRV_RUNTIME~EXECUTE_ACTION" my parameter table "IT_PARAMETER" only contains 1 single record:
How can I achieve that the table "IT_PARAMETER" contains two records (Reference='123' and Reference='456')?
Thanks and best regards,
Oliver
PS: As there can be any number of references, it is not an option to create several parameters "Reference1", "Reference2", "Reference3" and so on... .Hello Thomas,
In my opinion, i do not think you can pass same property multiple times as you are trying now. I really doubt if GW supports this and IT_PARAMETER has only one Reference ( which is sent 1st i.e., 123 ) as you have already shared values read at runtime.. As per my understanding it is the correct behavior of GW where only one reference number - 123 is present in IT_PARAMETER table.
Other standard way of accomplishing your business case would be implementing CREATE operation and operate it on BATCH.
Regards,
Ashwin -
Function Module: how to setting table import parameter
hi, i'm developing a function module. i create a TABLES where it will allow multiple variables IMPORT from user input to this function module. the tables i set as OPTIONAL and decribed as below.
PSPID PS_PSPID CHAR 24
POSID PS_POSID CHAR 24
AUFNR AUFNR CHAR 12
PSY J_STATUS CHAR 5
PUS J_STATUS CHAR 5
in my source code, i done a select statement to process the IMPORT input . the problems i face,for the PSY and PUS input, if the one or both input is BLANK, NO RESULT will display. What i'm try to do , if input one or both is BLANK, it wil neglect the input and return as ALL RESULT (return result oir all status for input pspis / posid / aufnr) . attached the select statement. thank you
itparm[] = objparm[].
select
a~pspnr a~stspr a~objnr a~pspid
b~psphi b~objnr as wobjnr b~posid
c~aufnr c~objnr as nobjnr c~pspel
d~objnr as jeobjnr d~inact d~stat
e~objnr as jcobjnr e~udate e~usnam e~utime e~stat as jcstat e~inact as jcinact
f~istat as syistat
f~txt04 as sytxt04
f~spras
g~estat as usestat
g~txt04 as ustxt04
into corresponding fields of table itobj
from proj as a
inner join prps as b on a~pspnr = b~psphi
inner join aufk as c on b~pspnr = c~pspel
inner join jest as d on c~objnr = d~objnr
inner join jcds as e on d~objnr = e~objnr
and d~stat = e~stat
inner join tj02t as f on e~stat = f~istat
inner join tj30t as g on a~stspr = g~stsma
for all entries in itparm
where ( a~pspid = itparm-pspid
or b~posid = itparm-posid
or c~aufnr = itparm-aufnr )
and ( f~istat = itparm-PSY and g~estat = itparm-PUS ).Thanks for your quick reply. actually the data will be somehing like this. since i developed a function module, i keep the import parameter in a table.
PSPID PS_PSPID CHAR 24
POSID PS_POSID CHAR 24
AUFNR AUFNR CHAR 12
PSY J_STATUS CHAR 5
PUS J_STATUS CHAR 5
the example data will be in OTPARM internal table
PSPID POSID AUFNR PSY PUS
aa-aa-aa a1 I001
bb-bb-bb b1 E009
cc-cc-cc
i'll store this into an internal table. from the data. it can be seen there a BLANK input. so the blank input should not be included into WHERE connditions. that why in the previous solution, i use SELECT inside LOOP because every line of the IMPORT tables will be generated with different WHERE conditions. i tried to do something like this:
PSPID POSID AUFNR PSY PUS cond_syx
aa-aa-aa a1 I001 if proj~pspid = itparm-pspid and prps~posid = itparm~posid and ....
bb-bb-bb b1 E009 if proj~pspid = itparm-pspid and aufk~aufnr = itparm~paufnr and ....
cc-cc-cc if proj~pspid = itparm-pspid
and implement with FOR ALL ENTERIES, but at the WHERE conditions i failed to put the CONF_SYX. please comment and give opinions. Thanks you very much. -
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 -
Add optional import parameter to an EXISTING Z function module.
Hi Guys,
I want to add an OPTIONAL IMPORT parameter. What are the things I need to take care to change and activate the FM, so that the changes does not effect the other programs calling this Z function module.
Thanks,Adding one more point,
While raising exceptions to your ootional parameter make sure that
For example XINT is optioanl paramter then
if NOT xint is initial.
" then raise your exception
endif.
a® -
Howto map to an odata model function import returning an entity, not an entity set?
Hi,
how do I map to an odate model function import returning an entity (not an entity set) in a XML view? I tried property mapping {/method/property}, which does not make a network request and sets the value to null and I tried aggregation mapping {/method}, which makes a network request with $skip=0&$top=100&$inlinecount=allpages which is of course rejected by the odata source.
Thanks,
WolfgangHello Dr. Wolfgang,
you can use
var oParams = {};
oParams.Field1 = 'ABC';
oParams.Field2= 'XYZ';
oParams.Field3= '123';
oModel.callFunction('MyFuncImport', 'GET', oParams, null, function(oResponse){
alert("Call to Func Imp successful");
},function(){
alert("Call to Func Imp failed");});
also refer SAPUI5 SDK - Demo Kit
Regards,
Chandra -
Checkbox as import parameter in function module
Hi all,
how to create a checkbox as import parameter in function module,
thnx in advance?? Function modules don't have screens...they do have import, export parameters.
If you look at how "checkboxes" are stored in db tables, you'll see that the previous replies are precisely correct. A check box is a char1 field...it is on when 'X' (ABAP_TRUE) and off when blank (initial)....you would call your FM with an import field of type char1 set to 'X' or set to space, and handle accordingly in your FM code.
If you have a checkbox on a selection screen, then the value of that parameter is either 'X' or space, depending upon whether or not the user checked the box.
Maybe you are looking for
-
How can I convert iWeb page to html with NO javascript for email campaign?
I have a holiday greeting I made in iWeb '09 for my business. The service I'm using to use to manage my mailing list wants me to strip all javascript code from the page so it is not seen as spam when it is emailed. How can I convert the page made in
-
Java NIO question...
Hey, I've just start reading and programming a client/server using NIO and got to a point where i need to keep a list of connected clients to send them messages as the server processes information it received... How could i handle this selection of c
-
How do I turn it back to the American iTunes store?
-
Problem in retrieving query string parameters
Hi All, AM working on wsrp in weblogic..Have a doubt in it.. I have two tabs in my application home page..One is tab HOME and another one is tab SEARCH.. So i want to navigate between these two tabs and i have my consumer portlet in tab HOME and prod
-
Why did the Download Manager stop blinking for new downloads?
With 3.6 when I used to start a new download and I had more than one Firefox window open and the pages were stacked on my Win XP taskbar the Firefox tab would light up and blink when my new download started. It was easy to know when the download had