SAP ABAP CRATING TABLES - abap

I'm creating a table and I've inserted the following fields:
MATERIAL CODES (MARA-MATNR)
Type of GAS (MARM-MEINH)
but I'm having problems with the 'CO2 coefficient' field.
Any help for the domain and Data Element of the field ?

CO2 coefficient field not exist in SAP data elements. You should be create domain and data element by using SE11 t-code.

Related

Retreiving ship-to-party country SAP QuickViewer

I've created a QuickView, where I enter Sales Document data as search criterias.
Selection fields are
VBAP-VBELN, VBAP-POSNR, VBAP-MATNR and VBAP-KWMENG
As the Sales Document Item data.
Furthermore I retrieve the Schedule line date from
VBEP-EDATU
From General Data in Customer Header KNA1, I use
KNA1-KUNNR and KNA1-LAND1
Now, all connections and keys works out. My issue is, I wish to list the Country Key for ship-to-part rather than sold-to-party (which is represented by KUNNR). How could this be solved?
Tables are joined as follows:
VBAK-VBELN -> (VBAP-VBELN,-POSNR) -> (VBEP-VBELN, -POSNR)
VBAK-KUNNR -> KNA1-KUNNR
I do know I would probably need a new table in here to retreive what Iæm looking for, but I'm completely blank. Any help would be greatly appriciated. I
Ship-To-Party is stored in table VPBA (Sales Document Partners) in field KUNNR1 for partner function SH, so to select it you should join KNA1 not with VBAK but with VBPA-KUNNR restricting function to SH.
However, SQVI is a very primitive tool which doesn't allow setting complex (neither trivial) conditions so you should switch to ABAP queries tool (SQ01).
But just in case you wanna do this in SQVI here is the workaround:
Join necessary tables in SQVI builder
Add necessary KNA1 fields to layout: KUNNR and LANDX
Go to layout mode and enable selection by partner function PARVW
Run your query by SH partner function
and voilá! You will be shown only the orders with ship-to-party specified with their countries

Database fields names for custom fields in CiviCRM

I created new contact type 'client', and created custom fields for client type like 'Ethnicity'.
I can now add records.
I need to create reports, for example the total number of clients with a certain Ethnicity.
The question is how can I know the database table and fields names?
I looked in wp-content->civicrm->civicrm->sql but found the basic tables only.
When you create a new set/group of fields there will be a new entry in the civicrm_custom_group table. The fields themselves are in civicrm_custom_field table.
The data for the fields is stored in civicrm_value__ so eg civicrm_value_client_fields_12
you may get better responses in http://civicrm.stackexchange.com/questions?sort=active

Where are the calculated fields from Odoo stored in the sql server when stored is set to true

If I create a new field on a model, making it a calculated or related field, and set the store parameter to be true. When I look on the sql server using pg admin, on the table itself, i can't fiend the field. I think this would be logic if the data entered wouldn't be stored, but calculated each time it was shown on a view (from, tree, ...).
Example in the POS orderline the field tax_ids is a calculated / related field. The tax_id is stored, because if I change the id on product level, it doesn't affect the order line, when consulting it after changing the tax id. So this data is stored. But when I try to find the field in the pos_order_line model on the sql server it doesn't show on the pos orderline. In odoo, settings models, it does show on the pos_order_line model. So where does odoo store the data?

SQL Server: Remove substrings from field data by iterating through a table of city names

I have two databases, Database A and Database B.
Database A contains some data which needs to be placed in a table in Database B. However, before that can happen, some of that data must be “cleaned up” in the following way:
The table in Database A which contains the data to be placed in Database B has a field called “Desc.” Every now and then the users of the system put city names in with the data they enter into the “Desc” field. For example: a user may type in “Move furniture to new cubicle. New York. Add electric.”
Before that data can be imported into Database B the word “New York” needs to be removed from that data so that it only reads “Move furniture to new cubicle. Add electric.” However—and this is important—the original data in Database A must remain untouched. In other words, Database A’s data will still read “Move furniture to new cubicle. New York. Add electric,” while the data in Database B will read “Move furniture to new cubicle. Add electric.”
Database B contains a table which has a list of the city names which need to be removed from the “Desc” field data from Database A before being placed in Database B.
How do I construct a stored procedure or function which will grab the data from Database A, then iterate through the Cities table in Database B and if it finds a city name in the “Desc” field will remove it while keeping the rest of the information in that field thus creating a recordset which I can then use to populate the appropriate table in Database B?
I have tried several things but still haven’t cracked it. Yet I’m sure this is probably fairly easy. Any help is greatly appreciated!
Thanks.
EDIT:
The latest thing I have tried to solve this problem is this:
DECLARE #cityName VarChar(50)
While (Select COUNT(*) From ABCScanSQL.dbo.tblDiscardCitiesList) > 0
Begin
Select #cityName = ABCScanSQL.dbo.tblDiscardCitiesList.CityName FROM ABCScanSQL.dbo.tblDiscardCitiesList
SELECT JOB_NO, LTRIM(RTRIM(SUBSTRING(JOB_NO, (LEN(job_no) -2), 5))) AS LOCATION
,JOB_DESC, [Date_End] , REPLACE(Job_Desc,#cityName,' ') AS NoCity
FROM fmcs_tables.dbo.Jobt WHERE Job_No like '%loc%'
End
"Job_Desc" is the field which needs to have the city names removed.
This is a data quality issue. You can always make a copy of the [description] in Database A and call it [cleaned_desc].
One simple solution is to write a function that does the following.
1 - Read data from [tbl_remove_these_words]. These are the phrases you want removed.
2 - Compare the input - #var_description, to the rows in the table.
3 - Upon a match, replace with a empty string.
This solution depends upon a cleansing table that you maintain and update.
Run a update query that uses the input from [description] with a call to [fn_remove_these_words] and sets [cleaned_desc] to the output.
Another solution is to look at products like Melisa Data (DQ) product for SSIS or data quality services in the SQL server stack to give you a application frame work to solve the problem.

using a lookup table on a form with Oracle Apex Item

I have an application that uses Oracle Apex 4.2 . It has a form ( form and report on a table) that needs to display descriptions for columns on the table. For instance, there is a column on the table called fund which has a numeric value ( 1 to 6). There is a separate table that gives a description for each of these 6 values. Under EDIT PAGE ITEM, under SOURCE, I chose SOURCE TYPE -> SQL QUERY
I entered this query below:
SELECT DESCRIPTION FROM
"#OWNER#"."BU19ANT",
"#OWNER#"."FUNDCD"
WHERE ANTFUNDCD = CODE
where BU19ANT is the table that used for this form
FUNDCD is the name of the look up table
ANTFUNDCD and CODE and numeric fields on the respective tables and DESCRIPTION is the value that I want to look up and display on the form.
This gives me the correct answer MOST of the time, but not all the time.
The key to the table ( and the field used to link from the report to the form) is the Soc Security Number. If I run this same query against the Oracle table hard coding the SS Number, I always get the correct answer.
This form has 5 look ups that work this way and they all have the same problem.
I assume that I DONT need to include the Social Security Number as part of the query Apex already knows that.
But I tried to add that and can not figure out how to code it.
I tried
WHERE ANTSOCIALSECURITYNUMBER ( column on table) = P2_SOCIALSECURITYNUMBER ( the item on this page)
but that gave this error
ORA-00904: "P2_SOCIALSECURITYNUMBER ": invalid identifier
Is there some other way to code this? Or to say where SS Number = current record?
Or am I on the wrong track here?
Try :P2_SOCIALSECURITYNUMBER (for items on session) or &P2_SOCIALSECURITYNUMBER. (for items on page)