Remember values for generating a function tree
Most user settings are kept in either the project or the workspace file. Unfortunately, this is not true for building a function tree (Options/Generate Function Tree). Starting CVI the previous entries are lost. Actually this is an old issue but may be not too old to be improved...
So I suggest to save the information about Instrument name, Function prefix, Default qualifier, and Output function tree in the appropriate configuration file (prj or cws)
Thanks
Arash wrote:
hi,
i tried to write a function that generate a actual tree select and i think this is very helpful
We are so proud of you!
Similar Messages
-
A function for generate a actual tree select
hi,
i tried to write a function that generate a actual tree select and i think this is very helpful
Create Or Replace Function Generate_Tree_Fun(p_Path Varchar2,
p_Delimiter Varchar2,
p_Level Integer,
p_Tbl_Name Varchar2,
p_Parent_Field Varchar2,
p_Child_Filed Varchar2)
Return Varchar2 Is
v_Txt Varchar2(5000) := '';
v_Row_Num Number;
v_Max_Count Number;
v_Child Varchar2(100);
v_Parent Varchar2(100);
v_Level Number := p_Level;
Begin
If (v_Level = 1) Then
Return '';
End If;
If (v_Level > 1) Then
v_Txt := '|' || Lpad('_', 6, '_');
End If;
If (v_Level > 2) Then
For i In 1 .. p_Level - 2 Loop
v_Level := v_Level - 1;
v_Child := Ltrim(Regexp_Replace(p_Path,
Ltrim(Replace(p_Path,
p_Delimiter,
')(' || p_Delimiter) || ')',
'\' || v_Level),
p_Delimiter);
Execute Immediate 'Select t.' || p_Parent_Field || '
From ' || p_Tbl_Name || ' t
Where t.' || p_Child_Filed || ' = :1'
Into v_Parent
Using v_Child;
Execute Immediate 'Select a, b From (Select Row_Number() Over(Order By t.' ||
p_Child_Filed ||
') a,Count(1) Over(Partition By t.' ||
p_Parent_Field || ') b,t.' || p_Child_Filed ||
',t.' || p_Parent_Field || ' From ' || p_Tbl_Name ||
' t Where t.' || p_Parent_Field ||
' = :1 Order By t.' || p_Child_Filed || ') Where ' ||
p_Child_Filed || ' = :2 '
Into v_Row_Num, v_Max_Count
Using v_Parent, v_Child;
If (v_Row_Num <> v_Max_Count) Then
v_Txt := Rpad('|', 20, ' ') || v_Txt;
Else
v_Txt := Rpad(' ', 20, ' ') || v_Txt;
End If;
End Loop;
End If;
Return v_Txt;
End;
select Generate_Tree_Fun(sys_connect_by_path(e.empno,','),',',level,'emp','mgr','empno') || e.ename
from emp e
start with mgr is null
connect by e.mgr=prior e.empno
enjoy itArash wrote:
hi,
i tried to write a function that generate a actual tree select and i think this is very helpful
We are so proud of you! -
Can not input data when removed the value for seleciton condition
Dear Experts,
We met a very strange issue for the IP.
We create a aggregation level and relatd query for user to key in data.
We have a filter in the aggregation level.
It will set value for A,B,C,D
When user opent he report, system will require user to key in the value for A,B,C,D.
Now we found that if we key in value for B, cell is input ready.
If we removed the value in for the B in the selection condition (I mean the value of B is empty, this means tha all the value of B will display in the report), we can not key in data.
Could you kindly let me kow the reason?
Thanks and best regards
Alex yangDear Experts,
Many thanks for your information.
I know the principle for the IP.
But I think you may misunderstanding this issue due to my incorrect explaination.
First, we think the aggreagtion level is ok. This is due to that for the B in my example, we set its as column value in the query.
This is means for each record in the IP query, it has only one B value to reflect it.
But strange things is that if we set fixed value for B, IP input is ok.
If we removed fixed value for B, IP function is error.
Now, we will test if we key in multi value for B whether IP input function is ok or not.
Any update, I will inform you.
Thanks and best regards
Alex yang -
CRMD_ORDER: how to set default values for Requester and Change Manager
Hello Folks,
how do I set default values in TA crmd_order?
I drew my organizational hierarchy using TAs bp and ppoma_crm.
When a new Change Request (e. g. SDHF) is created, I want the four roles (Requester, Change Manager, IT Operator and Developer) to be set automatically, not manually.
Both Requester (= Key User) and Change Manager are derivable. I did not find anything in SPRO neither in the OSS neither here.
Points will be rewarded as a matter of course!
Thanx in advance!Hi Dirk,
look for Define Access Sequence & Define Partner Determination Procedure in SPRO and read the IMG Activity Documentation. You can find it in the Service Desk config, but it works for the other transaction types too.
Basically, you create Access Sequences where you tell the Partner Determination Procedure where to look for the values for the Partner Function fields.
The Access Sequence can use lots of sources for the information, including your org structure.
regards,
Jason -
Hi, guys:
I have a partner function created (ie. ZEMPLY), and i want to remove the value for the partner function once I dispatch the service request.
I want to use the xpath to get the entity.
get_entity_b_path( path = '//CURRENTBT/BTOrderHeader/BTHeaderPartnerSet/.......' ).
and then I do not know which one I can use after /BTHeaderPartnerSet. because it is not SAP standard partner function.
Can you guys know this?
Cheers,
EricUsing BPath I would go for this
lr_col = lr_entity->get_related_entities_by_bpath( './BTOrderHeader/BTHeaderPartnerSet/BTPartnerAll[@PARTNER_FCT="ZEMPLY"]' ).
lr_entity = lr_col->get_first( ).
Be sure to read the great blogs by Jürgen Gatter on BPath: http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/u/49754
You can also add the relationship you are missing into the GenIL model. Customizing is in SPRO and the relation would be BTPartnerSet -> "BTPartner_ZEMPLY" -> BTPartner.
cheers Carsten -
Default values for iBase and component in CRMD_ORDER
Dear developers,
is there a possibility to set the input fields for iBase and component in the transaction CRMD_ORDER on a userspecified default value? The Parameter-ID's IBC and IIB that are saved with the SAP-User doesn't work
Is the a known solution?
Thanks in advance,
Jens SperkHi Dirk,
look for Define Access Sequence & Define Partner Determination Procedure in SPRO and read the IMG Activity Documentation. You can find it in the Service Desk config, but it works for the other transaction types too.
Basically, you create Access Sequences where you tell the Partner Determination Procedure where to look for the values for the Partner Function fields.
The Access Sequence can use lots of sources for the information, including your org structure.
regards,
Jason -
Using a variable value in CDATA for generating an XML type in Oracle
Hello,
I have prepared a function given below where I have some input variables & I have to generate one XML with those input variables as tag attribute value:
create or replace function NEW_PROJECT_DETAILS
( p_ReferenceId in varchar2 ,
p_Project_No in varchar2,
p_Project_Name in varchar2,
p_Project_Desc in varchar2 ,
p_Project_Type in varchar2,
p_Project_Location in varchar2,
p_Project_Status in varchar2 )
return xmltype
as
payload xmltype;
begin
dbms_output.put_line('Payload Started');
payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
<ProjectDetails>
<RefID>'||p_ReferenceId||'</RefID>
<ProjectNo>'||p_Project_No||'</ProjectNo>
<ProjectName>'||p_Project_Name||'</ProjectName>
<ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
<ProjectType>'||p_Project_Type||'</ProjectType>
<ProjectLocation><![CDATA[p_Project_Location]]></ProjectLocation>
/* <ProjectLocation>'||p_Project_Location||'</ProjectLocation> */
<ProjectStatus>'||p_Project_Status||'</ProjectStatus>
</ProjectDetails>');
dbms_output.put_line('Payload Comp1');
return payload;
end;
This procedure works absolutely fine.
Now the problem which I am having is that the variable p_Project_Location has value like "6747:BBO&M SBV".
Due to the '*&*' in that value I have to use CDATA. But i dont know how to pass this variable directly in the CDATA in the XML.
Please help me with this asap.
Thanks & Regards,
Divya Aggarwal
Edited by: 784414 on Dec 2, 2010 4:15 AM
Edited by: 784414 on Dec 2, 2010 4:16 AMHi,
If you absolutely want to use a CDATA section, then :
payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
<ProjectDetails>
<RefID>'||p_ReferenceId||'</RefID>
<ProjectNo>'||p_Project_No||'</ProjectNo>
<ProjectName>'||p_Project_Name||'</ProjectName>
<ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
<ProjectType>'||p_Project_Type||'</ProjectType>
<ProjectLocation><![CDATA['||p_Project_Location||']]></ProjectLocation>
<ProjectStatus>'||p_Project_Status||'</ProjectStatus>
</ProjectDetails>');Alternatively, you can escape non valid characters with DBMS_XMLGEN.CONVERT, e.g. :
payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
<ProjectDetails>
<RefID>'||p_ReferenceId||'</RefID>
<ProjectNo>'||p_Project_No||'</ProjectNo>
<ProjectName>'||p_Project_Name||'</ProjectName>
<ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
<ProjectType>'||p_Project_Type||'</ProjectType>
<ProjectLocation>'||dbms_xmlgen.convert(p_Project_Location)||'</ProjectLocation>
<ProjectStatus>'||p_Project_Status||'</ProjectStatus>
</ProjectDetails>');which outputs :
<?xml version="1.0" encoding="UTF-8"?>
<ProjectDetails>
<RefID>1</RefID>
<ProjectNo>1</ProjectNo>
<ProjectName>PRJ1</ProjectName>
<ProjectDesc>This is project 1</ProjectDesc>
<ProjectType>P</ProjectType>
<ProjectLocation>6747:BBO&M SBV</ProjectLocation>
<ProjectStatus>S</ProjectStatus>
</ProjectDetails>Any basic XML parser should then convert back escaped characters when processing the document.
You can also use SQL/XML functions, which will take care of that automatically.
For example :
SELECT appendChildXML(
XMLType('<?xml version="1.0" encoding="UTF-8"?><ProjectDetails/>'),
XMLForest(
'1' as "RefID",
'1' as "ProjectNo",
'PRJ1' as "ProjectName",
'This is project 1' as "ProjectDesc",
'P' as "ProjectType",
'6747:BBO&M SBV' as "ProjectLocation",
'S' as "ProjectStatus"
FROM dual;or,
SELECT appendChildXML(
XMLType('<?xml version="1.0" encoding="UTF-8"?><ProjectDetails/>'),
XMLForest(
'1' as "RefID",
'1' as "ProjectNo",
'PRJ1' as "ProjectName",
'This is project 1' as "ProjectDesc",
'P' as "ProjectType",
XMLCData('6747:BBO&M SBV') as "ProjectLocation",
'S' as "ProjectStatus"
FROM dual; -
Generating MD5 hash value for any specific flat file
Hi experts,
I am developing a program that will generate flat files and also I should generate the MD5 Hash value for each and every flat files. My question is how can I generate the MD5 hash value for the generated .txt files.
Thanks in advance
ShabirYou can use functions
MD5_CALCULATE_HASH_FOR_CHAR for text file
MD5_CALCULATE_HASH_FOR_RAW for binary -
Required to get class Charateristics and values for an functional location
Hi ,
As per the requirement ,i have to read the class characteristics and the corresponding values for an function location.I have functional location number ,and the various class names associated with fn.location. Any pointers would be helpful
Regards
Arun TFM BAPI_OBJCL_GETDETAIL
OBJECTKEY ?0100000000000011643
OBJECTTABLE IFLOT
CLASSNUM ZPMI_BLDG
CLASSTYPE 003
KEYDATE 29.07.2009
UNVALUATED_CHARS
LANGUAGE EN
Cheers! -
SQLJ-JPublisher - J2T-153, Invalid value for -context:while generating the
Hi All,
I am trying to generate the java code for the oracle types defined for one of the module in our project.for that i have defined a new context by extending the 'DefaultContext'
provided by SQLJ and as mentioned in the below URL.
http://docs.oracle.com/cd/A91202_01/901_doc/java.901/a90214/jpub.htm
Topic : JPublisher Generation of SQLJ Classes
MyContext:-
import java.sql.Connection;
import java.sql.SQLException;
import sqlj.runtime.ref.DefaultContext;
public class MyContext extends sqlj.runtime.ref.DefaultContext{
static {
DefaultContext defaultContext = null;
try {
defaultContext = new DefaultContext(<datasource>);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
DefaultContext.setDefaultContext(defaultContext);
public MyContext(Connection arg0) throws SQLException {
super(arg0);
public Connection getConnection(){
Connection con = null;
try {
con = <datasource>getConnection();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return con;
JPub command:
jpub -user=usr/pwd -context=com.test.context.MyContext -sql=<My Types Here> -compile=false
I am getting the below error while running the jpub command in dos prompt.
Error Log:
J2T-153, Invalid value for -context: com.test.context.MyContext. This must be set to generated or to DefaultContext.
Please let me know if anybody has come across this problem before.
Thanks,
Vijay
Edited by: 905698 on 03-Jan-2012 09:53Hi Vijay,
This post DOES NOT correspond to this forum.
The current forum is for BI Publisher. Your question is for JPublisher and believe it corresponds to PL/SQL forums.
Please close the thread
thanks
Jorge -
Functional specs for generating Report.
< MODERATOR: All points have been UNASSIGNED and the message locked. Please do not share email addresses, documents, or links to copyrighted or company confidential information on these forums. >
Hi
This is Sunil garg Sd consultant.
Can any body provide me the format with exaples for writing a functional specs to generate the Reports.
How we will write yhe processing logic of that repot.
Tables & thier relations.
Please Help me
Thanks & Regards
Sunil gargPatial example of Functional Specs. Please map it in Excel & it will give you better clearity. This is Sample for SD report covering Link Between Project System, Sales Order, Delivery, Billing & Accounting Document
<b>Initial Screen</b>:
Fields | Table-Field | Remark | Table Joint
Sales Organization | VBAK-WAERK | Single Selection
Distribution Channel | VBAK-VTWEG | Multiple Selection
Division | VBAK-SPART | Multiple Selection
Sales office | VBAK-VKBUR | Multiple Selection
Sold to Party | VBPA-KUNNR | Multiple Selection | VBAK-VBELN=VBPA-VBELN
Material | VBAP-MATNR | Multiple Selection | VBAK-VBELN=VBAP-VBELN
WBS Element | VBAP-PS PSP PNR | Multiple Selection | VBAK-VBELN=VBAP-VBELN
Sales Order Type | VBAK-AUART | Multiple Selection
Billing Type | VBRK-FKART | Multiple Selection | VBAK-VBELN=VBFA-VBELV & VBRK-VBELN=VBFA-VBELN
Period
<b>Main Screen</b>:
<i>Header</i>
Sales Organization | VBAK-VKORG
Period
<i>Item Level</i>:
Sold-to-Party | VBPA-KUNNR where VBPA-PARVW = AG
Distribution Channel | VBAK-VKWEG
Division | VBAK-SPART
WBS Element | VBAP-PS_PSP_PNR
Sales Office | VBAK-VKBUR
Sales Doc type | VBAK-AUART
Sales Doc No | VBAK-VBELN
Material | VBAP-MATNR
Mat Desc | VBAP-ARKTX
Qty | VBAP-KWMENG
UOM | VBAP-MEINS
Doc Currency | VBAK-WAERK
Delivery No | LIKP-VBELN
Billing Document Type | VBRK-FKART
Billing Document No | VBRK-VBELN
Billing Document Line No | VBRP-POSNR
Quantity | VBRP-FKIMG
Price - Base Price
Price - Service Tax
Price - Education Cess
Price - VAT
Price - Other taxes
Price - Total
Accounting Document Number | BKPF-BELNR
Table Joints at Item Level:
VBAK-VBELN = VBPA-VBELN
VBAK-VBELN = VBAP-VBELN
VBAK-VBELN = VBFA-VBELV (For Delivery)
VBAK-VBELN = VBFA-VBELV
LIKP-VBELN = VBFA-VBELV
VBRK-VBELN = VBRP-VBELN
VBRK-XBLNR = BKPF-XBLNR
some details are missing, please try to identify & use it as per your requirement.
Regards,
Rajesh Banka
Reward suitable points.
How to give points: Mark your thread as a question while creating it. In the answers you get, you can assign the points by clicking on the stars to the left. You also get a point yourself for rewarding (one per thread). -
Function module expression for dynamic value for Cost center in BRF
Hello Experts,
We are in SRM 7.0 and our business object is shopping cart using BRF.
Right now we have Cost Center Approver and its evaluation id ()zev_sc_**_*) has expression zc_sc_*_** that checks whether overallvalue >= 5000. It initiates cost center approver only if value is greater than or equal to 5000. But this is static expression. We want it in a dynamic way so that we don't have to modify this value frequently. Therefore we have set approach to use an expression of Function Module BAdI as expression. We have a new z table which contains value field zval. Now I want to know how or what should be the process so that this FM knows the corresponding value from a z table that user might select in the SC.How it should be linked to this. I am using /SAPSRM/WF_BRF_0EXP000 function module. Please advise where should the code be written ? Any method ? And what should be the exporting and importing parameters for this ?
Right now I can see EV_VALUE, EV_TYPE, EV_CURRENCY etc as exporting paramters. Looking for your suggestions experts.
Thank you.
Best regards.Dear abhijeet,
just follow the steps.
i) I believe you have created the event as Zev_*** with implememt Class 0EVENT.
ii) copy the std fm /SAPSRM/WF_BRF_0EXP000 to z custom fm
iii) since you want to have an expression as function module procurement type create expression with
expression type 0CF001
result type B ( boolean)
Buffering as event-controlled buffering
and very important procurement type as function module.
iv) immediatly you may find written as AccessFM where pass your custom z function module.
v) finally link this expression to your event.
In the custom function module the exporting parameter EV_VALUE is solely responsible for identifieng the approval based upon the approval criteria. If the field EV_VALUE = 'X' this notify that the approval is required for current process level, otherwise if it is initial then it will skip the current level and continue with the next level.
whatever your coding should be written in FM.
just look into below code
DATA LO_WF_BRF_EVENT TYPE REF TO /SAPSRM/CL_WF_BRF_EVENT.
DATA LO_CONTEXT_PROVIDER TYPE REF TO /SAPSRM/IF_WF_CONTEXT_PROVIDER.
DATA: LV_HEADER LIKE BBP_PDS_SC_HEADER_D.
DATA: LT_ITEM TYPE STANDARD TABLE OF BBP_PDS_SC_ITEM_D.
LO_WF_BRF_EVENT ?= IO_EVENT.
LO_CONTEXT_PROVIDER = LO_WF_BRF_EVENT->GET_CONTEXT_PROVIDER( ).
CALL METHOD LO_CONTEXT_PROVIDER->GET_DOCUMENT
IMPORTING
EV_DOCUMENT_GUID = LV_DOCUMENT_GUID
EV_DOCUMENT_TYPE = LV_DOCUMENT_TYPE.
pass this guid in the below function module in order to get the SC details.
GET SC DETAILS
CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
EXPORTING
I_GUID = LV_DOCUMENT_GUID
IMPORTING
E_HEADER = LV_HEADER
TABLES
E_ITEM = LT_ITEM
After that loop the internal table LT__ITEM and you decide based upon your approval criteria for each line item level wheather the gross price of line item is exceed 5000k or not.
you should decide the value for field EV_VALUE within the loop so that each line item will be verified for approval.
Pls contribute if this helpfull.
regards
sahil purushan -
Calling a user defined function as default value for a column
Hi All
Can we call a user defined function as default value for a column ??
for example:
create or replace function test1 return number is
begin
return 10;
end;
create table testt
(id as test1,
name varchar2(20));
getting error:
Error at line 1
ORA-02000: missing ( keywordThanks
Ashwani
Edited by: Ashwani on Jan 16, 2012 1:19 AMHi;
For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Database » SQL and PL/SQL which you can get more quick response
Regard
Helios -
Can't we use function to derive value for NEXT clause in MV ?
Hi Friends,
I have a requirement like below
I need to derive the schedule (Value for NEXT clause in the create MV command) for a MV to run it
e.g., Value from a date column : 03-JUL-2012 10:00 AM, VALUE for NEXT clause in CREATE MV statement should be 03-JUL-2012 04:45 AM (It is -5.45 hrs from the above date column value )
So I wrote a function (GET_DATE) to derive schedule for NEXT clause and tried to call it from NEXT caluse, but it is giving error message as mentioned below
ORA-04044: procedure, function, package, or type is not allowed here
CREATE MATERIALIZED VIEW child_mv
PARALLEL 16
INITRANS 16
STORAGE (
FREELISTS 16
FREELIST GROUPS 4
BUILD IMMEDIATE
REFRESH COMPLETE
NEXT GET_DATE('PARENT_MV')
AS
SELECT * from xxmdme_party_stage where rownum<101;
Could you please help to give some light on how this can be done ?942661 wrote:
Hi Friends,
I have a requirement like below
I need to derive the schedule (Value for NEXT clause in the create MV command) for a MV to run it
e.g., Value from a date column : 03-JUL-2012 10:00 AM, VALUE for NEXT clause in CREATE MV statement should be 03-JUL-2012 04:45 AM (It is -5.45 hrs from the above date column value )
So I wrote a function (GET_DATE) to derive schedule for NEXT clause and tried to call it from NEXT caluse, but it is giving error message as mentioned below
ORA-04044: procedure, function, package, or type is not allowed here
CREATE MATERIALIZED VIEW child_mv
PARALLEL 16
INITRANS 16
STORAGE (
FREELISTS 16
FREELIST GROUPS 4
BUILD IMMEDIATE
REFRESH COMPLETE
NEXT GET_DATE('PARENT_MV')
AS
SELECT * from xxmdme_party_stage where rownum<101;
Could you please help to give some light on how this can be done ?you must (ab)use EXECUTE IMMEDIATE -
Function Module to extract char values for a matl variant
Experts,
Looking for a Function Module with which I can extract the Char value for a specific characteristic on my material variant. So, the class type is 300 & I would like to pass this material (variant) as an input in order to retrieve the value for the specific characteristic (which will be unique to this variant)
Any one, an idea?
thanksOk, I found what I needed. For everyone's benefit, herez what I found:
1. every application/object in the SAP side which uses the configuration has a unique Internal Object #. For material variants, Sales Documents, Prodn Ord headers & components, so on so forth.
2. In the system the fields CUOBF, CUOBJ carry these Internal Obj #'s. For the sake of getting the material variant char & values I found the func module VC_I_GET_CONFIGURATION, where the input could be the Int Obj # from the MARA or the one from VBAP, based on the need.
Thanks
Maybe you are looking for
-
Using external drive for itunes
Hope someone can help with this: I am going travelling and want to take my music library, at present in itunes on my desktop G4. I have copied this library onto a 100GB portable hard drive, and would now like to get itunes on my macbook to refer to t
-
DVCPro HD transfer through FireWire 800
Hi there, I'm planning on connecting an external DVCProHD tape deck to capture footage using Final Cut Pro through the 800 port, then chaining a LaCie drive via an adapter to catpure the footage on to this external drive. So essentially, a FireWire 8
-
Hello Experts, can anyone help me how to call the executable report in BSP. Is it possible through SUBMIT ? If it is possible then provide me the code. Thanks in Advance. Regards, Hetal
-
IIII IIII what is causing this?
This is what happens every now and then to my G4 can anyone help? IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII it takes up the entire window. I am not using the key board when it happens.
-
HIi All Here My Question is that I have created document number range 1 t0 50000 for purchase order for year 2009-10 Now my Client want Same number range for next year Is it Possible or any smart solution is there ??? Thanks & Regards Amit