How Achieve timedseries calculations with out using AGO And ToDate function
Hi,,
1)
How Achieve timedseries calculations with out using AGO And ToDate functionion
this question asking in interview ..is it possible..?
if yes please response as soon as possible..
2) i have 2 cloumns Product and value...
client requirement is they need ranks based on Value ..in dashboard .using dashboard prompt..edit box...if user enter any number (ex :5 ) report should show top 5 ranks if he enter 20 should be top 20 ranks..
how to achive this ?
thanks,
raj
Consider yor first question:
1. Yes, we can create timeseries measures without using AGO and TODATE
1. Create ALIAS of fact tabe in the physical layer
2. Join the Time id from the ALIAS fact table with the YAGO_MONTH_ID column from your time dimension table (For calculating Year Ago variants) similarly join with MAGO_MONTH_ID column for Month Ago measures.
3.Pull the ALIAS tables as an additional Logical table source in the Lgical layer
4.Keep the mapping of the columns from the ALIAS table as its is
5. For e.g If you pick Revenue from the Year Ago Alias table it will give you the "Prior Year Revenue"
See if this helps you
Similar Messages
-
I want to use the AGO and TODATE functions to calculate a measure for the selected year and the year before, as well as a year--o date measure, but cannot get it to work. It fails with the following error:
A general error has occurred. [nQSError: 22040] To use TODATE function, the storage level of the query ('[D_TIJD.TIJDKEY]') must be a static level.
I have setup a time dimensions in which I can drill up and down and followed exactly the same steps that were layed out in the Oracle training activity guide, but so far without any luck. From Mark Rittman's articles I learned that using these functions is not as straight forward as one might hink. Does anybody have a working example of this?
Regards,
PaulTo reply to my own question. It appears I got it working, that is, the error message problem is solved, but I still have questions on how to use these functions.
To get it to work, I added the primary key D_TIJD.TIJDKEY at the level of the lowest grain in my dimension (level tab).
What I still wonder is how to make it select the right values. I have the following hierarchy: bookyear - bookperiod - week. A bookperiod contains 4 or 5 weeks (4,4,5 in a quarter), so 12 periods in one year. I defined a measure at period level and another at that level with the ago function, that should return the figures for that same period of the year before. My first question is, whether to go back 12 periods or 52 weeks (which is the lowest grain in my dimension)?
The second question is how to use a combination of TODATE and AGO so that if I calculate the current period (of which only 2 weeks are passed), I also only want to include the same two weeks for that period one year ago in order to make a correct comparison. How do I do that??? -
Nested Ago and Todate function problem
Hi,
in my rpd i have following Time hierarchy:
Year
Quarter
Month
and a fact table Fact Shop which contains Monthly measure "Number of Hearing Aids Delivered".
I must calculate PY_QTD, PY_YTD versions of above measure.
I have tried to use built-in Time Functions Ago and ToDate in the following way:
PY_QTD
Todate(Ago("Number of Hearing Aids Delivered",1,"Time.Year"), "Time.Quarter")
PY_YTD
Todate(Ago("Number of Hearing Aids Delivered",1,"Time.Year"), "Time.Year")
but when i check consistency i have error which says approximately "You can nest Ago and ToDate functions".
There's another way, to calculate it? Can you help?
Thanks
GiancarloSo u r referring PY as previous year ;)
Here u go;
it’s a combination of AGO and TODATE.
You create a value – let’s say Sales MTD by just following normal process…then you create a logical column with the following formula AGO (Sales MTD, Month Dim, 12)
that should give you a MTD measure you’re looking for. I hope this is useful. Just dont use both function in single logical column....use seperate by first creating YTD n then AGO function to create previous year data.
For ur case use to calculate PY_YTD use below:
Create logical column
Aids Delivered YTD with formula as TODATE("Number of Hearing Aids Delivered"), "Time.Year")
and then create another logical column as
Aids Delivered PY_YTD with formula as AGO("Aids Delivered YTD","Time.Year",1)
This will work for sure.... -
Ago and Todate functions very slow
I have been playing around with the Ago and Todate functions in BI EE (based on data from the Global schema which I imported into BI EE Administrator) but I find these functions very slow to return the data in an Answers report. Has anyone else found this?
What's the size of the data set?
Yes, I'm currently experiencing it. Running on a 600-700k rows tables...
However, there're 2 things that might help:
a) we're doing development with cache off - enabling cache - makes report come instantly...
b) make sure the metrics have correct levels set up - i.e. it's sometimes advantageous to have several duplicates of 1 metric just for this purpose...with different levels....
Please let me know if you find other ways to improve performance... -
Hi All How to TypeCast in vector<>... typedef struct ... to class...
//how to cast the vector to vector cast with out using loop
// is there any way?
//================ This is Type Definition for the class of ClsMytype=====================
typedef struct tagClsMytype
CString m_Name;
int m_Index;
double m_Value;
} xClsMytype;
//================ End of Type Definition for the class of ClsMytype=====================
class ClsMytype : public CObject
public:
ClsMytype(); // Constructor
virtual ~ClsMytype(); // Distructor
ClsMytype(const ClsMytype &e);//Copy Constructor
// =========================================
DECLARE_SERIAL(ClsMytype)
virtual void Serialize(CArchive& ar); /// Serialize
ClsMytype& operator=( const ClsMytype &e); //= operator for class
xClsMytype GetType(); // return the typedef struct of an object
ClsMytype& operator=( const xClsMytype &e);// = operator to use typedef struct
ClsMytype* operator->() { return this;};
operator ClsMytype*() { return this; };
//public veriable decleare
public:
CString m_Name;
int m_Index;
double m_Value;
typedef struct tagClsMyTypeCollection
vector <xClsMytype> m_t_Col;
} xClsMyTypeCollection;
class ClsMyTypeCollection : public CObject
public:
ClsMyTypeCollection(); // Constructor
virtual ~ClsMyTypeCollection(); // Distructor
ClsMyTypeCollection(const ClsMyTypeCollection &e);//Copy Constructor
DECLARE_SERIAL(ClsMyTypeCollection)
virtual void Serialize(CArchive& ar);
xClsMyTypeCollection GetType();
ClsMyTypeCollection& operator=( const xClsMyTypeCollection &e);
ClsMyTypeCollection& operator=( const ClsMyTypeCollection &e); //= operator for class
void Init(); // init all object
CString ToString(); // to convert value to string for the display or message proposed
ClsMyTypeCollection* operator->() { return this;}; // operator pointer to ->
operator ClsMyTypeCollection*() {return this;};
public:
vector <ClsMytype> m_t_Col;
//private veriable decleare
private:
//===================================================
ClsMytype& ClsMytype::operator=( const xClsMytype &e )
this->m_Name= e.m_Name;
this->m_Index= e.m_Index;
this->m_Value= e.m_Value;
return (*this);
//==========================Problem for the vector to vector cast
ClsMyTypeCollection& ClsMyTypeCollection::operator=( const xClsMyTypeCollection &e )
this->m_t_Col= (vector<ClsMytype>)e.m_t_Col; // how to cast
return (*this);
Thanks in AdvanceHi Smirt
You could do:
ClsMyTypeCollection* operator->() {
returnthis;};
// operator pointer to ->
operatorClsMyTypeCollection*()
{returnthis;};
public:
vector<ClsMytype>
m_t_Col;//??
The last line with "vector<xClsMytype>
m_t_Col;". It compiles but I doubt that is what you want.
Regards
Chong -
How to get Last Year Sales and YTD Sales without using AGO and TODATE?
Hi all,
I have got Company and Time dimensions and Sales Fact. My requirement is to get Last Year sales for each company without using AGO function and YTD without using TODATE function. (Due to performance issue as AGO and TODATE do not insert a Cache entry).
Can someone please help me to achieve my requirement? Thanks in advance.Hi Satya,
Thanks again for your reply. To start with I don't have data for the years 2012 and 2011 to test as I am using SH sample schema from Oracle. I have applied your solution but it does not seem to be working for the previous years like 2000, 2001. My requirement is to have a dashboard prompt "YEAR" and let the user choose whatever year he wants.
Please have a look at the column formulas of my analysis (As per your solution) :
***here B_YEAR is replaced by CALENDAR_YEAR.
Amount: "F1 Sales"."Amount"
AmountYTD: FILTER("F1 Sales"."Amount" USING "D1 Time"."CALENDAR_YEAR" =YEAR(CURRENT_DATE))
Amount LY: FILTER("F1 Sales"."Amount" USING "D1 Time"."CALENDAR_YEAR" =YEAR(CURRENT_DATE)-1)and the physical query generated by BI Server: (as you can see I have got a filter CALENDAR_YEAR= 2000)
WITH
SAWITH0 AS (select sum(T1074.AMOUNT_SOLD) as c1,
sum(case when T1035.CALENDAR_YEAR = TO_NUMBER(TO_CHAR(TO_DATE('2012-05-03' , 'YYYY-MM-DD'), 'yyyy'), '9999') then T1074.AMOUNT_SOLD end ) as c2,
sum(case when TO_NUMBER(TO_CHAR(TO_DATE('2012-05-03' , 'YYYY-MM-DD'), 'yyyy'), '9999') - 1 = T1035.CALENDAR_YEAR then T1074.AMOUNT_SOLD end ) as c3,
T1035.CALENDAR_MONTH_DESC as c4,
T1035.CALENDAR_YEAR as c5,
T1035.CALENDAR_MONTH_ID as c6
from
TIMES T1035 /* D1 Time */ ,
SALES T1074 /* F1 Sales */
where ( T1035.CALENDAR_YEAR = 2000 and T1035.TIME_ID = T1074.TIME_ID )
group by T1035.CALENDAR_MONTH_DESC, T1035.CALENDAR_MONTH_ID, T1035.CALENDAR_YEAR)
select distinct 0 as c1,
D1.c4 as c2,
D1.c5 as c3,
D1.c1 as c4,
D1.c2 as c5,
D1.c3 as c6,
D1.c6 as c7
from
SAWITH0 D1
order by c3, c2 Thanks in advance. -
How can I. Update with out using a pc ?.
I need help to upgrate my iPad to use netflix and others add that don't let me to down low need update
If you are, as your device tags indicate, already on iOS 5, all you need is a WiFi connection. Open the Settings app, select General, and then Software Update. Follow the directions. If you are on a version earlier than 5, you will need a computer with iTunes to upgrade.
Netflix only requires iOS 4.2. What makes you think you need to upgrade to use it? -
Mathematical calculation with out using operators
i am beginer of java.my sir was asked to try out problem.
perform mathematical calculation without using arthematic operators.How about this example:
import java.math.BigInteger;
public class MathWithoutOperators {
public static void main(String[] args) {
BigInteger x = new BigInteger("12");
BigInteger y = new BigInteger("54");
BigInteger z = x.add(y);
System.out.println(z.toString());
}See the API documentation of class java.math.BigInteger for more. -
How to do jaas with out using call back handler classes
hi
i successfully executed jaas under weblogic 6.1 now i wanted
to implement it in our project, for that i wanted to use
some GUI screens to ask for user name/password and to show error messages
so my questions are
1)where i have to call GUI screens in Login module or some where else
2)if in i am calling in client then i have to pass user name and password to
login module.
how can i pass this to loginmodule..?
3)or what i am thinking is not the properway..?
thanx in advanceHi Nivas,
You can pass the security credentials via a URL, please refer to http://e-docs.bea.com/wls/docs61/security/prog.html#1043462.
Regards,
Richard Wallace
Senior Developer Relations Engineer
BEA Support.
"nivas" <[email protected]> wrote:
>
hi
i successfully executed jaas under weblogic 6.1 now i wanted
to implement it in our project, for that i wanted to use
some GUI screens to ask for user name/password and to show error messages
so my questions are
1)where i have to call GUI screens in Login module or some where else
2)if in i am calling in client then i have to pass user name and password
to
login module.
how can i pass this to loginmodule..?
3)or what i am thinking is not the properway..?
thanx in advance -
Generic "AGO" and "TODATE" functions
Hi, I'd like to find out if it's possible to have "generic" date functionality that applies at whatever date level the user chooses. For example, instead of having:
Day Sales
Prior Day Sales
Year Ago Day Sales
Week Sales
Prior Week Sales
Year Ago Week Sales
Month Sales
Prior Month Sales
Year Ago Month Sales
Quarter Sales
Prior Quarter Sales
Year Ago Quarter Sales
Year Sales
Prior Year Sales
instead I'd like to have:
Sales
Prior Period Sales
Year Ago Period Sales
It looks like the "AGO" function, for instance, requires the time level to be put in. But I'd rather NOT put a specific time level in - and have that default to whatever the user asks for in the report. i.e. if they put "Jan 2009" in the report then it knows it's at the month level. If they put "Q3 2009" in it would know to do it at the quarter level, etc.
Is there any way to do this?
Thanks in advance,
ScottTo reply to my own question. It appears I got it working, that is, the error message problem is solved, but I still have questions on how to use these functions.
To get it to work, I added the primary key D_TIJD.TIJDKEY at the level of the lowest grain in my dimension (level tab).
What I still wonder is how to make it select the right values. I have the following hierarchy: bookyear - bookperiod - week. A bookperiod contains 4 or 5 weeks (4,4,5 in a quarter), so 12 periods in one year. I defined a measure at period level and another at that level with the ago function, that should return the figures for that same period of the year before. My first question is, whether to go back 12 periods or 52 weeks (which is the lowest grain in my dimension)?
The second question is how to use a combination of TODATE and AGO so that if I calculate the current period (of which only 2 weeks are passed), I also only want to include the same two weeks for that period one year ago in order to make a correct comparison. How do I do that??? -
How to display the alv report blocks wise with out using the blocked alv
Hi
How to display the alv report with out using the blocked alv function module.
Thanks
Chinnusee this Standard Program
RPR_ABAP_SOURCE_SCAN -
BDC PROGRAM WITH OUT USING A FM?
Hi Experts,
I need wirte a BDC program for tcode PA30.
i did the screen recording part using tcode-shdb.
i need to use field i recorded as input fields.
Now the main part is how to write code? with out using a class/method?
class/method which i earlier used is class : CL_GUI_FRONTEND_SERVICES.
method: gui_upload.
am not using ny flat file/xml file to upload?
are there any function modules which i can use?
and how to write code with out using FM?
if any can solve my issue would be very helpful...plz provide code...which would be more helpful.
Thanks in Adv.
Krrish.Hi,
If you are migrating employee data, I would suggest you to do it through PA40 transaction rather PA30. systematic screen validations it will go through. If you dont want to use any FM and wanted to do using recording pls find the below code which will update the employee data through PA40 with call transaction method.
SELECTION SCREEN
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_plan TYPE ibipparms-path OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK b1.
TYPES: BEGIN OF ty_error,
pernr TYPE persno, " Personnel number
rel_obj_id(12), " Related Object ID
msg(200) TYPE c, " To store Message
END OF ty_error.
DATA: i_tplan TYPE STANDARD TABLE OF alsmex_tabline WITH HEADER LINE,
i_intern TYPE STANDARD TABLE OF alsmex_tabline WITH HEADER LINE,
i_error TYPE ty_error OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF w_pa000,
pernr TYPE persno,
begda TYPE begda,
END OF w_pa000.
DATA: wa_plan LIKE i_plan,
wa_messtab TYPE bdcmsgcoll, " Messages
wa_error TYPE ty_error. " Errors
DATA: it_pa000 LIKE STANDARD TABLE OF w_pa000 WITH HEADER LINE,
it_pa002 LIKE STANDARD TABLE OF w_pa000 WITH HEADER LINE,
it_pa001 LIKE STANDARD TABLE OF w_pa000 WITH HEADER LINE.
DATA: g_mode LIKE ctu_params-dismode VALUE 'N',
g_file TYPE ibipparms-path.
ALV field catalog
DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
Batchinputdata of single transaction
DATA: i_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
messages of call transaction
DATA: i_messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
error session opened (' ' or 'X')
Table to hold the return messages
DATA: BEGIN OF i_errmsg OCCURS 10.
INCLUDE STRUCTURE bapiret2.
DATA: END OF i_errmsg.
ALV List header table
DATA : i_header1 TYPE slis_t_listheader.
ALV List header table
DATA : i_header TYPE slis_listheader.
***ALV Events
DATA: is_layout TYPE slis_layout_alv.
DATA : it_event TYPE slis_alv_event.
DATA : it_event1 TYPE slis_t_event.
To get the F4 help for file
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_plan.
PERFORM get_filename.
START OF SELECTION
START-OF-SELECTION.
Initialise data
PERFORM initialise_events.
Retrieve data from Excel file
PERFORM retreive_data.
Populate final data into an internal table
PERFORM populate_data.
Process the excel file data to create a record for IT0007
PERFORM process_data.
END OF SELECTION
END-OF-SELECTION.
PERFORM final_output.
*& Form GET_FILENAME
FORM get_filename .
*Function module used for F4 help
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_plan.
ENDFORM. " GET_FILENAME
*& Form INITIALISE_EVENTS
FORM initialise_events .
i_header-typ = 'H'.
i_header-key = 'R'.
i_header-info = 'BDC Interface for PA Infotypes 0000,0001,0002'.
APPEND i_header TO i_header1.
CLEAR i_header.
i_header-typ = 'S'.
i_header-info = 'Hiring, Org.Assignment, Personnel Data'.
APPEND i_header TO i_header1.
CLEAR i_header.
***Events and form name
it_event-name = 'TOP_OF_PAGE'.
it_event-form = 'TOP_OF_PAGE'.
APPEND it_event TO it_event1.
ENDFORM. " INITIALISE_EVENTS
*& Form RETREIVE_DATA
FORM retreive_data .
PERFORM upload_data.
ENDFORM. " RETREIVE_DATA
*& Form UPLOAD_DATA
FORM upload_data .
FM to upload data from excel sheet to internal table
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_plan
i_begin_col = g_colbeg
i_begin_row = g_rowbeg
i_end_col = g_colend
i_end_row = g_rowend
TABLES
intern = i_tplan
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 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.
ENDFORM. " UPLOAD_DATA
*& Form POPULATE_DATA
FORM populate_data .
processing the internal table generated from the function module
Passing data from Excel file to internal table
CLEAR: g_cnt_processed,
g_cnt_err_processed,
i_intern,
i_plan.
LOOP AT i_tplan.
AT NEW row.
CLEAR i_plan.
ENDAT.
CASE i_tplan-col.
Begin Date
WHEN '0001'.
i_plan-pernr = i_tplan-value.
End Date
WHEN '0002'.
i_plan-begda = i_tplan-value.
WHEN '0003'.
i_plan-massg = i_tplan-value.
Sign
WHEN '0004'.
i_plan-plans = i_tplan-value.
WHEN '0005'.
i_plan-werks = i_tplan-value.
WHEN '0006'.
i_plan-persg = i_tplan-value.
WHEN '0007'.
i_plan-persk = i_tplan-value.
WHEN '0008'.
i_plan-anrex = i_tplan-value.
WHEN '0009'.
i_plan-nachn = i_tplan-value.
WHEN '0010'.
i_plan-vorna = i_tplan-value.
WHEN '0011'.
i_plan-gesch = i_tplan-value.
WHEN '0012'.
i_plan-gbdat = i_tplan-value.
WHEN '0013'.
i_plan-fatxt = i_tplan-value.
WHEN '0014'.
i_plan-famdt = i_tplan-value.
WHEN '0015'.
i_plan-gblnd = i_tplan-value.
WHEN '0016'.
i_plan-anzkd = i_tplan-value.
WHEN '0017'.
i_plan-natio = i_tplan-value.
WHEN '0018'.
i_plan-btrtl = i_tplan-value.
WHEN '0019'.
i_plan-gsber = i_tplan-value.
WHEN '0020'.
i_plan-abkrs = i_tplan-value.
ENDCASE.
Appending the internal table tb_data, tb_chng
AT END OF row.
APPEND i_plan.
IF i_plan IS INITIAL.
g_cnt_err_processed = g_cnt_err_processed + 1.
ENDIF.
ENDAT.
ENDLOOP.
To get the total number of records processed
DESCRIBE TABLE i_plan LINES g_lines.
g_cnt_processed = g_cnt_err_processed + g_lines.
CLEAR g_lines.
ENDFORM. " POPULATE_DATA
*& Form PROCESS_DATA
FORM process_data .
CLEAR wa_error.
REFRESH i_bdcdata.
Check if the employee numbers from the template has already been hired
SELECT pernr
begda
FROM pa0000
INTO TABLE it_pa000
FOR ALL ENTRIES IN i_plan
WHERE pernr = i_plan-pernr
AND massn = 'ZA'.
IF sy-subrc = 0.
SORT it_pa000 BY pernr.
Check if employee has a corresponding infotype 0001 record
SELECT pernr
begda
FROM pa0001
INTO TABLE it_pa001
FOR ALL ENTRIES IN it_pa000
WHERE pernr = it_pa000-pernr AND
begda = it_pa000-begda.
IF sy-subrc = 0.
SORT it_pa001 BY pernr.
Check if employee has a corresponding infotype 0002 record
SELECT pernr
begda
FROM pa0001
INTO TABLE it_pa002
FOR ALL ENTRIES IN it_pa001
WHERE pernr = it_pa001-pernr AND
begda = it_pa001-begda.
IF sy-subrc = 0.
SORT it_pa002 BY pernr.
ENDIF.
ENDIF.
ENDIF.
LOOP AT i_plan.
REFRESH i_bdcdata.
***your recording to be pasted here***
PERFORM bdc_field USING 'BDC_CURSOR'
'P0006-BEGDA'.
PERFORM call_transaction.
APPEND wa_error TO i_error.
REFRESH: i_bdcdata, i_messtab.
CLEAR: wa_error, i_error.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*& Form BDC_DYNPRO
FORM bdc_dynpro USING program dynpro.
CLEAR i_bdcdata.
i_bdcdata-program = program.
i_bdcdata-dynpro = dynpro.
i_bdcdata-dynbegin = 'X'.
APPEND i_bdcdata.
ENDFORM. "BDC_DYNPRO
*& Form BDC_FIELD
FORM bdc_field USING fnam fval.
IF fval <> nodata.
CLEAR i_bdcdata.
i_bdcdata-fnam = fnam.
i_bdcdata-fval = fval.
APPEND i_bdcdata.
ENDIF.
ENDFORM. "bdc_field
*& Form ERROR_RECORD_DATA
FORM error_record_data .
CLEAR: g_lines,
wa_messtab,
g_msg.
DESCRIBE TABLE i_messtab LINES g_lines.
READ TABLE i_messtab INTO wa_messtab INDEX g_lines.
IF sy-subrc = 0.
CLEAR g_msg.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = wa_messtab-msgid
lang = sy-langu
no = wa_messtab-msgnr
v1 = wa_messtab-msgv1
v2 = wa_messtab-msgv2
v3 = wa_messtab-msgv3
v4 = wa_messtab-msgv4
IMPORTING
msg = g_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF wa_messtab-msgtyp = 'E'.
IF wa_messtab-msgtyp = 'S' AND wa_messtab-msgnr = '102' AND wa_messtab-msgid = 'PG'.
wa_error-pernr = i_plan-pernr.
wa_error-rel_obj_id = 'S'.
wa_error-msg = 'Personnel Number Created Successfully'.
ELSE.
wa_error-pernr = i_plan-pernr.
wa_error-rel_obj_id = 'E'.
wa_error-msg = g_msg.
ENDIF.
APPEND wa_error TO i_error.
CLEAR i_error.
ENDIF.
ENDFORM. " ERROR_RECORD_DATA
*& Form FINAL_OUTPUT
FORM final_output .
CLEAR g_lines.
SORT i_error.
*************added*********************************************
loop at i_error into wa_error.
if wa_error-MSG eq 'No batch input data for screen MP000600 2000'.
wa_error-rel_obj_id = 'S'.
wa_error-MSG = 'Record Created Successfully'.
modify i_error from wa_error.
endif.
endloop.
loop at i_error into wa_error.
if wa_error-rel_obj_id = 'S'.
g_cnt_success = g_cnt_success + 1. " Append success count
elseif wa_error-rel_obj_id = 'E'.
g_cnt_failure = g_cnt_failure + 1. " Append error count
endif.
endloop.
***Field catalog
PERFORM field_cat.
***Assigning Program name
g_repid = sy-repid.
SORT i_error.
***Display Output
IF NOT it_final[] IS INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'PF_STATUS_SET'
i_save = 'A'
it_events = it_event1
is_layout = is_layout
it_fieldcat = i_fieldcat[]
TABLES
t_outtab = i_error[].
ELSE.
MESSAGE i015(zv_msg) WITH 'No Data Found for this selection'.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " FINAL_OUTPUT
*& Form top_of_page
text
FORM top_of_page.
***FM for Displaying Heading
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_header1[]
i_logo = 'ENJOYSAP_LOGO'.
ENDFORM. "top_of_page
*& Form FIELD_CAT
FORM field_cat .
ENDFORM. " FIELD_CAT
*& Form CALL_TRANSACTION
FORM call_transaction .
CALL TRANSACTION 'PA40' USING i_bdcdata
MODE g_mode
UPDATE 'S'
MESSAGES INTO i_messtab.
If call transaction successful
IF sy-subrc = 0.
g_cnt_success = g_cnt_success + 1. " Append success count "changed
PERFORM error_record_data. " Populate all data
If call transaction not successful
ELSE.
PERFORM error_record_data. " Populate all table
g_cnt_failure = g_cnt_failure + 1. " Append error count "changed
ENDIF.
ENDFORM. " CALL_TRANSACTION -
Please suggest a select query / sub query with out using any subprograms or
source table: Three columns ORIGIN, DESTINATION,MILES
Origin Destination Miles
Sydney Melbourne 1000
Perth Adelaide 3000
Canberra Melbounre 700
Melbourne Sydney 1000
Brisbane Sydney 1000
Perth Darwin 4000
Sydney Brisbane 1000
out put :Three columns ORIGIN, DESTINATION,MILES
Duplicate routes are to be ignored so the output is
Origin Destination Miles
Sydney Melbourne 1000
Perth Adelaide 3000
Canberra Melbounre 700
Brisbane Sydney 1000
Perth Darwin 4000
Please suggest a select query / sub query with out using any subprograms or functions/pkgs to get the out put table.Hi,
user9368047 wrote:
... Please suggest a select query / sub query with out using any subprograms or functions/pkgs to get the out put table.Why? If the most efficient way to get the results you want involves using a function, why wouldn't you use it?
Here's one way, without any functions:
SELECT a.*
FROM source_table a
LEFT OUTER JOIN source_table b ON a.origin = b.destination
AND a.destination = b.origin
AND a.miles = b.miles
WHERE b.origin > a.origin -- Not b.origin > b.origin
OR b.origin IS NULL
;If you'd care to post CREATE TABLE and INSERT statements for your sample data, then I could test this.
Edited by: Frank Kulash on Nov 6, 2012 7:39 PM
Corrected WHERE clause after MLVrown (below) -
Purge Data #error when UserResponse and ToDate function is used in same formula
Hi,
I have a formula which works well when there is data but when I purge the webi report I get #Error for the cells wherever I have used UserResponse and ToDate function in the same formula.
Ex: =FormatDate(ToDate(UserResponse("Enter Modified Date:");"M/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")
I tired in multiple reports. I get the same error in all reports when i purge the data but when i unpurge and show the reports with data, I won't get any error.
Is this known issue? If anyone knows the solution. Please answer it.
(FYI, I am using BO4.0 SP5)
Thanks.Thanks a lot for all your efforts in trying to find the solution to my question but the formula that you had has a error, as you were using commas instead of semicolon. If you want I can change it & it's not a big deal.
By the way, I have found even better solution.
Substrings will kill the processing time and we should try to avoid string functions as much as possible. So I used IsError function instead.
=If IsError(FormatDate(ToDate(UserResponse("Enter Modified Date:");"MM/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")) Then "" Else FormatDate(ToDate(UserResponse("Enter Modified Date:");"MM/dd/yyyy hh:mm:ss a");"MM/dd/yyyy") -
I would like to know how i can create a bell graph with out using sub VIs, the data that i created consists in 500 readings with values of 0 to 100, i calculated the mean value and standard diviation. I hope some one can help me
Here's a quick example I threw together that generates a sort-of-bell-curve shaped data distribution, then performs the binning and plotting.
-Kevin P.
Message Edited by Kevin Price on 12-01-2006 02:42 PM
Attachments:
Binning example.vi 51 KB
Binning example.png 12 KB
Maybe you are looking for
-
I am trying to run my macbook (White), I think it is from 2007, to my tv via the VCR RCA inputs. I have successfully run sound through the headphone jack, but I get no video on the TV when I have it hooked up with the Apple mini dvi to RCA adapter. I
-
Hello There, Is there any possibility to use SAP Smartforms in SAP version 4.6B? If so could any one let me know the procedure to install in 46B Unix Enviornment? Thanks in Advance. Cheers Sankar
-
Removing border around Flash content
I really cant stand what adobe has done to the flash player. They totally messed it up. My question is how do I remove the box/boarder that the new flash player puts around flash content. Go to a site with flash content, once there hover your mouse o
-
How do i know if i have this virus?
Hi. Had a weid thing where my mac book pro seemed to have vrashed. Its pretty **** new so I thought it was weird. then i read the article on the bbc about the malware that has finally got hold of macs. What should i do? How do I know if I got it
-
Need help setting up a .mac email account-not .me
I just came home with a mac book pro today with one to one and mobile me, but I would like to create a [email protected] account. I can't figure it out at all. Please, tell me where to begin. Thanks!