Logic need for currency calculation
Hi All,
Can u pleae help me out to solve this requirement?
Sample code below;
1 declare
2 CURSOR C1 IS SELECT * FROM TEST2;
3 begin
4 DBMS_OUTPUT.PUT_LINE('From Currency'||' '||'To Currency'||' '||'Rate:');
5 FOR C2 IN C1 LOOP
6 DBMS_OUTPUT.PUT_LINE(c2.from_currency||' '||c2.to_currency||' '||c2.rate);
7 END LOOP;
8* end;
SQL> /
From Currency To Currency Rate:
GBP INR 75.1371
GBP AUD 1.5342
GBP USD 1.57291
Based on this i need to derive all the permutations and Combination of other currencie like INR to AUD,INR to USD,etc...
Please any one come across through such requirement Please help me to solve this requiremen.
Regards
Raaghavendra
Hello,
Is it what you need ?
with t as
(select 'GBP' fromCur ,'INR' ToCurr, 75.1371 rate from dual union all
select 'GBP', 'AUD' ,1.5342 from dual union all
select 'GBP', 'USD', 1.57291 from dual)
select t1.tocurr as calc_fromcurr,
t2.tocurr as calc_tocurr,
t2.rate/t1.rate as calc_rate
from t t1, t t2
where t1.tocurr!=t2.tocurr;regards,
Sylvie
Similar Messages
-
What is the best field type for currency calculations?
Hiya,
I am doing a load of currency calculations e.g. here's one line of it
The 'Total' fields I am using for doing/totalling my calculations has been defined as a local variable that reference an amount field setup in the data dictionary as:
So in my program I am using these 2 decimal field.
Of course I now realize this is a problem, as lots of rounding occurs and my values are way out when you deal with amounts in the millions.
Does anyone know what type of variable they think is best for doing currency calculations?
And could you provide a simple example?
Many thanks!Hello Robert,
I guess you can go ahead with ATFLV, incase if you want to display as a currency, you can use the function module KKEK_CONVERT_FLOAT_TO_CURR.
DATA: c_lv_float TYPE ATFLV VALUE '4.4500000000000000E+02',
c_lv_curr TYPE WAERS VALUE 'EUR',
c_lv_currval TYPE NETWR_AP.
CALL FUNCTION 'KKEK_CONVERT_FLOAT_TO_CURR'
EXPORTING
float_imp = c_lv_float
curr_imp = c_lv_curr
IMPORTING
CURR_FIELD_EXP = c_lv_currval
EXCEPTIONS
OVERFLOW = 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.
WRITE:/ c_lv_currval.
Output: 445,00
Regards,
TP -
Fail safe logic needed for purchase order upload program
Hello all,
i am working on creating PO's by reading data from a text file. I need to implement fail safe logic in it, which is to make sure this program uploads all the records in the text file successfully. For example, i have 1000 records in my text file and while running the upload program if the program times out while creating the 500th PO or if SAP is down at that time, then we have 499 PO's created and 501 yet to be created. But if we run the same program again, we will generate duplicate PO's for 499 again. I want to avoid this kind of problem.
How do i implement this idea?
Kindly guide me on this.
Thanks.Ok ..
Then I would suggest you use Application Log to keep the success and error messages of PO processing.
You can check trsnaction SLG0 and create your own application log object.
Then you need to use FMs BAL_LOG_* to crate and add messages to it.
This way you will have a facility to check as which of your records are converted to PO for a run.
In case SAP gets down in between , still you can find the details using Xn SLG1 and then accordingly remove the records from your file which are already converted to PO.
Thanks,
Ram -
Logic Needed for MM Report with PR, PO, GR and Invoice details
Hi Experts,
We need to provide a list of below details as columns.
PR, PR creation date, PO, PO creation date, GR, GR creation date, Invoice and Invoice creation date.
Now on the selection screen we'll have Date range. If I give the dat range as 01.01.2011 to 31.12.2011, then the list should be displaying all the details. However, it should first check Invoices in that date range and mention the related details. If there are some GRs (for which invoice is not yet created) for that year, then the related details (PR, PO and GR) of that GR are to be shown. For POs (for which GR itself is not yet created), again details are to be shown (PR and PO details).
Can somebody help me in getting this done in some simpler way? I am thinking of fetching the data from the respective tables for this date range and then from invoice i will be printing and then deleting the corresponding GR, PO and PR. Then will be checking GR , printing the details and deleting corresponding PR and PO.. and so on. But I felt this not that great.
Can anyone suggest some other logic or provide some inputs?
Thanks.Hi,
As per your requirement you can cross the tables i.e. BSET,RSEG,RBKP(For Invoice Header n Item Details).Then now go to the MKPF,MSEG tables (For MIGO Details) and EBAN,EKKO,EKPO(For Purchase Requsitions,Orders Details).... Consider BUDAT as a selection date among the tables RSEG,MKPF,EKKO.
Regards,
Rickky -
Logic needed for report: Parameter Group
hi..friends,
im dev a report: refernce std report - "S_ALR_87012178" is the tcode. there they are giving 5 slabs: ie. under 'Output control Sel Scrn - in "Due date sorted List" '. but my requirement is to do same like that for 10 slabs.
the values are dynamic. Accordingly we should display the amount falling in that specified period.
i hav already fetched the data. but to display them, i hav struck.
how to access the input and print them.
i hav to use alv hierarchical seq display format.
My decl:
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 01(30) text-050 for field p_slab1.
SELECTION-SCREEN POSITION POS_LOW.
PARAMETERS: p_slab1 LIKE rfpdo1-allgrogr OBLIGATORY DEFAULT '15',
p_slab2 LIKE rfpdo1-allgrogr OBLIGATORY DEFAULT '30',
p_slab3 LIKE rfpdo1-allgrogr OBLIGATORY DEFAULT '45',
p_slab4 LIKE rfpdo1-allgrogr OBLIGATORY DEFAULT '60',
p_slab5 LIKE rfpdo1-allgrogr OBLIGATORY DEFAULT '75',
p_slab6 LIKE rfpdo1-allgrogr OBLIGATORY DEFAULT '90',
p_slab7 LIKE rfpdo1-allgrogr OBLIGATORY DEFAULT '115',
p_slab8 LIKE rfpdo1-allgrogr OBLIGATORY DEFAULT '130',
p_slab9 LIKE rfpdo1-allgrogr OBLIGATORY DEFAULT '145'.
SELECTION-SCREEN END OF LINE.
suggest me logic pls.
regards,
Padmashree.Hi,
Try out this.
declare all the parameters in the block.
selection-screen begin of block b2 with frame .
parameter: declare all the parameters.
selection-screen end of block b2.
hope it may help you. -
Logic needed for dynamic report
Hi Experts,
I have made a dynamic report where my logic is if the value of the columns is 0 than it should be blank and if the columns of the stores have some value for eg: 01 than it should populate the same store.
The logic goes like :
for matnr 01store 02 store
01 100.00 0.00
02 00 00
03 50.00 13.00
than the output should be
matnr 01store 02 store
01 01store
02
03 01store 02 store
I have made the logic but all the lines are getting appended
it_field_dynamic1-fieldname = 'MATNR'.
it_field_dynamic1-desc = 'ARTICLE'.
it_field_dynamic1-reffield = 'MATNR'.
it_field_dynamic1-reftab = 'MBEW'.
it_field_dynamic1-seq = 1.
COLLECT it_field_dynamic1.
CLEAR wa_itab.
LOOP AT itab INTO wa_itab. "WHERE SALK3 NE '0.00'.
it_field_dynamic1-fieldname = wa_itab-bwkey.
it_field_dynamic1-desc = wa_itab-bwkey.
* IF WA_ITAB-SALK3 NE '0.00'.
* it_field_dynamic1-reffield = wa_itab-bwkey.
* ENDIF.
it_field_dynamic1-reftab = 'MBEW'.
it_field_dynamic1-seq = 1.
COLLECT it_field_dynamic1.
CLEAR wa_itab.
ENDLOOP.
LOOP AT it_field_dynamic1.
wa_alv_cat1-fieldname = it_field_dynamic1-fieldname.
wa_alv_cat1-col_pos = sy-tabix.
wa_alv_cat1-ref_field = it_field_dynamic1-reffield.
wa_alv_cat1-ref_table = it_field_dynamic1-reftab.
wa_alv_cat1-seltext = it_field_dynamic1-desc.
COLLECT wa_alv_cat1 INTO lt_alv_cat1 .
CLEAR wa_alv_cat1 .
* APPEND wa_alv_cat TO lt_alv_cat .
ENDLOOP.
IF NOT lt_alv_cat1[] IS INITIAL .
* Create Dynamic Table -> i_table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_alv_cat1
IMPORTING
ep_table = i_table1.
ASSIGN i_table1->* TO <table1> .
* Create dynamic work area and assign to FS
CREATE DATA i_struct1 LIKE LINE OF <table1>.
ASSIGN i_struct1->* TO <struc1>.
ENDIF.
DATA: l_row TYPE sy-index.
FIELD-SYMBOLS: <ls_table> TYPE ANY.
FIELD-SYMBOLS: <l_field> TYPE ANY.
DATA: wa_dref1 TYPE REF TO data.
FIELD-SYMBOLS: <wa_tab1> TYPE ANY.
CREATE DATA wa_dref1 LIKE LINE OF <table1>.
ASSIGN wa_dref1->* TO <wa_tab1>.
FIELD-SYMBOLS: <fs1>, <fs2>.
* DATA: wa_dref1 TYPE REF TO data.
* FIELD-SYMBOLS: <wa_tab1> TYPE ANY.
CREATE DATA wa_dref1 LIKE LINE OF <table1>.
ASSIGN wa_dref1->* TO <wa_tab1>.
CLEAR : wa_matnr, wa_itab.
LOOP AT imatnr INTO wa_matnr.
*clear: wa_itab-bwkey.
* CLEAR: wa_itab.
LOOP AT itab INTO wa_itab WHERE matnr = wa_matnr-matnr.
* CLEAR: wa_itab-bwkey.
IF wa_itab-salk3 EQ '0.00'.
CLEAR: wa_itab-bwkey .
ELSE.
ASSIGN COMPONENT wa_itab-bwkey OF STRUCTURE <wa_tab1> TO <fs1>.
IF sy-subrc = 0 . "AND WA_ITAB-SALK3 NE '0.00'.
<fs1> = wa_itab-bwkey.
ENDIF.
ENDIF.
*ON CHANGE OF WA_ITAB-MATNR.
ASSIGN COMPONENT 'MATNR' OF STRUCTURE <wa_tab1> TO <fs2>.
IF sy-subrc = 0.
* ON CHANGE OF wa_itab-matnr.
<fs2> = wa_itab-matnr.
* ENDON.
ENDIF.
* APPEND <wa_tab1> TO <table1>.
ENDLOOP.
APPEND <wa_tab1> TO <table1>.
CLEAR : wa_ltab.
ENDLOOP.
than i have called the alv grid display
Please let me know.
Thanks,
Nikhil.Hi Oliver,
My current output is:
for
matnr 01store 02 store
01 100.00 0.00
02 00 00
03 50.00 13.00
matnr 01store 02 store
01 01store
02 01store
03 01store
but for matnr 02, 01 store has 0 value hence it should come blank but its appending from the first line and populating 01store for material 2.
Thanks & Regards,
Nikhil. -
Logic need for my selection screen
Hi,
i designed my selection screen
PARAMETERS:
rb_alv RADIOBUTTON GROUP g2, " Radio 1
rb_pc RADIOBUTTON GROUP g2, " Radio 2
rb_unix RADIOBUTTON GROUP g2. " Radio 3
*File path
PARAMETERS: pa_ftxt TYPE rlgrap-filename.
Below isMy requirement is :How to do it???please help
Do not hard-code the directory output for Unix. Just make sure the selection logic checks to make sure a value exists in the path field if either download option (pc/unix) is set). For the PC default, use u2018c:\temp\veninfo.txtu2019 as a constant.
Thanks
asisPARAMETERS:
rb_alv RADIOBUTTON GROUP g2 user-command 'RAD', " Radio 1
rb_pc RADIOBUTTON GROUP g2, " Radio 2
rb_unix RADIOBUTTON GROUP g2. " Radio 3
*File path
PARAMETERS: pa_ftxt TYPE rlgrap-filename.
at selection-screen output.
if rb_pc = 'X'.
pa_ftxt = 'c:\temp\veninfo.txt'.
else.
clear pa_ftxt.
endif.
at selection-screen on value request for pa_ftxt.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
i_server = ' '
i_path = ' ' "here you can give the path of the server directory
IMPORTING
o_path = l_path
abend_flag = l_abend_flag
EXCEPTIONS
communication_failure = 1
system_failure = 2
rfc_error = 3.
IF sy-subrc EQ 0.
p_file = l_path. "This gives you the path
ENDIF.
IF l_abend_flag = 'X'.
EXIT.
else.
Move l_path to your screen field pa_ftxt.
ENDIF. -
Help Please Needed for Java Calculator - ActionListener HELP
Hi. I am constructing a simple Java calculator and need help with the actionlistener and how it could work with my program. I am not too sure how to begin constructing the actionlistener. I would like to know the best and most simple solution to get this program work the way it should, like a real calculator. If anyone can help me, that would be much appreciated.
package calculator;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class CalculatorGUI extends JFrame implements ActionListener{
JTextField screen;
JButton button7;
JButton button8;
JButton button9;
JButton button4;
JButton button5;
JButton button6;
JButton button1;
JButton button2;
JButton button3;
JButton button0;
JButton add;
JButton minus;
JButton multiply;
JButton divide;
JButton equals;
JButton clear;
private JTextField m_displayField;
private boolean m_startNumber = true;
private String m_previousOp = "=";
private CalculatorLogic m_logic = new CalculatorLogic();
public CalculatorGUI() {
CalculatorGUILayout customLayout = new CalculatorGUILayout();
getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
getContentPane().setLayout(customLayout);
screen = new JTextField("textfield_1");
getContentPane().add(screen);
button7 = new JButton("7");
getContentPane().add(button7);
button7.addActionListener(this);
button8 = new JButton("8");
getContentPane().add(button8);
button8.addActionListener(this);
button9 = new JButton("9");
getContentPane().add(button9);
button9.addActionListener(this);
button4 = new JButton("4");
getContentPane().add(button4);
button4.addActionListener(this);
button5 = new JButton("5");
getContentPane().add(button5);
button5.addActionListener(this);
button6 = new JButton("6");
getContentPane().add(button6);
button6.addActionListener(this);
button1 = new JButton("1");
getContentPane().add(button1);
button1.addActionListener(this);
button2 = new JButton("2");
getContentPane().add(button2);
button2.addActionListener(this);
button3 = new JButton("3");
getContentPane().add(button3);
button3.addActionListener(this);
button0 = new JButton("0");
getContentPane().add(button0);
button0.addActionListener(this);
add = new JButton("+");
getContentPane().add(add);
add.addActionListener(this);
minus = new JButton("-");
getContentPane().add(minus);
minus.addActionListener(this);
multiply = new JButton("*");
getContentPane().add(multiply);
multiply.addActionListener(this);
divide = new JButton("/");
getContentPane().add(divide);
divide.addActionListener(this);
equals = new JButton("=");
getContentPane().add(equals);
equals.addActionListener(this);
clear = new JButton("Clear");
getContentPane().add(clear);
clear.addActionListener(this);
setSize(getPreferredSize());
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
public void actionPerformed(ActionEvent event) {
public static void main(String args[]) {
CalculatorGUI window = new CalculatorGUI();
window.setTitle("Calculator");
window.pack();
window.show();
class CalculatorGUILayout implements LayoutManager {
public CalculatorGUILayout() {
public void addLayoutComponent(String name, Component comp) {
public void removeLayoutComponent(Component comp) {
public Dimension preferredLayoutSize(Container parent) {
Dimension dim = new Dimension(0, 0);
Insets insets = parent.getInsets();
dim.width = 421 + insets.left + insets.right;
dim.height = 494 + insets.top + insets.bottom;
return dim;
public Dimension minimumLayoutSize(Container parent) {
Dimension dim = new Dimension(0, 0);
return dim;
public void layoutContainer(Container parent) {
Insets insets = parent.getInsets();
Component c;
c = parent.getComponent(0);
if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+8,408,64);}
c = parent.getComponent(1);
if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+80,96,56);}
c = parent.getComponent(2);
if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+80,96,56);}
c = parent.getComponent(3);
if (c.isVisible()) {c.setBounds(insets.left+232,insets.top+80,96,56);}
c = parent.getComponent(4);
if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+144,96,56);}
c = parent.getComponent(5);
if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+144,96,56);}
c = parent.getComponent(6);
if (c.isVisible()) {c.setBounds(insets.left+232,insets.top+144,96,56);}
c = parent.getComponent(7);
if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+208,96,56);}
c = parent.getComponent(8);
if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+208,96,56);}
c = parent.getComponent(9);
if (c.isVisible()) {c.setBounds(insets.left+232,insets.top+208,96,56);}
c = parent.getComponent(10);
if (c.isVisible()) {c.setBounds(insets.left+120,insets.top+272,96,56);}
c = parent.getComponent(11);
if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+80,72,56);}
c = parent.getComponent(12);
if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+144,72,56);}
c = parent.getComponent(13);
if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+208,72,56);}
c = parent.getComponent(14);
if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+272,72,56);}
c = parent.getComponent(15);
if (c.isVisible()) {c.setBounds(insets.left+344,insets.top+336,72,56);}
c = parent.getComponent(16);
if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+408,408,72);}
}Yeah, I have a rough idea of what the calculator
should do, like most people would. Its just that I
dont know how to implement this in Java. Thats the
problem. Can anyone provide me with code snippets
that I can try?No I would rather see you make an effort from what has been discussed here. This is not a Java problem this is a general programming problem. -
Some help needed for shopping calculator program
Hi. I would like to thank you in advance for helping me. At the moment I am pretty much stuck. I don't know how to add the input using 'while loop'. This is what I'm suppose to do:
Write a program called ShoppingCalculator.java that allows the user to enter the prices of several items they have bought and then tells them the total amount. The user can enter the prices for as many items as they want, until they click Cancel. The program should then output the total amount they spent, in a message dialog box. Use pounds for all the amounts.
So far I have written:
import javax.swing.JOptionPane;
public class ShoppingCalculator
public static void main(String[] args)
boolean done = false;
double amount;
String input;
while (!done)
input = JOptionPane.showInputDialog("Enter the amount you spent on the next item:");
amount = Double.parseDouble (input);
if (done = true)
JOptionPane.showMessageDialog (null, "You spent a total amound of £" + amount );
}Sorry if the code doesn't make much sense cause I've been changing the code around so many times that.
At one point when I was playing around with the code, I manage to make the input dialog loop nicely but when I pressed cancel, the message dialog only output the last input I put in. What I'm really stuck here is I need to know how to add the input when using 'while loop' and is it correct to use the IF Statement on this program. Please give me some advice on how to and I will try to work on it again.Ok. I have edit the code and this is what it looks like:
import javax.swing.JOptionPane;
public class ShoppingCalculator
public static void main(String[] args)
boolean done = false;
double amount;
String input;
double total = 0;
while (!done)
input = JOptionPane.showInputDialog("Enter the amount you spent on the next item:");
amount = Double.parseDouble (input);
if (input == null)
total = total + amount;
JOptionPane.showMessageDialog (null, "You spent a total amound of " + total );
}I created another variable (total) and it even compiled. The only problem I have now is the message dialog wouldn't show at the end. When I press cancel and nothing happen. This is what I get on my output command window:
Exception in thread "main" java.lang.NullPointerException
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:991)
at java.lang.Double.parseDouble(Double.java:510)
at ShoppingCalculator.main(ShoppingCalculator.java:23)
Java Result: 1
Anything that isn't right here? -
Logic needed for increment value
HI,
This function returns me if i pass 'ABC01' it will return 'ABC02' like if i pass
'ABC55' it will return 'ABC56'.
But my requirment is i need to pass value from 01 to 99.
so if i pass 'ABC99' it sud return ''ABC01'.
so the sequence is from 01 to 99.And after 99 it will again start from 01.
create or replace function get_next_value
string_1 in varchar2
return varchar2
as
v_string_1 number(10);
v_string_2 varchar2(10);
begin
select to_number(substr(string_1,4))+1 into v_string_1 from dual;
if length(v_string_1)=1 then
v_string_2:=substr(string_1,1,4)||v_string_1;
return v_string_2;
else
v_string_2:=substr(string_1,1,3)||v_string_1;
return v_string_2;
end if;
end;
test sript
select get_next_value('ABC01') from dual
select get_next_value('ABC55') from dual
Thanks,
Lonycreate or replace function get_next_value
string_1 in varchar2
return varchar2
as
v_string_1 number(10);
v_string_2 varchar2(10);
begin
select to_number(substr(string_1,4))+1 into v_string_1 from dual;
if length(v_string_1)=1 then
v_string_2:=substr(string_1,1,4)||v_string_1;
return v_string_2;
else
v_string_2:=substr(string_1,1,3)||v_string_1;
if v_string_1 = 100 then
return substr(string_1,1,3)||'01';
end if;
return v_string_2;
end if;
end;
select get_next_value('ABC01') from dual;
select get_next_value('ABC99') from dual;
GET_NEXT_VALUE('ABC01')
ABC02
1 rows selected
GET_NEXT_VALUE('ABC99')
ABC01 -
Hi ,
I ned to write Bdc for the FI transaction f-53. In that BDC various entry is uploaded in trnsaction thr flat file . After Upload Document No is generted and it should stored in the excel file and at the last col of th flat file .
How to do this . I have no clue for thsi . How to capture valus of document no which is genrated ,
ThanksYou can also use parameter ID 'BLN' if you are calling individual transactions. Some variants of the FI transactions will use different success messages, so if you use a common routine for the call, you'll definitely want to use this approach instead of hardcoding message numbers and fields to read.
Before the call:
SET PARAMETER ID 'BLN' FIELD SPACE.
CLEAR GV_BELNR.
After the call, insert the proper error handling and for successful calls:
GET PARAMETER ID 'BLN' FIELD GV_BELNR. " GV_BELNR defined as type BELNR_D -
Logic needed for the following data
Hi All,
I have procedure in that I am calling a cursor to fetch the records. This query is returning the following data
DI
SZ
DII
CWT
Top
down
9 1/2
9.625
8.921
36
18
1602
13 1/2
13.375
12.515
61
19
1962
18 1/2
18.625
17.755
87.5
20
503
26
26
24.75
105
20
103
9 1/2
9.625
8.835
40
1602
3858
7
7
6.276
26
1683
6352
I want to print just these values ..
9 1/2
9.625
8.921
36
18
1602
9 1/2
9.625
8.835
40
1602
3858
7
7
6.276
26
1683
6352
As you can see in these values top and down are overlapping.
I tried several ways to sort the query on the fields and have some logic, but I am always getting one row extra which is not overlapping.
Can someone please give me the logic to get the desired result through conditions in Procedure/function/package
ThanksBrendanP wrote:
26 AND t.top
"AND t.top....."... what?
Here's another solution, giving the least overlap over the greatest distance...
SQL> ed
Wrote file afiedt.buf
1 with data as (select 1 id , 18 top, 1602 down from dual union all
2 select 2,19, 1962 from dual union all
3 select 3,20, 503 from dual union all
4 select 4,20, 103 from dual union all
5 select 5,1602, 3858 from dual union all
6 select 6,1683, 6352 from dual
7 )
8 -- -------------------------------------------------------
9 -- END OF TEST DATA JUST USE QUERY BELOW AGAINST OWN TABLE
10 -- -------------------------------------------------------
11 ,idealpath as (
12 select id, path, idpath
13 from (
14 select id, path, idpath, cmlt_diff, min_diff, cvrg, max_cvrg
15 from (
16 select x.id
17 ,x.path
18 ,idpath
19 ,to_number(y.column_value) as cmlt_diff
20 ,min(to_number(y.column_value)) over (partition by cvrg) as min_diff
21 ,cvrg
22 ,max(cvrg) over () as max_cvrg
23 from (
24 select connect_by_root(id) as id
25 ,down-connect_by_root(top) as cvrg
26 ,ltrim(sys_connect_by_path(prior down-top,'+'),'+') as cmlt_diff
27 ,ltrim(sys_connect_by_path(top||'-'||down,':'),':') as path
28 ,ltrim(sys_connect_by_path(id,':'),':') as idpath
29 from data
30 where connect_by_isleaf = 1
31 connect by nocycle top between prior top and prior down
32 and not down between prior top and prior down
33 ) x
34 ,xmltable(nvl(cmlt_diff,'0')) y
35 )
36 where cvrg = max_cvrg
37 )
38 where cmlt_diff = min_diff
39 )
40 --
41 select d.id, d.top, d.down
42 from data d
43 ,(select level l, to_number(regexp_substr(idpath,'[^:]+',1,level)) as id
44 from idealpath
45 connect by regexp_substr(idpath,'[^:]+',1,level) is not null) bp
46 where bp.id = d.id
47* order by bp.l
SQL> /
ID TOP DOWN
1 18 1602
2 19 1962
6 1683 6352 -
I need to find an Unibody 2.66GHz core i7 logic board for my MacBook Pro 15"
I need to find an Unibody 2.66GHz core i7 logic board for my MacBook Pro 15". Where can I find it?
have you searched the internet? perhaps ifixit.com might have one.
-
I need to buy a logic board for
Apple MacBook Pro 15" A1286, but i couldn´t find online to buy it where can i get one and if it´s possible if i can have it delivered to my hotelThere are a lot of MacBook Pros with the model # A1286 - which year is your model (e.g., "15-inch Late 2011")?
The only place that I know that you might could score a specific logic board is www.ifixit.com. They may be able to ship to your hotel.
Clinton -
SAP PS Module Report, Help needed for the Right Logic.
Hi,
I have to develop a PS module Report . This spec of this report is when you enter , project # , month , date , proj type it should display all the projects and only the billing levels with different fiels like ITD cost, ITD sales, ytd cost, sales, awards etc etc.
Right now Iam getting the O/P : in the following manner, There are many fields I am just showing the desired ones which have to be changed.
Proj, Title, award, ITDsales, ITD cost , ytd sales, ytd costs,
14148, New prj 123 -- --- -
14148-B01, bill1 -
234 -
456 -
14148-B02, bill2 -
789 -
123 -
14148.001 wbs1 -
123 -
456
14148.001 wbs2 -
567 -
890
But for me the desired output must be only for project and the billing levels. It shouldnt be for WBS elements xxxx.001 and xxxx.002.
Desired output:
Proj, Title, award, ITDsales, ITD cost , ytd sales, ytd costs,
14148, New prj 123 -- 690 -
1346
14148-B01, bill1 -
234 -
456 -
14148-B02, bill2 -
789 -
123 -
The ITD costs and YTD costs must be added 123 + 567 = 690 and
456+890 = 1346.
And these values must come on the project level.
P.S: I can restrict the values for wbs elements , means I can filter them at PRPS table by giving prps-stufe LE 2. Then I wont get the wbs level, But I want the values of these to be added up and then show it on the project level.
Please go through this code and let me know where exactly I need to put the right logic to work in the desired manner.
Thanks in advance
Dan
Code Below************************
[code]TABLES: PROJ, "Project Definition
PRPS, "WBS Elements
prhi,
CEPC, " Profit Center w/ Group Head info
BPGE, "Plans (12, 13, etc.)
COSP, "Primary Cost Element (Bill Sales, DPC)
COSS, "Secondary Cost Element (Shrd Sls,Sal,etc)
COSB, "Results Analysis Cost Elements (Unbil Sls)
COOI, "Commitments management: Line items
JEST, "Project Status
TCJ04, "Person Responsible for Project
zpclasses, "Project classes.
New Added
CRCO, " Assignment of Work Center to Cost Center
CRHD. " Work Center Header
Record Layout of extracted data
TYPES: BEGIN OF EXDEF, "Data definition of extract data
X_BU(2) TYPE C, "Business Unit
X_CNTR(10) TYPE C, " Profit Center
X_PROJ(24) TYPE C, "Project def (Prj)
X_CREP(30) TYPE C, "Contract Rep.
X_BDREP(25) TYPE C, "BD Rep. name
X_GRPH(15) TYPE C, "Tech Rep employee name
X_ACTREP(15) TYPE C, "Acct Rep employee name
X_PMGR(15) TYPE C, "PM employee name
X_TTLE(35) TYPE C, "Title
X_CLNT(20) TYPE C, "Client
X_POCN(20) TYPE C, "Prime Contract Number
X_TYPE(13) TYPE C, "Order Type Sarnoff
X_OPEN(10) TYPE C, "Open Date
X_CLOSE(10) TYPE C, "Close Date
X_CGT(4) TYPE C, "CO, GV, TC
X_DISTR(2) TYPE C, "Distribution Channel
X_CONTR(6) TYPE C, "Percentage contribution
X_AWRD(14) TYPE C, "Award (Plan 11)
X_P12R(14) TYPE C, "Auth Revenue (Plan 12 @ Rev)
X_P12C(14) TYPE C, "Auth Cost (Plan 12 @ Cost)
X_P13R(14) TYPE C, "Auth Revenue (Plan 13 @ Rev)
X_P13C(14) TYPE C, "Auth Cost (Plan 13 @ Cost)
X_ITDS(14) TYPE C, "ITD Sales
X_ITDC(14) TYPE C, "ITD Costs
X_YTDS(14) TYPE C, "YTD Sales
X_YTDC(14) TYPE C, "YTD Costs
X_MTHS(14) TYPE C, "Current Month Sales
X_MTHC(14) TYPE C, "Current Month Costs
X_ITDB(14) TYPE C, "ITD Billed Sales
X_YTDB(14) TYPE C, "YTD Billed Sales
X_MTHB(14) TYPE C, "Current Month Billed Sales
X_COMM(14) TYPE C, "Commitments
X_STAT(6) TYPE C, "Active or Inactive (REL, TECO, or CLSD)
X_ZPROJCLASS(12),
X_MTHIC(14) TYPE C, "Current Month Incremental Costs
X_YTDIC(14) TYPE C, "YTD Incremental Costs
X_ITDIC(14) TYPE C, "ITD Incremental Costs
X_ZSCURVE(10) TYPE C, "S-CURVE Status
New Added
X_CM_COST(20) TYPE C,
X_AM_COST(20) TYPE C,
X_TL_COST(20) TYPE C,
X_KP_COST(20) TYPE C,
X_PM_COST(20) TYPE C,
END OF EXDEF.
Data declarations
FIELD-SYMBOLS <MNT> .
DATA: ETAB TYPE EXDEF OCCURS 100 WITH HEADER LINE.
DATA: X1_PM_COST(20) TYPE C,
X1_TL_COST(20) TYPE C,
X1_AM_COST(20) TYPE C,
X1_CM_COST(20) TYPE C,
X1_KP_COST(20) TYPE C.
DATA: KOKRS_FIXED LIKE PROJ-VKOKR VALUE 'DSRC', "Controlling Area
TOTAL_AWARD LIKE BPGE-WTGES,
TOTAL_AUTHR12 LIKE BPGE-WTGES,
TOTAL_AUTHC12 LIKE BPGE-WTGES,
TOTAL_AUTHR13 LIKE BPGE-WTGES,
TOTAL_AUTHC13 LIKE BPGE-WTGES,
TOTAL_ITDSALES LIKE BPGE-WTGES,
TOTAL_ITDCOSTS LIKE BPGE-WTGES,
TOTAL_ITDICOSTS LIKE BPGE-WTGES,
TOTAL_YTDSALES LIKE BPGE-WTGES,
TOTAL_YTDCOSTS LIKE BPGE-WTGES,
TOTAL_YTDICOSTS LIKE BPGE-WTGES,
TOTAL_MTHSALES LIKE BPGE-WTGES,
TOTAL_MTHCOSTS LIKE BPGE-WTGES,
TOTAL_MTHICOSTS LIKE BPGE-WTGES,
TOTAL_ITDBILLED LIKE BPGE-WTGES,
TOTAL_YTDBILLED LIKE BPGE-WTGES,
TOTAL_MTHBILLED LIKE BPGE-WTGES,
TOTAL_COMMITMENT LIKE COOI-WTGBTR,
HOLD_PRART LIKE PRPS-PRART,
COUNT_PROJECTS TYPE I,
MNT_INDX(20) TYPE C,
HLD_INDX(3) TYPE N,
YYYY_MM(10) TYPE C,
TEMP-DATE(8) TYPE C.
Selection Screen
SELECTION-SCREEN SKIP 3.
SELECTION-SCREEN BEGIN OF BLOCK XEXTRPM WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN SKIP 2.
PARAMETERS MONTH(2) TYPE N OBLIGATORY.
PARAMETERS YEAR(4) TYPE N OBLIGATORY.
SELECT-OPTIONS: EXTRPRJ FOR PROJ-PSPID. " Range of Projects
SELECT-OPTIONS: EXTRTYP FOR PRPS-PRART. "Project Types (CO,GV,etc.*)
SELECT-OPTIONS: EXTRPCTR FOR PROJ-PRCTR. " Range of Profit centers
SELECTION-SCREEN SKIP 2.
PARAMETERS: OPT1 RADIOBUTTON GROUP OPTN,
OPT2 RADIOBUTTON GROUP OPTN DEFAULT 'X'.
select-options : s_pc for proj-zprojclass. "project class
SELECTION-SCREEN END OF BLOCK XEXTRPM.
Select Tables
START-OF-SELECTION.
write: / 'Sales data (Unshared) extracted on: ', sy-datum.
uline.
CLEAR: COUNT_PROJECTS,
TOTAL_AWARD,
TOTAL_AUTHR12,
TOTAL_AUTHC12,
TOTAL_AUTHR13,
TOTAL_AUTHC13,
TOTAL_ITDSALES,
TOTAL_ITDCOSTS,
TOTAL_YTDSALES,
TOTAL_YTDCOSTS,
TOTAL_MTHSALES,
TOTAL_MTHCOSTS,
TOTAL_ITDBILLED,
TOTAL_YTDBILLED,
TOTAL_MTHBILLED,
TOTAL_COMMITMENT,
ETAB.
PROJ Table Project Definition
SELECT * FROM PROJ "Project Definition
WHERE PSPID IN EXTRPRJ AND " Range of Project Numbers
PRCTR IN EXTRPCTR and " Range of Profit center
zprojclass in s_pc. "project class
SELECT * FROM PRPS WHERE "WBS Elements
PRART IN EXTRTYP " Range of Proj.Types (CO,GV,TC..
and PSPHI = PROJ-PSPNR.
HOLD_PRART = ' '. "clears project type
CLEAR ETAB.
ETAB-X_PROJ = PRPS-POSID.
ETAB-X_BU = PRPS-PRCTR(2). "Business Unit
ETAB-X_PMGR = PROJ-VERNA. "Project Manager
IF PRPS-PRCTR(2) = '01'.
ETAB-X_CNTR = PRPS-PRCTR. " Profit Center
CONCATENATE SPACE PRPS-PRCTR INTO ETAB-X_CNTR SEPARATED BY SPACE.
ELSE.
ETAB-X_CNTR = PRPS-PRCTR. " Profit Center
ENDIF.
ETAB-X_TTLE = PRPS-POST1. "Title
CLEAR TEMP-DATE.
TEMP-DATE = PROJ-PLFAZ. "Project planned start date
CONCATENATE TEMP-DATE4(2) '/' TEMP-DATE6(2) '/'
TEMP-DATE+0(4) INTO ETAB-X_OPEN.
TEMP-DATE = PROJ-PLSEZ. "Project planned finish date
CONCATENATE TEMP-DATE4(2) '/' TEMP-DATE6(2) '/'
TEMP-DATE+0(4) INTO ETAB-X_CLOSE.
Tech Lead
will comment below
SELECT SINGLE VERNA FROM TCJ04 "Tech Lead name from TCJ04
INTO (ETAB-X_GRPH) WHERE VERNR = PROJ-ZGRPHD.
End Of Tech Lead
Account Manager
SELECT SINGLE VERNA FROM TCJ04 "Acct Manager from TCJ04
INTO (ETAB-X_BDREP) WHERE VERNR = PROJ-ZBUSDEV.
******End Of Account Manager
Key Personnel
SELECT SINGLE VERNA FROM TCJ04 "Account Rep name from TCJ04
INTO (ETAB-X_ACTREP) WHERE VERNR = PROJ-ZRESPDIR.
********End of Key Personnel
**Contract Manager
SELECT SINGLE VERNA FROM TCJ04 "Contract Rep name from TCJ04
INTO (ETAB-X_CREP) WHERE VERNR = PROJ-ZCNTREP.
End of Contract Manager
PRPS Table WBS's attached to the Project
SELECT * FROM PRPS WHERE "WBS Elements
PRART IN EXTRTYP "Range of Proj.Types (CO,GV,TC..
AND PSPHI = PROJ-PSPNR.
order by posid stufe. "Sort by WBS & Level (needed?)
get info from level 1 of the WBS
IF PRPS-STUFE EQ 1. "top-level WBS element
HOLD_PRART = PRPS-PRART. "save project type for later
ETAB-X_STAT = '????'. "set ? as the default status
get Status for level 1
SELECT * FROM JEST "use JEST to determine Status
WHERE OBJNR = PRPS-OBJNR
AND INACT EQ SPACE. "space denotes an active status
CASE JEST-STAT. "find the system status (Ixxx)
WHEN 'I0001'.
ETAB-X_STAT = 'CRTD'. "Created
WHEN 'I0002'.
ETAB-X_STAT = 'REL'. "Released
WHEN 'I0045'.
ETAB-X_STAT = 'TECO'. "Technically Complete
WHEN 'I0046'.
ETAB-X_STAT = 'CLSD'. "Closed
ENDCASE.
ENDSELECT.
Select only active projects (ie; those not with TECO or CLSD)
IF OPT2 EQ 'X'
AND ( ETAB-X_STAT EQ 'TECO'
OR ETAB-X_STAT EQ 'CLSD' ).
EXIT.
ENDIF.
*comment Contract Rep and Proj man because we get them from PROJ now
etab-x_crep = prps-zzcont. "Contract Rep.
etab-x_pmgr = prps-verna. "Program Manager Name
ETAB-X_CLNT = PRPS-ZZMANDT. "Client Name
ETAB-X_CGT = PRPS-PRART. "CO, GV, TC, etc
ETAB-X_DISTR = PRPS-ZZVTWEG. "Distrib Channel (ie; GP, etc.)
ETAB-X_CONTR = PRPS-USR04. "Contribution %
ETAB-X_POCN = PRPS-ZZPOCN. "Contract Number
ETAB-X_TYPE = PRPS-ZZORDT. "Order Type Sarnoff
Award and Authorization (Revenue & Cost)
SELECT * FROM BPGE
WHERE OBJNR = PRPS-OBJNR
AND LEDNR = '0001' "Budget / Planning Ledger
AND TRGKZ = 'N' "Object indicator
AND WRTTP = '01' "Value Type
AND ( VERSN = '011' "011 = Award
OR VERSN = '012' "012 = Billing Authorization
OR VERSN = '013' ). "013 = RA Authorization
"010 = Funding Authorization
Award Plan 11
IF BPGE-VERSN = '011'. "Plan 11 = Award
CASE BPGE-VORGA.
WHEN 'KSTP'. "KSTP = Cost level
ETAB-X_AWRD = ETAB-X_AWRD + BPGE-WTGES.
ENDCASE.
ENDIF.
IF prps-stufe eq '2'.
Authorization (Revenue & Cost plan 12) Plan 12
IF BPGE-VERSN = '012'. "Plan 12 = RA Authorization
CASE BPGE-VORGA.
WHEN 'KSTR'. "KSTR = Revenue level
ETAB-X_P12R = ETAB-X_P12R - BPGE-WTGES.
WHEN 'KSTP'. "KSTP = Cost level
ETAB-X_P12C = ETAB-X_P12C + BPGE-WTGES.
ENDCASE.
ENDIF.
Authorization (Revenue & Cost plan 13) Plan 13
IF BPGE-VERSN = '013'. "Plan 13 = RA Authorization
CASE BPGE-VORGA.
WHEN 'KSTR'. "KSTR = Revenue level
ETAB-X_P13R = ETAB-X_P13R - BPGE-WTGES.
WHEN 'KSTP'. "KSTP = Cost level
ETAB-X_P13C = ETAB-X_P13C + BPGE-WTGES.
ENDCASE.
ENDIF.
endif.
ENDSELECT. "BPGE
ENDIF. "end of if prps-stufe eq 1. top-level WBS element
COSP Table (External Postings) Awards
COSP Table (External Postings) Billed Sales
COSP Table (External Postings) DPC's & Legacy Load
SELECT * FROM COSP
WHERE OBJNR = PRPS-OBJNR AND
GJAHR LE YEAR
AND (
( kstar = '0000400999' and "old CE for Award $
( KSTAR BETWEEN '0000400990' AND '0000400999' AND
VERSN = '011' AND "11 = Award
WRTTP = '01' ) "01 = Planned
OR ( ( KSTAR BETWEEN '0000400001' AND '0000400989' OR
KSTAR BETWEEN '0000999001' AND '0000999003' ) AND
WRTTP = '04' ) "04 = Actuals
OR ( ( KSTAR BETWEEN '0000998001' AND '0000998010' OR
KSTAR BETWEEN '0000600001' AND '0000601999' ) AND
WRTTP = '04' ) "04 = Actuals
*------- Awards
if cosp-kstar = '0000400999' and "old 400999 = Awards
IF COSP-KSTAR BETWEEN '0000400990' AND '0000400999' AND
COSP-VERSN = '011' AND "11 = Award
COSP-WRTTP = '01'. "01 = Planned
IF YEAR = COSP-GJAHR.
DO.
IF SY-INDEX LE MONTH.
MOVE SY-INDEX TO HLD_INDX.
MNT_INDX = 'COSP-WKGXXX'.
REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
ASSIGN (MNT_INDX) TO <MNT>.
ETAB-X_AWRD = ETAB-X_AWRD + <MNT>.
ELSE.
EXIT.
ENDIF.
ENDDO.
ELSEIF YEAR > COSP-GJAHR.
ETAB-X_AWRD = ETAB-X_AWRD +
COSP-WKG001 + COSP-WKG002 +
COSP-WKG003 + COSP-WKG004 +
COSP-WKG005 + COSP-WKG006 +
COSP-WKG007 + COSP-WKG008 +
COSP-WKG009 + COSP-WKG010 +
COSP-WKG011 + COSP-WKG012 +
COSP-WKG013 + COSP-WKG014 +
COSP-WKG015 + COSP-WKG016.
ELSE.
EXIT.
ENDIF.
ENDIF.
*------- Billed Sales
IF ( COSP-KSTAR BETWEEN '0000400001' AND '0000400989' OR
COSP-KSTAR BETWEEN '0000999001' AND '0000999003' ) AND
COSP-WRTTP = '04'.
"0000999001 = ITD Sales
"0000999003 = ITD Billed Revenue
IF YEAR = COSP-GJAHR.
DO.
IF SY-INDEX LE MONTH.
MOVE SY-INDEX TO HLD_INDX.
MNT_INDX = 'COSP-WKGXXX'.
REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
ASSIGN (MNT_INDX) TO <MNT>.
ETAB-X_ITDB = ETAB-X_ITDB - <MNT>.
ETAB-X_YTDB = ETAB-X_YTDB - <MNT>.
IF SY-INDEX = MONTH.
ETAB-X_MTHB = ETAB-X_MTHB - <MNT>.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ELSEIF YEAR > COSP-GJAHR.
ETAB-X_ITDB = ETAB-X_ITDB -
COSP-WKG001 - COSP-WKG002 -
COSP-WKG003 - COSP-WKG004 -
COSP-WKG005 - COSP-WKG006 -
COSP-WKG007 - COSP-WKG008 -
COSP-WKG009 - COSP-WKG010 -
COSP-WKG011 - COSP-WKG012 -
COSP-WKG013 - COSP-WKG014 -
COSP-WKG015 - COSP-WKG016.
ELSE.
EXIT.
ENDIF.
ENDIF.
*------- DPC's & Legacy Load
IF ( COSP-KSTAR BETWEEN '0000998001' AND '0000998010' OR
COSP-KSTAR BETWEEN '0000600001' AND '0000601999' ) AND
COSP-WRTTP = '04'.
IF YEAR = COSP-GJAHR.
DO.
IF SY-INDEX LE MONTH.
MOVE SY-INDEX TO HLD_INDX.
MNT_INDX = 'COSP-WKGXXX'.
REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
ASSIGN (MNT_INDX) TO <MNT>.
ETAB-X_ITDC = ETAB-X_ITDC + <MNT>.
ETAB-X_YTDC = ETAB-X_YTDC + <MNT>.
IF SY-INDEX = MONTH.
ETAB-X_MTHC = ETAB-X_MTHC + <MNT>.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ELSEIF YEAR > COSP-GJAHR.
ETAB-X_ITDC = ETAB-X_ITDC +
COSP-WKG001 + COSP-WKG002 +
COSP-WKG003 + COSP-WKG004 +
COSP-WKG005 + COSP-WKG006 +
COSP-WKG007 + COSP-WKG008 +
COSP-WKG009 + COSP-WKG010 +
COSP-WKG011 + COSP-WKG012 +
COSP-WKG013 + COSP-WKG014 +
COSP-WKG015 + COSP-WKG016.
ELSE.
EXIT.
ENDIF.
ENDIF.
ENDSELECT.
COOI Table (Commitments) commitments for the WBS elements
SELECT * FROM COOI
WHERE OBJNR = PRPS-OBJNR.
ETAB-X_COMM = ETAB-X_COMM + COOI-WTGBTR.
ENDSELECT.
COSS Table (External Postings) G&A on Commitments
COSS Table (External Postings) Shared Billed Sales
COSS Table (External Postings) Shared DPC's
COSS Table (External Postings) Salary,ESE,OH, & G&A
SELECT * FROM COSS
WHERE
( OBJNR = PRPS-OBJNR AND
WRTTP = '22' ) "G&A on Commitments
OR
( OBJNR = PRPS-OBJNR AND
GJAHR LE YEAR AND
WRTTP = '04' AND "04 = Actuals
( "Shared Billed Sales
( KSTAR BETWEEN '0000400001' AND '0000400989' OR
KSTAR BETWEEN '0000999001' AND '0000999003' )
OR "Shared DPC's
( KSTAR BETWEEN '0000600001' AND '0000601999' )
OR "Salary,ESE,OH, & G&A
( ( KSTAR BETWEEN '0000001000' AND '0000001999' OR
KSTAR BETWEEN '0000002100' AND '0000002199' OR
KSTAR BETWEEN '0000002500' AND '0000002599' OR
KSTAR BETWEEN '0000002800' AND '0000002899' ) )
and parob not like 'PR%' ) "commented out on 4/19/2000
*------- G&A on Commitments (NOTE: data is always as of the RUN date)
IF COSS-WRTTP = '22'.
ETAB-X_COMM = ETAB-X_COMM +
COSS-WKG001 + COSS-WKG002 +
COSS-WKG003 + COSS-WKG004 +
COSS-WKG005 + COSS-WKG006 +
COSS-WKG007 + COSS-WKG008 +
COSS-WKG009 + COSS-WKG010 +
COSS-WKG011 + COSS-WKG012 +
COSS-WKG013 + COSS-WKG014 +
COSS-WKG015 + COSS-WKG016.
ENDIF.
*------- Shared Billed Sales
IF ( COSS-KSTAR BETWEEN '0000400001' AND '0000400989' OR
COSS-KSTAR BETWEEN '0000999001' AND '0000999003' ) AND
COSS-WRTTP = '04'.
IF YEAR = COSS-GJAHR.
DO.
IF SY-INDEX LE MONTH.
MOVE SY-INDEX TO HLD_INDX.
MNT_INDX = 'COSS-WKGXXX'.
REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
ASSIGN (MNT_INDX) TO <MNT>.
ETAB-X_ITDB = ETAB-X_ITDB - <MNT>.
ETAB-X_YTDB = ETAB-X_YTDB - <MNT>.
IF SY-INDEX = MONTH.
ETAB-X_MTHB = ETAB-X_MTHB - <MNT>.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ELSEIF YEAR > COSS-GJAHR.
ETAB-X_ITDB = ETAB-X_ITDB -
COSS-WKG001 - COSS-WKG002 -
COSS-WKG003 - COSS-WKG004 -
COSS-WKG005 - COSS-WKG006 -
COSS-WKG007 - COSS-WKG008 -
COSS-WKG009 - COSS-WKG010 -
COSS-WKG011 - COSS-WKG012 -
COSS-WKG013 - COSS-WKG014 -
COSS-WKG015 - COSS-WKG016.
ELSE.
EXIT.
ENDIF.
ENDIF.
*------- Shared DPC's
IF COSS-KSTAR BETWEEN '0000600001' AND '0000601999' AND
COSS-WRTTP = '04'.
IF YEAR = COSS-GJAHR.
DO.
IF SY-INDEX LE MONTH.
MOVE SY-INDEX TO HLD_INDX.
MNT_INDX = 'COSS-WKGXXX'.
REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
ASSIGN (MNT_INDX) TO <MNT>.
ETAB-X_ITDC = ETAB-X_ITDC + <MNT>.
ETAB-X_YTDC = ETAB-X_YTDC + <MNT>.
IF SY-INDEX = MONTH.
ETAB-X_MTHC = ETAB-X_MTHC + <MNT>.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ELSEIF YEAR > COSS-GJAHR.
ETAB-X_ITDC = ETAB-X_ITDC +
COSS-WKG001 + COSS-WKG002 +
COSS-WKG003 + COSS-WKG004 +
COSS-WKG005 + COSS-WKG006 +
COSS-WKG007 + COSS-WKG008 +
COSS-WKG009 + COSS-WKG010 +
COSS-WKG011 + COSS-WKG012 +
COSS-WKG013 + COSS-WKG014 +
COSS-WKG015 + COSS-WKG016.
ELSE.
EXIT.
ENDIF.
ENDIF.
*------- Salary,ESE,OH,& G&A
IF ( COSS-KSTAR BETWEEN '0000001000' AND '0000001999' OR
COSS-KSTAR BETWEEN '0000002100' AND '0000002199' OR
COSS-KSTAR BETWEEN '0000002500' AND '0000002599' OR
COSS-KSTAR BETWEEN '0000002800' AND '0000002899' ) AND
COSS-WRTTP = '04'.
IF YEAR = COSS-GJAHR.
DO.
IF SY-INDEX LE MONTH.
MOVE SY-INDEX TO HLD_INDX.
MNT_INDX = 'COSS-WKGXXX'.
REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
ASSIGN (MNT_INDX) TO <MNT>.
ETAB-X_ITDC = ETAB-X_ITDC + <MNT>.
ETAB-X_YTDC = ETAB-X_YTDC + <MNT>.
IF SY-INDEX = MONTH.
ETAB-X_MTHC = ETAB-X_MTHC + <MNT>.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ELSEIF YEAR > COSS-GJAHR.
ETAB-X_ITDC = ETAB-X_ITDC +
COSS-WKG001 + COSS-WKG002 +
COSS-WKG003 + COSS-WKG004 +
COSS-WKG005 + COSS-WKG006 +
COSS-WKG007 + COSS-WKG008 +
COSS-WKG009 + COSS-WKG010 +
COSS-WKG011 + COSS-WKG012 +
COSS-WKG013 + COSS-WKG014 +
COSS-WKG015 + COSS-WKG016.
ELSE.
EXIT.
ENDIF.
ENDIF.
ENDSELECT.
COSB Table (Results from running RA) Unbilled Sales
SELECT * FROM COSB
WHERE OBJNR = PRPS-OBJNR
AND KSTAR BETWEEN '0000003004' AND '0000003005'
"0000003004 = Unbilled Revenue
"0000003005 = Unearned Revenue
AND GJAHR LE YEAR
AND WRTTP = '32'. "32 = Results Analysis
IF YEAR = COSB-GJAHR.
DO.
IF SY-INDEX LE MONTH.
MOVE SY-INDEX TO HLD_INDX.
MNT_INDX = 'COSB-WKGXXX'.
REPLACE 'XXX' WITH HLD_INDX INTO MNT_INDX.
ASSIGN (MNT_INDX) TO <MNT>.
ETAB-X_ITDS = ETAB-X_ITDS - <MNT>.
ETAB-X_YTDS = ETAB-X_YTDS - <MNT>.
IF SY-INDEX = MONTH.
ETAB-X_MTHS = ETAB-X_MTHS - <MNT>.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ELSEIF YEAR > COSB-GJAHR.
ETAB-X_ITDS = ETAB-X_ITDS -
COSB-WKG001 - COSB-WKG002 -
COSB-WKG003 - COSB-WKG004 -
COSB-WKG005 - COSB-WKG006 -
COSB-WKG007 - COSB-WKG008 -
COSB-WKG009 - COSB-WKG010 -
COSB-WKG011 - COSB-WKG012 -
COSB-WKG013 - COSB-WKG014 -
COSB-WKG015 - COSB-WKG016.
ELSE.
EXIT.
ENDIF.
ENDSELECT.
ENDSELECT. "End of WBS records (from PRPS) for project
Get Total Sales by adding Billed Sales to Unbilled Sales.
ETAB-X_ITDS = ETAB-X_ITDS + ETAB-X_ITDB.
ETAB-X_YTDS = ETAB-X_YTDS + ETAB-X_YTDB.
ETAB-X_MTHS = ETAB-X_MTHS + ETAB-X_MTHB.
IF HOLD_PRART IN EXTRTYP. "Matches the user requested project type
IF OPT1 EQ 'X' OR "All projects
( OPT2 EQ 'X' AND "Only active projects
ETAB-X_STAT NE 'TECO' AND
ETAB-X_STAT NE 'CLSD' ).
TOTAL_AWARD = TOTAL_AWARD + ETAB-X_AWRD.
TOTAL_AUTHR12 = TOTAL_AUTHR12 + ETAB-X_P12R .
TOTAL_AUTHC12 = TOTAL_AUTHC12 + ETAB-X_P12C.
TOTAL_AUTHR13 = TOTAL_AUTHR13 + ETAB-X_P13R.
TOTAL_AUTHC13 = TOTAL_AUTHC13 + ETAB-X_P13C.
TOTAL_ITDSALES = TOTAL_ITDSALES + ETAB-X_ITDS.
TOTAL_ITDCOSTS = TOTAL_ITDCOSTS + ETAB-X_ITDC.
TOTAL_YTDSALES = TOTAL_YTDSALES + ETAB-X_YTDS.
TOTAL_YTDCOSTS = TOTAL_YTDCOSTS + ETAB-X_YTDC.
TOTAL_MTHSALES = TOTAL_MTHSALES + ETAB-X_MTHS.
TOTAL_MTHCOSTS = TOTAL_MTHCOSTS + ETAB-X_MTHC.
TOTAL_ITDBILLED = TOTAL_ITDBILLED + ETAB-X_ITDB.
TOTAL_YTDBILLED = TOTAL_YTDBILLED + ETAB-X_YTDB.
TOTAL_MTHBILLED = TOTAL_MTHBILLED + ETAB-X_MTHB.
TOTAL_COMMITMENT = TOTAL_COMMITMENT + ETAB-X_COMM.
PERFORM SHIFT_SIGN.
APPEND ETAB. "Write data to internal table
CLEAR ETAB.
COUNT_PROJECTS = COUNT_PROJECTS + 1. "Count # of Projects
ENDIF.
ENDIF.
ENDSELECT.
ENDSELECT. "End of Projects from PROJ table
PERFORM GRAND_TOTALS.
SORT ETAB BY X_BU X_PROJ.
ETAB-X_BU = 'BU'.
ETAB-X_CNTR = 'PrftCntr'.
ETAB-X_PROJ = 'Proj'.
ETAB-X_CREP = 'Contract Mgr'.
ETAB-X_BDREP = 'Account Mgr'.
ETAB-X_GRPH = 'Technical Lead'.
ETAB-X_ACTREP = 'Key Person1'.
ETAB-X_PMGR = 'Program Mgr'.
ETAB-X_TTLE = 'Title'.
ETAB-X_CLNT = 'Client'.
ETAB-X_POCN = 'Contract #'.
ETAB-X_TYPE = 'Type'.
ETAB-X_OPEN = 'Open'.
ETAB-X_CLOSE = 'Close'.
ETAB-X_CGT = 'CGT'.
ETAB-X_DISTR = 'DC'.
ETAB-X_CONTR = 'Contr%'.
ETAB-X_AWRD = 'Award'.
ETAB-X_P12R = 'Auth12 Sales'.
ETAB-X_P12C = 'Auth12 Cost'.
ETAB-X_P13R = 'Auth13 Sales'.
ETAB-X_P13C = 'Auth13 Cost'.
ETAB-X_ITDS = 'ITD Sales'.
ETAB-X_ITDC = 'ITD Costs'.
ETAB-X_YTDS = 'YTD Sales'.
ETAB-X_YTDC = 'YTD Costs'.
ETAB-X_MTHS = 'Mth Sales'.
ETAB-X_MTHC = 'Mth Costs'.
ETAB-X_ITDB = 'ITD Billed'.
ETAB-X_YTDB = 'YTD Billed'.
ETAB-X_MTHB = 'Mth Billed'.
ETAB-X_COMM = 'Commitments'.
ETAB-X_STAT = 'Status'.
INSERT ETAB INDEX 1. "Write a report header line to internal table
CLEAR ETAB.
CALL FUNCTION 'Z_RH_START_EXCEL_DATA_OLE'
EXPORTING
data_name = 'C:\WINNT\Profiles\cbraswell\Desktop\TestTemp.xlt'
DATA_NAME = 'ZSales.XLS'
DATA_PATH_FLAG = 'W'
DATA_TYPE = 'DAT'
DATA_BIN_FILE_SIZE = 'ZSales'
CHART_TITLE = 'ZSales'
CHART_TYPE = 2
CATEGORY_TITLE = 'ZSales'
VALUE_TITLE = 'ZSales'
DATA_XTOP_COR = 0
DATA_YTOP_COR = 0
DATA_XBOT_COR = 0
DATA_YBOT_COR = 0
CATEGORY_XTOP_COR = 0
CATEGORY_YTOP_COR = 0
CATEGORY_XBOT_COR = 0
CATEGORY_YBOT_COR = 0
TABLES
DATA_TAB = ETAB
EXCEPTIONS
NO_BATCH = 1
DOWNLOAD_ERROR = 2
INVALID_TYPE = 3
INTERNAL_ERROR = 4
NO_OLE_SUPPORT = 5
OLE_FILE_ERROR = 6
OLE_ERROR = 7
NO_DATA = 8
COORDINATE_ERROR = 9
OTHERS = 10.
Negative # sign in the front of number for downloading to Excel
FORM SHIFT_SIGN.
IF ETAB-X_AWRD CA '-'. SHIFT ETAB-X_AWRD RIGHT CIRCULAR. ENDIF.
IF ETAB-X_P12R CA '-'. SHIFT ETAB-X_P12R RIGHT CIRCULAR. ENDIF.
IF ETAB-X_P12C CA '-'. SHIFT ETAB-X_P12C RIGHT CIRCULAR. ENDIF.
IF ETAB-X_P13R CA '-'. SHIFT ETAB-X_P13R RIGHT CIRCULAR. ENDIF.
IF ETAB-X_P13C CA '-'. SHIFT ETAB-X_P13C RIGHT CIRCULAR. ENDIF.
IF ETAB-X_ITDS CA '-'. SHIFT ETAB-X_ITDS RIGHT CIRCULAR. ENDIF.
IF ETAB-X_ITDIC CA '-'. SHIFT ETAB-X_ITDIC RIGHT CIRCULAR. ENDIF.
IF ETAB-X_ITDC CA '-'. SHIFT ETAB-X_ITDC RIGHT CIRCULAR. ENDIF.
IF ETAB-X_YTDS CA '-'. SHIFT ETAB-X_YTDS RIGHT CIRCULAR. ENDIF.
IF ETAB-X_YTDC CA '-'. SHIFT ETAB-X_YTDC RIGHT CIRCULAR. ENDIF.
IF ETAB-X_YTDIC CA '-'. SHIFT ETAB-X_YTDIC RIGHT CIRCULAR. ENDIF.
IF ETAB-X_MTHS CA '-'. SHIFT ETAB-X_MTHS RIGHT CIRCULAR. ENDIF.
IF ETAB-X_MTHC CA '-'. SHIFT ETAB-X_MTHC RIGHT CIRCULAR. ENDIF.
IF ETAB-X_MTHIC CA '-'. SHIFT ETAB-X_MTHIC RIGHT CIRCULAR. ENDIF.
IF ETAB-X_ITDB CA '-'. SHIFT ETAB-X_ITDB RIGHT CIRCULAR. ENDIF.
IF ETAB-X_YTDB CA '-'. SHIFT ETAB-X_YTDB RIGHT CIRCULAR. ENDIF.
IF ETAB-X_MTHB CA '-'. SHIFT ETAB-X_MTHB RIGHT CIRCULAR. ENDIF.
IF ETAB-X_COMM CA '-'. SHIFT ETAB-X_COMM RIGHT CIRCULAR. ENDIF.
ENDFORM.
FORM GRAND_TOTALS.
SKIP 1. .
WRITE: / '----
WRITE: / 'System ID = ', SY-SYSID,
/ 'Client = ', SY-MANDT,
/ 'User = ', SY-UNAME,
/ 'Date of data extract = ', SY-DATUM ,
/ 'Number of Projects = ', COUNT_PROJECTS,
/ 'total Award (Plan 11) = ', TOTAL_AWARD,
/ 'total Auth SalesHi all,
Iam really waiting for someone to see and get the logic right for this code.Iam completely stuck up. i need ur help
Thanks
Maybe you are looking for
-
First of all I best say that I am new to Logic Express and Garageband, in fact the Mac thing so forgive the basic nature of this post. I have had some funny goings on with my mac since a failed software install so I decided to rebuild everything incl
-
Slow attachment upload with Exchange Web Services (Outlook 2011 for Mac?)
We're experiencing slow attachment upload with Exchange Web Services versus MAPI, OWA, and Outlook Anywhere. I'm not totally certain that it is Exchange Web Services or specifically Outlook 2011 for Mac. I attempted to test with the Mac Mail App, b
-
Dateformat 1000*60*60*24
Good Day: As far as I know the date calculation in other languages, it should be 60*60*24 but what I got from a Java code is 1000*60*60*24. Anyone can tell me where is the 1000 come from? if to be precise: d.setTime((1000*60*60*24) + d.getTime()); wh
-
Hi there. I have a rtf file in which I am inserting string using Java: FileInputStream fis= new FileInputStream(exampleFile); RTFEditorKit rtf = new RTFEditorKit(); Document doc = rtf.createDefaultDocument(); rtf.read(fis, doc, 0); doc.insertString(5
-
PMS color in a vector smart object
How do I retain a spot color in a vector smart object placed in Photoshop. Once the SO is updated within the PS file, the separations palette does not reflect the change, and the spot color is no longer there.