PowerPivot - Create a Lookup Table and Calculate Totals via PowerQuery
Hi,
I have got a question to powerpivot/powerquery.
I have got one source file "product-sku.txt" with product data (product number, product size, product quantity etc.).
In powerpivot I created via this text file 2 powerpivot tables:
product-sku and
products.
The "products" table is a lookup table and was created via powerquery using the columns prodnumber, removing the prodsize and the prodquantity columns and then removing duplicates.
My question: How could I show/leave a column prodquantity in the lookup table "products" which shows the total of all sizes per prodnumber?
I need this prodquantity in the lookup table to do a banding analysis via the "products" table (e.g. products with quantity 0-100, 101-200 etc.).
I give you an example:
source file columns (product-sku.txt):
Source
Date
ProdNumber
ProdSize
ProdQuantity
ProdGroup
ProdSubGroup
ProdCostPrice
ProdSellingPrice
The powerpivot table "product-sku" contains all columns from the txt file above
The lookup table "products" created via powerquery has the following columns:
Source
Date
ProdNumber
ProdQuantity (this column I would wish to add; if a prodnumber 123 had two sizes (36 and 38) with quantities of 5 and 10, the prodquantity should add up in the lookup table to 15. How could this be achieved?)
I enclose a link to my dropbox with example files: PowerPivot-Example-Files
Thank you for any help.
Chiemo
Chiemo,
If you would like to consolidate to one table as Olaf has suggested, that would be very easy to do. I have included the modified DAX for the calculated column below. This calculated column would be created in the 'product-sku' table itself.
You are correct in your assumption that you need an explicitly calculated column to most easily do banding analysis.
Olaf is correct that avoiding the creation of a separate 'products' table as you have done is a good idea. I was not thinking about modeling best practices when I replied. If the only purpose of your 'products' table was to create this calculated column,
then I do suggest deleting that table and implementing the calculated column in 'product-sku' with the DAX below.
Edit: If you need to use 'products' as a dimension table which will have a relationship to a fact table, then it will be necessary to keep it. PowerPivot does not natively handle a many-to-many relationship. Dimension tables must have a unique key. If [ProdNumber]
is the key, then it will be necessary to have your 'products' table. If you need to implement a many-to-many relationship, please see this
post as a primer.
=
CALCULATE (
SUM ( 'product-sku'[ProdQuantity] ),
'product-sku'[ProdNumber] = EARLIER ( 'product-sku'[ProdNumber] )
Similar Messages
-
Need to create Enterprise field, LookUp Table and PDPs programmatically
Hi,
Please suggest how i can create Enterprise field, LookUp Table and PDPs, Workflow Stages, Phases programmatically for Project Server 2013. Any resource / blog link will be really be helpful.
I searched google but most of them are for PS 2010
Regards,
Ankit GBy Enterprise field i am assuming you mean Custom Field.
The Google/Bing results for PS 2010 is referring to the PSI model. This model can still be used for Project Server 2013 OnPremise installations, but not for Project Online.
The question is how do you want to create them/which technology do you want to use. you can program Agains the Project server through the PSI API, the CSOM API, the REST interface, Javascript and VBA code.
I am gussing you want to create an application that uses C# therefore i will suggest to use the PSI or CSOM API.
PSI is the old model, but is still supported in PS2013.
The CSOM is the new model and only Works in PS2013 and comming versions.
A great reference you should download is the Project Server 2013 SDK:
http://www.microsoft.com/en-us/download/details.aspx?id=30435
I am guessing you are new to Project Server programming so i will suggest you go with PSI as it has the most documentation.
PSI:
Getting started:
http://msdn.microsoft.com/en-us/library/office/ff843379(v=office.14).aspx
http://msdn.microsoft.com/en-us/library/office/ee767707(v=office.15).aspx
Create Custom field:
http://msdn.microsoft.com/en-us/library/office/websvccustomfields.customfielddataset.customfieldsdatatable.newcustomfieldsrow_di_pj14mref(v=office.15).aspx
http://msdn.microsoft.com/en-us/library/office/gg217970.aspx
Setting custom field values:
http://blogs.msdn.com/b/brismith/archive/2007/12/06/setting-custom-field-values-using-the-psi.aspx
http://msdn.microsoft.com/en-US/library/office/microsoft.office.project.server.library.customfield_di_pj14mref
Lookuptables are the same procedure:
http://msdn.microsoft.com/en-us/library/office/websvclookuptable_di_pj14mref(v=office.15).aspx
Workflow phases/stages:
http://msdn.microsoft.com/en-us/library/office/websvcworkflow_di_pj14mref(v=office.15).aspx
PDP's:
PDP's have to be created through the SharePoint interface as Web Part Pages. I havn't tried this.
I think you want to do this in a backup/restore scenario. In this case you might consider the free tool Playbooks:
http://technet.microsoft.com/en-us/library/gg128952(v=office.14).aspx -
How to count and calculate total percentage for field
hi all,
i have two tables as follow:
i have a inner join as follow :
SELECT distinct dbo.Motor_Story.Name, dbo.Goods.kala, dbo.Goods.type, dbo.Goods.id_story FROM
dbo.Goods INNER JOIN dbo.Motor_Story ON dbo.Goods.id_story = dbo.Motor_Story.Id
I have the following data are entered
in my database,
type
kala
no
Panaconic
Monitor
1
Sony
Telvision
2
Samsung
Phone
3
Vaio
Computer
4
Panaconic
Monitor
5
Sony
Telvision
6
Panaconic
Phone
7
Panaconic
Printer
8
Sony
Computer
9
Panaconic
Monitor
10
Sony
Telvision
11
Samsung
Phone
12
Panaconic
Printer
13
i want create a view so that, count 'dbo.Goods.type' and calculate total percentage of ' dbo.Goods.type, than other products based on 'dbo.Goods.kala'.
pls hlp me.
best regards.Hi,
Welcome to MSDN.
I am afraid this is not the proper forum for this issue, since it is not a specific vb.net issue.
I would suggest you consider posting this issue in sql forum for more dedicated support.
http://social.msdn.microsoft.com/Forums/en-US/home?category=sqlserver
Thanks for your understanding.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Proper use of a Lookup table and adaptations for NET
Hello,
I need to create a few lookup tables and I often see the following:
create table Languages
Id int identity not null primary key (Id),
Code nvarchar (4) not null,
Description nvarchar (120) not null,
create table Posts
Id int identity not null primary key (Id),
LanguageId int not null,
Title nvarchar (400) not null,
insert into Languages (Id, Code, Description)
values (1, "en", "English");
This way I am localizing Posts with language id ...
IMHO, this is not the best scheme for Languages table because in a Lookup table the PK should be meaningful, right?
So instead I would use the following:
create table Languages
Code nvarchar (4) not null primary key (Code),
Description nvarchar (120) not null,
create table Posts
Id int identity not null primary key (Id),
LanguageCode nvarchar (4) not null,
Title nvarchar (400) not null,
insert into Languages (Code, Description)
values ("en", "English");
The NET applications usually use language code so this way I can get a Post in English without using a Join.
And with this approach I am also maintaining the database data integrity ...
This could be applied to Genders table with codes "M", "F", countries table, transaction types table (should I?), ...
However I think it is common to use int as PK in lookup tables because it is easier to map to ENUMS.
And know it is even possible to map to Flag Enums so have a Many to Many relationship in an ENUM.
That helps in NET code but in fact has limitations. A Languages table could never be mapped to a FLags Enum ...
... An flags enum can't have more than 64 items (Int64) because the keys must be a power of two.
A SOLUTION
I decided to find an approach that enforces database data integrity and still makes possible to use enums so I tried:
create table Languages
Code nvarchar (4) not null primary key (Code),
Key int not null,
Description nvarchar (120) not null,
create table Posts
Id int identity not null primary key (Id),
LanguageCode nvarchar (4) not null,
Title nvarchar (400) not null,
insert into Languages (Code, Key, Description)
values ("en", 1, "English");
With this approach I have a meaningfully Language code, I avoid joins and I can create an enum by parsing the Key:
public enum LanguageEnum {
[Code("en")
English = 1
I can even preserve the code in an attribute. Or I can switch the code and description ...
What about Flag enums? Well, I will have not Flag enums but I can have List<LanguageEnum> ...
And when using List<LanguageEnum> I do not have the limitation of 64 items ...
To me all this makes sense but would I apply it to a Roles table, or a ProductsCategory table?
In my opinion I would apply only to tables that will rarely change over time ... So:
Languages, Countries, Genders, ... Any other example?
About the following I am not sure (They are intrinsic to the application):
PaymentsTypes, UserRoles
And to these I wouldn't apply (They can be managed by a CMS):
ProductsCategories, ProductsColors
What do you think about my approach for Lookup tables?
Thank You,
Miguel>>IMHO, this is not the best scheme for Languages table because in a Lookup table the PK should be meaningful, right?<<
Not necessarily. The choice to use, or not to use, a surrogate key in a table is a preference, not a rule. There are pros and cons to either method, but I tend to agree with you. When the values are set as programming terms, I usually use a textual value
for the key. But this is nothing to get hung up over.
Bear in mind however, that this:
create table Languages
Id int identity not
null primary key
(Id),
Code nvarchar (4)
not null, Description nvarchar
(120) not
null,
is not equivalent to
create table Languages
Code nvarchar (4)
not null primary
key (Code),
Description nvarchar (120)
not null,
The first table needs a UNIQUE constraint on Code to make these solutions semantically the same. The first table could have the value 'Klingon' in it 20 times while the second only once.
>>However I think it is common to use int as PK in lookup tables because it is easier to map to ENUMS.<<
This was going to be my next point. For that case, I would only change the first table to not have an identity assigned key value, as it would be easier to manage at the same time and manner as the enum.
>>. A Languages table could never be mapped to a FLags Enum ...<<
You could, but I would highly suggest to avoid any values encoded in a bitwise pattern in SQL as much as possible. Rule #1 (First Normal Form) is partially to have 1 value per column. It is how the optimizer thinks, and how it works best.
My rule of thumb for lookup (or I prefer the term "domain" tables, as really all tables are there to look up values :)), is all data should be self explanatory in the database, through data if at all possible. So if you have a color column,
and it contains the color "Vermillion", and all you will ever need is the name, and you feel like it is good enough to manage in the UI, then great. But bear in mind, the beauty of a table that is there for domain purposes, is that you can then store
the R, G, and B attributes of the vermillion color (254, 73, 2 respectively, based on
http://www.colorcombos.com/colors/FE4902) and you can then use that in coding. Alternate names for the color could be introduce, etc. And if UserRoles are 1, 2, 3, and 42 (I have seen worse), then
definitely add columns. I think you are basically on the right track.
Louis
Without good requirements, my advice is only guesses. Please don't hold it against me if my answer answers my interpretation of your questions. -
Hi,
iam trying to create a lookup table for HEX values but the LUT is taking only decimal values.... here is the problem
Iam getting HEX data from a serial port...........Now with respect this data i have to compare with the LUT and has to display the respective data(result)
LOOKUP TABLE should be like this
LUT X X data
00 1435.0
01 1435.5
02 1436.0
C7 1534.5
C8 1535.0
some 200 values.................
now from serial port say C7 is coming ,,,,,,its has to compare with the LUT(200 values) and has to display its corresponding value which 1534.5
please tell me how i have to approach this?????????? now iam using control design and simulation toolkit also(in this LUTs of 1D,2D,3D are avaliable)
ThankYouMultiply all of your X data by ten (store 1435.5 as 14355) then divide by ten when you take it out.
I'm only familiar with LUTs in FPGA programming (I have at least one week of experience doing this), and don't have either toolkit at home. Hope this helps.
Jim
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice -
Hi
I have been looking and trying to figure this out for a few days and after awhile you just head no where.
What I need to do is use a lookup table and change gray code to an angular reading.
I have an 11 bit encoder I am also using LabVIEW 7.1 with a USB-6259. I can read the decimal and the Hex values but just can not seem to figure out how to get the angular measurements that I need. I have attached a simple .vi to get the hex and decimals as well as a .txt file with the gray code any help will be appreciated.
Thanks
Gerald
Attachments:
Encoder Test 8-14-06.llb 26 KB
test3.txt 51 KBNew problem. Have duplicated the VI and hooked up the second sensor. Sensor 1 still works fine sensor 2 does not. I think the problem is that it is reading 22bit and I only need 11 bit. I have both sensors wired into port0 sensor 1 is wired to port0/line0:10 sensor 2 is wired port0/line11:21. Is there a way to ignore the fist 11bits (line 0:10) or a way that would work. It shows up as 1100111110100000000000 and a dec. as 3401728. Please see attached.
Thanks in advance
Gerald
Attachments:
Encoder Test 8-16-06.llb 72 KB
test6.txt 25 KB -
Lookup-table and query-database do not use global transaction
Hi,
following problem:
DbAdapter inserts data into DB (i.e. an invoice).
Process takes part in global transaction.
After the insert there is a transformation which uses query-database and / or lookup-table.
It seems these XPath / XSLT functions are NOT taking part in the transaction and so we can not access information from the current db transaction.
I know workarounds like using DbAdapter for every query needed, etc. but this will cost a lot of time to change.
Is there any way to share transaction in both DbAdapter insert AND lookup-table and query-database?
Thanks, Best Regards,
MartinOne dba contacted me and made this statement:
Import & export utilities are not independent from characterset. All
user data in text related datatypes is exported using the character set
of the source database. If the character sets of the source and target
databases do not match a single conversion is performed.So far, that does not appear to be correct.
nls_characterset = AL32UTF8
nls_nchar_characterset = UTF8
Running on Windows.
EXP produces a backup in WE8MSWIN1252.
I found that if I change the setting of the NLS_LANG registry setting for my oracle home, the exp utility exports to that character set.
I changed the nls_lang
from AMERICAN_AMERICA.WE8MSWIN1252
to AMERICAN_AMERICA.UTF8
Unfortunately , the export isn't working right, although it did change character sets.
I get a warning on a possible character set conversion issue from AL32UTF8 to UTF8.
Plus, I get an EXP_00056 Oracle error 932 encountered
ORA-00932: inconsistent datatypes: expected BLOB, CLOB, get CHAR.
EXP-00000: export terminated unsuccessfully.
The schema I'm exporting with has exactly one procedure in it. Nothing else.
I guess getting a new error message is progress. :)
Still can't store multi-lingual characters in data tables. -
Creating a master table and using it to populate other tables.
Hi everyone.
I am a novice at using Numbers and I need some direction.
I am looking to create a master table with information for our summer camp. This table will include vital information such as name, address, etc. along with cabin assignments, tuitions received, and more.
We will separate this information into smaller tables that different portions of that master table for specific use. Such as: names and addresses for leaders, names and tuitions for registration, etc.
My goal is to type the information into the master table and have it update the other tables automatically. Can someone direct me how to format the master and sub tables so that this is possible?
I would greatly appreciate it and it will greatly reduce the record-keeping time for our camp.
Thank You!
RoyHi Roy,
Welcome to the Numbers discussions. You are giving us a tall order, especially when we don't know your level of experience in programming spreadsheets.
Here are a couple of basics to start the conversation...
In normal spreadsheet programming, we Pull data from one location into another, we don't Push it or Send it. This should help you to understand that the hard work is done in the sub tables, not the master.
You will use LOOKUP functions to pull the data to your sub tables. Download the Numbers User Guide and the Formulas and Functions User Guide and read up on them.
In your master table, make sure you have one column that uniquely identifies each participant so it will be easy to reference that person in your sub tables.
Regards,
Jerry -
How to create a lookup table in flex
Hi,
I am not sure how to construct and use a lookup table in flex, i have a string which needs to replaced with a string in the lookup table. Can someone let me know can i can do this.
Thanks@learningflex,
Here is the simple example of doing this..
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onCreationComplete();">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import flash.utils.setInterval;
import mx.controls.Alert;
[Bindable]
private var dataList:ArrayCollection = new ArrayCollection([
{name:'Person'},
{name:'Student'},
{name:'Teacher'},
{name:'Employee'}]);
private function onCreationComplete():void
for(var i:int=0;i<dataList.length;i++)
var obj:Object = dataList.getItemAt(i);
obj.abbr = getAbbrevatedName(obj.name);
dataList.setItemAt(obj,i);
dataGrid.dataProvider = dataList;
private function getAbbrevatedName(name:String):String
switch(name)
case "Person":
return "prsn";
case "Student":
return "sdt";
case "Teacher":
return "tcr";
case "Employee":
return "emp";
default:
return "";
]]>
</mx:Script>
<mx:DataGrid id="dataGrid" x="10" y="177" visible="true">
<mx:columns>
<mx:DataGridColumn headerText="Actual Name" dataField="name"/>
<mx:DataGridColumn width="150" headerText="Abbrevated Name" dataField="abbr"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
See I have displayed both the FullNames in one column and also the abbrevated names in another column. So you can make use of the second column.
Thanks,
Bhasker -
How 2 create dynamic internal table and can we pass it to gui_download FM
HI all,
How can we create a dynamic internal table?
I have a requirement where i have to create an internal table with the no. of fields depending on the selection screen values, i think tat can be possible though dynamic creation only.
How to solve this issue..?Pointers will be very much useful..
Thanks
Sunny.hi
Follow the code it will help you out....
REPORT YUSMM_TEXT2 .
*TABLES
TABLES: MARA, " General Material Data
MAKT, " Material Descriptions
T002. " Language Keys
* GLOBAL TYPE-POOL
TYPE-POOLS : SLIS.
* GLOBAL TYPES
TYPES: BEGIN OF TP_LANG ,
SPRAS LIKE T002-SPRAS,
LAISO LIKE T002-LAISO,
SRNO(3) TYPE N,
END OF TP_LANG.
TYPES: BEGIN OF TP_MATNR,
MATNR LIKE MARA-MATNR,
BEGRU LIKE MARA-BEGRU,
END OF TP_MATNR.
* DECLARATION FOR GLOBAL INTERNAL TABLES (WITH INCLUDE STRUCTURE)
DATA:GT_MAKT TYPE STANDARD TABLE OF MAKT, "Materialkurztexte,
GT_THEAD TYPE STANDARD TABLE OF THEAD, "SAPscript: Text-Header,
GT_LINETAB TYPE STANDARD TABLE OF TLINE, "SAPscript: Text-Zeilen,
GT_T002 TYPE STANDARD TABLE OF T002. "Language key
DATA: BEGIN OF GV_TEXT_OUTPUT_LINE,
MATNR LIKE MARA-MATNR,
BEGRU LIKE MARA-BEGRU,
MAKTX LIKE MAKT-MAKTX,
LTXT40(1250) TYPE C,
SRNO(3) TYPE N,
SPRAS LIKE T002-SPRAS,
END OF GV_TEXT_OUTPUT_LINE.
DATA: GT_MATNR TYPE STANDARD TABLE OF TP_MATNR,
WA_GT_MATNR TYPE TP_MATNR.
DATA: GT_LANG TYPE STANDARD TABLE OF TP_LANG,
WA_GT_LANG TYPE TP_LANG.
DATA: GT_TEXT_OUTPUT_LINE LIKE STANDARD TABLE OF GV_TEXT_OUTPUT_LINE,
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
GV_FIELDCAT LIKE LINE OF GT_FIELDCAT,
CT_GT_FIELDCAT_IN LIKE GV_FIELDCAT,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
GV_REPID TYPE SY-REPID.
DATA: BEGIN OF GV,
FORMER_ERROR LIKE SY-MARKY, " Fehlermeldung bereits
FILE_OPEN(1), " Flag open file
REC_LENGTH TYPE I, " record length
MATNR TYPE MARA-MATNR, " material
REPID TYPE SYST-REPID,
RETCO TYPE SY-SUBRC,
END OF GV.
DATA: GV_MAKT TYPE MAKT,
GV_T002 TYPE T002,
GV_LANGU TYPE THEAD-TDSPRAS.
* DECLARATION FOR FIELD-SYMBOLS
FIELD-SYMBOLS: <FS_DATA> TYPE REF TO DATA,
<FS_DATA1> TYPE REF TO DATA,
<FS_2> TYPE STANDARD TABLE,
<FS_22> TYPE STANDARD TABLE,
<FS_1>,
<FS_11>,
<F>,
<FA>,
<LWA_LINE_WA>,
<LWA_LINE_WA1>.
DATA: IT_FLDCAT TYPE LVC_T_FCAT.
DATA: T_FLDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
DATA: L_LT TYPE SLIS_LAYOUT_ALV.
DATA: WA_IT_FLDCAT TYPE LVC_S_FCAT.
DATA: WA_IT_FLDCAT1 TYPE SLIS_FIELDCAT_ALV.
DATA: GP_TABLE TYPE REF TO DATA.
DATA: WA_NEWLINE TYPE REF TO DATA.
*DECLARATION FOR CONSTANTS
CONSTANTS:
BEGIN OF GC,
TDID_GRUN TYPE THEAD-TDID VALUE 'GRUN',
TDOBJECT_MAT TYPE THEAD-TDOBJECT VALUE 'MATERIAL',
ON(01) TYPE C VALUE 'X',
YES(01) TYPE C VALUE 'X',
TXT(25) TYPE C VALUE 'MATERIAL DETAILS',
MAT(25) TYPE C VALUE 'MATERIAL NUMBER',
AUT(25) TYPE C VALUE 'AUTHORIZATION GROUP',
FOUND TYPE SY-SUBRC VALUE '00', " Return-Code
RC_OK TYPE SY-SUBRC VALUE '00', " Return-Code
OFF TYPE SY-SUBRC VALUE '00', " return code
FALSE TYPE SY-SUBRC VALUE '00', " boolean
TRUE TYPE SY-SUBRC VALUE '01', " boolean
END OF GC.
* DECLARATION FOR VARIABLES
DATA: V(3) TYPE N,
STR TYPE STRING,
STR1 TYPE STRING,
V_VAR(3) TYPE N,
V_VAR1(3) TYPE N,
V_FIELDNAME(15) TYPE C,
V_CHAR(15) TYPE C,
V_LINES(3) TYPE N,
MAKTEXT LIKE MAKT-MAKTX,
LT_DATA TYPE REF TO DATA,
LT_DATA1 TYPE REF TO DATA,
LWA_LINE TYPE REF TO DATA,
LWA_LINE1 TYPE REF TO DATA.
*SELECTION-SCREEN AND PARAMETERS
SELECTION-SCREEN: BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS:
S_MATNR FOR MARA-MATNR, "MATERIAL NUMBER
S_MTART FOR MARA-MTART, "MATERIAL TEXT
S_LANG FOR MAKT-SPRAS. "LANGUAGE
PARAMETER: GP_SIZE TYPE I DEFAULT 200. "DATA LENGTH
SELECTION-SCREEN: END OF BLOCK A1.
* AT SELECTION SCREEN
AT SELECTION-SCREEN.
IF GP_SIZE < 0.
MESSAGE E002(00).
ENDIF.
IF GP_SIZE > 50000.
MESSAGE W130(26) WITH TEXT-004.
SET CURSOR FIELD 'gp_size'.
ENDIF.
* INITIALIZATION
INITIALIZATION.
GV-REPID = SY-REPID.
*START-OF-SELECTION
START-OF-SELECTION.
PERFORM GET_MARA_DATA
TABLES
GT_TEXT_OUTPUT_LINE
USING
S_MATNR[]
S_MTART[]
GP_SIZE
CHANGING
GV-RETCO
PERFORM GET_MAT_TEXT
TABLES
GT_MAKT
GT_TEXT_OUTPUT_LINE
GT_THEAD
GT_LINETAB
USING
GC
GV-RETCO
CHANGING
GV_TEXT_OUTPUT_LINE
GV_MAKT
PERFORM GET_LANG.
PERFORM DYNAMIC_TABLES.
PERFORM POPULATE_FINAL_TABLE.
PERFORM POPULATE_DYNAMIC_TABLE.
* END-OF-SELECTION
END-OF-SELECTION.
PERFORM DATA_OUTPUT.
*& Form get_mara_data
* Materialdaten lesen
* <->ct_gt_text_output_line Ausgabetabelle
* -->it_s_matnr Parameter Materialnummer
* -->it_s_mtart Parameter Materialart
* -->if_gp_size Parameter Anzahl Materialnummern
FORM GET_MARA_DATA TABLES CT_GT_TEXT_OUTPUT_LINE STRUCTURE
GV_TEXT_OUTPUT_LINE
USING IT_S_MATNR LIKE S_MATNR[]
IT_S_MTART LIKE S_MTART[]
IF_GP_SIZE
CHANGING IF_GV-RETCO. "#EC *
* MARA in die Übergabestruktur einlesen
SELECT MATNR BEGRU
FROM MARA UP TO IF_GP_SIZE ROWS
APPENDING CORRESPONDING FIELDS OF TABLE GT_MATNR
WHERE MATNR IN IT_S_MATNR
AND MTART IN IT_S_MTART.
IF_GV-RETCO = SY-SUBRC.
ENDFORM. " get_mara_data
*& Form get_mat_text
* Kurz- und Langtexte zum Material lesen
* <->ct_gt_makt Materialkurztexte
* <->ct_gt_text_output_line Ausgabetabelle
* <->ct_gt_thead Kopftabelle für ALV
* <->ct_gt_linetab Zeilentabelle für ALV
* -->if_gc Globale Konstanten
* <--cf_gv_text_output_line Struktur Ausgabetabelle
* <--cf_gv_makt Struktru Materialkurztexte
FORM GET_MAT_TEXT TABLES CT_GT_MAKT STRUCTURE MAKT
CT_GT_TEXT_OUTPUT_LINE STRUCTURE
GV_TEXT_OUTPUT_LINE
CT_GT_THEAD STRUCTURE THEAD
CT_GT_LINETAB STRUCTURE TLINE
USING
IF_GC LIKE GC
IF_GV-RETCO
CHANGING CF_GV_TEXT_OUTPUT_LINE LIKE
GV_TEXT_OUTPUT_LINE
CF_GV_MAKT LIKE GV_MAKT
DATA: STRG TYPE STRING,
STRG1(1255) TYPE C.
IF IF_GV-RETCO = IF_GC-FOUND.
* Materialkurztexte in alles Sprachen einlesen
SELECT * FROM MAKT APPENDING TABLE CT_GT_MAKT
FOR ALL ENTRIES IN GT_MATNR "ct_gt_text_output_line
WHERE MATNR = GT_MATNR-MATNR " ct_gt_text_output_line-matnr
* Kurztexte in die sprachabhängigen Felder bringen
LOOP AT GT_MATNR INTO WA_GT_MATNR.
LOOP AT CT_GT_MAKT INTO CF_GV_MAKT
WHERE MATNR = WA_GT_MATNR-MATNR.
CF_GV_TEXT_OUTPUT_LINE-MATNR = WA_GT_MATNR-MATNR.
CF_GV_TEXT_OUTPUT_LINE-BEGRU = WA_GT_MATNR-BEGRU.
CF_GV_TEXT_OUTPUT_LINE-MAKTX = CF_GV_MAKT-MAKTX.
CF_GV_TEXT_OUTPUT_LINE-SPRAS = CF_GV_MAKT-SPRAS.
* LANGTEXT
CLEAR CT_GT_THEAD[].
CT_GT_THEAD-TDOBJECT = IF_GC-TDOBJECT_MAT.
CT_GT_THEAD-TDNAME = WA_GT_MATNR-MATNR.
CT_GT_THEAD-TDID = IF_GC-TDID_GRUN.
CT_GT_THEAD-TDSPRAS = CF_GV_MAKT-SPRAS.
CALL FUNCTION 'TEXT_READ'
EXPORTING
I_HEADER = CT_GT_THEAD
I_READONLY = IF_GC-ON
IMPORTING
E_HEADER = CT_GT_THEAD
TABLES
T_LINES = CT_GT_LINETAB[]
EXCEPTIONS
NOTFOUND = 1.
IF SY-SUBRC = IF_GC-FOUND.
LOOP AT CT_GT_LINETAB.
STRG = CT_GT_LINETAB-TDLINE.
IF STRG1 <> ' '.
CONCATENATE STRG1 ';' STRG INTO STRG1.
ELSE.
STRG1 = STRG.
ENDIF.
ENDLOOP.
CF_GV_TEXT_OUTPUT_LINE-LTXT40 = STRG1.
APPEND CF_GV_TEXT_OUTPUT_LINE TO CT_GT_TEXT_OUTPUT_LINE.
CLEAR CF_GV_TEXT_OUTPUT_LINE.
STRG1 = ' '.
ELSE.
APPEND CF_GV_TEXT_OUTPUT_LINE TO CT_GT_TEXT_OUTPUT_LINE.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDFORM. " get_mat_text
*& Form data_output
* Daten mit ALV ausgeben
* <->ct_GT_FIELDCAT Feldkatalog für ALV
* <->ct_gt_text_output_line Ausgabetabelle
* -->P_GS_LAYOUT Layout für ALV
* -->if_gc Globale Konstanten
* <--cf_GV_REPID Zur Zeit aufgerufener Reportname
* <--cf_gv_fieldcat Struktur Feldkatalog
* <--cf_gv Globale Variablen
FORM DATA_OUTPUT.
PERFORM FIELDCATBUILD.
PERFORM LAYOUT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GV-REPID
I_CALLBACK_PF_STATUS_SET = 'EVENT_SET_STATUS_01'
I_CALLBACK_USER_COMMAND = 'EVENT_USER_COMMAND'
IS_LAYOUT = L_LT
IT_FIELDCAT = T_FLDCAT1[]
TABLES
T_OUTTAB = <FS_2>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> GC-FOUND.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " data_output
*& Form fieldcatbuild
* text
* --> p1 text
* <-- p2 text
FORM FIELDCATBUILD. " TABLES ct_gt_fieldcat_in STRUCTURE gv_fieldcat.
LOOP AT IT_FLDCAT INTO WA_IT_FLDCAT.
WA_IT_FLDCAT1-FIELDNAME = WA_IT_FLDCAT-FIELDNAME.
WA_IT_FLDCAT1-TABNAME = WA_IT_FLDCAT-TABNAME.
WA_IT_FLDCAT1-SELTEXT_L = WA_IT_FLDCAT-FIELDNAME.
APPEND WA_IT_FLDCAT1 TO T_FLDCAT1.
CLEAR : WA_IT_FLDCAT,WA_IT_FLDCAT1.
ENDLOOP.
ENDFORM. " fieldcatbuild
* Form event_set_status_01*
FORM EVENT_SET_STATUS_01 USING LT_EXCL TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ABCD' .
ENDFORM. "EVENT_SET_STATUS_01
*& Form Name: event_user_command *
*& Form Desc: For Handling USER_COMMAND *
FORM EVENT_USER_COMMAND USING
IF_UCOMM TYPE SY-UCOMM
IS_SELFIELD TYPE SLIS_SELFIELD.
CASE IF_UCOMM.
WHEN 'DOWNLOAD'.
PERFORM POPULATE_DOWNLOAD_TABLE.
DATA: L_LENGHT TYPE I.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:data.xls'
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
TRUNC_TRAILING_BLANKS = 'X'
DAT_MODE = 'X'
IMPORTING
FILELENGTH = L_LENGHT
TABLES
DATA_TAB = <FS_22>.
IF SY-SUBRC <> GC-FOUND.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF L_LENGHT NE GC-FOUND.
MESSAGE S398(00) WITH 'DATA downloaded to c:data.xls'.
ENDIF.
ENDCASE.
ENDFORM. "event_user_command
*& Form get_lang
* text
* --> p1 text
* <-- p2 text
FORM GET_LANG.
SELECT SPRAS
LAISO FROM T002 INTO CORRESPONDING FIELDS OF TABLE GT_LANG
WHERE SPRAS IN S_LANG.
DESCRIBE TABLE GT_LANG LINES V_LINES.
LOOP AT GT_LANG INTO WA_GT_LANG.
V = V + 1.
WA_GT_LANG-SRNO = V.
MODIFY GT_LANG FROM WA_GT_LANG TRANSPORTING SRNO.
ENDLOOP.
LOOP AT GT_LANG INTO WA_GT_LANG.
CONCATENATE 'MATEDESC-' WA_GT_LANG-LAISO INTO V_FIELDNAME.
CLEAR WA_IT_FLDCAT.
WA_IT_FLDCAT-FIELDNAME = V_FIELDNAME.
WA_IT_FLDCAT-SELTEXT = V_FIELDNAME.
WA_IT_FLDCAT-DATATYPE = 'CHAR'.
WA_IT_FLDCAT-INTLEN = 40.
WA_IT_FLDCAT-TABNAME = '<FS_2>'.
APPEND WA_IT_FLDCAT TO IT_FLDCAT .
CLEAR WA_GT_LANG.
ENDLOOP.
LOOP AT GT_LANG INTO WA_GT_LANG.
CONCATENATE 'BASDAT-' WA_GT_LANG-LAISO INTO V_FIELDNAME.
CLEAR WA_IT_FLDCAT.
WA_IT_FLDCAT-FIELDNAME = V_FIELDNAME.
WA_IT_FLDCAT-DATATYPE = 'CHAR'.
WA_IT_FLDCAT-INTLEN = 255.
WA_IT_FLDCAT-SELTEXT = V_FIELDNAME.
WA_IT_FLDCAT-TABNAME = '<FS_2>'.
APPEND WA_IT_FLDCAT TO IT_FLDCAT .
CLEAR WA_GT_LANG.
ENDLOOP.
V_FIELDNAME = 'MATNR'.
CLEAR WA_IT_FLDCAT.
WA_IT_FLDCAT-FIELDNAME = V_FIELDNAME.
WA_IT_FLDCAT-DATATYPE = 'CHAR'.
WA_IT_FLDCAT-SELTEXT = 'Matnr'.
WA_IT_FLDCAT-INTLEN = 18.
WA_IT_FLDCAT-TABNAME = '<FS_2>'.
INSERT WA_IT_FLDCAT INTO IT_FLDCAT INDEX 1.
V_FIELDNAME = 'BEGRU'.
CLEAR WA_IT_FLDCAT.
WA_IT_FLDCAT-FIELDNAME = V_FIELDNAME.
WA_IT_FLDCAT-DATATYPE = 'CHAR'.
WA_IT_FLDCAT-SELTEXT = 'BEGRU'.
WA_IT_FLDCAT-INTLEN = 4.
WA_IT_FLDCAT-TABNAME = '<FS_2>'.
INSERT WA_IT_FLDCAT INTO IT_FLDCAT INDEX 2.
ENDFORM. " get_lang
*& Form dynamic_tables
* text
* --> p1 text
* <-- p2 text
FORM DYNAMIC_TABLES.
ASSIGN LT_DATA TO <FS_DATA>.
* Creating the Dynamic Internal Table
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IT_FLDCAT " Fieldcatalogue
IMPORTING
EP_TABLE = <FS_DATA> " Dynamic Internal Table
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
OTHERS = 2.
* Assign Dyn Table To Field Sumbol
ASSIGN <FS_DATA>->* TO <FS_1>.
* Assigning the Internal Table TYPE ANY to Standard internal Table
ASSIGN <FS_1> TO <FS_2>.
* Creating a Workarea
CREATE DATA LWA_LINE LIKE LINE OF <FS_2> .
* Assigning the Content to the workares as a Pointer
ASSIGN LWA_LINE->* TO <LWA_LINE_WA>.
ENDFORM. " dynamic_tables
*& Form populate_final_table
* text
* --> p1 text
* <-- p2 text
FORM POPULATE_FINAL_TABLE.
LOOP AT GT_TEXT_OUTPUT_LINE INTO GV_TEXT_OUTPUT_LINE.
READ TABLE GT_LANG INTO WA_GT_LANG
WITH KEY SPRAS = GV_TEXT_OUTPUT_LINE-SPRAS.
IF SY-SUBRC EQ GC-FOUND.
GV_TEXT_OUTPUT_LINE-SRNO = WA_GT_LANG-SRNO.
ENDIF.
MODIFY GT_TEXT_OUTPUT_LINE FROM GV_TEXT_OUTPUT_LINE.
ENDLOOP.
ENDFORM. " populate_final_table
*& Form populate_dynamic_table
* text
* --> p1 text
* <-- p2 text
FORM POPULATE_DYNAMIC_TABLE.
DATA: INDX TYPE SY-TABIX.
LOOP AT GT_TEXT_OUTPUT_LINE INTO GV_TEXT_OUTPUT_LINE.
AT NEW MATNR.
INDX = SY-TABIX.
ASSIGN COMPONENT 1 OF STRUCTURE <LWA_LINE_WA> TO <F>.
<F> = GV_TEXT_OUTPUT_LINE-MATNR.
ASSIGN COMPONENT 2 OF STRUCTURE <LWA_LINE_WA> TO <F>.
<F> = GV_TEXT_OUTPUT_LINE-BEGRU.
ENDAT.
LOOP AT GT_LANG INTO WA_GT_LANG.
IF GV_TEXT_OUTPUT_LINE-SRNO = WA_GT_LANG-SRNO.
V_VAR = GV_TEXT_OUTPUT_LINE-SRNO + 2.
ASSIGN COMPONENT V_VAR OF STRUCTURE <LWA_LINE_WA> TO <F>.
<F> = GV_TEXT_OUTPUT_LINE-MAKTX.
V_VAR = GV_TEXT_OUTPUT_LINE-SRNO + V_LINES + 2.
ASSIGN COMPONENT V_VAR OF STRUCTURE <LWA_LINE_WA> TO <F>.
<F> = GV_TEXT_OUTPUT_LINE-LTXT40.
ENDIF.
ENDLOOP.
AT END OF MATNR.
APPEND <LWA_LINE_WA> TO <FS_2>.
CLEAR <LWA_LINE_WA>.
ENDAT.
ENDLOOP.
ENDFORM. " populate_dynamic_table
*& Form LAYOUT
* text
* --> p1 text
* <-- p2 text
FORM LAYOUT.
CLEAR L_LT.
L_LT-ZEBRA = GC-YES.
L_LT-COLWIDTH_OPTIMIZE = 'X'.
L_LT-WINDOW_TITLEBAR = GC-TXT.
ENDFORM. " LAYOUT
*& Form populate_download_table
* text
* --> p1 text
* <-- p2 text
FORM POPULATE_DOWNLOAD_TABLE.
ASSIGN LT_DATA1 TO <FS_DATA1>.
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IT_FLDCAT " Fieldcatalogue
IMPORTING
EP_TABLE = <FS_DATA1> " Dynamic Internal table
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
OTHERS = 2.
* Assign Dyn Table To Field Sumbol
ASSIGN <FS_DATA1>->* TO <FS_11>.
* Assigning the Internal Table TYPE ANY to Standard internal Table
ASSIGN <FS_11> TO <FS_22>.
* Creating a Workarea
CREATE DATA LWA_LINE1 LIKE LINE OF <FS_22> .
* Assigning the Content to the workares as a Pointer
ASSIGN LWA_LINE1->* TO <LWA_LINE_WA1>.
DATA: STRN1 TYPE STRING,
STRN2 TYPE STRING,
INDX TYPE SY-TABIX.
ASSIGN COMPONENT 1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = GC-MAT.
ASSIGN COMPONENT 2 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = GC-AUT.
LOOP AT GT_LANG INTO WA_GT_LANG.
V_VAR1 = WA_GT_LANG-SRNO + 2.
CONCATENATE 'MATERIALDESCRIPTION-' WA_GT_LANG-LAISO INTO STRN1.
ASSIGN COMPONENT V_VAR1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = STRN1.
V_VAR1 = WA_GT_LANG-SRNO + V_LINES + 2.
CONCATENATE 'BASICDATA-' WA_GT_LANG-LAISO INTO STRN2.
ASSIGN COMPONENT V_VAR1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = STRN2.
ENDLOOP.
APPEND <LWA_LINE_WA1> TO <FS_22>.
CLEAR <LWA_LINE_WA1>.
APPEND <LWA_LINE_WA1> TO <FS_22>.
V_VAR1 = 0.
LOOP AT GT_TEXT_OUTPUT_LINE INTO GV_TEXT_OUTPUT_LINE.
AT NEW MATNR.
INDX = SY-TABIX.
ASSIGN COMPONENT 1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = GV_TEXT_OUTPUT_LINE-MATNR.
ASSIGN COMPONENT 2 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = GV_TEXT_OUTPUT_LINE-BEGRU.
ENDAT.
LOOP AT GT_LANG INTO WA_GT_LANG.
IF GV_TEXT_OUTPUT_LINE-SRNO EQ WA_GT_LANG-SRNO.
V_VAR1 = GV_TEXT_OUTPUT_LINE-SRNO + 2.
ASSIGN COMPONENT V_VAR1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = GV_TEXT_OUTPUT_LINE-MAKTX.
V_VAR1 = GV_TEXT_OUTPUT_LINE-SRNO + V_LINES + 2.
ASSIGN COMPONENT V_VAR1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
* STR = GV_TEXT_OUTPUT_LINE-LTXT40.
* SEARCH STR FOR ';'.
* DO.
* IF SY-SUBRC = 0.
* SPLIT STR AT ';' INTO STR1 STR.
* <FA> = STR1.
* APPEND <LWA_LINE_WA1> TO <FS_22>.
* SEARCH STR FOR ';'.
* CLEAR <LWA_LINE_WA1>.
* ELSE.
* EXIT.
* ENDIF.
* ENDDO.
* <FA> = STR.
* APPEND <LWA_LINE_WA1> TO <FS_22>.
<FA> = GV_TEXT_OUTPUT_LINE-LTXT40.
ENDIF.
ENDLOOP.
AT END OF MATNR.
APPEND <LWA_LINE_WA1> TO <FS_22>.
CLEAR <LWA_LINE_WA1>.
ENDAT.
ENDLOOP.
ENDFORM. " populate_download_table
thanks
Nitya -
Lookup Table and Target Table are the same
Hi All,
I have a requirement in which I have to lookup the target table and based on the records in it, I need to load a new record into the target table.
Being very specific,
Suppose I have a key column which when changes I want to generate a new id and then insert this new value.
The target table record structure looks like this
list_id list_key list_name
1 'A' 'NAME1'
1 'A' 'NAME2'
1 'A' 'NAME3'
2 'B' 'NAME4'
2 'B' 'NAME5'
As shown the target table list_id changes only when the list key changes. I need to generate the list_id value from within OWB mapping.
Can anyone throw some light as to how this can be done in OWB???
regards
-APHello, AP
You underestimate the power of single mapping :) If you could tolerate using additional stage table (with is definitly recomended in case your table from example will account a lot of rows).
You underestimate the power of single mapping :) It you could tolerate using additional stage table (witch is definitely recommended in case your table from example will account a lot of rows), you could accomplish all you need within one mapping and without using PLSQL function. This is true as far as you could have several targets within one mapping.
Source ----------------------------------------------------- >| Join2 | ---- > Target 2
|------------------------ >|Join 1| --> Lookup table -->|
Target Dedup >|
Here Target your target table. Join 1 operator covers operations needed to get existing key mapping (from dedup) and find new mappings. Results are stored within Lookup Table target (operation type TRUNCATE/INSERT).
Join 2 is used to perform final lookup and load it into the Target 2 the same as Target
The approach with lookup table is fast and reliable and could run on Set base mode. Also you could revisit lookup table to find what key mapping are loaded during last load operation.
Serhit -
How to Create new Lookup Type and look up codes within it.
Hi,
I need to create a Poplist.
I want the View Object(to be associated with the poplist) to fetch the value from a new look up type and lookup codes as mentioned below.
How to create these in the APPS?
Lookup Type
RATINGS
LookupCode Meaning
A Very Good
B Good
C Satisfactory
D Bad
Please tell me how can i create the above mentioned Lookup Type and codes ?
thanks,
GowtamI have one more doubt regarding the AM to be associated with the poplist and that with the page and choice box within it.
The ViewObject for the poplist belongs to the package <xyz>.oracle.apps.employee.poplist.server.
My questions are
1.What should be the AM property for PageLayoutRN?
- is it oracle.apps.fnd.server.OAApplicationModule(as in HelloWorld)
OR
- is it <xyz>.oracle.apps.employee.poplist.server (view objects AM)
2.What should be the AM property for the Choice?
- do I need to assign it to <xyz>.oracle.apps.employee.poplist.server
OR
- leave it blank?
Please clarify my doubts.
Thanks,
Gowtam -
Problem with lookup-table and single quotes
SOA Suite 10.1.3.3. I have an ESB project with an XSLT map that uses orcl:lookup-table to translate values. I use this instead of lookup-dvm because I want non-IT users to manage the mappings without having access to the ESB Console.
According to the doco:-
G.1.79 lookup-table
orcl:lookup-table(table, inputColumn, key, outputColumn, datasource)
This function returns a string based on the SQL query generated from the parameters.
The string is obtained by executing:
SELECT outputColumn FROM table WHERE inputColumn = key
The problem I'm having is that it seems if "key" contains a single quote (i.e an apostrophe), then lookup-table fails to find the corresponding value - even though the value in table.inputColumn also contains the single quote.
I've put the incoming into an XSL variable, but to no avail.
<xsl:variable name="incoming">
<xsl:value-of select="/obj1:DEV_MESSAGE_TYP/DATA1"/>
</xsl:variable>
<xsl:variable name="dvm-text">
<xsl:value-of select="orcl:lookup-table('MYTABLE','INVAL',$incoming,'OUTVAL','ds/dev')"/>
</xsl:variable>
Are there any XSLT Gurus out there that have come across this or can think of ways around it?
Thanks in advance...
Regards,
GregOk - the above was on the right track but wasn't 100% because it can't handle more than 1 single quote (apostrophe) in the input to lookup-table.
I've since found a better solution - an XSLT re-usable template that operates recursively and so can replace multiple occurances of single quotes. I've modified it to handle a null input value, otherwise lookup-table will just return the value of the first row in the lookup table - doh! The way I've done it below, if null is passed in, then null will be returned.
This goes at the top of your XSLT map file...
<!-- reusable replace-string function -->
<xsl:template name="replace-string">
<xsl:param name="text"/>
<xsl:param name="from"/>
<xsl:param name="to"/>
<xsl:choose>
<xsl:when test="contains($text, $from)">
<xsl:variable name="before" select="substring-before($text, $from)"/>
<xsl:variable name="after" select="substring-after($text, $from)"/>
<xsl:value-of select="$before"/>
<xsl:value-of select="$to"/>
<xsl:call-template name="replace-string">
<xsl:with-param name="text" select="$after"/>
<xsl:with-param name="from" select="$from"/>
<xsl:with-param name="to" select="$to"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$text=''">NULL</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Then you call it from within the XSLT map as follows:-
<!-- if contains a single quote, replace with 2x single quotes. This makes lookup-table work! -->
<xsl:variable name="incoming">
<xsl:call-template name="replace-string">
<xsl:with-param name="text" select="inp1:myinputfield"/>
<xsl:with-param name="from">'</xsl:with-param>
<xsl:with-param name="to" select="'&apos;&apos;'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="dvm-text">
<xsl:value-of select="orcl:lookup-table('MYLOOKUPTABLE','INVAL',$incoming,'OUTVAL','ds/dev')"/>
</xsl:variable>
<!-- lookup-table returns null if input value not found. Output original value instead -->
<xsl:choose>
<xsl:when test="$dvm-text=''">
<xsl:value-of select="inp1:myinputfield"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$dvm-text"/>
</xsl:otherwise>
</xsl:choose>
Much Thanks to everyone who shares information and methods on the Internet!
Cheers,
Greg -
Create a Z-table and fill it with value and transport everything
Hi
I would like to create a Z-table, fill it with values and then transport everything.
This table will not be updated in the productions system.
Delivery class = C Customizing table, maintenance only by cust., not SAP import
Data Browser/table view maint = Display/maintenance allowed
Field: MANDT, etc. etc.
Technical settings: Data class = APPL1, Size = 0, Buffering switched on, Fully buffered.
I also create the Table maintenance generator
When I fill my table with values, these will not be saved in my change request.
What I'm doing wrong?
Thanks // Peter BGo to
se11>utilities>table maintenance generator-->there u fill
Fungroup group (inthe function group u give any a z name related to ur table name it create automatically)
package
maintenance screen type and screen name
After this save and activate.
Then goto
Utilities>TABLE CONTENTS>CREATE ENTERIES -
I have noticed that SSMS supports tool tips for the Tabular Model (tables and columns) however Excel 2013 doesn't appear to. This is a very important feature to our end users.
Does anyone know when this will be supported?
Thanks
M MeyerHi Meyer,
According to your description, you want to use the tooltip function in Microsoft Excel for the SQL Server Analysis Services Tabular model, right?
I have tested it on my local environment (Microsoft SQL Server 2012 SP1 and Excel 2013), the result is that the feature is not supported currently. It's hard to say the detail date when this will be supported. If this feature is enabled, Microsoft will announce
it on the document.
Besides, if you have any concern about this behavior, you can submit a feedback at
http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that
they can be, Microsoft might consider to add this feature in the following release after official confirmation.
Regards,
Charlie Liao
TechNet Community Support
Maybe you are looking for
-
What's New in Adobe Creative Cloud for Web Pros | Creative Cloud for Web | Adobe TV
Introducing all of the tools you need to create a more beautiful, modern web - accessible now in Creative Cloud. http://adobe.ly/11O2G2N
-
Form created in Microsoft Frontpage?
Hello, I am attempting to fix a form using Dreamweaver. The form is located at the top-right corner of http://www.imagecandyusa.com The code for the form is as follows: <form method="POST" action="_vti_bin/shtml.exe/index.htm" onSubmit="" name="IC_h
-
Seeing so many complaints on the Adobe Muse bugs forum, wondering if there is fixes coming soon to all these, ESPECIALLY compatibility issues with Windows 8-8.1 64bit PC's. These are the PC's being sold nowadays, I cannot buy a new laptop with Window
-
Not showing recent messages in Yahoo Groups
I have noticed in the past week or so that messages to a couple of Yahoo Groups are not posting promptly. Right now Firefox is showing me no messages posted since 7:17 a.m. even though I can see in Internet Explorer that messages have been posted at
-
Can't access Application level item
Hi, I have set an Application level item. I have tried to assign it as a default value on a Page Item but nothing is being shown. Application Level Item: APP_USER_ID On New Instance computation: select user_id from isp_user where login_id=:APP_USER P