How to insert / Update value for PFAKT in BP Relationship
Hi Friends / Experts,
How to insert the value for PFAKT ( Function value ) in BP Relationship in BP tcode , in SAP CRM.
I have tried it but it BAPI_BUPR_CONTP_CREATE. But I need it with BAPI_BUPR_RELATIONSHIP_CREATE Function Module.
Please help me out.
Any Enhancement points in BAPI_BUPR_RELATIONSHIP_CREATE or any user exists. Please let me know.
Regards,
KMF.
you can also acheive this using MERGE( available in sql 2008 and above).
also, you are referring to DTS. DTS is legacy solution now..are you using sql 2000, you can use ssis, if you want and it available in sql 2005. as said, there are multiple ways you can do this.. it find the below one a easy solution, since your are
talking about only one table..
try this example..
create table test1(sno int primary key,sname varchar(20),scity varchar(20))
go
create table test2(sno int primary key,sname varchar(20),scity varchar(20))
go
insert into test1
values(1,'stan','atlanta'),(2,'william','newyork')
go
insert into test2
values(1,'robin','orlando')
go
--set this in you sql job and let it run for every half an hour
MERGE test2 t2
USING test1 t1
ON t2.sno = t1.sno
WHEN MATCHED THEN
UPDATE
SET t2.sname = t1.sname,t2.scity=t1.scity
WHEN NOT MATCHED by target THEN
Insert(sno,sname,scity)
values (sno,sname,scity);
go
--check this table and clean up
select * from test2
go
drop table test1
go
drop table test2
Hope it Helps!!
Similar Messages
-
Hi all,
In my SQL Server 2012 Management Studio (SSMS2012), I tried to create a Database (MacLochainnsDB) and a dbo Table (marvel). then I wanted insert 8 VALUES into the Table by using the following code:
USE master
IF EXISTS
(SELECT 1
FROM sys.databases
WHERE name = 'MacLochlainnsDB')
DROP DATABASE MacLochlainnsDB
GO
CREATE DATABASE MacLochlainnsDB
GO
CREATE TABLE [dbo].[marvel] (
[avenger_name] [char] (30) NULL)
INSERT INTO marvel
(avenger_name)
VALUES
('Hulk', 1),
('Iron Man', 2),
('Black Widow', 3),
('Thor', 4),
('Captain America', 5),
('Hawkeye', 6),
('Winter Soldier', 7),
('Iron Patriot', 8)
I got the following error Message:
Msg 110, Level 15, State 1, Line 5
There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
How can I correct this problem?
Please kindly help and advise.
Thanks in advance,
Scott Chang
P. S.
The reason I tried to create the Database, dbo Table, and then to insert the VALUES is to learn the following thing:
You can query the entire node tree with the following xquery statement because it looks for the occurrence of any node with the /* search string:
DECLARE @x xml;
SET @x = N'<marvel>
<avenger_name>Captain America</avenger_name>
</marvel>';
SELECT @x.query('/*');
You can query the avenger_name elements from the marvel_xml table with the following syntax:
SELECT xml_table.query('/marvel/avenger_name')
FROM marvel_xml;
It returns the following set of avenger_name elements:
<avenger_name>Hulk</avenger_name>
<avenger_name>Iron Man</avenger_name>
<avenger_name>Black Widow</avenger_name>
<avenger_name>Thor</avenger_name>
<avenger_name>Captain America</avenger_name>
<avenger_name>Hawkeye</avenger_name>
<avenger_name>Winter Soldier</avenger_name>
<avenger_name>Iron Patriot</avenger_name>
You can query the fourth avenger_name element from the marvel_xml table with the following xquery statement:
SELECT xml_table.query('/marvel[4]/avenger_name')
FROM marvel_xml;
It returns the following avenger_name element:
<avenger_name>Thor</avenger_name>Hi Scott,
The master database records all the system-level information for a SQL Server system, so best practise would be not to create any user-defined
object within it.
To change your default database(master by default) of your login to another, follow the next steps so that next time when connected you don't have to use "USE dbname" to switch database.
Open SQL Server Management Studio
--> Go to Object explorer(the left panel by default layout)
--> Extend "Security"
--> Extend "Logins"
--> Right click on your login, click "propertites"
--> Choose the "Default database" at the bottom of the pop-up window.
--or simply by T-SQL
Exec sp_defaultdb @loginame='yourLogin', @defdb='youDB'
Regarding your question, you can reference the below.
SELECT * FROM master.sys.all_objects where name ='Marvel'
--OR
SELECT OBJECT_ID('master.dbo.Marvel') --if non empty result returns, the object exists
--usually the OBJECT_ID is used if a if statement as below
IF OBJECT_ID('master.dbo.Marvel') IS NOT NULL
PRINT ('TABLE EXISTS') --Or some other logic
What is the sys.all_objects? See
here.
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
How to insert a value from sequence in Bussiness Components?
How to insert a value from sequence in Bussiness Components?
I would like to do it, but without a triger that would do it before insert.
I know that there is a type DBSequence in BC where you can insert a sequence name but it does not work when I type there my sequence name.
Do you now how to fix that problem?
Bart.The newer way to do it is to make the type DBSequence and enter the name of the Sequence object in the sequence field. It must match the same name of the sequence object in the database. Next, you have to create a before insert for each row trigger on the table. Basically, something like this:
CREATE OR REPLACE TRIGGER TGB_THEME_SEQ
BEFORE INSERT ON THEME
FOR EACH ROW
DECLARE
BEGIN
-- Assign the id from the sequence if null
IF( :new.theme_id IS NULL ) THEN
SELECT THEME_ID_SEQ.nextval
INTO :new.theme_id
FROM dual;
END IF;
END;
In the above example, THEME_ID_SEQ is the seuence object name in the database. If you have the name right but it still fails, then the user you are logging in as probably doesn't have access to the sequence in the database.
Hope this helps.
Erik -
How to insert varchar2 value in timestamp column in table?
Hi all,
Hope doing well,
sir i am using one stored procedure and storing time in varchar2 variable in this format: 08:00:00
now i have to insert this value in timestamp column in table. how to insert this value in timestamp column?
thanks952646 wrote:
Hi all,
Hope doing well,
sir i am using one stored procedure and storing time in varchar2 variable A "Very Bad Idea"(tm)
When you do this, there is no fundamental difference between "08:00:00" and "here's your sign".
Data should always be stored in the correct data type. For dates and times, that data type is either DATE or TIMESTAMP. Period.
in this format: 08:00:00
now i have to insert this value in timestamp column in table. how to insert this value in timestamp column?
Hopefully as remediation to the original bad design.
thanks -
How to insert/update ProductTree_Lines per B1if
Hi everybody,
I´m using SAP Business One 8.82 and the B1if 1.11.2.
My Scenario should insert ProductTree und ProductTree_Lines for an item. But I can´t find a object-Id (structure) for ProductTree_Lines. Per DTW (data transfer workbench) I learned, that ProductTree ist the master (object-Id 66 in B1if) and ProductTree_Lines are the details (object-Id ??).
I tried to learn more by getting an test-item with a test-scenario by B1Object-atom-GetList() for object-Id 66 but I only get the master structure and no details.
Any suggestions how to insert/update ProductTree_Lines per B1if?
greetings BenjaminHello Benjamin,
the Schema look like this:
<BOM xmlns="">
<!--DB Table Name: -->
<BO>
<!--multiple such elements are allowed-->
<AdmInfo>
<Object>long</Object><!--66-->
<Version>long</Version>
</AdmInfo>
<QueryParams>
<TreeCode>string</TreeCode>
</QueryParams>
<ProductTrees>
<row>
<!--multiple such elements are allowed-->
<TreeCode>string</TreeCode>
<TreeType>string</TreeType>
<Quantity>double</Quantity>
<DistributionRule>string</DistributionRule>
<Project>string</Project>
<DistributionRule2>string</DistributionRule2>
<DistributionRule3>string</DistributionRule3>
<DistributionRule4>string</DistributionRule4>
<DistributionRule5>string</DistributionRule5>
<PriceList>long</PriceList>
<Warehouse>string</Warehouse>
</row>
</ProductTrees>
<ProductTrees_Lines>
<row>
<!--multiple such elements are allowed-->
<ItemCode>string</ItemCode>
<Quantity>double</Quantity>
<Warehouse>string</Warehouse>
<Price>double</Price>
<Currency>string</Currency>
<IssueMethod>string</IssueMethod>
<Comment>string</Comment>
<ParentItem>string</ParentItem>
<PriceList>long</PriceList>
<DistributionRule>string</DistributionRule>
<Project>string</Project>
<DistributionRule2>string</DistributionRule2>
<DistributionRule3>string</DistributionRule3>
<DistributionRule4>string</DistributionRule4>
<DistributionRule5>string</DistributionRule5>
<WipAccount>string</WipAccount>
<ItemType>long</ItemType>
<LineText>string</LineText>
<AdditionalQuantity>double</AdditionalQuantity>
</row>
</ProductTrees_Lines>
</BO>
</BOM> -
How to set default values for boolean columns
I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
I've tried to set default value at column level:
<Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
<Default>TRUE</Default>
</Field>
and at content type level:
<FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
But in any case, when i create a new item with this content type, default value is applied.
Can anyone tell how to set default values for boolean columns?
Thanks in advance,
Regards,
SergioIn the field definition you can set
<Default>1</Default>
or
<Default>0</Default>
How to set the default value Null? -
A^b = n ,How to get the value for a ?
a^b = n ===> n = Math.pow(a,b)
How to get the value for a ?
dose Java have API to get the value for a ?
Thanks for help~~~a^b = n
=>
a = n^(1/b)
So,
a = Math.pow(n,1.0/b) -
How to define a Value for an Attribute of an Class
Hi,
How to define a Value for an Attribute of a Class ...
( I need to change the value of an Attribute of a class in standard program ....
Ex...
cl_hrce_masterswitches=>infotype_framework_is_active
Here infotype_framework_is_active is the attribute .. its value in standard program is 'X'... Now i need to change it as ' '.
How to define it and set value as ' '.Hello Surendar
The static attribute INFOTYPE_FRAMEWORK_IS_ACTIVE is read-only and there is not SETTER method to manipulate its value.
However, the attribute is filled in the CLASS_CONSTRUCTOR:
METHOD class_constructor.
IF ce_is_active = true OR
global_payroll_is_active = true OR
mngmt_global_empls_is_active = true.
infotype_framework_is_active = true.
perid_infotype_is_active = true.
ELSE.
infotype_framework_is_active = false.
perid_infotype_is_active = false.
ENDIF.
ENDMETHOD.
Thus, you need to analyze how attribute CE_IS_ACTIVE, GLOBAL_PAYROLL_IS_ACTIVE and MNGMT_GLOBAL_EMPLS_IS_ACTIVE are filled in the CLASS_CONSTRUCTOR.
For sure you will find customizing settings that are responsible for this.
Regards
Uwe -
How do I update Java for Adobe Flash CS3?
Hi,
When I ran Secunia Software Inspector today it told me that
the version of Java I have installed on my computer is out of date.
It tells me that it is finding 3 out-of-date files:
Once here:
C:\Program Files\Java\jre1.6.0_04\bin\java.exe
Twice here:
C:\Windows\System32\java.exe
and three times here:
C:\Program Files\Adobe\Adobe Flash CS3\JVM\bin\java.exe
I updated Java via the Sun website and consequently the first
and second warnings disappeared when I reran the Software
Inspector.
The software inspector however is still finding an
out-of-date Java version here:
C:\Program Files\Adobe\Adobe Flash CS3\JVM\bin\java.exe
Question is: How do I update Java for Adobe Flash CS3?
Is it adequate to copy the updated file "java.exe" from
"C:\Program Files\Java\jre1.6.0_04\bin\" to "C:\Program
Files\Adobe\Adobe Flash CS3\JVM\bin\" or do I need to do anything
else?
Any help will be much appreciated.Hi
I have the same problem of you, and the same dont find a
solution. Me it's Kaspersky Anti Virus (AV) which find this
problem.
So (and I dont know if this solution is perfect), but I open
Flash CS3 with the Java update choiced and apparently Flash
fonctionnely well and Kaspersky dont find this
prob now. But I dont never use Java in Flash (or without that
I know that..), and same, I dont know at what Java is used in Flash
I think that "JRE v 1.6.0_04" and more recent Java version is
not good, because it's not quite the same Java application that in
Flash CS3, In Flash CS3 it's "J2RE" and
not "JRE".
The history of all Java versions (and this) is here (
http://java.sun.com/products/archive/)
(but in all this versions... seriousely it's a true shambles !)
If you want the last version for J2RE in this archives it's v
1.4.2.18 but the last version is J2RE 1.4.2.19 but dont again in
this archives
(search on Java site, maybe first page ? I dont remember
where I to find it...). But the problem... it's that this last
version (19) is always detected bad by my AV...
So I decide to use just the next version (v 1.5) and last
version in this series (in archives site) which is the "JDK/JRE -
5.0 v 5.0.16" but again named "Java 2 Platform
Standard Edition (J2SE) 5.0 Update 16" in this dowload next
archives page
http://java.sun.com/products/archive/j2se/5.0_16/index.html),
so well again named "Java 2" in this page (that which dont
the case for the equivalent same download page for Java 6...)
(Choice "JRE 5.0 Update 16" in this page)
For instal "JRE 5.0 Update 16":
1) Supp all files and folders in "JVM" (Java Virtual Machine)
folder in Flash CS3 (but dont supp this folder, empty now) and save
this contents in archive in you have
affraid.
2) dl "JRE 5.0 Update 16", directly in this page if you want:
(https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/View ProductDetail-Start?ProductRef=jre-1.5.0_16-oth-JPR@CDS-CDS_Dev
eloper)
3) In install, choice "personal instal" (or +/- the same
terms) and choice the "JVM" folder of you Flash CS3
and AV dont detect this version same a bad file -
HT1338 how do i update java for my computer
how do i update java for my computer
Welcome to the Apple Support Communities
To install the most recent Java version for Mac OS X Snow Leopard, open > Software Update. If it tells you that you are running the most recent version, you are using the most recent Java version for Snow Leopard -
How do I update IOS for my iPad2 wirenessly ?
How do I update IOS for my iPad2 wirenessly ?
It isn't possible to update from an iOS version prior to 5.0 wirelessly; it must be done from iTunes on a computer, and if possible, the one the device normally syncs with.
(90449) -
How to calculate acquisition value for specified day
Hi,
in my z program I have a problem how to calculate acquisition value for my asset for specified day.
Example:
I have asset created 8.7.2008 with TTYPE 104 (External asset acquisition) with value 5950.
30.11.2008 there is another TTYPE 272 (Retirement of current-yr acquis., w/o revenue) with value 950.
So BEFORE 30.11.2008 acquisition value is 5950. After is 5000. Is there any function module (or something else) in SAP system where I can send asset number and date a it return to me acquisition value for that day?
Many thanks for any answer!Hi,
your suggestion means that I have to compute acquisition value by myself (sum all TTYPE 1** - sum all TTYPE 2**). So SAP does't provide such functionality (LDB ADA have it, because it can compute acquisitiob value for specific day)?
Mant thanks for answer -
How to select XML value for a namespace when multiple namespaces
Hi,
I'm a beginner with this, but I'm doing well with your help from this forum in a recent post selecting out all the detail from my xml
out into my oracle relational tables. Stumped, though, on how to select a value for xml tag value referenced by a defined namespace.
Version, XML, what I want to select, and attempted sql is below. Thanks in advance!
select * from V$VERSION
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Solaris: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
drop table TRANSCRIPT;
create table TRANSCRIPT (
CONTENT xmltype
<?xml version="1.0" encoding="UTF-8"?>
<arb:AcademicRecordBatch xmlns:arb="urn:org:pesc:message:AcademicRecordBatch:v1.0.0">
<hst:HighSchoolTranscript xmlns:hst="urn:org:pesc:message:HighSchoolTranscript:v1.0.0" xmlns:ct="http://ct.transcriptcenter.com">
<TransmissionData>
<DocumentID>2013-01-02T09:06:15|D123456789</DocumentID>
</TransmissionData>
<Student>
<Person>
<Name>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
</Name>
</Person>
<AcademicRecord>
<AcademicSession>
<Course>
<CourseTitle>KEYBOARD 101</CourseTitle>
<UserDefinedExtensions>
<ct:TranscriptExtensions>
<NCESCode>01001E010456</NCESCode>
<CourseRigor>1</CourseRigor>
</ct:TranscriptExtensions>
</UserDefinedExtensions>
</Course>
<Course>
<CourseTitle>SCIENCE 101</CourseTitle>
<UserDefinedExtensions>
<ct:TranscriptExtensions>
<NCESCode>01001E010457</NCESCode>
<CourseRigor>2</CourseRigor>
</ct:TranscriptExtensions>
</UserDefinedExtensions>
</Course>
</AcademicSession>
<AcademicSession>
<Course>
<CourseTitle>MATH 201</CourseTitle>
<UserDefinedExtensions>
<ct:TranscriptExtensions>
<NCESCode>01001E010458</NCESCode>
<CourseRigor>2</CourseRigor>
</ct:TranscriptExtensions>
</UserDefinedExtensions>
</Course>
</AcademicSession>
</AcademicRecord>
</Student>
</hst:HighSchoolTranscript>
</arb:AcademicRecordBatch>I want to be able to select the NESCODE associated to each coursetitle (01001E010456, 01001E010457, 01001E010458), with NESCode defined by namespace, but getting out NULL.
DOCUMENTID LASTNAME COURSETITLE NCESCODE
2013-01-02T09:06:15|D123456789 Doe KEYBOARD 101
2013-01-02T09:06:15|D123456789 Doe SCIENCE 101
2013-01-02T09:06:15|D123456789 Doe MATH 201
My SQL is below. You'll see where I commented out a couple failed alternatives too. Thanks again in advance for any guidance.
select x0.DocumentID
,x1.LastName
, x3.CourseTitle
,x3.NCESCode
from TRANSCRIPT t
, xmltable(
xmlnamespaces(
'urn:org:pesc:message:AcademicRecordBatch:v1.0.0' as "ns0"
, 'urn:org:pesc:message:HighSchoolTranscript:v1.0.0' as "ns1"
--, 'http://ct.transcriptcenter.com' as "ns1b"
, '/ns0:AcademicRecordBatch/ns1:HighSchoolTranscript'
passing t.content
columns DocumentID varchar2(40) path 'TransmissionData/DocumentID'
, Student xmltype path 'Student'
) x0
, xmltable(
'/Student'
passing x0.Student
columns LastName varchar2(20) path 'Person/Name/LastName'
,AcademicRecord xmltype path 'AcademicRecord'
) x1
, xmltable(
'/AcademicRecord/AcademicSession'
passing x1.AcademicRecord
columns GradeLevel varchar2(20) path 'StudentLevel/StudentLevelCode'
, Courses xmltype path 'Course'
) x2
, xmltable(
xmlnamespaces('http://ct.transcriptcenter.com' as "ns2b")
, '/Course'
passing x2.Courses
columns CourseTitle varchar2(40) path 'CourseTitle'
,NCESCode varchar2(20) path 'UserDefinedExtensions/ns2b:ct/NCESCode'
--,NCESCode varchar2(20) path 'UserDefinedExtensions/ns2b:ct/TranscriptExtensions/NCESCode'
) x3
<<I'm assuming there is more to your XML than you showed, since
StudentLevel/StudentLevelCode
is not in the XML, but is in your query. >>
Yes, to simplify, I left out some of the additional XML data, which is typically present, sorry for any confusion. I should have removed those references to that data in my example which was failing to retrieve the NCESCode data which was denoted by that namespace.
Thank you very much! Your correction worked. I was not understanding until your correction how to properly reference in the XPATH for that namespace value. I'm a newbie at this, and this is my second post. But I've been able to populate quite a few relational tables and that was the first of several namespace tags I will have to deal with next, and with that help, I should be good with that syntax now.
Thanks again for your help on this. -
How to set Update Mode for DSO in BI7.0?
Hi,
As you know in bw3.5, in update rules we can set the update mode for ods as Additive or overwrite functionality.
But can anybody tell me where are these settings in bi7.0? or
How to set Update Mode for DSO in BI7.0?
Thanks and Regrards,
HarshalDear Harshal,
GO to the tramsformations of your DSO..
In the Rule Group..Click on any key Figure..
this pops u a window..in which u will find AGGREGATION ..Then u can select Either OVERWRITe or SUMMATION which suites ur requirement..
Hope this helps u..
Assign points if helpful..
Best Regards,
VVenkat.. -
Hi,
How to assign a value for Unit of measure (like PC, KG...) in ABAP program?
I want to assign PC in a field to execute the program, like wa-ENTRY_UOM = 'pc'.
But the system returen a message that "Unit of measure is not convertible to stockkeeping unit PC"
Could anyone tell me how to assign the value??
Thanks!hi,
first convert the quantity in the same unit ( like in you case ST to PC ) by using FM : MD_CONVERT_MATERIAL_UNIT
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = matnr
i_in_me = entry_uom
i_out_me = out_uom
i_menge = quantity
IMPORTING
E_MENGE = fp_l_v_quant
EXCEPTIONS
ERROR_IN_APPLICATION = 1
ERROR = 2
OTHERS = 3.
IF sy-subrc <> 0.
give error message here
ENDIF.
bcoz in ur program somewhere the quantities etc are compared and there units may be different... so that is why it is showing such error. so just convert convert the quantity in the same unit .
regards
rahul
Edited by: RAHUL SHARMA on Jun 17, 2009 9:31 AM
Maybe you are looking for
-
Dynamic physical table name vs. Cache
Hello, Experts! I'm facing quite an interesting problem. I have two physical tables with the same structure but with a different data. Requirement is to show same reports with one or another table. Idea is to have dynamically changed physical table n
-
Planning server not showing up while attaching BR in Essbase
Hi All, We are facing an issue with Business Rules Attachment Menu in EAS , when we try to associate a particular BR to a particular Planning Application we are not geeting anything in the drop down list of Servers for Planning ? On the other hand es
-
Meta data for streaming mp3s?
Hello I'm using Flash Media Streaming Server and I read that I can not obtain meta data on mp3s using FMS. Is this true? I want to be able to seek/scrub audio tracks, but I would probably need the duration of the mp3. If anyone can shed some light on
-
How to buy windows 7 for macbook air?
Hello everyone, I want to finally buy and install windows 7 Home premium 32-bit or 64-bit so badly but i don't see the way of doing it. Since my Macbook air 13" (mid 2012.)" doesn't have a CD slot i guess i have to buy it online and download it, but
-
Are there any known problems/bugs with Lion pre-loaded?
I'm in the market for a Macbook Pro and am wondering if I'd be better off getting it now before it comes shipped with Lion and install it later on when any bugs are worked out.