How 2 Develope user defined functions to call function modules in R/3 syst
How to Develope user defined functions to call function modules in SAP R/3 system....in xi
HIi,
If those function modules are RFC enabled then we can call those function module from user defined functions. Please see below link
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
Reward points if helpful.
Thanks,
Vijay Kumar T,
Similar Messages
-
How to Developed user defined functions to call function modules in SAP R/3
how to Develope user defined functions to call function modules in SAP R/3 system
Hello Raja,
Go through this V.imp Link...
http://download.oracle.com/docs/cd/B10464_05/integrate.904/b10408/rfc.htm
Steps to crate FM..
Follow these steps..
Go to the T: code SE37
First You Create Function Group
On That u specify
Function Group Name..............
Short Text..............................
save...
Go to SE 37
Specify the Function Module Name: Eg: Z_Bapi_Materialmaster
Short Text.......
Save...
Next Go to Attributes..
Select Radio button : Remote enabled model
Go to Parameters..
Click Import...
Give Parameter Type Associate type S.t
next Click Export...
Give Parameter Type Associate type S.t
Next Click Tables Button..
Specify tables..
Next click source code button..
Write Source code here..
Eg : Select statements Etc..
Finally we should be select the Radio button Enable remorely
https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=39728
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/bapi%2bstep%2bby%2bstep
Re: User Defined Functions Tutorials
Hope this information is useful to you..
Thanks ,
Satya Kumar.. -
PL/SQL Using SQL%NOTFOUND to raise a user defined exception in a function
I have written the following function for finding the number of items in stock in the item table.
CREATE OR REPLACE function getAmount (ItemID IN NUMBER)
RETURN NUMBER
AS
invalid_id EXCEPTION;
returnedQty number;
BEGIN
Select qty
Into returnedQty
From item
Where itemNo = ItemID;
RETURN (returnedQty);
IF SQL%NOTFOUND THEN
RAISE invalid_id;
END IF;
COMMIT;
Exception
WHEN invalid_id THEN
DBMS_OUTPUT.PUT_LINE('Invalid ID entered');
END getAmount;
The function compiles successfully, although there is a problem that Oracle is not handling my user-defined exception invalid_id
If I use the following for a valid itemID:
DECLARE
return_value number;
BEGIN
return_value := getAmount(1);
DBMS_OUTPUT.PUT_LINE (return_value);
END;
then the function returns the quantity of items in stock correctly.
However, if I enter an incorrect itemID, say 20
DECLARE
return_value number;
BEGIN
return_value := getAmount(20);
DBMS_OUTPUT.PUT_LINE (return_value);
END;
The invalid_id exception is not raised, and the Oracle errors says: no_data_found and the function has not returned a value. If I add a no_data_found exception, this works perfectly, but for this assignment I must write my own user-defined error.
Any help would be very much appreciated!
Thank you.What you're trying to do, is to use an implicit cursor. Implicit cursors will raise no_data_found and too_many_rows in case of an error. Explicit cursors will not.
Also, you have a small coding error ... a little rewrite and your code will do as you want to:
CREATE OR REPLACE function getAmount (ItemID IN NUMBER)
RETURN NUMBER
AS
invalid_id EXCEPTION;
returnedQty number;
cursor citem is
Select qty
From item
Where itemNo = ItemID;
fnd boolean;
BEGIN
open citem;
fetch citem Into returnedQty;
fnd := citem%found;
close citem;
if fnd then
RETURN (returnedQty);
else
RAISE invalid_id;
END IF;
/* Do not catch your own exception or the calling code will not receive it.
Exception
WHEN invalid_id THEN
DBMS_OUTPUT.PUT_LINE('Invalid ID entered');
END getAmount;
Your problem is, you're not using a package. This means, that the calling code has no way of catching this user-defined exeption. The correct way is to define a package, define the userdefined exception in the package and refer to it in your code:
create or replace package amt
is
invalid_id EXCEPTION;
function getAmount (ItemID IN NUMBER)
RETURN NUMBER;
end;
create or replace package body amt
is
function getAmount (ItemID IN NUMBER)
RETURN NUMBER
AS
returnedQty number;
cursor citem is
Select qty
From item
Where itemNo = ItemID;
fnd boolean;
BEGIN
open citem;
fetch citem Into returnedQty;
fnd := citem%found;
close citem;
if fnd then
RETURN (returnedQty);
else
RAISE invalid_id;
END IF;
end;
end; -- end package
To do a simple test, you'll do:
declare
a number;
begin
a := amt.getAmount(123);
dbms_output.put_line('The result is '||a);
exception
when amt.invalid_id then
dbms_output.put_line('ID not found');
end;
Other ways is to raise the exception in your no_data_found block.
But I'm REALLY puzzled if there's really someone out there who prefers a user-defined exception instead of the clearly defined NO_DATA_FOUND exception.
I can't be sure of course, but are you sure what they mean is they don't want ANY exception? That's a pretty common requirement.
In general - explicit cursors are a bit faster because Oracle does not have to do a second fetch to determine TOO_MANY_ROWS. And it's not too much additional writing. Explicit cursors will never raise exceptions - unless you use dynamic sql and your SQL is invalid.
Good luck -
How? Flex pass variables or call function in SWF
Dear All:
I am new in Flex.
But I stuck with a problem for weeks.
I wish to communication between Flex and Flash(swf).
I tried to pass variable from Flex to Swf. (Call function in Swf also pass variables)
I did some tourital on google by using SWFLoader, which works fine.
BUT the AS code in SWF must in MAIN FRAME.
I need put my AS code by using DOCUMENT CLASS.
BUT when I using Document class, the method is not working.
The flex cannot find function in Flash.
PS.I already set main.as class as public
Hope some one can give some hint.
I really get a huge headache.
Many thanks,
HenrymyIP wrote:
> or perhaps more ideal;
>
> for(var sVar in flashVars)
> {
> i++;
> //var mcName = sVar.substr(0,3);
>
> // create the MCs:
> duplicateMovieClip(_root.testBut,"medium"+sVar,i);
> _root["medium"+sVar].testText.text=sVar;
> _root["medium"+sVar].mcName = sVar.substr(0,3);
>
>
> // assign the function to each created MC:
> _root["medium"+sVar].onRelease = function()
> {
> trace(this.mcName)
> _root[mcName]._x=0;
> }
> }
>
thanks but this does not work.
I think that the problem is that the variables defined in the
for loop do not exist in the scope of
the function.
when the MC is clicked, and the onRelease function says:
_root[mcName]._x=0;
the variable "mcName" is empty.
seb ( [email protected])
http://webtrans1.com | high-end web
design
An Ingenious WebSite Builder:
http://sitelander.com -
How to get improt values in CALL function 'smartfomr name'?
i am calling smartform with fucntion module but i am getting 3 import parameter value null(i wnat regarding spool info, etc. from it) ,
i have already defined that 3 import parameters as llike in function module assosiated type.
where i am wrong , what should i have to do,
regards,I thin k you are calling function module directly - use this ,
Use FM SSF_FUNCTION_MODULE_NAME to find Smartform's FM.
formname = 'ZSMRTFORM'.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = formname
importing
fm_name = fm_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
exit.
endif.
then pass the value in
CALL FUNCTION fm_name
EXPORTING ....
IMPORTING
DOCUMENT_OUTPUT_INFO = l_doc_output_info
JOB_OUTPUT_INFO = tab_otf_data
JOB_OUTPUT_OPTIONS = l_job_output_options
TABLE .....
Regards,
Amit
Reward all helpful replies. -
How to pass string value to call function in BIIP FOX?
Dear all,
In BIIP fox , we can call function module.
I got a simple test FM like:
FUNCTION ZTESTBPSFM2.
""Local Interface:
*" IMPORTING
*" REFERENCE(I_X) TYPE STRING
*" REFERENCE(I_H) TYPE BSP_STRING
*" EXPORTING
*" REFERENCE(I_Y) TYPE F
ENDFUNCTION.
My FOX is like,
DATA YM TYPE 0CALMONTH.
DATA I_N TYPE F.
DATA J TYPE STRING.
J = 'KKKK'.
FOREACH YM.
CALL FUNCTION ZTESTBPSFM2
EXPORTING
I_X = J
IMPORTING
I_Y = I_N.
{ZREV , YM} = I_N.
ENDFOR.
When I run the function , I got a error .
"Types of parameter I_X (S) and variable J(C) are inconsistent "
Does anyone know which string data type I should use in function module?
Best Regards,
JeffHi Jeff
this is a bug. Please open a customer message so SAP support can correct the issue.
Regards,
Marc
SAP NetWeaver RIG -
How do I add "click to call" function
Now that I have completed my new CC squashable web site, www.oldeworldelace.com, I would like to add a "click to call" function to my mobile phone section. Is there an Adobe or outside source for this software? Thanks in advance.
What Ken said.
Keep in mind that a telephone link only works on phone devices that have the phone feature turned on. Some smart phones disable the phone during internet usage.
Nancy O. -
How register user defined listener name with OEM
DEFAULT LISTENER
[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 06-SEP-2010 10:03:46
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
USER DEFINED LISTENER
[oracle@localhost ~]$ lsnrctl status LISTENER_LIMCAMP
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 06-SEP-2010 10:04:03
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.106.72)(PORT=1521)))
STATUS of the LISTENER
Alias LISTENER_LIMCAMP
Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date 03-SEP-2010 19:42:11
Uptime 2 days 14 hr. 21 min. 52 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /ora10gsoft/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /ora10gsoft/oracle/product/10.2.0/db_1/network/log/listener_limcamp.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.106.72)(PORT=1521)))
Services Summary...
Service "LIMCAMP" has 1 instance(s).
Instance "LIMCAMP", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
I am able to connected thru listener.
But my OEM database control showing
Host localhost.localdomain
Port 1521
SID LIMCAMP
Oracle Home /ora10gsoft/oracle/product/10.2.0/db_1
Status Down
Host localhost.localdomain
Port 1521
Name LISTENER
Oracle Home /ora10gsoft/oracle/product/10.2.0/db_1
Location /ora10gsoft/oracle/product/10.2.0/db_1/network/admin
Details TNS-12541: TNS:no listener
My OEM taking the default LISTENER( which is not running). how to register OEM to take the listener (LISTENER_LIMCAMP).# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain
192.168.106.72 localhost.localdomain
would you please have a look into the below link which is the issue on the same server.
Heartbeat failed to connect to standby : archive files not transfering....
Edited by: SAKTHIVEL on Sep 6, 2010 11:45 AM -
SQL Developer user defined reports (appropriate utilization)
I have used SQL developer on a limited basis but I have never created a user defined report. Can someone compare and contrast the
types of user defined reports that can be created via SQL developer versus the types of user defined reports that can be created via
a tool such as Crystal Reports or similar tool.Hi user7753875 -
I agree with reidelme that it won't match the capabilities for fancy organisation/output of tools like Crystal Reports, but you can do interrelated parent/multiple child reports.
Check out the Reports tab on the SQL Developer Exchange for some examples of what other users have done with this.
Brian Jeffries
SQL Developer Team
Edited by: bjeffrie on Jun 3, 2011 5:01 PM
Turns out no one has used that in a long time. You will have to do some interpretive cut/past from xml given by web site & report editor in SQL Developer. Here is the "Who" report (master+2 child reports) from the exchange in a format you can use the import function from "User Defined Reports" on.
<?xml version="1.0" encoding="UTF-8" ?>
<displays>
<display id="57507b3a-0130-1000-8008-a9fec67b8254" type="" style="table" enable="true">
<name><![CDATA[Who]]></name>
<description><![CDATA[
A Report to show active seesion and some details about there activities. Includes 2 Child-reports for Active SQL and PID for the process supporting the session.
]]></description>
<tooltip><![CDATA[Who is logged in and what is he doing]]></tooltip>
<drillclass><![CDATA[null]]></drillclass>
<CustomValues>
</CustomValues>
<query>
<sql><![CDATA[SELECT sid, serial#, username, status, server, machine, program FROM v$session order by sid]]></sql>
</query>
<display id="null" type="Child" style="Table" enable="true">
<name><![CDATA[ActiveSQL]]></name>
<description><![CDATA[]]></description>
<tooltip><![CDATA[]]></tooltip>
<drillclass><![CDATA[null]]></drillclass>
<CustomValues>
<TYPE>null</TYPE>
</CustomValues>
<query>
<sql><![CDATA[select c.spid b1, b.osuser c1, b.username c2, b.sid b2, b.serial# b3, a.sql_text,b.status,to_char(b.logon_time, 'DD-MON-YYYY HH24:MI:SS') from v$sqltext a, v$session b, v$process c where a.address = b.sql_address and b.paddr = c.addr and a.hash_value = b.sql_hash_value and b.sid = :SID order by c.spid,a.hash_value,a.piece]]></sql>
<binds>
<bind id="SID">
<prompt><![CDATA[SID]]></prompt>
<tooltip><![CDATA[SID]]></tooltip>
<value><![CDATA[NULL_VALUE]]></value>
</bind>
</binds>
</query>
</display>
<display id="null" type="Child" style="Table" enable="true">
<name><![CDATA[Process]]></name>
<description><![CDATA[]]></description>
<tooltip><![CDATA[]]></tooltip>
<drillclass><![CDATA[null]]></drillclass>
<CustomValues>
<TYPE>null</TYPE>
</CustomValues>
<query>
<sql><![CDATA[select p.spid,p.addr,s.sid,s.server,p.username,s.osuser,p.program,t.value/1024/1024 PGA_Mb from v$process p,v$session s,v$sesstat t where p.addr=s.paddr and s.sid=t.sid and s.sid = :SID and t.statistic#=20]]></sql>
<binds>
<bind id="SID">
<prompt><![CDATA[SID]]></prompt>
<tooltip><![CDATA[SID]]></tooltip>
<value><![CDATA[NULL_VALUE]]></value>
</bind>
</binds>
</query>
</display>
</display>
</displays>
Edited by: bjeffrie on Jun 3, 2011 5:01 PM -
Wht is UPDATE TASK functionality in CALL FUNCTION??
Hi Experts,
Pls. clarify one of my simple doubt that, Wht is the functionality of UPDATE TASK, in following sttement?
<i><b>call function 'Z_FM_1' in update task</b></i>
I found SAP help as follow, but not understood??
<i>Flags the function module func for execution in the update task. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and a subsequent COMMIT WORK then causes the function module to be executed by the update task. Update function modules must be flagged as such in the Function Builder
The return value is not set.</i>
thanqHi,
It sounds like the FM was not called but it was (rollback process).
And what is the difference between an update attribute assigning FM and this?
You control the FM update process by setting the update module attribute.
- Update with immediate start
Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions can be restarted by the update task in case of errors.
- Update w. imm. start, no restart
Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions may not be restarted by the update task.
- Update with delayed start
Set this option for low priority ("V2") functions that run in their own update transactions. These functions can be restarted by the update task in case of errors.
Regards,
Ferry Lianto -
How toAccess User Defined Properties in NWDS
Hi to Experts,
i hope some one might faced this same problem, i want access user defined properties from KM to NWDS. For that Iu2019m using
EP 7.0 and NWDS Version: 7.0.11.
i have one Req.. to send value as a text or String to Km Property for store or display Km Folder. Like as we have name, date, created by, Description, Extra..... at the same place i want create my own Properties(using with Property metadata @ Global Service) and what ever Properties i created those ones i want use and store or send date to that particular property to display to end-user.
For above process am using WDJ
hope i can get this And thanQ in Advance.
vita- Create a user-defined OTD with one String field.
- Create an XSD-based OTD with repeating name and value fields of type String
- Create a "New Web Service" Java Collaboration whose input will be the first OTD, whose output will be the second OTD and whose operation will be named getProeprties, or some such
- Implement, in Java, the code necessary to read your properties, given the properties file name or path (given in the input OTD) and populate the name/valur pairs on the output OTD
- drag the operation of the collaboration onto the Business Process Editor canvas as an Activity
- Configure a Busienss Rule to set the input of the getProperties activity to the name/path of the properties file
- Configure a Business Rule(s) to use the name/value pairs returned from the ivocation of teh getProperties service
If you wish to take this one step further you could consider writing the java collaboration
a) generically so it can be reused from different business processes
b) to cache the properties on first read so each invocation after the first one simply returns the in-memory values instead of re-reading the proerties from disk
c) generically so it can read, cache and return different property sets depending on the properties file/path provided as input.
Bear in mind that IO from a java collaboration by means other than an eWay violates the EJB spec.. It works all the same.
Message was edited by:
mczapski -
User Defined Variable in REPOST function
Hai friends,
I have a planning package where i have defined a Planning function for REPOST. What I want to do is to change a characteristic value based on the User entered another characteristic value. For instance say there are 2 characteristic C1 and C2 , I want the user to enter the set of values of C1 for which C2 value must change. For this , i created a USER SPECIFIC variable and put in the selection condition of parameter group. But when I execute the function , it doesnt ask for the C1 value and changes the C2 value for all records.
It is highly urgent. Kindly help !
Regards,
Neha SolankiHai friends,
My problem has been resolved.
It was a mistake at my end.
Regards,
Neha Solanki -
How to User Profit Center Fucntionality in ISH Module
Hi,
In ISH Module, i dont find an option To User Profit Center Accounting fucntionality as i am able to see only Cost Center & Internal Order.
Kindly Proivde me some inputs how to use Profit Center in ISH module and How to get the P&L Reports profit center wise.
ThanksHi
IS-H uses cost centers for revenue accounting, you must deactivate the flag that blocks revenue accountig in cost center master data. The revenues are then posted to profit center assigned to the cost center. There is no place to configure profit center accounting in IS-H.
With best regards
Matías -
8i personal : error when Create user defined aggregate function
Hi,
I have problem on creating user defined aggregate function.
I try to create the sample aggregate function "SecondMax" from 9i developer guide(append at the end of this post).
It's work to create object type and the type body, but
there is error when I create the aggregate function..
"CREATE FUNCTION SecondMax (input NUMBER) RETURN NUMBER
PARALLEL_ENABLE AGGREGATE USING SecondMaxImpl;"
I am using 8i personal now.. is that the syntax of create function in 9i is different from that in 8i?
Example: Creating and Using a User-Defined Aggregate
This example illustrates creating a simple user-defined aggregate function SecondMax() that returns the second-largest value in a set of numbers.
Creating SecondMax()
Implement the type SecondMaxImpl to contain the ODCIAggregate routines.
create type SecondMaxImpl as object
max NUMBER, -- highest value seen so far
secmax NUMBER, -- second highest value seen so far
static function ODCIAggregateInitialize(sctx IN OUT SecondMaxImpl)
return number,
member function ODCIAggregateIterate(self IN OUT SecondMaxImpl,
value IN number) return number,
member function ODCIAggregateTerminate(self IN SecondMaxImpl,
returnValue OUT number, flags IN number) return number,
member function ODCIAggregateMerge(self IN OUT SecondMaxImpl,
ctx2 IN SecondMaxImpl) return number
Implement the type body for SecondMaxImpl.
create or replace type body SecondMaxImpl is
static function ODCIAggregateInitialize(sctx IN OUT SecondMaxImpl)
return number is
begin
sctx := SecondMaxImpl(0, 0);
return ODCIConst.Success;
end;
member function ODCIAggregateIterate(self IN OUT SecondMaxImpl, value IN number)
return number is
begin
if value > self.max then
self.secmax := self.max;
self.max := value;
elsif value > self.secmax then
self.secmax := value;
end if;
return ODCIConst.Success;
end;
member function ODCIAggregateTerminate(self IN SecondMaxImpl, returnValue OUT
number, flags IN number) return number is
begin
returnValue := self.secmax;
return ODCIConst.Success;
end;
member function ODCIAggregateMerge(self IN OUT SecondMaxImpl, ctx2 IN
SecondMaxImpl) return number is
begin
if ctx2.max > self.max then
if ctx2.secmax > self.secmax then
self.secmax := ctx2.secmax;
else
self.secmax := self.max;
end if;
self.max := ctx2.max;
elsif ctx2.max > self.secmax then
self.secmax := ctx2.max;
end if;
return ODCIConst.Success;
end;
end;
Create the user-defined aggregate.
CREATE FUNCTION SecondMax (input NUMBER) RETURN NUMBER
PARALLEL_ENABLE AGGREGATE USING SecondMaxImpl;
Using SecondMax()
SELECT SecondMax(salary), department_id
FROM employees
GROUP BY department_id
HAVING SecondMax(salary) > 9000;This could be a x64/x86 problem. Try following this thread
[GetCompanyService|GetCompanyService] and recompile your code for the platform you need. -
USER DEFINED EVENT IN FUNCTION EXIT
HI,
CAN WE TRIGER AN USER DEFINED EVENT IN AN FUNCTION EXIT FOR XK01.Hi,
if you identified the correct place then yes we can trigger the event. you want any workflow event to be raised.
do you have any such exit with you.
Regards
vijay
Maybe you are looking for
-
How do I use iTunes Match to restore my iTunes library?
I tried to move my entire iTunes library to an external hard drive in order to free up space on my laptop's hard drive. I followed a step-by-step guide on doing this. The process didn't go to plan though and now I'm in a situation where a good two th
-
Eclipse Plugins for Servlets and JSP.
Hi Guys, Can any one suggest where i can get the eclipse plugins for Servlets and JSP. May i am wrong posting this question in this forum. I already browsed thru all the forum to get the info but in vain. so any help will be appreciated. Thank You, c
-
Check if the file exists in the local machine...
Hi, I am getting a problem while checking if the local file exists or not. In the first case the server is same as my local machine. When I try to test if the file exists or not using FILE.exists() it works because I am looking for the file in my mac
-
Little Arrows Don't Link to Music Store As Before
When I click on the little arrows next to the artist or album title in my library in iTunes 7 - Windows (on computer at work), it no longer takes me to the artist or album page in iTunes as before. Now it takes me to the Search page, autofills all th
-
Battery Depletion While Sleeping...can we make it better?
I was thinking, but have not had time/resources to do any benchmarking. If these laptops use battery juice while sleeping to preserve the contents of RAM....Would freeing up RAM (quitting applications, flushing cache to disk etc) make an difference o