Regarding Functions
Hi,
This is a piece of code that I'm stuck up with.
CREATE OR REPLACE FUNCTION NEW_DL_VALIDATION(link2 in varchar2,prottype in varchar2,vlink1type in varchar2,vlink1ckt in varchar2,vdla_ne in varchar2,
vdlz_ne in varchar2,vlink1aport1 in varchar2,vlink1zport1 in varchar2,vlink1aport2 in varchar2,
vlink1zport2 in varchar2)
return varchar2
is
newdl_stat varchar2(1);
vlink2 facodr%rowtype;
vnewdla_ne locref.clli%type;
vnewdlz_ne locref.clli%type;
begin
dbms_output.put_line('These are the inputs for 2nd function');
dbms_output.put_line('LINK2:' || link2);
dbms_output.put_line('prottype' || prottype);
dbms_output.put_line('LINK1:' || vlink1ckt);
begin
select ckt,type,layout,cac,a_port1,z_port1,a_port2,z_port2,prot1,a_location,z_location into vlink2.ckt,vlink2.type,vlink2.layout,vlink2.cac,
vlink2.a_port1,vlink2.z_port1,vlink2.a_port2,vlink2.z_port2,vlink2.prot1,vlink2.a_location,vlink2.z_location from facodr where ckt=link2
and stat='IE' and inter_domain='Y';
exception
when no_data_found then
dbms_output.put_line('The 2nd DL is not a valid one');
newdl_stat := 'N';
return newdl_stat;
end;
dbms_output.put_line('VLINK2.PROT1:' || vlink2.prot1);
select clli into vnewdla_ne from locref where cllikey=vlink2.a_location;
select clli into vnewdlz_ne from locref where cllikey=vlink2.z_location;
if vlink2.ckt!=vlink1ckt
then
if vlink2.type=vlink1type
then
if vlink2.prot1=prottype
then
if (vnewdla_ne=vdla_ne and vnewdlz_ne=vdlz_ne) or (vnewdla_ne=vdlz_ne and vnewdlz_ne=vdla_ne)
then
newdl_stat := 'Y';
return newdl_stat;
else
dbms_output.put_line('The locations or NEs of 2 DLs do not match');
newdl_stat := 'N';
return newdl_stat;
end if;
else
dbms_output.put_line('The protection types of the 2 DLs do not match');
newdl_stat := 'N';
return newdl_stat;
end if;
end;
Here in the third validation vlink2.prot1=prottype, the thing is that prottype is NULL. This variable is cominf from another function. Now when I checked vlink2.prot1 is also null. But when it tries to validate it tells me that both of them are not equal. its comapring NULL with NULL. How can I change this in order to make it work.
Thanks in advance
If you only want trap the situation in which both variables are NULL you might be better off with:
IF vlink2.prot1=prottype
OR (vlink2.prot1 IS NULL AND prottype IS NULL)
THEN
...Using NVL() runs the risk of false positives, although the risk may be negligible.
Cheers, APC
Similar Messages
-
Dilemma regarding function based indexes
Hello,
I have a dilemma regarding function based indexes.
I have read Note:66277.1 on the Metalink discussing thoroughly the subject of “Concepts and Usage of Function Based Indexes”.
This doc was revised on 30-May-2006 so I was sure it referred to 9i and 10g.
This doc as well as other docs on the web claim that in order to use FBI (function based indexes) one must set the following parameters (can be done also at session level)
QUERY_REWRITE_ENABLED = TRUE
QUERY_REWRITE_INTEGRITY = TRUSTED
Also the schema that is owner of the FBI should be granted with QUERY REWRITE sys priv and statistics should be collected since FBI is usable only by CBO (cost based optimizer).
I have tested it and it works, my problem was that it worked
(1) Without granting the QUERY REWRITE to the owning schema.
(2) QUERY_REWRITE_ENABLED was set to false.
(3) QUERY_REWRITE_INTEGRITY was set to enforced.
I have conducted my tests on 9.2.0.6 and found no evidence in the docs (10g) saying the above is required or not.
I found at http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1197786003246 the following:
“Oracle9iR2 relaxed this so that the FBI on the builtin function may be used.”
so I have tested it with my own function:
create or replace function upper2( p_str in varchar2 ) return
varchar2 DETERMINISTIC
as
begin
return upper(p_str);
end;
=>
Also (yes you guessed right), without any privilege granted nor parameter setting the optimizer picked my FBI.
Can anyone refer me to a place documenting this behavior as a correct one?
Other comments?
Regards,
Tal Olier ([email protected])Got an answer from Oracle support:
19-DEC-06 18:04:31 GMT
(Update for record id(s): 101017780,101017796)
QUESTION
========
Questions about the options required in 10g related to Function Based Indexes, and the correct
behaviors associated with them.
ANSWER
======
For 10g:
These requirements are no longer true in 10g. This has already clarified by
development in the Bug 3999326 which is available on metalink.
For 9I:
For the creation of a function-based index in your own schema, you must be
granted the QUERY REWRITE system privileges. To create the index in another
schema or on another schema's tables, you must have the CREATE ANY INDEX
and GLOBAL QUERY REWRITE privileges.
You must have the following initialization parameters defined to create a
function-based index:
QUERY_REWRITE_INTEGRITY set to TRUSTED
QUERY_REWRITE_ENABLED set to TRUE
COMPATIBLE set to 8.1.0.0.0 or a greater value
Additionally, to use a function-based index:
The table must be analyzed after the index is created.
The query must be guaranteed not to need any NULL values from the indexed
expression, since NULL values are not stored in indexes.
However, in 9.2.0.4 patchset, these prerequisites do not apply and one can
create function-based indexes without any of the above to be true. This is not
the case in 9.2.0.3, not in 8.1.7.
Reference: Oracle 9i R2 Administrators Guide
So as mentioned above that is why you didnt have any errors
Please back to us if any further information is need, and we will be pleased to
assist you further.
Thank You,
Best Regards,
Mina Anes -
query regarding function module SPOOL_RQ_READ_BAPI_EXPORTS (EBP-SRM Module)
shopping cart
Hi in FM SPOOL_RQ_READ_BAPI_EXPORTS
i want to relate the internal tables requisition_items and requisition_services.
but in am not getting the key on which they should be joined
here i have to take the quantity and other fields from requisition_services
right now i am using the joining condition as
requisition_items-pckg_no = requisition_services-pckg_no.
any help in this regard is welcome.
Thanks and regards,
VithalprasadHi Kathirvel,
Thank you for reply. I am making changes for standard code only.
" Call FM SPOOL_DPO_READ_BAPI_EXPORTS to read PO data exported to backend.
Use this data to call FM B46B_DPO_TRANSFER and copy errors tab from
' lt_bapi_return ' to ' et_messages' retrun tab in 'doc_check' badi. "
Thank you.
Regards, Sunu -
hi all,
as per my knowledge is concern,functions accept only IN parameters but not out parameters.b'se there is return clause in header and return statement inthe executable section to return the value to the calling envirement.
inthat case,how can we use the following syntax for creating functions,here we are using OUT parameters. even though function is creating without compilation errors.
create or replace functin(p1 OUT number,p2 OUT number)
return number
is
begin
return 0;
end;
iam getting confusion.pl clarify anyone.
thanks
pavani.hi
Dont create duplicate thread ..
Re: regarding function
Khurram -
Question regarding Function F4IF_INT_TABLE_VALUE_REQUEST
Hi Experts,
I am using the function F4IF_INT_TABLE_VALUE_REQUEST in my code as follows :
*& Report ZTESTER
REPORT ZTESTER.
DATA : begin of VALUE_TAB occurs 0,
matnr like marc-matnr,
werks like marc-werks,
pstat like marc-pstat,
end of value_tab.
data: Lt_fields type table of dfies,
lt_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.
PARAMETERS : P_WERKS LIKE MARC-WERKS.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WERKS.
SELECT matnr werks pstat INTO CORRESPONDING FIELDS OF TABLE
VALUE_TAB
FROM MARC WHERE MATNR LIKE 'SH%'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'MARC'
retfield = 'WERKS'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_WERKS'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = 'X'
DISPLAY = 'X'
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = VALUE_TAB
FIELD_TAB = LT_FIELDS
RETURN_TAB = LT_RETURN
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT LT_RETURN.
P_WERKS = LT_RETURN-fieldval.
ENDLOOP.
The code is working fine and when we execute the report and press F4 on the Field, there is an option for User Input also in the search help. The F4 Help shows the values for Material, Plant and Maintenance Status. Also, the user-input options contain the same fields.
My question is Can we give user an additional field say, MARC-MMSTA to enter the value in but dont display it in the value-list.
Please help. Points will be rewarded to useful answers.
Thanks.This is not possible.... when ever you give an additional field as user input, these values are definitely reflected when you call for F4 help... So its not possible to avoid the additional field to be displayed...
Regards,
Pavan P. -
Regarding function changes in sap backend system
Hi Team,
I would like to check if we can alter functions and its actions/permissions in SAP back end and transport it across landscape.
This is needed as we customize the rule set and its difficult to validate the risk analysis changes directly in production when its made via nwbc.
Thanks in advance.
Regards,
AnilHi Anil
If you maintain a Function definition then you are updating those tables (Function to Action (transactions) and Function to Permission (Authorisations) tables). So the answer is YES
If you are asking if you should maintain directly in Production Vs Transport then the answer would be DEPENDS - what is your company process
If you are asking if you can maintain the SAP delivered rule set (activate via BC SETS) then the answer is DEPENDS. Again, it comes back to your company business process. You would then need to consider how you manage any future recommendations from SAP if they update their rule sets
But again, those tables is where you store function definitions so of course you can maintain them.
Regards
Colleen -
hi all,
When i am trying to copy function group j1i4 to j1i4z( This i need to copy from j1i4 , i have acess key also).It is showing this error.
SAP names file for RAMI locked by another process
Message no. PU815
Diagnosis
An operating system file (the SAPNAMES file of user RAMI) could not be accessed from the program that is running, since it is locked by another transaction.
The name of the lock file is "/usr/sap/trans/tmp/RAMI.LOS".
Procedure
Execute the function again after a few seconds.
If the message occurs regularly, contact your SAP administrator.
what will be the problem.
please suggest.
Regards
ReddyTry to copy to zj1i4 instead of j1i4z and you may not need access key to do this. The custom objects shoul start with Z or Y. Otherwise you will have namespace conflict.
-
Regarding Function Module 'SO_NEW_DOCUMENT_SEND_API1'
Hi All,
I am having a issue in using Function Module 'SO_NEW_DOCUMENT_SEND_API1'.
<b>I am presently sending the E-mail as follow:</b>
From: [email protected]
To: [email protected]
Subject: You have Missing Time
Please Do Not Respond To This E-mail ***
BOHAN JAMES P. S25751
07/01/2005 4.00 HRS
07/07/2005 4.00 HRS
07/27/2005 1.50 HRS
For any missing time greater than 30 calendar days, please complete a Salary Request for Labor Hours Transfer Form (SA8250). If you have any questions, please contact Salary Timekeeping on extension 6-5571 or 6-5500.
<b>But the user wants it to be in following way:</b>
From: [email protected] [mailto:[email protected]]
Sent: Monday, August 15, 2005 10:44 AM
To: [email protected]
Subject: You have Missing Time
Please Do Not Respond To This E-mail ***
BOHAN JAMES P. S25751
07/01/2005 4.00 HRS
07/07/2005 4.00 HRS
07/27/2005 1.50 HRS
For any missing time greater than 30 calendar days, please complete a Salary Request for Labor Hours Transfer Form (SA8250). If you have any questions, please contact Salary Timekeeping on extension 6-5571 or 6-5500.
<i>I want following Extra row to be added in when i send Emails to recipients.They should receive Date & Time when i sent that E-mail in following way.</i>
<b>Sent: Monday, August 15, 2005 10:44 AM</b>
Can any body help how can i solve this issue.
Thanks in advance.
Thanks & Regards,
Rayeezuddin.Hi,
check this link:
http://www.sapdevelopment.co.uk/reporting/email/email_sapmail.htm
It has options for date and time while sending a mail.
Best Regards,
Anjali -
Regarding function module in update task
Hi,
I have a function module(Zxxx) which is update type. i have called the fun.module in my program (Zyyy) using the syntax CALL FUNCTION ZXXX IN UPDATE TASK. As I suppose to debug the function module, I activated the update debugging in the debugging screen. But the controll still not goen into the function module. Please let me know solution.
Thanks & regards,
Suresh>
sureshkumar vaniyasekar wrote:
> I activated the update debugging in the debugging screen. But the controll still not goen into the function module.
Hello Suresh,
What do you mean by not going?
If you are trying to do an F5 at the function call, the debugger is not "enter" into the FM. This is because at this point the function call is registered but the FM is not executed.
Update FM calls registered in a particular LUW are executed(in a special "UPD" workprocess) when there is a COMMIT encountered(may be explicit or implicit).
Did you read the online help on [Update Debugging|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/c6/617d0ce68c11d2b2ab080009b43351/content.htm] & [Breakpoint behaviour during Update Debugging|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/c6/617cbee68c11d2b2ab080009b43351/content.htm]?
BR,
Suhas -
Dought regarding Function module
Hi ,
I have small dought regarding fm....
since Read_text is a function module can it be changed to RFC , since i need to retrive data from sap to informatica .
since some of the long text are also need to retrived to a non sap system .
if i creat a zread _text as a RFC .
will this work .am i in the right path ,need ur advice on the same .
if its right what are the steps needs to be followed .to create a zread_text
Thanks ,
VInay .Create a new function module in SE37, e.g. Z_RFC_READ_TEXT and tick that it is RFC enabled. The Import, Export, and Tables parameters should mirror those in READ_TEXT, but you might like to add another table so you can return any exception messages to the caller (e.g. "OT_RETURN" with a structure like BAPIRET2)... you might also have local standard for naming parameters in custom code which you may need to follow. Inside your "Z" function module you just call 'READ_TEXT' using the parameters of the "Z" function. Any exceptions from 'READ_TEXT' should be added into OT_RETURN so that the external caller can be advised of the problem.
-
Regarding Function module HR_MAINTAIN_MASTERDATA.
hi experts,
i have a requirement where in i need to inseert data in to infotype:0000,0001,0105,9010,0041 and update the infotypes:0015,0014,0008,0009 by using function module HR_MAINTAIN_MASTERDATA . i have used ACTIO as 'INS' and 'MOD' (since T589A table doesn't contain the 'UPD' operation).
but using this "MOD' i am unable to update all the infotypes, instead it is throwing the error as entry doesn't exist in T589A for P.
i need to know whether the following code is correct or not and also to overcome the error.. Please let me know the changes needed.
DATA: BEGIN OF IT_INFTY,
INFTY TYPE PPROP-INFTY,
END OF IT_INFTY .
DATA: LV_PERNR TYPE PSPAR-PERNR.
LV_PERNR = '430102'.
if ( IT_INFTY-infty = '0000' or IT_INFTY-infty = '0001'
or IT_INFTY-infty = '9010'
or IT_INFTY-infty = '0105' OR IT_INFTY-infty = '0041' ).
LV_OPERATION = 'INS'.
elseif ( IT_INFTY-infty = '0007' or IT_INFTY-infty = '0008'
or IT_INFTY-infty = '0014' or IT_INFTY-infty = '0015').
LV_OPERATION = 'MOD'.
endif.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = LV_PERNR "WA_SOURCE_DATA-pernr
IMPORTING
RETURN =
LOCKING_USER = sy-uname
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = LV_PERNR
MASSN =
ACTIO = LV_OPERATION "'INS'
TCLAS = 'A'
BEGDA = SY-DATUM
ENDDA = '99991231'
OBJPS =
SEQNR =
SPRPS =
SUBTY = lv_subty
WERKS =
PERSG =
PERSK =
PLANS =
DIALOG_MODE = '2'
LUW_MODE = '1'
NO_EXISTENCE_CHECK = ' '
NO_ENQUEUE = ' '
IMPORTING
RETURN = RC
RETURN1 = RC1
HR_RETURN =
TABLES
PROPOSED_VALUES = PROPOSED_VALUES
MODIFIED_KEYS =
write : / rc-message.
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = LV_PERNR "WA_SOURCE_DATA-pernr
IMPORTING
RETURN =
kindly suggest.
regards,
joy.hi,
i have a similar situation wherein i need to use the two operations insert and modifications for the infotypes.
the problem i am facing is ,i need to put the logic in a method and it doesnt allow the usage of with header line. so how can we refer to the fields if the following logic is used.
TYPES : begin of ty_infty,
infty TYPE pprop-infty,
END OF ty_infty.
DATA: it_INFTY TYPE STANDARD TABLE OF TY_INFTY,
proposed_values TYPE pprop occurs 0 with header line,
wa_INFTY TYPE TY_INFTY.
*************************updation of 0000***********************
lv_fval = '01'.
wa_proposed_values-infty = '0000'.
wa_proposed_values-fname = 'P0000-MASSG'.
wa_proposed_values-fval = LV_FVAL.
wa_proposed_values-fname = '00'.
append wa_proposed_values to proposed_values.
it_infty-infty = wa_proposed_values-infty.
clear wa_proposed_values.
***similarly we update the values for other infotypes
if ( it_infty-infty = '0000' or it_infty-infty = '0001'
or it_INFTY-infty = '0041' or it_INFTY-infty = '9010'
or it_INFTY-infty = '0105').
lv_operation = 'INS'.
elseif ( it_INFTY-infty = '0007' or it_INFTY-infty = '0014' ).
"or IT_INFTY-infty = '0014' or IT_INFTY-infty = '0015').
lv_operation = 'MOD'.
endif.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = lv_pernr
IMPORTING
RETURN =
LOCKING_USER = sy-uname
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = lv_pernr
MASSN =
ACTIO = lv_operation
TCLAS = 'A'
BEGDA = SY-DATUM
ENDDA = '99991231'
OBJPS =
DIALOG_MODE = '2'
LUW_MODE = '1'
NO_EXISTENCE_CHECK = ' '
NO_ENQUEUE = ' '
IMPORTING
RETURN = rc
RETURN1 = rc1
HR_RETURN =
TABLES
PROPOSED_VALUES = proposed_values
MODIFIED_KEYS =
write : / rc-message.
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = lv_pernr
IMPORTING
RETURN =
here its giving an error that it_infty is a table without headerline and has no field as infty.
how to over come this, please guide me in this regard. if this is not the correct logic please tell me the appropraite one..
thanks in advance,
Durga. -
Regarding Function module call
Hi Guru s
Can any body explain how many Function modules are stored in One function group.
And What happen when I call 1 function module in a F.Group.
Thanks in advance,
Kumar.Hi,
Function group can be defined it as collection of Function
modules. This Function groups are presents in the Packages
where we can create in the SE38. So,that all packages are
consists in the Function Groups.All function groups are
consists Function Modules.This function modules are created
at enhancements/Exists.
A function group can hav any no. of FM's.
there is no restriction.
reward if useful
thanks and regards
suma sailaja -
Regarding function module to convert hours to minutes and seconds to minute
hi all,
is there any function module to convert hours to minutes and seconds to minutes....if so please guided me....i hav req like this...want to convert all those to minutes[seconds and hours]....Hi,
Use FM
SD_CALC_DURATION_FROM_DATETIME
Pass paramters like
I_DATE1 16.09.2008
I_TIME1 10:33:00
I_DATE2 16.09.2008
I_TIME2 19:00:00
and you will get the result as below..
E_TDIFF 8:27
8 hours and 27 minutes...
Now u can use this values of hours and minutes to get the exact wage type values... get the details from HR module and multiply it with the hours and minute and calculate it...
Use Offsets and get the hour and minute value from E_TDIFF
Hope it will solve your problem..
Thanks & Regards,
Naresh -
Regarding Function Module AC_DOCUMENT_RECORD
Hi All,
I am working on one Report in which I am calling the function module
<b>AC_DOCUMENT_RECORD</b>. I am Exporting values for all the parameters to this function except
I_AWSYS, I_AWTYP_INCL,I_AWTYP_EXCL.
These parameters will be treated as Default to SPACE.
Can anyone please tell me what these parameters are and what type of value or what value shall
I Export to these Parameters.
Regards,
RishiDear Rishi,
All these three parameters are optional. You can comment them if you do not want to pass any data. The system would treat them as SPACE.
I_AWSYS - Logical System (Character Type of Length 10: ACCHD-AWSYS)
I_AWTYP_INCL - Reference procedure (Character Type of Length 5 :ACCHD-AWTYP)
I_AWTYP_EXCL - Reference procedure (Character Type of Length 5 :ACCHD-AWTYP)
Regards,
Naveen. -
Regarding Function Specification in Sap FICO
HI guyz
Could anybody plz explain what is Functional Specification in SAP FICO
Could anybody explain me with an example.
Could you give any idea abot Technical Specifications too..
Regards
AnilYour question of this general type is discouraged here on SDN-BPX. Please reaquaint yourself with the the [rules of engagment|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement].
[Jeffrey Holdeman|http://wiki.sdn.sap.com/wiki/display/profile/Jeffrey+Holdeman]
SAP Labs, LLC
BusinessObjects Division
Americas Regional Implementation Group (RIG) -
Regarding Functions of Integration Builder (Design)
Hi friends,
I am new to XI.
In Message Mappings ,in data flow editor ,in a particular scenerio I have both source and target fileds and connection between them.How to insert function between those two.
With Best regards,
sagarHi,
At the bottom that is below the mapping object you can find Functions. In that select function and double click on that.
Regards
Agasthuri Doss
Maybe you are looking for
-
Hi. I've recently bought a new computer that doesn't have a CD drive. I am trying to install Dreamweaver CS4 on my new computer (and uninstall from they old one), but I only have the program on CD. Is it possible for me to download Dreamweaver CS4 an
-
Mail issues since manually updating to Mac OS X 10.5.5
Many email issues have popped up since I upgraded to Mac OS X 10.5.5.... could I have some help please? I have a gmail IMAP account in Mail, and a POP account. my most recent incoming emails are not showing up in Mac Mail but they are on the web at g
-
Which ipad air LTE should i buy from US to be used in Singapore
Any suggestions are welcomed. Thanks in advance. -ian-
-
So, until yesterday, I actually believed that this was not possible, but I updated BootCamp to 4.0 and I noticed that when I was using my external display with a MDP -> DVI -> HDMI, there was sound and video coming through it. My question is, how do
-
Unreadable files from camera??
I am an amature photographer and am incredibly dependent on iPhoto. However, within the last week (seems to be after an update - I have a shared iMac) I have been getting obnoxiously repetative warning messages from the application as I am trying to