S&OP factor calculation (alpha, beta, gamma)
Hi gurus,
I´m trying to adap the automatic forecast selection in MC88 transaction to a graphic company scenario. They have several clients where they planned all the forecast for them, based on increase/decrease sales of each client. Today they are using the alpha, beta, gama factors but they still need to calculate the demand in a Excel spreadsheet and adjust the result in SAP.
My questions are:
- There´s any way to change the factors criteria? For example, if I want to increase the forecast for 2012 in 10% over 2011. If not, anyone knows a way to input this growing factor into the automatic forecast?
- I already found the formulas for the alpha, beta, gamma, but it´s not didactic to explain to some users. Anyone knows where I can find a simple and objective explanation for this factors?
Thanks in advance.
Best Regards,
Felipe Tavares
Hi,
It's your wrong assumption that clients are not using Forecast. Most of the Retails clients are effectively using forecast.
Without forecasting, Retail operation will not work at all.
A demand forecast is a prediction of the amount of each article / product that will be sold in the future. It's easy to see that inaccurate forecasts can cause major problems for your company. When forecasted demand is far below actual demand for a product, you risk running out of products and disappointing your customers. If forecasted demand exceeds actual usage, you'll probably be faced with large quantities of dead stock and slow-moving inventory.
For your company to be successful, your demand forecasts for products must be as accurate as possible.
(a) Alpha is used in the basic value calculation
(b) Beta is used in trend value calculation
(c) Gamma is used in the Seasonal index calculation
The value for the parameters range from 0 to 1. A higher value will place more emphasis on recent history. The parameters also control how reactive the forecast is to changes in historical patterns.
This is FYI.
Bye,
Muralidhara
Similar Messages
-
Alpha, beta, gamma, delta waves in Logic Pro 9
Can anyone tell me if there is an easy way to create alpha, beta, gamma, delta waves?
ThanksIn response to...
"You're kidding, right? Those are words used to describe electrical fluctuations that result from brain activity. A computer is not a brain and so even if you use it to generate wave forms that match those of a brain in action, it is not by definition an "alpha, beta, gamma, or delta wave."
Let me just say this:
http://www.gobrainev.com/?gclid=CIbpzfzHrp8CFRlZbQodv3pO2A -
Min max with Alpha Beta pruning
Hey I would like to add Min max with Alpha - Beta pruning for my tic tac toe game. If you know some sort of tutorial or anything please let me know. After I complete I'm going to make a complete guide to make a Tic Tac Toe game with a really nice GUI, Music, AI, and Network capabilities. I have the game made so far. I'm going to rewrite it with interfaces and clean up the code a lot then create the guide, but before I do all this I want to create and AI for it.
I suppose that since, other than reading a summary on Wikipedia, I
don't know what a 'minimax algorithm' is and have never tried to
implement one I should not make fun.The idea is quite simple: your best move e.g. in a board game is my worst
result and vice versa. If I can minimize your best move I have maximized
my best move (and that's the move I'll play).
Now suppose my best move somewhere in that game tree turns out
to be worse than another best move of mine somewhere else in that
same tree, there is no need anymore for me to explore the rest of that
subtree. That's the alpha pruning part. The same counts for you and
that's the beta pruning part.
alpha-beta pruning reduces the number of nodes to be examined to
O(sqrt(n)) where n are all the nodes in the fully examined tree. It is
quite a nice algorithm although quite tricky too when you have to build it.
The best reference I can think of now is the old book "Data Structures"
by Horrowitz and Sahni.
kind regards,
Jos -
Special character alpha, beta, sigma insert in Form 5
Hi everyone,
I have a problem to insert special character alpha, beta, sigma
in form 5. when I insert these characters is display it code
not display it actual symbol.
How I could solve this problem.
with advance thanks
MateenHi everyone,
I have a problem to insert special character alpha, beta, sigma
in form 5. when I insert these characters is display it code
not display it actual symbol.
How I could solve this problem.
with advance thanks
Mateen -
Everything from repositories to the FTP server is deleted. It's like Maemo is completely forgotten. Ovi Store hasnt been updated since Fennec 6. On the FTP servers there where v13,14 but now Maemo folders are deleted. Where I can obtain the latest alpha, beta & stable versions?
There is a fellow by the name of Romaxa who has been supplying the recent Firefox builds for the OVI store.
* http://store.ovi.com/content/257468
* http://romaxa.bolshe.net/fennec/ -
Help in nega max+alpha beta pruning
well I have programmed a connect four which implemented minimax algorithm,but then it took 10 secs(minimum) to reply for maxdepth of 8. More over it still lost few games to online ai's which to my surprise played faster and more accurate than my program.Then by searching in books and internet I came across search funtion called as megamax with alpha-beta pruning.I replaced my minimax with this method but then it plays very bad(doesn't even see the connect 4 even if there are 3 in a row).I am willing to put my source code, pls point out my mistakes and rectify (with explanations if possible). Thank you, and also forgive me for grammatical mistakes(if any) as english is my second language.
I know alpha beta is a bit tedious thing to do(at least for me as I am doing it for the very first time).
So I request you all to please helpHere is the source code
package connect4;
import java.io.*;
import java.util.*;
public class Connect4 {
private static final int WIDTH=7, HEIGHT=6;
private static int MAX_RECURDEPTH=8;
private static BufferedReader in;
private int[][] grid=new int[WIDTH][HEIGHT];
private int[] columnHeight=new int[WIDTH];
private static int recurDepth=0;
public static void main(String[] args) {
in=new BufferedReader(new InputStreamReader(System.in));
new Connect4();
public Connect4() {
Scanner read=new Scanner(System.in);
int column,p;
int player=1;
System.out.println("Who play first?");
System.out.println("1.Player");
System.out.println("2.Computer");
p=read.nextInt();
player=p;
double a=-MAX_RECURDEPTH;
double b=MAX_RECURDEPTH;
int move=0;
double value=0;
Vector moves=new Vector();
while(true) {
if(player==1) {
printGrid();
do {
System.out.println("Make your move (1-7): ");
column=readInt()-1;
} while(column<0 || column >=WIDTH || columnHeight[column]>=HEIGHT);
} else {
moves.removeAllElements();
column=0;
value=0;
double prevValue=-MAX_RECURDEPTH-1;
for(int x=0; x<WIDTH; x++)
if(columnHeight[x]>=HEIGHT)
continue;
if (move==0)
moves.add(new Integer(3));
break;
if(p==2 && move==1)
moves.add(new Integer(3));
break;
value=minmax_ab(2,x,a,b);
if(value>prevValue) {
moves.removeAllElements();
prevValue=value;
if(value==prevValue)
moves.add(new Integer(x));
move++;
System.out.println("VAlue="+prevValue);
if(moves.size()>0) {
Collections.shuffle(moves);
column=((Integer)moves.get(0)).intValue();
if(moves.size()==0) {
System.out.println("Its a draw.");
break;
grid[column][columnHeight[column]]=player;
if(player==2)
System.out.println("I PUT MY CHECKER IN "+(column+1));
columnHeight[column]++;
int haswon=0;
haswon=fourInARow();
if(haswon>0) {
printGrid();
if(player==2)
System.out.println("I WON");
else
System.out.println("YOU WON");
break;
player=3-player;
double minmax_ab(int player, int column,double a,double b) {
double value=0;
if(columnHeight[column]>=HEIGHT)
return 0;
grid[column][columnHeight[column]]=player;
columnHeight[column]++;
if(columnHeight[column]>=HEIGHT)
return 0;
recurDepth++;
if(fourInARow()>0) {
if(player==2)
value=(MAX_RECURDEPTH+1)-recurDepth;
else value=-MAX_RECURDEPTH-1+recurDepth;
if(recurDepth<MAX_RECURDEPTH&&value==0)
value=MAX_RECURDEPTH+1;
for(int x=0; x<WIDTH; x++)
if(columnHeight[x]>=HEIGHT)
continue;
double v=-minmax_ab(3-player,column,-b,-a);
if(value==(MAX_RECURDEPTH+1))
value=v;
else if(player==2)
if(v>value)
value=v;
else if(v>value)
value=v;
else if(v>a)
a=v;
else if(a>=b)
return value;
recurDepth--;
columnHeight[column]--;
grid[column][columnHeight[column]]=0;
return a;
int fourInARow() {
int num, player;
for(int y=0; y<HEIGHT; y++) {
num=0; player=0;
for(int x=0; x<WIDTH; x++) {
if(grid[x][y]==player) num++;
else { num=1; player=grid[x][y]; }
if(num==4 && player>0)
return player;
for(int x=0; x<WIDTH; x++) {
num=0; player=0;
for(int y=0; y<HEIGHT; y++) {
if(grid[x][y]==player) num++;
else { num=1; player=grid[x][y]; }
if(num==4 && player>0) return player;
for(int xStart=0, yStart=2; xStart<4; ) {
num=0; player=0;
for(int x=xStart, y=yStart; x<WIDTH && y<HEIGHT; x++, y++) {
if(grid[x][y]==player) num++;
else { num=1; player=grid[x][y]; }
if(num==4 && player>0) return player;
if(yStart==0) xStart++;
else yStart--;
for(int xStart=0, yStart=3; xStart<4; ) {
num=0; player=0;
for(int x=xStart, y=yStart; x<WIDTH && y>=0; x++, y--) {
if(grid[x][y]==player) num++;
else { num=1; player=grid[x][y]; }
if(num==4 && player>0) return player;
if(yStart==HEIGHT-1) xStart++;
else yStart++;
return 0;
void printGrid() {
int x=0;
int y=0;
for(y=HEIGHT-1; y>=0; y--)
for(x=0; x<WIDTH; x++)
if(grid[x][y]==0)
System.out.print(" * ");
else if(grid[x][y]==1)
System.out.print(" A ");
else if(grid[x][y]==2)
System.out.print(" B ");
System.out.println();
System.out.println();
System.out.println(" 1 2 3 4 5 6 7 ");
int readInt() {
try {
String input=in.readLine();
int number=Integer.parseInt(input);
return number;
} catch(NumberFormatException e) {
return -1;
} catch(IOException e) {
return -1; -
Error in Proportional Factor Calculation Program
Hi ,
I have developed an ABAP Program to calculate Proportional Factor(PF) as below.
Generally,to calculate the PF for a period , we need to use transaction /sapapo/sdp94 to create a profile .After doing that , to calculate PF we need to go transaction /sapapo/mv8v .
Now,the given program has three options :-
1)Create : To create the selection-ID by taking areabasepackRS as name of the selection-ID . Here we need to give the excel sheet that is used to load data into /sapapo/mc8v to calculate PF.
2)Calculate PF : This option is used to calculate proportional factor.
Now if we try to calculate PF ,I get an error message saying there are no
plannable characteristic combinations .
3) Delete : This option is used to delete the selection profile.
I am getting an error in this program which I have explained with the document attached in this mail .
Please could anyone help me out with this .
The program is as below:-
<b>report ZRSNORMS_PPF
no standard page heading line-size 255.</b>
*include bdcrecx1.
INCLUDE ZAPO_DATA_DECLARATION_PPF.
INCLUDE Z_APO_FORMS_PPF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = syst-repid
DYNPRO_NUMBER = SYST-DYNNR
field_name = p_file1
STATIC = ' '
MASK = ' '
CHANGING
file_name = p_file1
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
start-of-selection.
PERFORM READ_DATA TABLES I_PROFILE
I_EXEL
IT_PROFILE_NAME
USING P_FILE1
CHANGING W_SUBRC.
PERFORM SAVE_SELECTION TABLES I_EXEL
IT_SAVE_SEL
IT_PROFILE_NAME.
IT_GRP-OBJNAM = 'ZRSBASPCK'.
APPEND IT_GRP.
LOOP AT IT_GRP INTO W_GROUP.
APPEND W_GROUP TO IT_GROUP.
ENDLOOP.
G_PAREAID = 'ZRSPAHPC'.
G_MVIEW = 'ZRSPAHPC'.
G_COUNT = 0.
IF CREATE = 'X'.
LOOP AT IT_SAVE_SEL INTO W_SEL_SAVE.
IF W_SEL_SAVE-IOBJNM = '9AVERSION' AND SY-TABIX > 1.
G_COUNT = G_COUNT + 1.
READ TABLE IT_PROFILE_NAME INDEX G_COUNT.
G_NAME = IT_PROFILE_NAME-F_NAME.
CALL FUNCTION '/SAPAPO/MCPSH_SELECTION_SAVE'
EXPORTING
IV_SELID =
IV_FLG_USED_FOR =
IV_PAREAID = G_PAREAID
IV_MVIEW = G_MVIEW
IV_SEL_DESCRIPTION = G_NAME
IT_SELECTION = IT_SEL_SAVE
IT_OBJECTS =
IT_SEL_GROUP = IT_GROUP
IV_POPUP_SEL_DESCRIPTION =
IMPORTING
EV_SELID =
EV_SEL_DESCRIPTION =
EXCEPTIONS
DUPLICATE_SELECTION = 1
MULTIPLE_SELECTION = 2
INCONSISTENT_DATABASE = 3
DUPLICATE_DESCRIPTION = 4
INVALID_DESCRIPTION = 5
NO_PERMISSION = 6
SELID_INVALID = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR IT_SEL_SAVE[].
APPEND W_SEL_SAVE TO IT_SEL_SAVE.
ELSEIF W_SEL_SAVE-IOBJNM = '9AVERSION' AND SY-TABIX = 1.
APPEND W_SEL_SAVE TO IT_SEL_SAVE.
ELSE.
APPEND W_SEL_SAVE TO IT_SEL_SAVE.
ENDIF.
ENDLOOP.
G_COUNT = G_COUNT + 1.
READ TABLE IT_PROFILE_NAME INDEX G_COUNT.
G_NAME = IT_PROFILE_NAME-F_NAME.
CALL FUNCTION '/SAPAPO/MCPSH_SELECTION_SAVE'
EXPORTING
IV_SELID =
IV_FLG_USED_FOR =
IV_PAREAID = G_PAREAID
IV_MVIEW = G_MVIEW
IV_SEL_DESCRIPTION = G_NAME
IT_SELECTION = IT_SEL_SAVE
IT_OBJECTS =
IT_SEL_GROUP = IT_GROUP
IV_POPUP_SEL_DESCRIPTION =
IMPORTING
EV_SELID =
EV_SEL_DESCRIPTION =
EXCEPTIONS
DUPLICATE_SELECTION = 1
MULTIPLE_SELECTION = 2
INCONSISTENT_DATABASE = 3
DUPLICATE_DESCRIPTION = 4
INVALID_DESCRIPTION = 5
NO_PERMISSION = 6
SELID_INVALID = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IV_GROUP = 'ZRSBASPCK'.
LOOP AT IT_SEL_SAVE INTO w_confirm_sel.
APPEND w_confirm_sel TO it_confirm_sel.
ENDLOOP.
CALL FUNCTION '/SAPAPO/MSDP_SH_OBJ_LIST_BUILD'
EXPORTING
IV_PAREAID = G_PAREAID
IV_MVIEW = G_MVIEW
IV_DVIEW =
IV_FROMDATE =
IV_ENDDATE =
IV_NO_POPUPS =
IMPORTING
ET_SH_OBJECTS =
EXCEPTIONS
INVALID_INPUT = 1
INTERNAL_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR IT_SEL_SAVE[].
ENDIF.
if calc_ppf = 'X'.
PERFORM CALC_PPF TABLES I_EXEL
BDCTAB
IT_PROFILE_NAME.
ENDIF.
if del_prof = 'X'.
LOOP AT I_EXEL.
concatenate i_exel-area I_EXEL-BASE INTO DEL_NAME.
SELECT SINGLE * FROM /SAPAPO/TS_SELKO INTO IT_TS_SELKO
WHERE SEL_DESRCIPTION = DEL_NAME.
DEL_PROFILE = IT_TS_SELKO-SELECTIONID.
CALL FUNCTION '/SAPAPO/MCPSH_SELECTION_DELETE'
EXPORTING
IV_SELID = DEL_PROFILE
IV_FLG_CONFIRM_TRANS = 'X'
EXCEPTIONS
NO_ENTRY = 1
NO_AUTHORITY = 2
DELETION_NOT_POSSIBLE = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
ENDIF.
<b>INCLUDE ZAPO_DATA_DECLARATION_PPF .</b>
types: t_ts_selpo type /sapapo/ts_selpo.
TYPES: BEGIN OF T_EXEL,
PROF_DATFRM TYPE DATS,
PROF_DATTO TYPE DATS,
FORCAST_FROM TYPE DATS,
FORCAST_TO TYPE DATS,
AREA(60),
BASE(60),
POPID(60),
RATING(60),
RS(60),
END OF T_EXEL.
types: begin of t_profile,
obj(30),
val(60),
end of t_profile.
TYPES: begin of t_profile_name,
f_name(60),
end of t_profile_name.
DATA: G_COUNT TYPE I VALUE 0.
*TYPES: T_SAVE_SEL LIKE IT_SELECTION.
data: w_subrc TYPE sy-subrc,
I_TS_SELPO TYPE Table of t_ts_selpo with header line,
I_EXEL TYPE Table of t_EXEL with header line.
DATA: IV_GROUP TYPE /SAPAPO/IOBJNM.
DATA: IT_PROFILE_NAME TYPE TABLE OF T_PROFILE_NAME WITH HEADER LINE.
data: i_profile type table of t_profile with header line.
*/sapapo/ts_iobj_selection_tab.
data: IT_SEL_SAVE TYPE /sapapo/ts_iobj_selection_tab,
w_SEL_SAVE type /SAPAPO/TS_IOBJ_SELECTION.
DATA: IT_CONFIRM_SEL TYPE /SAPAPO/SH_SEL_RANGE_TAB,
W_CONFIRM_SEL TYPE /SAPAPO/SH_SEL_RANGE_STR.
TYPES: BEGIN OF T_SAVE_SEL,
IOBJNM(30),
SIGN,
OPTION(2),
LOW(60),
HIGH(60),
END OF T_SAVE_SEL.
DATA: IT_SAVE_SEL TYPE TABLE OF T_SAVE_SEL WITH HEADER LINE.
TYPES: BEGIN OF T_GRP,
OBJNAM(30),
END OF T_GRP.
DATA: IT_GRP TYPE TABLE OF T_GRP WITH HEADER LINE.
DATA DECLARATION FOR FUNC MODULE **************
DATA: IT_GROUP TYPE /SAPAPO/TS_GROUP_BY_TAB,
W_GROUP TYPE /SAPAPO/TS_GROUP_BY_STR.
DATA: G_PAREAID TYPE /SAPAPO/TS_PAREAID,
G_MVIEW TYPE /SAPAPO/PB_MVIEW,
G_NAME TYPE /SAPAPO/TS_SEL_DESCR.
BDC TABLES ***************************
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: it_messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA : BDCTAB like BDCDATA occurs 0 with header line.
DATA : w_file type string.
****************BDC ERROR TAB ***************************
DATA : xcount1 TYPE i,
xstat TYPE i,
xmsgv1 LIKE balm-msgv1,
xmsgv2 LIKE balm-msgv2,
xmsgv3 LIKE balm-msgv3,
xmsgv4 LIKE balm-msgv4,
xmessage(80) TYPE c.
DATA : BEGIN OF t_errlog OCCURS 0,
sno TYPE i,
message(80) TYPE c,
END OF t_errlog.
DATA: DEL_PROFILE TYPE /SAPAPO/SELECTIONID2,
DEL_NAME(60).
************DUPLICATE NAME TAB **************************
DATA: IT_NOT_PROCESSED TYPE TABLE OF /SAPAPO/TS_SELPO WITH HEADER LINE.
DELETE TAB *****************************
DATA: IT_TS_SELKO TYPE TABLE OF /SAPAPO/TS_SELKO WITH HEADER LINE.
SELECTION-SCREEN : BEGIN OF BLOCK b1.
parameters: p_file1 TYPE rlgrap-filename.
parameters: create type c radiobutton group g1,
calc_ppf type c radiobutton group g1,
del_prof type c radiobutton group g1.
SELECTION-SCREEN END OF BLOCK b1.
Include Z_APO_FORMS_PPF
*& Include Z_APO_FORMS_PPF
*& Form READ_DATA
text
-->P_I_PROFILE text
-->P_I_EXEL text
-->P_IT_PROFILE_NAME text
-->P_P_FILE1 text
<--P_W_SUBRC text
FORM READ_DATA TABLES P_I_PROFILE STRUCTURE I_PROFILE
P_I_EXEL STRUCTURE I_EXEL
P_IT_PROFILE_NAME STRUCTURE IT_PROFILE_NAME
USING P_P_FILE1
CHANGING P_W_SUBRC.
DATA : iexcel LIKE zexcel_read OCCURS 0 WITH HEADER LINE,
G_DATE TYPE DATS.
data: l_name(60).
CLEAR p_w_subrc.
CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_p_file1
i_begin_col = 1
i_begin_row = 1
i_end_col = 62
i_end_row = 50000
TABLES
intern = iexcel.
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
p_w_subrc = 0 .
endif.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT iexcel WHERE row > 1.
IF iexcel-col = '0001'.
PERFORM CONVERT_DATE CHANGING G_DATE iexcel-value.
p_i_EXEL-PROF_DATFRM = G_DATE.
ENDIF.
IF iexcel-col = '0002'.
PERFORM CONVERT_DATE CHANGING G_DATE iexcel-value.
p_i_EXEL-PROF_DATTO = G_DATE.
ENDIF.
IF iexcel-col = '0003'.
PERFORM CONVERT_DATE CHANGING G_DATE iexcel-value.
p_i_EXEL-FORCAST_FROM = G_DATE.
ENDIF.
IF iexcel-col = '0004'.
PERFORM CONVERT_DATE CHANGING G_DATE iexcel-value.
p_i_EXEL-FORCAST_TO = G_DATE.
ENDIF.
IF iexcel-col = '0005'.
p_i_EXEL-AREA = iexcel-value.
p_i_profile-obj = 'ZRSAREA'.
p_i_profile-VAL = iexcel-value.
append p_i_PROFILE.
clear p_i_PROFILE.
ENDIF.
IF iexcel-col = '0006'.
p_i_EXEL-BASE = iexcel-value.
p_i_profile-obj = 'ZRSBASPCK'.
p_i_profile-VAL = iexcel-value.
append p_i_PROFILE.
clear p_i_PROFILE.
ENDIF.
IF iexcel-col = '0007'.
p_i_EXEL-POPID = iexcel-value.
p_i_profile-obj = 'ZRSPOPULN'.
p_i_profile-VAL = iexcel-value.
append p_i_PROFILE.
clear p_i_PROFILE.
ENDIF.
IF iexcel-col = '0008'.
p_i_EXEL-RATING = iexcel-value.
ENDIF.
IF iexcel-col = '0009'.
p_i_EXEL-RS = iexcel-value.
p_i_profile-obj = 'ZRSCUSTMR'.
p_i_profile-VAL = iexcel-value.
append p_i_PROFILE.
clear p_i_PROFILE.
ENDIF.
at end of row.
append p_i_EXEL.
clear p_i_EXEL.
endat.
endloop.
loop at P_I_EXEL.
concatenate P_I_EXEL-AREA P_I_EXEL-BASE INTO L_NAME.
P_it_profile_name-f_name = l_name.
append P_it_profile_name.
ENDLOOP.
ENDFORM. " READ_DATA
*& Form CONVERT_DATE
text
<--P_G_DATE text
<--P_IEXCEL_VALUE text
FORM CONVERT_DATE CHANGING P_G_DATE
P_IEXCEL_VALUE.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = p_iexcel_value
ACCEPT_INITIAL_DATE =
IMPORTING
DATE_INTERNAL = p_g_date
EXCEPTIONS
DATE_EXTERNAL_IS_INVALID = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " CONVERT_DATE
*& Form SAVE_SELECTION
text
-->P_I_EXEL text
-->P_IT_SAVE_SEL text
-->P_IT_PROFILE_NAME text
FORM SAVE_SELECTION TABLES P_I_EXEL STRUCTURE I_EXEL
P_IT_SAVE_SEL STRUCTURE IT_SAVE_SEL
P_IT_PROFILE_NAME STRUCTURE IT_PROFILE_NAME.
DATA: L_PAREAID(40).
loop at p_i_exel.
p_it_save_sel-iobjnm = '9AVERSION'.
p_it_save_sel-SIGN = 'I'.
p_it_save_sel-OPTION = 'EQ'.
p_it_save_sel-LOW = '000'.
APPEND P_IT_SAVE_SEL.
CLEAR P_IT_SAVE_SEL.
p_it_save_sel-iobjnm = 'ZRSAREA'.
p_it_save_sel-SIGN = 'I'.
p_it_save_sel-OPTION = 'EQ'.
p_it_save_sel-LOW = P_I_EXEL-AREA.
APPEND P_IT_SAVE_SEL.
CLEAR P_IT_SAVE_SEL.
IF NOT P_I_EXEL-BASE IS INITIAL.
p_it_save_sel-iobjnm = 'ZRSBASPCK'.
p_it_save_sel-SIGN = 'I'.
p_it_save_sel-OPTION = 'EQ'.
p_it_save_sel-LOW = P_I_EXEL-BASE.
ENDIF.
APPEND P_IT_SAVE_SEL.
CLEAR P_IT_SAVE_SEL.
IF NOT P_I_EXEL-POPID IS INITIAL.
p_it_save_sel-iobjnm = 'ZRSPOPULN'.
p_it_save_sel-SIGN = 'I'.
p_it_save_sel-OPTION = 'EQ'.
p_it_save_sel-LOW = P_I_EXEL-POPID.
APPEND P_IT_SAVE_SEL.
CLEAR P_IT_SAVE_SEL.
ENDIF.
IF NOT P_I_EXEL-RS IS INITIAL.
p_it_save_sel-iobjnm = 'ZRSCUSTMR'.
p_it_save_sel-SIGN = 'I'.
p_it_save_sel-OPTION = 'EQ'.
p_it_save_sel-LOW = P_I_EXEL-RS.
APPEND P_IT_SAVE_SEL.
CLEAR P_IT_SAVE_SEL.
ENDIF.
write 'hi'.
*CLEAR P_IT_SAVE_SEL[].
ENDLOOP.
*submit
ENDFORM. " SAVE_SELECTION
*& Form CALC_PPF
text
-->P_I_EXEL text
-->P_BDCTAB text
-->P_IT_PROFILE_NAME text
FORM CALC_PPF TABLES P_I_EXEL STRUCTURE I_EXEL
P_BDCTAB STRUCTURE BDCTAB
P_IT_PROFILE_NAME STRUCTURE IT_PROFILE_NAME.
DATA: PERIOD_FROM TYPE /SAPAPO/BASIS_VON_BIS,
PERIOD_TO TYPE /SAPAPO/BASIS_VON_BIS,
TRANSFER_FORM TYPE /SAPAPO/TARGET_VON_BIS,
TRANSFER_TO TYPE /SAPAPO/TARGET_VON_BIS,
SEL_PROFILE TYPE /SAPAPO/SEL_TXT.
DATA: SEL_NAME(60).
DATA : L_TEMP TYPE SY-DATUM,
L_TEMP1 TYPE SY-DATUM,
L_TEMP2 TYPE SY-DATUM,
L_TEMP3 TYPE SY-DATUM.
LOOP AT P_I_EXEL.
L_TEMP0(2) = P_I_EXEL-FORCAST_FROM6(2). "passed date
L_TEMP2(2) = P_I_EXEL-FORCAST_FROM4(2). "passed Month
L_TEMP4(4) = P_I_EXEL-FORCAST_FROM0(4). "passed year
L_TEMP10(2) = P_I_EXEL-FORCAST_TO6(2). "passed date
L_TEMP12(2) = P_I_EXEL-FORCAST_TO4(2). "passed Month
L_TEMP14(4) = P_I_EXEL-FORCAST_TO0(4). "passed year
L_TEMP20(2) = P_I_EXEL-PROF_DATFRM6(2). "passed date
L_TEMP22(2) = P_I_EXEL-PROF_DATFRM4(2). "passed Month
L_TEMP24(4) = P_I_EXEL-PROF_DATFRM0(4). "passed year
L_TEMP30(2) = P_I_EXEL-PROF_DATTO6(2). "passed date
L_TEMP32(2) = P_I_EXEL-PROF_DATTO4(2). "passed Month
L_TEMP34(4) = P_I_EXEL-PROF_DATTO0(4). "passed year
PERIOD_FROM = L_TEMP2.
PERIOD_TO = L_TEMP3.
transfer_form = L_TEMP.
TRANSFER_TO = L_TEMP1.
concatenate P_I_EXEL-AREA P_I_EXEL-BASE INTO SEL_NAME.
SEL_PROFILE = SEL_NAME.
perform bdc_dynpro using '/SAPAPO/RMDP_SHARE_VERSION_M' '1000'.
perform bdc_field using 'BDC_CURSOR'
'BPAREAID'.
perform bdc_field using 'BDC_OKCODE'
'=ONLI'.
perform bdc_field using 'PAREAID'
'ZRSPAHPC'.
perform bdc_field using 'FLG_AREA'
'X'.
perform bdc_field using 'BPAREAID'
'ZRSPAHPC'.
perform bdc_dynpro using '/SAPAPO/RMDP_SHARE_MANAGER' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=UCOMM1'.
perform bdc_field using 'BDC_CURSOR'
'Z_DATE-HIGH'.
perform bdc_field using 'B_VER'
'000'.
perform bdc_field using 'B_KENN'
'9AVCORHIST'.
perform bdc_field using 'B_DATE-LOW'
PERIOD_FROM.
perform bdc_field using 'B_DATE-HIGH'
PERIOD_TO.
perform bdc_field using 'VERSION'
'000'.
perform bdc_field using 'Z_DATE-LOW'
transfer_form.
perform bdc_field using 'Z_DATE-HIGH'
TRANSFER_TO.
perform bdc_field using 'FLG_ONE'
'X'.
perform bdc_dynpro using '/SAPAPO/RMDP_SHARE_MANAGER' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=ONLI'.
perform bdc_field using 'BDC_CURSOR'
'SEL_TXT'.
perform bdc_field using 'SEL_TXT'
SEL_PROFILE.
perform bdc_dynpro using '/SAPAPO/RMDP_SHARE_MANAGER' '1000'.
perform bdc_field using 'BDC_OKCODE'
'/EE'.
perform bdc_dynpro using '/SAPAPO/RMDP_SHARE_VERSION_M' '1000'.
perform bdc_field using 'BDC_OKCODE'
'=ONLI'.
perform bdc_field using 'BDC_OKCODE'
'/EE'.
perform bdc_field using 'BDC_CURSOR'
'PAREAID'.
*perform bdc_transaction using '/SAPAPO/MC8V'.
SELECT SINGLE * FROM /SAPAPO/TS_SELKO INTO IT_TS_SELKO
WHERE SEL_DESRCIPTION = sel_NAME.
if sy-subrc = 0.
call transaction '/SAPAPO/MC8V'
using bdctab
mode 'A'
update 'L'
messages into it_messtab.
describe table it_messtab lines xcount1.
read table it_messtab index xcount1.
LOOP AT it_messtab WHERE msgtyp = 'E'
OR msgtyp = 'A'.
MOVE It_messtab-msgv1 TO xmsgv1.
MOVE It_messtab-msgv2 TO xmsgv2.
MOVE It_messtab-msgv3 TO xmsgv3.
MOVE It_messtab-msgv4 TO xmsgv4.
CALL FUNCTION 'MESSAGE_PREPARE'
EXPORTING
LANGUAGE = sy-langu
msg_id = It_messtab-msgid
msg_no = It_messtab-msgnr
MSG_VAR1 = xmsgv1
MSG_VAR2 = xmsgv2
MSG_VAR3 = xmsgv3
MSG_VAR4 = xmsgv4
IMPORTING
MSG_TEXT = xmessage
EXCEPTIONS
FUNCTION_NOT_COMPLETED = 1
MESSAGE_NOT_FOUND = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
MOVE sy-tabix TO t_errlog-sno.
MOVE xmessage TO t_errlog-message.
APPEND t_errlog.
CLEAR t_errlog..
ENDLOOP.
CLEAR BDCTAB[].
CLEAR SEL_NAME.
CLEAR P_I_EXEL.
endif.
ENDLOOP.
ENDFORM. " CALC_PPF
*& Form bdc_dynpro
text
-->P_0424 text
-->P_0425 text
FORM bdc_dynpro USING PROGRAM DYNPRO.
CLEAR bdcTAB.
bdcTAB-program = program.
bdcTAB-dynpro = dynpro.
bdcTAB-dynbegin = 'X'.
APPEND bdcTAB.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
-->P_0494 text
-->P_TRANSFER_FROM text
FORM bdc_field USING FNAM FVAL.
CLEAR bdcTAB.
bdcTAB-fnam = fnam.
bdcTAB-fval = fval.
APPEND bdcTAB.
ENDFORM. " bdc_fieldHi,
As I have not been able to attach the document, I will explain the problem in full as below:-
Business scenario - Consider a factory having 5 different customers (which is known as Customer_rs). We need to supply stock to each of them based on their past consumption. So to forecast this, we calculate a factor known as proportional factor based on the data we have for previous months.
So to calculate the PF for a period, we need to create a profile in /sapapo/sdp94 .
After creating the profile, the profile can be seen by clicking on SPD94 and going to selection-screen button .
Then to calculate PF , we need to go to transaction /sapapo/mv8v .
Here we will have to give the selection id that was saved in SDP94.
All this process has to be automated and a program has been created to do this.
A description of how the program works is as given below.
When we try to calculate the proportional factor with this program , the following error is obtained :-
There are no plannable characteristic combinations.
We are passing the same parameters that were passed by the SDP94 transaction to the standard function module for saving the selection ids. This is shown in the below screenshots.
In spite of this we are getting the error.
Now to delete the selection ids,click on delete option in the program .
But the problem is even if we click on delete , the PPF data will be stored in the database inspite of deleting the selection profiles .
Please can anyone help me out with this .
Regards,
Sushanth H.S.
Now we will have to give the selection description
Now the profile can be seen by going to SDP94 and clicking on selection profile button.
Now to calculate PF, go to transaction /sapapo/mv8v
Click on execute and give following inputs
This will forecast the PF for the period 01.09.2007 to 21.02.2007 based on data from 21.04.2007 to 20.05.2007
Click on other settings
Here we will have to give the selection id that was saved in SDP94.
Click on execute.
All this process has to be automated and a program was created to do this.
A description of how the program is given below.
Program zrsnorms_ppf
Execute.
Give file path of excel sheet.
Execute.
This will create the selection id by taking areabasepackRS as name of id.
This is the excel sheet that is used to load data into /sapapo/mc8v to calculate the PF.
Upon executing, the ids have been created
The new selection ids can be seen by going to /sapapo/sdp94
And clicking on selection profile.
Parameters passed to standard function module in order to save the selection id.
Now if we try to calculate PF using the program, the following happens
When executed,
BDC is called to input data to transaction /sapapo/mc8v to calculate ppf.
An error screen is generated with the message There are no plannable characteristic combinations.
We are passing the same parameters that were passed by the SDP94 transaction to the standard function module for saving the selection ids. This is shown in the below screenshots.
In spite of this we are getting the error.
When IV_POPUP_SEL_DESCRIPTION is passed, a popup will be displayed where the selection description will have to be entered. I am passing the same selection description here as is picked by the program.( H3HPCDEL00110096, H3HPCDEL00110063)
To avoid this, we need to go to SDP94 and after going to selection window, we need to save the selections as shown in the following screenshots.
Select the selection id one by one.
Click on save selection
Click on save.
Do the same for all ids created by the program.
Now if we try to calculate the PF using the program, it is seen to work
So what needs to be done is that we need to avoid going to SDP94 in order to save the selections after the ids are created by the program.
How the Program works
Se38
Program zrsnorms_ppf
Execute.
Give file path of excel sheet.
Execute.
This will create the selection id by taking areabasepackRS as name of id.
The new selection ids can be seen by going to /sapapo/sdp94
And clicking on selection profile.
Now the selection has to be saved. For that, follow the following procedure.
Click on selection window.
Click on load selection.
Select the ids.
Select and then press save.
Do the same for every id.
Only then can proportional factor be calculated.
Now go to program and select Calc_ppf, with filepath to excel sheet as the sel_ids will be pulled from the excel.
When executed,
BDC is called to input data to transaction /sapapo/mc8v to calculate ppf.
Now go to sdp94 and load the selection
Click on load data.
And make sure, data view is TDP_VIEW_PROP as shown
PPF will be shown for the period chosen in the excel sheet.
Now to delete the selection ids.
Go to the program and give file path of the excel sheet and execute.
The selection profiles will be deleted as shown.
But PPF data will be stored in the database inspite of deleting the selection profiles. And ppf can be shown by selecting the basepack and the sales area.
Click load data.
Business scenario - Consider a factory having 5 different customers (which is known as Customer_rs). We need to supply stock to each of them based on their past consumption. So to forecast this, we calculate a factor known as proportional factor based on the data we have for previous months.
So to calculate the PF for a period, we need to create a profile in /sapapo/sdp94
How it is done in standard transaction /SAPAPO/SDP94
Important pushbuttons and their functions
Click on selection window.
Give the selections
Click on save selection
A break-point has been set in the standard program to show what all parameters are being passed to the standard function module /SAPAPO/MCPSH_SELECTION_SAVE used to save the selection
Now we will have to give the selection description
Now the profile can be seen by going to SDP94 and clicking on selection profile button.
Now to calculate PF, go to transaction /sapapo/mv8v
Click on execute and give following inputs
This will forecast the PF for the period 01.09.2007 to 21.02.2007 based on data from 21.04.2007 to 20.05.2007
Click on other settings
Here we will have to give the selection id that was saved in SDP94.
Click on execute.
All this process has to be automated and a program was created to do this.
A description of how the program is given below.
Program zrsnorms_ppf
Execute.
Give file path of excel sheet.
Execute.
This will create the selection id by taking areabasepackRS as name of id.
This is the excel sheet that is used to load data into /sapapo/mc8v to calculate the PF.
Upon executing, the ids have been created
The new selection ids can be seen by going to /sapapo/sdp94
And clicking on selection profile.
Parameters passed to standard function module in order to save the selection id.
Now if we try to calculate PF using the program, the following happens
When executed,
BDC is called to input data to transaction /sapapo/mc8v to calculate ppf.
An error screen is generated with the message There are no plannable characteristic combinations.
We are passing the same parameters that were passed by the SDP94 transaction to the standard function module for saving the selection ids. This is shown in the below screenshots.
In spite of this we are getting the error.
When IV_POPUP_SEL_DESCRIPTION is passed, a popup will be displayed where the selection description will have to be entered. I am passing the same selection description here as is picked by the program.( H3HPCDEL00110096, H3HPCDEL00110063)
To avoid this, we need to go to SDP94 and after going to selection window, we need to save the selections as shown in the following screenshots.
Select the selection id one by one.
Click on save selection
Click on save.
Do the same for all ids created by the program.
Now if we try to calculate the PF using the program, it is seen to work
So what needs to be done is that we need to avoid going to SDP94 in order to save the selections after the ids are created by the program.
How the Program works
Se38
Program zrsnorms_ppf
Execute.
Give file path of excel sheet.
Execute.
This will create the selection id by taking areabasepackRS as name of id.
The new selection ids can be seen by going to /sapapo/sdp94
And clicking on selection profile.
Now the selection has to be saved. For that, follow the following procedure.
Click on selection window.
Click on load selection.
Select the ids.
Select and then press save.
Do the same for every id.
Only then can proportional factor be calculated.
Now go to program and select Calc_ppf, with filepath to excel sheet as the sel_ids will be pulled from the excel.
When executed,
BDC is called to input data to transaction /sapapo/mc8v to calculate ppf.
Now go to sdp94 and load the selection
Click on load data.
And make sure, data view is TDP_VIEW_PROP as shown
PPF will be shown for the period chosen in the excel sheet.
Now to delete the selection ids.
Go to the program and give file path of the excel sheet and execute.
The selection profiles will be deleted as shown.
But PPF data will be stored in the database inspite of deleting the selection profiles. And ppf can be shown by selecting the basepack and the sales area.
Click load data. -
Effects of using EF in EF-S camera and lens crop factor calculations.
I have read a lot about APS-C sensors and the differences between EF and EF-S lenses.
I still have two remaining questions regarding how EF-S lenses are marketed.
1) Do EF-S lenses need to have the 1.6x factor applied for effective focal length or are they marked correctly since they can only be used in APS-C cameras?
E.G. My 17-40mm EF 4L lens is effectively a 27.2-64mm when used in a EF-S mount camera due to the 1.6x factor.
So would a 60mm EF-S prime lens actually be similar to a 60mm EF prime lens in terms of focal and "zoomed" level of the image? Or would it also apply the crop factor and be effectively a 96mm focal length?
2) Are there any other attributes of an EF lens that you must apply a conversion when using in an EF-S mount? F-stop rating?
Thank you in advance for any guidance you provide!!
Solved!
Go to Solution.techjedi wrote:
I have read a lot about APS-C sensors and the differences between EF and EF-S lenses.
I still have two remaining questions regarding how EF-S lenses are marketed.
1) Do EF-S lenses need to have the 1.6x factor applied for effective focal length or are they marked correctly since they can only be used in APS-C cameras?
E.G. My 17-40mm EF 4L lens is effectively a 27.2-64mm when used in a EF-S mount camera due to the 1.6x factor.
So would a 60mm EF-S prime lens actually be similar to a 60mm EF prime lens in terms of focal and "zoomed" level of the image? Or would it also apply the crop factor and be effectively a 96mm focal length?
2) Are there any other attributes of an EF lens that you must apply a conversion when using in an EF-S mount? F-stop rating?
Thank you in advance for any guidance you provide!!
If you feel obliged to think in full-frame terms even when using an APS-C camera, then yes, the crop factor is applied equally to zooms and primes. But unless you routinely use both types of camera, the mental exercise is really rather silly. Better to simply get used to the idea that on an APS-C camera a 30mm lens is "normal"; a 50mm lens is a mild telephoto or portrait lens; a 17-55mm zoom is a typical "walking around" lens; etc. Once you start thinking in those terms, you're much less likely to select the wrong lens than if you have to constantly apply the correction factor. If you do use both APS-C and FF cameras, you'll quickly get used to selecting, for example, the right normal lens for either type of camera, because you already know, in each case, what that is. At least that's what I've found to be true.
Bob
Boston, Massachusetts USA -
we r doing our project in same concept ...we can calculate power factor using nielvis ah? and how it is possible?pls reply as asap..thanks in advance
This is a very open question, but in short, you need to measure the phase lead/lag between voltage and current (0° phase lag = Power Factor of 1, etc). Assuming you're using one phase ~120VAC, you'll need to drop the voltage down with a resistor divider, then sense the current using a low impedance (ex: .01Ω, .1Ω, etc) series current resistor... actual impedance is a function of the current you're pulling: you want the voltage across the resistor under maximum current to be close to (but less than) the maximum input voltage of the analog input channel. Then you'll need to plug these low voltage measurements into two channels on the Elvis board. After that, you'll need to acquire the data and then perform your calculations.
In short, yes, it is possible to measure power factor on the ELVIS platform. Please let us know if you have any specific questions.
-John Sullivan
Analog Engineer -
Hi.... gurus
to all
can anybody help me out...plz..
1 what is the use of Time stram ID in the Storage Bucket Profile??<br />
2. What the mean of Fiscial year Variant in Storage Bucket Profile? How we can create that Variant ? What are the setting are there to create? what is the use of it??
3. if SBF horizon is 2 years then PBF horizon is 3 years so is that possible to give more than SBF?
4. so DP planning is in months so wnat to send it to SNP in Months and weaks? so where is the setting we do???
5.what is the Ex-post ???
6. What is the mean of UNiverate???
7. what are the Methods have in DP???how may they are?? can u explain each??
8. which period is display in interactive demand plan is that period display specied in SBF or PBF or Planning Book???
9. Which period ( Horison) should be in large i mean to say whether specified Planning Book horizon or Master forecast profile horizon ? among both which one should be large?1. What is the field -- Fiscial year Variant in Storage Bucket Profile?
The Fiscal year is picked up based on the fiscal year variant you define in the Storage Bucket profile.
2)if the storage bucket profile period is 2 year. planning bucket profile period is 3 year? so is it possible to give 3 years in PBF than SBF? (specified period is 2 years in SBF)
See the simple logic is your PBF should always be sub set of the SBP.
It is you can have SBP as 3 years and PBF as 1,2 or 3 years.
3)in demand planing the planning has done in MONTHs. so needs to send to snp in months and weeks. How?
Demand planning is long term planning & SNP- Medium planning,
Thoug you are planning in months in DP,if you are using the SBP as monthly and weekly in DP you can then transfer forecast to SNP in months and weeks.
4)what is the UNIVERATE. why we call Univerate .
This profile as the name suggests is based on a single factor....
Like this mathematical expression
Y=aX
where a is the single factor
X is the historical value.
Y is the forecast value.
You can observe in the above expression that Y can vary only based on a factor called a,i.e a single factor,
Hence it is called Univariate,
we have other smoothening factors like Alpha,beta,gamma,Sigma which will purify our forecast value.
5)What are the forecsting methods in demand planning. How many they are? what are they? can u explaing? plz...
There are primarily three profiles:
1)Univariate
2)Composite
3)MLR
It would be difficult to explain about them here,
Please refer the below link further to understand them:
http://help.sap.com/saphelp_scm50/helpdata/en/8f/9d6937089c2556e10000009b38f889/frameset.htm
5)which Horizon should be large? is it PB Horizon or WE specified in in Master Forecast Profile. In both profile we specified Horions. which one should be large horizon?
Here the Forecast horizon that we define in Master Forecast profile should always be subset of the one which we define in the Planning book. -
I have a .vi I am trying to write in Labview for a project that really has me stuck. Basically what I want to be able
to do is calculate distance using pythagoras, given a user selected number of dimensions (up to 20). That means rather
than traditionally just calculating pythagoras using x and y, I now have x, y, z, .... etc.
Currently I am at the stage where I can send an array of integers, where each represents which dimension to use
in calculation. eg 1 is x, 2 is y, 3 is z ... etc.
What I have done is a .vi for just x and y, which I have attatched but as for expanding this for z, alpha, beta,
gamma, delta etc I draw a blank. Any clues?
Solved!
Go to Solution.
Attachments:
Pythagoras.vi 9 KBLabVIEW will do primitive operations on arrays. For example, if you connect two one-dimensional arrays into the add primitive, it will return an array that contains and element by element addition of the inputs. This makes your problem fairly easy. Instead of indexing individual points, index the entire location vectors of the two points you want to know the distance between. Subtract one from the other to get the differences. Square the resultant vector. Use the Array Sum to sum it, then take the square root. This approach will scale with however many dimensions you want.
Good luck!
This account is no longer active. Contact ShadesOfGray for current posts and information. -
Problem calling two perl modules from java in seperate threads(JVM CRASHES)
Dear Friends,
I have one severe problem regarding calling perl modules from java
I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
I am unable to spot out why ....
For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
The following is the code snippet
<JAVA FILE>
class Sample
static {
System.loadLibrary("xyz"); // Here xyz is the library file generated by compiling c code
public native void call_PrintList();
public native void call_PrintListNew();
Sample()
new Thread1(this).start();
public static void main(String args[])
System.out.println("In the main Method");
new Sample().call_PrintList();
class Thread1 extends Thread
Sample sample;
Thread1(Sample sam)
sample=sam;
public void run()
sample.call_PrintListNew();
}<C FILE>
#include <EXTERN.h>
#include <perl.h>
static PerlInterpreter *my_perl;
static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
static void
call_PrintList(){
printf("\nIn the Call method of string.c\n");
char *wor[] = {"hello", "sudha", NULL } ;
char *my_argv[] = { "", "string.pl" };
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
perl_construct( my_perl );
perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_run(my_perl);
dSP ;
perl_call_argv("PrintList", G_DISCARD, wor) ;
PL_perl_destruct_level = 1;
// perl_destruct(my_perl);
// perl_free(my_perl);
// PERL_SYS_TERM();
static void
call_PrintListNew(){
printf("In the new call method\n");
char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
char *my_argv[] = { "", "string.pl" };
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
PL_perl_destruct_level = 1;
perl_construct( my_perl );
perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_run(my_perl);
dSP ;
perl_call_argv("PrintListNew", G_DISCARD, wor) ;
PL_perl_destruct_level = 1;
// perl_destruct(my_perl);
// perl_free(my_perl);
// PERL_SYS_TERM();
void callNew()
call_PrintListNew();
void call ( )
call_PrintList();
//char *wor[] = {"hello","sudha",NULL};
/* char *my_argv[] = { "", "string.pl" };
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
perl_construct( my_perl );
perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_run(my_perl);*/
// call_PrintList(); /*** Compute 3 ** 4 ***/
/* perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();*/
}And Finally the perl code
sub PrintList
my(@list) = @_ ;
foreach (@list) { print "$_\n" }
sub PrintListNew
my(@list) = @_ ;
foreach (@list) { print "$_\n" }
}Please help me in this regardDear Friends,
I have one severe problem regarding calling perl modules from java
I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
I am unable to spot out why ....
For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
The following is the code snippet
<JAVA FILE>
class Sample
static {
System.loadLibrary("xyz"); // Here xyz is the library file generated by compiling c code
public native void call_PrintList();
public native void call_PrintListNew();
Sample()
new Thread1(this).start();
public static void main(String args[])
System.out.println("In the main Method");
new Sample().call_PrintList();
class Thread1 extends Thread
Sample sample;
Thread1(Sample sam)
sample=sam;
public void run()
sample.call_PrintListNew();
}<C FILE>
#include <EXTERN.h>
#include <perl.h>
static PerlInterpreter *my_perl;
static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
static void
call_PrintList(){
printf("\nIn the Call method of string.c\n");
char *wor[] = {"hello", "sudha", NULL } ;
char *my_argv[] = { "", "string.pl" };
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
perl_construct( my_perl );
perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_run(my_perl);
dSP ;
perl_call_argv("PrintList", G_DISCARD, wor) ;
PL_perl_destruct_level = 1;
// perl_destruct(my_perl);
// perl_free(my_perl);
// PERL_SYS_TERM();
static void
call_PrintListNew(){
printf("In the new call method\n");
char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
char *my_argv[] = { "", "string.pl" };
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
PL_perl_destruct_level = 1;
perl_construct( my_perl );
perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_run(my_perl);
dSP ;
perl_call_argv("PrintListNew", G_DISCARD, wor) ;
PL_perl_destruct_level = 1;
// perl_destruct(my_perl);
// perl_free(my_perl);
// PERL_SYS_TERM();
void callNew()
call_PrintListNew();
void call ( )
call_PrintList();
//char *wor[] = {"hello","sudha",NULL};
/* char *my_argv[] = { "", "string.pl" };
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
perl_construct( my_perl );
perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
perl_run(my_perl);*/
// call_PrintList(); /*** Compute 3 ** 4 ***/
/* perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();*/
}And Finally the perl code
sub PrintList
my(@list) = @_ ;
foreach (@list) { print "$_\n" }
sub PrintListNew
my(@list) = @_ ;
foreach (@list) { print "$_\n" }
}Please help me in this regard -
JTable problem...can anybody help me...
hi i have try out some jtable program. I have done some alteration to the table that it can resize row and column via the gridline. but it seems that when i'm resizing through the gridline, the row header did not resize. I sense that the row header not syncronizing with the main table. So when i'm tried to resize, the row header didn't
can you solve my problem...
//the main program
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
public class Test { public static void main(String[] args)
//row headers:
String[][] rowHeaders = {{"Alpha"},{"Beta"}, {"Gamma"}};
JTable leftTable = new JTable(rowHeaders, new Object[]{""});
leftTable.setDefaultRenderer(
Object.class, leftTable.getTableHeader().getDefaultRenderer());
leftTable.setPreferredScrollableViewportSize(new Dimension(50,100));
//main table:
Object[][] sampleData = {{"Homer", "Simpson"},{"Seymour","Skinner"},{"Ned","Flanders"}};
JTable mainTable = new JTable(sampleData, new Object[]{"",""});
//scroll pane:
JScrollPane sp = new JScrollPane(
mainTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
sp.setRowHeaderView(leftTable);
sp.setColumnHeaderView(null);
new TableColumnResizer(mainTable);
new TableRowResizer(mainTable);
//frame:
final JFrame f = new JFrame("Test");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(sp);
f.pack();
SwingUtilities.invokeLater(new Runnable(){
public void run(){ f.setLocationRelativeTo(null);
f.setVisible(true); } });
}This the TableColumnResizer.java
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.MouseInputAdapter;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.*;
public class TableColumnResizer extends MouseInputAdapter
public static Cursor resizeCursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
private int mouseXOffset;
private Cursor otherCursor = resizeCursor;
private JTable table;
public TableColumnResizer(JTable table){
this.table = table;
table.addMouseListener(this);
table.addMouseMotionListener(this);
private boolean canResize(TableColumn column){
return column != null
&& table.getTableHeader().getResizingAllowed()
&& column.getResizable();
private TableColumn getResizingColumn(Point p){
return getResizingColumn(p, table.columnAtPoint(p));
private TableColumn getResizingColumn(Point p, int column){
if(column == -1){
return null;
int row = table.rowAtPoint(p);
if(row==-1)
return null;
Rectangle r = table.getCellRect(row, column, true);
r.grow( -3, 0);
if(r.contains(p))
return null;
int midPoint = r.x + r.width / 2;
int columnIndex;
if(table.getTableHeader().getComponentOrientation().isLeftToRight())
columnIndex = (p.x < midPoint) ? column - 1 : column;
else
columnIndex = (p.x < midPoint) ? column : column - 1;
if(columnIndex == -1)
return null;
return table.getTableHeader().getColumnModel().getColumn(columnIndex);
public void mousePressed(MouseEvent e){
table.getTableHeader().setDraggedColumn(null);
table.getTableHeader().setResizingColumn(null);
table.getTableHeader().setDraggedDistance(0);
Point p = e.getPoint();
// First find which header cell was hit
int index = table.columnAtPoint(p);
if(index==-1)
return;
// The last 3 pixels + 3 pixels of next column are for resizing
TableColumn resizingColumn = getResizingColumn(p, index);
if(!canResize(resizingColumn))
return;
table.getTableHeader().setResizingColumn(resizingColumn);
if(table.getTableHeader().getComponentOrientation().isLeftToRight())
mouseXOffset = p.x - resizingColumn.getWidth();
else
mouseXOffset = p.x + resizingColumn.getWidth();
private void swapCursor(){
Cursor tmp = table.getCursor();
table.setCursor(otherCursor);
otherCursor = tmp;
public void mouseMoved(MouseEvent e){
if(canResize(getResizingColumn(e.getPoint()))
!= (table.getCursor() == resizeCursor)){
swapCursor();
public void mouseDragged(MouseEvent e){
int mouseX = e.getX();
TableColumn resizingColumn = table.getTableHeader().getResizingColumn();
boolean headerLeftToRight =
table.getTableHeader().getComponentOrientation().isLeftToRight();
if(resizingColumn != null){
int oldWidth = resizingColumn.getWidth();
int newWidth;
if(headerLeftToRight){
newWidth = mouseX - mouseXOffset;
} else{
newWidth = mouseXOffset - mouseX;
resizingColumn.setWidth(newWidth);
Container container;
if((table.getTableHeader().getParent() == null)
|| ((container = table.getTableHeader().getParent().getParent()) == null)
|| !(container instanceof JScrollPane)){
return;
if(!container.getComponentOrientation().isLeftToRight()
&& !headerLeftToRight){
if(table != null){
JViewport viewport = ((JScrollPane)container).getViewport();
int viewportWidth = viewport.getWidth();
int diff = newWidth - oldWidth;
int newHeaderWidth = table.getWidth() + diff;
/* Resize a table */
Dimension tableSize = table.getSize();
tableSize.width += diff;
table.setSize(tableSize);
* If this table is in AUTO_RESIZE_OFF mode and has a horizontal
* scrollbar, we need to update a view's position.
if((newHeaderWidth >= viewportWidth)
&& (table.getAutoResizeMode() == JTable.AUTO_RESIZE_OFF)){
Point p = viewport.getViewPosition();
p.x =
Math.max(0, Math.min(newHeaderWidth - viewportWidth, p.x + diff));
viewport.setViewPosition(p);
/* Update the original X offset value. */
mouseXOffset += diff;
public void mouseReleased(MouseEvent e){
table.getTableHeader().setResizingColumn(null);
table.getTableHeader().setDraggedColumn(null);
} This is TableRowResizer.java
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.MouseInputAdapter;
import java.awt.*;
import java.awt.event.MouseEvent;
public class TableRowResizer extends MouseInputAdapter
public static Cursor resizeCursor = Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR);
private int mouseYOffset, resizingRow;
private Cursor otherCursor = resizeCursor;
private JTable table;
public TableRowResizer(JTable table){
this.table = table;
table.addMouseListener(this);
table.addMouseMotionListener(this);
private int getResizingRow(Point p){
return getResizingRow(p, table.rowAtPoint(p));
private int getResizingRow(Point p, int row){
if(row == -1){
return -1;
int col = table.columnAtPoint(p);
if(col==-1)
return -1;
Rectangle r = table.getCellRect(row, col, true);
r.grow(0, -3);
if(r.contains(p))
return -1;
int midPoint = r.y + r.height / 2;
int rowIndex = (p.y < midPoint) ? row - 1 : row;
return rowIndex;
public void mousePressed(MouseEvent e){
Point p = e.getPoint();
resizingRow = getResizingRow(p);
mouseYOffset = p.y - table.getRowHeight(resizingRow);
private void swapCursor(){
Cursor tmp = table.getCursor();
table.setCursor(otherCursor);
otherCursor = tmp;
public void mouseMoved(MouseEvent e){
if((getResizingRow(e.getPoint())>=0)
!= (table.getCursor() == resizeCursor)){
swapCursor();
public void mouseDragged(MouseEvent e){
int mouseY = e.getY();
if(resizingRow >= 0){
int newHeight = mouseY - mouseYOffset;
if(newHeight > 0)
table.setRowHeight(resizingRow, newHeight);
}cross-post: http://forum.java.sun.com/thread.jspa?forumID=57&threadID=755250
-
Hi,
as I listened to the Video about Forecast Smoothing this should be only available to SPS7.
The Video: http://www.saphana.com/docs/DOC-4326
Looking into the Table SYS:AFL_FUNCTIONS_ I find the Entry "FORECASTSMOOTHING" in the Table. So I guess the Forecast Smoothing is available to me.
In HANA Studio - Help - About ... I see Version: 1.0.7000 / Build id: 386119
But running my Example of Forecast Smoothing gives me the Error:
Could not execute 'CALL _SYS_AFL.PAL_TS (V_TS_DATA, #TS_PARAMS, TS_OPTIMAL_PARAMS, TS_RESULTS) WITH OVERVIEW' in 176 ms 111 µs .
SAP DBTech JDBC: [2048]: column store error: search table error: [2620] _SYS_AFL.AFLPAL:FORECASTSMOOTHING: [135] (range 2) AFLFunctionFatal exception: PAL error[73001502]:Ahead exception throw out, Check trace for details
My Params are:
INSERT INTO #TS_PARAMS VALUES ('THREAD_NUMBER', 2, null, null);
INSERT INTO #TS_PARAMS VALUES ('FORECAST_MODEL_NAME', null, null, 'TESM'); SESM: Single, DESM: Double, TESM: Triple
INSERT INTO #TS_PARAMS VALUES ('FORECAST_NUM', 30, null, null);
INSERT INTO #TS_PARAMS VALUES ('STARTTIME', 0, null, null);
INSERT INTO #TS_PARAMS VALUES ('CYCLE', 90, null, null);
INSERT INTO #TS_PARAMS VALUES ('FORECAST_AUTOMATIC', 0, null, null);
INSERT INTO #TS_PARAMS VALUES ('ALPHA', null, 0.1, null); 0-1 for smoothing weight
INSERT INTO #TS_PARAMS VALUES ('BETA', null, 0.1, null); 0-1 for trend (DESM & TESM)
INSERT INTO #TS_PARAMS VALUES ('GAMMA', null, 0.1, null); 0-1 for seasonality (TESM)
I try also without the FORECAST_AUTOMATIC, ALPHA, BETA, GAMMA but then I read in the Indexserver-Alert that the Param FORECAST_AUTOMATIC is missing.
As I know:
- The Data has no gaps
- The Base Example in the Documentation fails with the same error
Any suggestion?
How I can check if the Forecast SMoothing is available in my Version?
Regards,
MansurHello Ravi,
yes sure you can have the Code. But it is finally exactly the same as Sampled in the Predictive Analytics Documentation. Just the Schema is changed.
I am able to run several other Analytics (smpl: Tripple Expo. Smoothing) as in the Documentation and also in own solutions. SO I do not see any Configuration / Right Problems.
First the Code, below the Errormessage:
SET SCHEMA ENE_TIS;
DROP TYPE PAL_FORECASTSINGLESMOOTHING_DATA_T;
CREATE TYPE PAL_FORECASTSINGLESMOOTHING_DATA_T AS TABLE ("TIMESTAMP" INT, "VALUE" DOUBLE);
DROP TYPE PAL_CONTROL_T;
CREATE TYPE PAL_CONTROL_T AS TABLE ("Name" VARCHAR(100), "intArgs" INT, "doubleArgs" DOUBLE, "strArgs" VARCHAR(100));
DROP TYPE PAL_OUTPARAMETER_T;
CREATE TYPE PAL_OUTPARAMETER_T AS TABLE ("NAME" VARCHAR(100), "VALUE" DOUBLE);
DROP TYPE PAL_FORECASTSINGLESMOOTHING_FORECAST_T;
CREATE TYPE PAL_FORECASTSINGLESMOOTHING_FORECAST_T AS TABLE ("TIMESTAMP" INT, "VALUE" DOUBLE, "DIFFERENCE" DOUBLE);
DROP table PAL_FORECASTSINGLESMOOTHING_PDATA_TBL;
CREATE column table PAL_FORECASTSINGLESMOOTHING_PDATA_TBL("ID" INT,"TYPENAME" VARCHAR(100),"DIRECTION" VARCHAR(100));
insert into PAL_FORECASTSINGLESMOOTHING_PDATA_TBL values (1,'ENE_TIS.PAL_FORECASTSINGLESMOOTHING_DATA_T','in');
insert into PAL_FORECASTSINGLESMOOTHING_PDATA_TBL values (2,'ENE_TIS.PAL_CONTROL_T','in');
insert into PAL_FORECASTSINGLESMOOTHING_PDATA_TBL values (3,'ENE_TIS.PAL_OUTPARAMETER_T','out');
insert into PAL_FORECASTSINGLESMOOTHING_PDATA_TBL values(4,'ENE_TIS.PAL_FORECASTSINGLESMOOTHING_FORECAST_T','out');
GRANT SELECT ON ENE_TIS.PAL_FORECASTSINGLESMOOTHING_PDATA_TBL to SYSTEM;
CALL SYSTEM.afl_wrapper_eraser('PALFORECASTSMOOTHING');
call SYSTEM.afl_wrapper_generator('PALFORECASTSMOOTHING','AFLPAL','FORECASTSMOOTHING',PAL_FORECASTSINGLESMOOTHING_PDATA_TBL);
DROP TABLE #PAL_CONTROL_TBL;
CREATE LOCAL TEMPORARY COLUMN TABLE #PAL_CONTROL_TBL ("Name" VARCHAR(100), "intArgs" INT, "doubleArgs" DOUBLE,"strArgs" VARCHAR(100));
INSERT INTO #PAL_CONTROL_TBL VALUES ('FORECAST_MODEL_NAME',null,null,'SESM');
INSERT INTO #PAL_CONTROL_TBL VALUES ('OPTIMIZER_TIME_BUDGET',5,null,null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('OPTIMIZER_RANDOM_SEED',5,null,null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('THREAD_NUMBER',8,null,null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('ALPHA',null,0.1,null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('FORECAST_NUM',2,null,null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('STARTTIME',0,null,null);
INSERT INTO #PAL_CONTROL_TBL VALUES ('FORECAST_AUTOMATIC',1,null,null);
-- input tables
DROP TABLE PAL_FORECASTSINGLESMOOTHING_DATA_TBL;
CREATE COLUMN TABLE PAL_FORECASTSINGLESMOOTHING_DATA_TBL("TIMESTAMP" INT NOT NULL PRIMARY KEY, "VALUE" DOUBLE);
-- input data
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (0,200.0);
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (1,135.0);
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (2,195.0);
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (3,197.5);
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (4,310.0);
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (5,175.0);
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (6,155.0);
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (7,130.0);
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (8,220.0);
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (9,277.5);
INSERT INTO PAL_FORECASTSINGLESMOOTHING_DATA_TBL VALUES (10,235.0);
DROP TABLE PAL_OUTPARAMETER_TBL;
CREATE COLUMN TABLE PAL_OUTPARAMETER_TBL("NAME" VARCHAR(100), "VALUE" DOUBLE);
-- forecast result tables
DROP TABLE PAL_FORECASTSINGLESMOOTHING_RESULT_TBL;
CREATE COLUMN TABLE PAL_FORECASTSINGLESMOOTHING_RESULT_TBL("TIMESTAMP" INT NOT NULL PRIMARY KEY, "VALUE" DOUBLE, "DIFFERENCE" DOUBLE);
call _SYS_AFL.PALFORECASTSMOOTHING( PAL_FORECASTSINGLESMOOTHING_DATA_TBL, "#PAL_CONTROL_TBL", PAL_OUTPARAMETER_TBL, PAL_FORECASTSINGLESMOOTHING_RESULT_TBL) with overview;
select * from PAL_OUTPARAMETER_TBL;
select * from PAL_FORECASTSINGLESMOOTHING_RESULT_TBL;
Errormessage:
Could not execute 'call _SYS_AFL.PALFORECASTSMOOTHING( PAL_FORECASTSINGLESMOOTHING_DATA_TBL, "#PAL_CONTROL_TBL", ...' in 236 ms 715 µs .
SAP DBTech JDBC: [2048]: column store error: search table error: [2620] _SYS_AFL.AFLPAL:FORECASTSMOOTHING: [135] (range 2) AFLFunctionFatal exception: PAL error[73001502]:Ahead exception throw out, Check trace for details
As you see the error happens at the call of the FC-Smooth.
I am not sure how to find the real reason for that.
regards,
Mansur -
What index is suitable for a table with no unique columns and no primary key
alpha
beta
gamma
col1
col2
col3
100
1
-1
a
b
c
100
1
-2
d
e
f
101
1
-2
t
t
y
102
2
1
j
k
l
Sample data above and below is the dataype for each one of them
alpha datatype- string
beta datatype-integer
gamma datatype-integer
col1,col2,col3 are all string datatypes.
Note:columns are not unique and we would be using alpha,beta,gamma to uniquely identify a record .Now as you see my sample data this is in a table which doesnt have index .I would like to have a index created covering these columns (alpha,beta,gamma) .I
beleive that creating clustered index having covering columns will be better.
What would you recommend the index type should be here in this case.Say data volume is 1 milion records and we always use the alpha,beta,gamma columns when we filiter or query records
what index is suitable for a table with no unique columns and primary key?
col1
col2
col3
MudassarMany thanks for your explanation .
When I tried querying using the below query on my heap table the sql server suggested to create NON CLUSTERED INDEX INCLUDING columns ,[beta],[gamma] ,[col1]
,[col2] ,[col3]
SELECT [alpha]
,[beta]
,[gamma]
,[col1]
,[col2]
,[col3]
FROM [TEST].[dbo].[Test]
where [alpha]='10100'
My question is why it didn't suggest Clustered INDEX and chose NON clustered index ?
Mudassar
Maybe you are looking for
-
Issue in creation of data from extended segment in background mode
Dear all, I am facing an issue in creation of data in receiving system using IDOC for an xtended matmas segment(Extended for classification view in user exit).The issue is that the idoc is received successfully in r3eceiving system but not created su
-
An NI representative (Eric Dean) recently held an NI Open House to showcase the contributions NI was making to the University. Before leaving he noticed cRIO-9014 was not functioning properly and asked that I reinstall the drivers, saying they ha
-
How well will Windows Server run in a virtual machine on OS X Server?
Does anyone have any experience running any of the flavors of Windows Server in a virtual box (either Parallels or VMware) on OS X Server? I'm looking at setting up a new server. There are a couple of things for which windows is required. I could set
-
Removing ownership & permissions for all files burned to a DVD?
Hello, I am new to the concept of "ownership & permissions". Do they apply to files burned to DVD or just the files on the computer? I would like to burn some files onto a DVD for backup and I do not want to copy the "ownership & permissions" setting
-
Quiero saber caracteristicas de mi lenovo
Buenos dias no tengo nada de conocimiento de computadores realmente tengo un lenovo g405 amd e1 essential y queiro saber datos importantes como ram, disco duro, lector de tarjetas, cuanto podria venderlo esta nuevo. Muchas gracias