How To Declare SimpleDateFormat!
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class Grid extends JFrame /*implements ActionListener*/
private JPanel date_panel,year_panel, month_panel,day_panel;
private String time=new String("");
private Date date=new Date();
Hey !
i am getting an error massege"cannot resolve the symbol'simpleDateFormat' ".
i think i have to declare it first ,i tried but could not come up with a solution.
please somebody help me!thanks
public Grid() {
time=time + new Date().toString();
/*//time=java.text.SimpleDateFormat ;
// Format the current time.
SimpleDateFormat formatter
= new SimpleDateFormat ("MM/dd/yy");
// Date time = new Date();
// String dateString = formatter.format(time);*/
SimpleDateFormat formatter = new SimpleDateFormat("E, MMMM d, yyyy") ;
time = formatter.format(date) ;
date_panel.add(new JLabel(time)) ;
year_panel=new JPanel();
month_panel=new JPanel();
day_panel=new JPanel();
date_panel.setLayout(new FlowLayout());
date_panel.add(new JLabel(time));
Container contentPane = getContentPane();
contentPane.setLayout(new GridLayout(1,4));
contentPane.add(date_panel);
public static void main(String args[]) {
Grid gw = new Grid();
gw.setTitle("Date Slider");
gw.setSize(400,200);
gw.setVisible(true);
}
you have to add
import java.text.SimpleDateFormat;
to your code, for javac to find the definition of java.text.SimpleDateFormat.
If you have any further questions don't hesitate to ask.
Similar Messages
-
How to declare a list of dates
Hi,
I have an item which type is "Display as text based on LOV". I put in the source section under the type "Pl/SQL function body" the following pl/sql function :
DECLARE
X VARCHAR2 (4000);
Y DATE ;
BEGIN
X := 'SELECT distinct(TO_CHAR(DATE1, ''YYYY'')) d, (TO_CHAR(DATE1, ''YYYY'')) r FROM SIVOA.EVV_'|| :p4_site ||' WHERE CLEF_VAR = (SELECT CLEF_VAR FROM SIVOA.SITE_DEBIT_RIVIERE WHERE SITE ='''|| :p4_site ||''')
order by d';
EXECUTE IMMEDIATE X INTO Y;
RETURN Y ;
END;The problem is that I get an ORA error.
ORA-00932: types de données incohérents ; attendu : - ; obtenu : -
I know that I have declared Y as a date and that what is returned by my function is a list of dates. I don't know how to declare a list of dates or whatever to be returned as a lis of values. Hope I am clear, sorry for my english.
Thank you for your kind help.
ChristianHi Tony
You hare very patient with me thank you !!!
Let me clarify well.
I am trying to create a list of values based on dates contained in a table. This list of values should contains the "years". If the table contains data for the years 2005, 2006, 2007, then the list of value should return :
2006
2007
2008
As I want a list of value I need to have a display and a return value. The name of the table is 'dynamic' It is the item P4_SITE that contains a part of the name of the table. This is why I am usins PL/SQL, because I don't know the name of the table in advance.
I have not seen any way to put a pl/sql statement in the List of values definition of the item. Thi s is why I try to make a LOV with the SOURCE of the item.
Hope I am clear. -
How to declare top of page in alv report
hi guru
how to declare top of page in alv report
thanks
subhasisHi,
check this simple program.
REPORT ZBHALV_LIST.
TABLES:MARA.
SELECT-OPTIONS: MATNR FOR MARA-MATNR.
DATA:BEGIN OF ITAB OCCURS 0,
MATNR LIKE MARA-MATNR,
ERSDA LIKE MARA-ERSDA,
MTART LIKE MARA-MTART,
MBRSH LIKE MARA-MBRSH,
END OF ITAB.
SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR
IN MATNR.
TYPE-POOLS SLIS.
DATA:FCAT TYPE slis_t_fieldcat_alv.
DATA:LAYOUT TYPE slis_layout_alv.
DATA:EVE TYPE slis_t_event WITH HEADER LINE.
DATA:HEAD TYPE slis_t_listheader WITH HEADER LINE.
DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
SORT-UP = 'X'.
SORT-SPOS = 1.
SORT-FIELDNAME = 'ERSDA'.
SORT-tabname = 'MARA'.
APPEND SORT.
SORT-SPOS = 2.
SORT-FIELDNAME = 'MTART'.
SORT-tabname = 'MARA'.
APPEND SORT.
EVE-NAME = 'TOP_OF_PAGE'.
EVE-FORM = 'TOPOFPAGE'.
APPEND EVE.
EVE-NAME = 'TOP_OF_LIST'.
EVE-FORM = 'TOPOFLIST'.
APPEND EVE.
EVE-NAME = 'END_OF_LIST'.
EVE-FORM = 'ENDOFLIST'.
APPEND EVE.
LAYOUT-ZEBRA = 'X'.
LAYOUT-no_hline = 'X'.
LAYOUT-NO_VLINE = 'X'.
LAYOUT-window_titlebar = 'MATERIAL DETAILS'.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'ITAB'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = FCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_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.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT
IT_SORT = SORT[]
IT_EVENTS = EVE[]
TABLES
T_OUTTAB = ITAB .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM TOPOFPAGE.
REFRESH HEAD.
HEAD-TYP = 'H'.
HEAD-INFO = 'MATERIALS'.
APPEND HEAD.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEAD[]
I_LOGO =
I_END_OF_LIST_GRID =
ENDFORM.
FORM TOPOFLIST.
REFRESH HEAD.
HEAD-TYP = 'H'.
HEAD-INFO = 'MATERIALS-LISTTOP'.
APPEND HEAD.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEAD[]
I_LOGO =
I_END_OF_LIST_GRID =
ENDFORM.
FORM ENDOFLIST.
REFRESH HEAD.
HEAD-TYP = 'H'.
HEAD-INFO = 'MATERIALS-LISTEND'.
APPEND HEAD.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEAD[]
I_LOGO =
I_END_OF_LIST_GRID =
ENDFORM.
Regards,
Priyanka. -
How to declare variables in standard text - so10 t.code
Hello Friends,
How to declare variables in standard text - so10 t.code? Your response will be appreciated much.
Thanks
SriFor Script & Smartform Text - &VAR&
-
How to declare value binding to array list element in a pojo?
I have a POJO called P, that contains an ArrayList member called w.
class P {
private ArrayList w = new ArrayList(5);
w is initied in the class constructor.
The POJO is in the SessionBean and I would like to reference individual
elements in the ArrayList via a value binding like so;
#{SessionBean1.instanceOfP.w[5]}
I'm not sure how to declare the getter/setter for member W in POJO P
so that setter and getter injection work.You may not be able to directly set the indexed value.
Try some thing like this.
Add a property that returns the indexed value.
Ex. if you ArrayList objets are of type "String"
int index = 5;
public String getMyValue(){
return w.get[index]
Now your value binding would look something like
#{SessionBean1.myValue}
BTW, if you want to access different index, create another method
public void setIndex(int index){
this.index = index;
- Winston
http://blogs.sun.com/roller/page/winston?catname=Creator -
How to declare Dynamic table in Tables Parameters of a Function Module...
Hi Gurus,
I would like to Know how to declare a Dynamic table in Tables parameters of a Function Module.
so that it should be able to hold any table data ....
I have tried all possible ways of trying to assign fields-symbol like declarations which doesnt allow here ...
plz Dont reply with the basics of creating dynamic internal tables, coz my case is not an Internal table it is FM table parameter declaration.....Hi,
If you are requirement is to create a function module with tables parameter having a generic line type i.e. no specific line type
just declare it with a name under Parameter name with out specifying the type.
A reference function module with such parameter, i would quote is the standard GUI_UPLOAD/ GUI_DOWNLOAD where the parameters specified under TABLES are generic.
If you want to process the values passed to these parameters in the source code of function module, field symbols would be a preferable option.
Regards,
Sharath Panuganti -
HR abap : how to declare internal table to fetch data from 0585 infotype
Hi all ,
I am able to fetch the data from pa0585 infotype for set of employee no , but the problem is as the fields in pa0585 (like Contr to ULIP , NSC , Medical Treatment,Contribution to Certain Pension Funds so on ..) will be changed dynamically and will be displayed based on the amount value in descending order iam not able to store the values of the fileds into internal table . I dont understand how to declare the internal table ..Please help in if u have solved this kind of problem.
I shld get the output in this way ...
Emp No Name Medical treatment Contr to ULIP ....... so on
101 abc 10000 150000 .......so on
102 xyz 12000 150000 .......so on
My header shld be fixed and I shld display values in this way .... I can use write statement to display directly .
Thanks ....Hi
Decalre INFOTYPE
Goto SE37 - Find FM -
READINFOTYPE* -
How to declare internal table in BADI with variable name beginning with 0..
Gurus,
How to declare an internal table within a BADI. I have to implement a BADI UC_TASK_CUSTOM for BCS to BW load and there i have to declare an internal table like:
TYPES: BEGIN OF t_cube_data,
0cs_version TYPE /bi0/oics_version,
0sem_cgcomp TYPE /bi0/oisem_cgcomp,
bcs_vers TYPE /bic/oibcs_vers,
bcs_lcus TYPE /bic/oibcs_lcus,
bcs_ldch TYPE /bic/oibcs_ldch,
bcs_invcom TYPE /bi0/oibcs_invcom,
bcs_litem TYPE /bic/oibcs_litem,
bcs_llob TYPE /bic/oibcs_llob,
bcs_lmay TYPE /bic/oibcs_lmay,
0move_type TYPE /bi0/oimove_type,
pcompany TYPE /bi0/oipcompany,
bcs_lprg TYPE /bic/oibcs_lprg,
figlxref3 TYPE /bic/oifiglxref3,
fiscyear TYPE /bi0/oifiscyear,
fiscper3 TYPE /bi0/oifiscper3,
fiscvarnt TYPE /bi0/oifiscvarnt,
curkey_gc TYPE /bi0/oicurkey_gc,
unit TYPE /bi0/oiunit,
cs_trn_gc TYPE /bi0/oics_trn_gc,
cs_trn_qty TYPE /bi0/oics_trn_qty,
END OF t_cube_data
But with this declaration it gives a error saying that u cannot have a variable beginning with 0...like 0cs_version....
but i have to do it for my functionality to wrk...
Please help me do it....
how can i declare a internal table that allows me to have variable names that start with 0....
Please help....Its URGENT....
Thanks
SamMurali,
I need to have 0 before the variable name in the declaration of the internal table....how can i attain that....
Please suggest...
Thanks
Sam -
How to declare in anonymous block
Declare
CURSOR c_je2acct_othr
IS
SELECT j.jemq_num, j.ml_retail_account,
-- (CASE WHEN j.exer_type = 4 THEN j.sar_shares ELSE j.shares END) shares, -- removed * -1 from sar_shares Manu 12/02/04
/* Commented 02/01/07*/
(CASE WHEN j.exer_type = 4 THEN
fn_get_shares(u.user_id,u.exer_num,u.soc_sec,j.
sar_shares)
ELSE (case when u.exer_type=2 and u.opts_exer!=u.shrs_sold and j.shares=u.shrs_sold then 0 else j.shares end)
END) shares,
-- removed * -1 from sar_shares Manu 12/02/04
j.name_first,
j.name_last, j.exer_type, j.ml_sec_num, j.ivr_plan_num,
j.exer_dt, j.grant_dt, j.user_id, j.mlu_rowid, j.settle_dt,
j.exer_num, j.plan_type, j.grant_num, j.acct_num_othr,
j.add_cancel,
/* (CASE WHEN j.exer_type = 4 THEN j.sar_cash_amount * -1 -- turned negative Manu 12/02/04 ml_retail distr
commented the above line for calculation of proceeds into other account for sar sale.
(CASE WHEN j.exer_type = 4 THEN
Pk_Xop_Citibank_Forex.fn_get_netamount(u.user_id,u.
exer_num,u.soc_sec,
u.sar_cash_amount,NVL(u.comm_value, 0),
NVL(u.tot_fee, 0),
NVL(u.multi_curr_handling_fee, 0))
-- Removed the negative as on ml_exer_upload all values are +ve.
ELSE
( (DECODE(u.exer_type,0,u.opts_exer * u.mkt_prc,u.shrs_sold * u.mkt_prc
- ( ROUND((u.opts_exer * NVL (u.opt_prc, 0)),2)
-- SPIF 39060 Added a Round of condition.
+ DECODE (NVL (u.shrs_wthld_for_taxes, 'N'),
'Y', 0,
ROUND (u.tot_tax, 2)
+ u.tot_fee
+ NVL(u.multi_curr_handling_fee,0)
+ u.comm_value
- u.backup_withholding
END ) AS gl_amt,
T.je_othr_mlacct_jemsg AS vc_trailer_desc,
u.opts_exer ,
u.shrs_sold,
u.rsu_type
FROM TB_XOP_JEMQ j, TB_ML_EXER_UPLOAD u, TB_FC_COMPY T
WHERE j.q_flag = 'N' AND u.je_flag = 'Y'
AND j.entry_dttime >= TRUNC (SYSDATE)
AND j.entry_dttime < TRUNC (SYSDATE) +1
AND j.source = 'X'
AND j.acct_num_othr != ' '
and (case when u.exer_type=2 and u.opts_exer!=u.shrs_sold then (case when j.shares=u.shrs_sold then 0 else 1 end) else 1 end)=1 FIx for PCTUP00566081
AND ( disp_flag <> 'D' OR disp_flag IS NULL ) Added by MARAN ARUNACHALAM on 01/25/2011 for PCTUP00493542 Fix
and j.current_status = '2Q' removed not required now in new plan
AND NOT EXISTS (
SELECT 1
FROM TB_XOP_JEMQ j2
WHERE j2.prev_jemq = j.jemq_num
AND source = 'T'
AND j.add_cancel = j2.add_cancel
AND j.user_id = j2.user_id
AND j.exer_num = j2.exer_num)
AND j.mlu_rowid = u.ROWID
AND 'CMS'||T.compy_acronym||'_USER' = j.user_id
ORDER BY add_cancel DESC;
v_mlac_mesg VARCHAR2(1000);
-- JE_OTHR_MLACCT_JEMSG
BEGIN
dbms_output.put_line('success');
FOR v_je2acct_othr IN c_je2acct_othr
LOOP
dbms_output.put_line('success1');
BEGIN
dbms_output.put_line('success2');
IF v_je2acct_othr.add_cancel = 'C'
THEN
dbms_output.put_line('success3');
UPDATE TB_XOP_JEMQ
SET add_cancel = DECODE(current_status,
'RJ',
add_cancel,
'C'),
q_flag = DECODE(current_status, 'RJ', q_flag, 'N'),
activ_dt = DECODE(current_status,
'RJ',
activ_dt,
SYSDATE)
WHERE prev_jemq = v_je2acct_othr.jemq_num
AND user_id = v_je2acct_othr.user_id
AND exer_num = v_je2acct_othr.exer_num
AND source ='T';
dbms_output.put_line('success4');
ELSIF v_je2acct_othr.add_cancel = 'A'
THEN
dbms_output.put_line('success5');
-- manipulating amount and shares to transfer when different exercise types
v_je2acct_othr.gl_amt :=( CASE
WHEN v_je2acct_othr.exer_type = 0 THEN 0
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer
!= v_je2acct_othr.shrs_sold
THEN v_je2acct_othr.gl_amt
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer =
v_je2acct_othr.shrs_sold
THEN v_je2acct_othr.gl_amt
ELSE v_je2acct_othr.gl_amt
END );
---- Commented on 11/01/2006 For Fixing 30585
/* v_je2acct_othr.shares :=( CASE
WHEN v_je2acct_othr.exer_type = 0 THEN v_je2acct_othr.opts_exer
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold
THEN v_je2acct_othr.opts_exer - v_je2acct_othr.shrs_sold
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold
THEN 0
ELSE v_je2acct_othr.shares
END );*/
---- Commented on 11/01/2006 For Fixing 30585
v_je2acct_othr.shares :=( CASE
WHEN v_je2acct_othr.exer_type = 0 THEN v_je2acct_othr.
Shares
--- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer
!= v_je2acct_othr.shrs_sold and v_je2acct_othr.shares!=0 and v_je2acct_othr.plan_type <> 0 -- Added plantype condition for CQ:PCTUP00493542
THEN v_je2acct_othr.Shares - v_je2acct_othr.shrs_sold
--- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer =
v_je2acct_othr.shrs_sold
THEN 0
ELSE v_je2acct_othr.shares
END );
dbms_output.put_line('success6');
IF LENGTH(TRIM(v_je2acct_othr.acct_num_othr))=8 OR TRIM(v_je2acct_othr.acct_num_othr) IS NULL
THEN
v_mlac_mesg :=NULL;
ELSE
v_mlac_mesg :='Check the ml a/c length';
dbms_output.put_line('success7');
END IF;
INSERT INTO TB_XOP_JEMQ
(jemq_num,
prev_jemq,
ml_retail_account,
wcma_shares,
shares, wcma_taxes, tax_amt,
wcma_reimburse,
reimburse_amt,
name_first,
name_last, exer_type,
ml_sec_num, wcma_bulking, bulking_amt,
ivr_plan_num,
exer_dt, grant_dt,
user_id, source,
mlu_rowid, settle_dt,
exer_num, plan_type,
grant_num,
vc_trailer_desc, rsu_type
VALUES (Pk_Xop_Get_Jemqnum.fn_xop_get_jemqnum,
v_je2acct_othr.jemq_num,
v_je2acct_othr.acct_num_othr,
-- 2nd ml_retail_account,
v_je2acct_othr.ml_retail_account,
-- move shares from old acct to 2nd acct above
v_je2acct_othr.shares,
--this is SHARES
--wcma_taxes
0,
--tax_amt,
v_je2acct_othr.ml_retail_account,
-- move gl_amt from old acct to 2nd acct above
v_je2acct_othr.gl_amt * -1,
v_je2acct_othr.name_first,
v_je2acct_othr.name_last, v_je2acct_othr.
exer_type,
v_je2acct_othr.ml_sec_num, ' ',
--wcma_bulking,
0,
--bulking_amt,
v_je2acct_othr.ivr_plan_num,
v_je2acct_othr.exer_dt, v_je2acct_othr.
grant_dt,
v_je2acct_othr.user_id, 'T',
--source
v_je2acct_othr.mlu_rowid, v_je2acct_othr.
settle_dt,
v_je2acct_othr.exer_num, v_je2acct_othr.
plan_type,
v_je2acct_othr.grant_num,
v_je2acct_othr.vc_trailer_desc,
v_je2acct_othr.
rsu_type
dbms_output.put_line('success8');
END IF;
EXCEPTION
WHEN OTHERS
THEN
Pr_Xop_Log_Errors ( 'Code :'
|| NVL(v_mlac_mesg,SQLERRM)
|| ' at '
|| USER
|| 'at sub exec block in pop_je2acct_othr'
END;
dbms_output.put_line('success9'); -- end of begin within loop
END LOOP;
--COMMIT;
EXCEPTION
WHEN OTHERS
THEN
Pr_Xop_Log_Errors ( 'Code :'
|| NVL(v_mlac_mesg,SQLERRM)
|| ' at '
|| USER
|| 'at pk_xop_jemq.pop_je2acct_othr'
dbms_output.put_line('success10');
END;}
{ORA-06550: line 10, column 31:
PL/SQL: ORA-00904: "FN_GET_SHARES": invalid identifier
ORA-06550: line 6, column 11:
PL/SQL: SQL Statement ignored
ORA-06550: line 81, column 17:
PLS-00364: loop index variable 'V_JE2ACCT_OTHR' use is invalid
ORA-06550: line 81, column 14:
PL/SQL: Statement ignored}
HI friends, as i am getting two errors when running code in the anonymous block, then how to declare that 2 errors in declare section plz guide me}Noone, will read your code unless it is formatted like below. See the comments added
DECLARE
CURSOR c_je2acct_othr
IS
SELECT j.jemq_num,
j.ml_retail_account,
-- (CASE WHEN j.exer_type = 4 THEN j.sar_shares ELSE j.shares END) shares, -- removed * -1 from sar_shares Manu 12/02/04
/* Commented 02/01/07*/
CASE
WHEN j.exer_type = 4
--"The current user is not seeing the below function fn_get_shares.Privilege issue probably.
THEN fn_get_shares(u.user_id,u.exer_num,u.soc_sec,j. sar_shares)
ELSE (
CASE
WHEN u.exer_type=2
AND u.opts_exer!=u.shrs_sold
AND j.shares =u.shrs_sold
THEN 0
ELSE j.shares
END)
END) shares,
-- removed * -1 from sar_shares Manu 12/02/04
j.name_first,
j.name_last,
j.exer_type,
j.ml_sec_num,
j.ivr_plan_num,
j.exer_dt,
j.grant_dt,
j.user_id,
j.mlu_rowid,
j.settle_dt,
j.exer_num,
j.plan_type,
j.grant_num,
j.acct_num_othr,
j.add_cancel,
/* (CASE WHEN j.exer_type = 4 THEN j.sar_cash_amount * -1 -- turned negative Manu 12/02/04 ml_retail distr
commented the above line for calculation of proceeds into other account for sar sale.
CASE
WHEN j.exer_type = 4
THEN Pk_Xop_Citibank_Forex.fn_get_netamount(u.user_id,u. exer_num,u.soc_sec, u.sar_cash_amount,NVL(u.comm_value, 0), NVL(u.tot_fee, 0), NVL(u.multi_curr_handling_fee, 0))
-- Removed the negative as on ml_exer_upload all values are +ve.
ELSE ( (DECODE(u.exer_type,0,u.opts_exer * u.mkt_prc,u.shrs_sold * u.mkt_prc )) - ( ROUND((u.opts_exer * NVL (u.opt_prc, 0)),2)
-- SPIF 39060 Added a Round of condition.
+ DECODE (NVL (u.shrs_wthld_for_taxes, 'N'), 'Y', 0, ROUND (u.tot_tax, 2) ) + u.tot_fee + NVL(u.multi_curr_handling_fee,0) + u.comm_value ) - u.backup_withholding )
END ) AS gl_amt,
T.je_othr_mlacct_jemsg AS vc_trailer_desc,
u.opts_exer ,
u.shrs_sold,
u.rsu_type
FROM TB_XOP_JEMQ j,
TB_ML_EXER_UPLOAD u,
TB_FC_COMPY T
WHERE j.q_flag = 'N'
AND u.je_flag = 'Y'
AND j.entry_dttime >= TRUNC (SYSDATE)
AND j.entry_dttime < TRUNC (SYSDATE) +1
AND j.source = 'X'
AND j.acct_num_othr != ' '
--and (case when u.exer_type=2 and u.opts_exer!=u.shrs_sold then (case when j.shares=u.shrs_sold then 0 else 1 end) else 1 end)=1 -- FIx for PCTUP00566081
--AND ( disp_flag <> 'D' OR disp_flag IS NULL ) -- Added by MARAN ARUNACHALAM on 01/25/2011 for PCTUP00493542 Fix
--and j.current_status = '2Q' -- removed not required now in new plan
AND NOT EXISTS
(SELECT 1
FROM TB_XOP_JEMQ j2
WHERE j2.prev_jemq = j.jemq_num
AND source = 'T'
AND j.add_cancel = j2.add_cancel
AND j.user_id = j2.user_id
AND j.exer_num = j2.exer_num
AND j.mlu_rowid = u.ROWID
AND 'CMS'
||T.compy_acronym
||'_USER' = j.user_id
ORDER BY add_cancel DESC;
v_mlac_mesg VARCHAR2(1000);
-- JE_OTHR_MLACCT_JEMSG
BEGIN
dbms_output.put_line('success');
FOR v_je2acct_othr IN c_je2acct_othr
LOOP
dbms_output.put_line('success1');
BEGIN
dbms_output.put_line('success2');
IF v_je2acct_othr.add_cancel = 'C' THEN
dbms_output.put_line('success3');
UPDATE TB_XOP_JEMQ
SET add_cancel = DECODE(current_status, 'RJ', add_cancel, 'C'),
q_flag = DECODE(current_status, 'RJ', q_flag, 'N'),
activ_dt = DECODE(current_status, 'RJ', activ_dt, SYSDATE)
WHERE prev_jemq = v_je2acct_othr.jemq_num
AND user_id = v_je2acct_othr.user_id
AND exer_num = v_je2acct_othr.exer_num
AND source ='T';
dbms_output.put_line('success4');
ELSIF v_je2acct_othr.add_cancel = 'A' THEN
dbms_output.put_line('success5');
-- manipulating amount and shares to transfer when different exercise types
--"You cannot assign values to the recor variable declared for a loop. Either define seperate variables or use explicit record variable"
v_je2acct_othr.gl_amt :=
CASE
WHEN v_je2acct_othr.exer_type = 0 THEN
0
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold THEN
v_je2acct_othr.gl_amt
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold THEN
v_je2acct_othr.gl_amt
ELSE
v_je2acct_othr.gl_amt
END );
---- Commented on 11/01/2006 For Fixing 30585
/* v_je2acct_othr.shares :=( CASE
WHEN v_je2acct_othr.exer_type = 0 THEN v_je2acct_othr.opts_exer
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold
THEN v_je2acct_othr.opts_exer - v_je2acct_othr.shrs_sold
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold
THEN 0
ELSE v_je2acct_othr.shares
END );*/
---- Commented on 11/01/2006 For Fixing 30585
v_je2acct_othr.shares :=
CASE
WHEN v_je2acct_othr.exer_type = 0 THEN
v_je2acct_othr. Shares
--- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold AND v_je2acct_othr.shares!=0 AND v_je2acct_othr.plan_type 0 -- Added plantype condition for CQ:PCTUP00493542
THEN
v_je2acct_othr.Shares - v_je2acct_othr.shrs_sold
--- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold THEN
0
ELSE
v_je2acct_othr.shares
END );
dbms_output.put_line('success6');
IF LENGTH(TRIM(v_je2acct_othr.acct_num_othr))=8 OR TRIM(v_je2acct_othr.acct_num_othr) IS NULL THEN
v_mlac_mesg :=NULL;
ELSE
v_mlac_mesg :='Check the ml a/c length';
dbms_output.put_line('success7');
END IF;
INSERT
INTO TB_XOP_JEMQ
jemq_num,
prev_jemq,
ml_retail_account,
wcma_shares,
shares,
wcma_taxes,
tax_amt,
wcma_reimburse,
reimburse_amt,
name_first,
name_last,
exer_type,
ml_sec_num,
wcma_bulking,
bulking_amt,
ivr_plan_num,
exer_dt,
grant_dt,
user_id,
source,
mlu_rowid,
settle_dt,
exer_num,
plan_type,
grant_num,
vc_trailer_desc,
rsu_type
VALUES
Pk_Xop_Get_Jemqnum.fn_xop_get_jemqnum,
v_je2acct_othr.jemq_num,
v_je2acct_othr.acct_num_othr,
-- 2nd ml_retail_account,
v_je2acct_othr.ml_retail_account,
-- move shares from old acct to 2nd acct above
v_je2acct_othr.shares,
--this is SHARES
--wcma_taxes
0,
--tax_amt,
v_je2acct_othr.ml_retail_account,
-- move gl_amt from old acct to 2nd acct above
v_je2acct_othr.gl_amt * -1,
v_je2acct_othr.name_first,
v_je2acct_othr.name_last,
v_je2acct_othr. exer_type,
v_je2acct_othr.ml_sec_num,
--wcma_bulking,
0,
--bulking_amt,
v_je2acct_othr.ivr_plan_num,
v_je2acct_othr.exer_dt,
v_je2acct_othr. grant_dt,
v_je2acct_othr.user_id,
'T',
--source
v_je2acct_othr.mlu_rowid,
v_je2acct_othr. settle_dt,
v_je2acct_othr.exer_num,
v_je2acct_othr. plan_type,
v_je2acct_othr.grant_num,
v_je2acct_othr.vc_trailer_desc,
v_je2acct_othr. rsu_type
dbms_output.put_line('success8');
END IF;
EXCEPTION
WHEN OTHERS THEN
Pr_Xop_Log_Errors ( 'Code :' || NVL(v_mlac_mesg,SQLERRM) || ' at ' || USER || 'at sub exec block in pop_je2acct_othr' );
END;
dbms_output.put_line('success9'); -- end of begin within loop
END LOOP;
--COMMIT;
EXCEPTION
WHEN OTHERS THEN
Pr_Xop_Log_Errors ( 'Code :' || NVL(v_mlac_mesg,SQLERRM) || ' at ' || USER || 'at pk_xop_jemq.pop_je2acct_othr' );
dbms_output.put_line('success10');
END;
{code}   -
How to declare a dynamic array in java
I have to use a dynmic array of boolean and the size of this array will defiend throuh the run of the program to explian
boolean[][] a;
a=new boolean[number_of_ raw][number_of_ culm];
after the program run the number_of_ raw and number_of_ culm will defind..so if any body know how to declare this kind of arraies in java please help me.My previous post gives me an idea on how to use ArrayList of ArrayList as dynamic 2 dimensional array.
More info bellow
ArrayList rows = new ArrayList()
ArrayList columns_of_row0 = new ArrayList()
rows.insertAt(0) = columns_of_row0;
ArrayList columns_of_row1 = new ArrayList()
rows.insertAt(1) = columns_of_row1;and so on..
You can't use the code exactly or similar way, it would depend on how this array grows in your application.
But this and my previous post should give an idea on how to insert and retrieve elements from ArrayList when
treated as 2 dimensional array.
Hope this helps. -
How to Declare Arrays in bpel and use them as acollection
Hi,
I Am new to Bpel, I had created an empty Bpel Process and configured file adapter to a directory, In my text file i have 3 records with four columns, each column seperated by ',' and each record seperated by "EOL(end of line)", Below is the xsd file generated by the native format xsd builder, taken a recieve activity to recieve the contents of file from file adapter.
So all the data which is in the file will be there in recieve activity.
FileContents
55555,rgfdgsd,gfdgfdg,23
66666,retretret,trtertg,21
77777,rtrttreter,trtter,23
My Question is
I want to compare whether value of C1 = '55555' and if the value is equal to 55555 then that record with c1=55555 has to be inserted into database by using Arrays
How to compare the value of c1 through bpel functions.
with java i have to use the logic similar to this by using Xpath
getElement by tagname(c1);- it will give all the elements with tagname c1, three records are there with tagname c1 (c1=55555,c1=66666,c1=77777), we have to iterate through the elemnts and check whether the value iof c1='55555' and get the whole parent block which contains values of c1,c2,c3,c4 and insert that to database
What variables we have to use to get the Similar logic in bpel
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
targetNamespace="http://TargetNamespace.com/FileAdapter"
xmlns:tns="http://TargetNamespace.com/FileAdapter"
elementFormDefault="qualified"
attributeFormDefault="unqualified" nxsd:encoding="ASCII" nxsd:stream="chars" nxsd:version="NXSD">
<xsd:element name="Associates">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Associate" minOccurs="1" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="C1" type="xsd:double" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy=""">
</xsd:element>
<xsd:element name="C2" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy=""">
</xsd:element>
<xsd:element name="C3" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy=""">
</xsd:element>
<xsd:element name="C4" type="xsd:double" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy=""">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
I want to do it by using Arrays,
Please post the step by step procedure like
How to declare an Array?
How to iterate the results in recieve acticity of file adapter and put them to array?
How to compare the values in array with our desired value?
Please Look into this and suggest me the solution.
RegardsI think it is a good option to use transformations. Do you have any critical reason why you want to do this using array?
Little explanation below for your questions.
As per my understanding from variable is the recieve activity variable and to variable is the Array variable is it right?
Yes. Here I was try to build my array from the different source system data. This will append data to the array variable.
How can we declare an array variable in bpel(to variable) with name as Variable_Array, part as payload and query as ArrayList?
*Any element that can hold another element can be a array.
For example if element A is declared as sequence of element B type, then A acts as a array for B*
Could you please explain this also, what is from variable? and what is to variable?
+<assign name="Assign_XPath_For_Array">+
+<copy><from expression="concat('/ns1:ArrayList/ns2:ArrayElem') "/><to variable="Variable_Xpath"/></copy>+
+</assign>+
what is the type of to variable "Variable_Xpath"(String or int etc)?
This creates a dynamic Xpath and store in some variable here. Here the variable is called Variable_Xpath which is a string
similarly what is the type of to variable?
+<assign name="Assign_Read_Array">+
+<copy>+
+<from expression="bpws:getVariableData('Variable_Array','payload',bpws:getVariableData('Variable_Xpath'))"/>+
+<to variable="Variable_Read_Array_Element" query="/ns1: ABC"/>+
+</copy>+
+</assign>+
To variable type is the variable that I read from the Array.
*For example if A is the array holding B, then the to variable is B and from is doing A[counter]*
Every Little Helps
Kalidass Mookkaiah
http://oraclebpelindepth.blogspot.com/ -
How to declare ftp in File class. I want to display filename of file in FTP
How to declare ftp in File class. I want to display filename of file in FTP server.
I try
File f2= new File("ftp://abc:abc1111@ABC/file");
String n[] = f2.list();
System.out.print(n[0]);
Vector filename = null ;
for (int i2 = 0; i2 < n.length; i2++) {
filename.add(n[i2]);
but it is not work
Thank you.You can use Jakarta's net-package to connect to a FTP server.
Download it here:
http://jakarta.apache.org/site/downloads/downloads_commons-net.cgi
Here's a small demo:
import org.apache.commons.net.ftp.*;
public class FTPTest {
private boolean isConnected;
private FTPClient client;
public FTPTest() {
isConnected = false;
connect();
private void connect() {
String server = "server.org";
String username = "user";
String password = "password";
client = new FTPClient();
try {
client.connect(server);
client.login(username, password);
String[] files = client.listNames();
for(int i = 0; i < files.length; i++) {
System.out.println(files);
isConnected = true;
disconnect();
catch(Exception e) {
e.printStackTrace();
private void disconnect() {
if(isConnected) {
try {
client.disconnect();
isConnected = false;
catch(Exception e) {
e.printStackTrace();
public static void main(String[] args) {
new FTPTest(); -
How to declare top of page in alv grid disply
Hi
Can any ine let me know how to declare the top -of -page??
Arun JosephHi , check this one u will get easily .
*& Report ZMM_ANNEXURE4_ALV
REPORT ZMM_ANNEXURE4_ALV1.
TYPE-POOLS SLIS .
TABLES : J_1IEXCHDR,
J_1IEXCDTL,
J_1IGRXSUB, " FOR QTY
LFA1, " Vendor Master
ADRC, " Vendor Address
MSEG, " Batch - Identification Marks
MKPF. "
DATA : IT_J_1IEXCHDR LIKE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
DATA : IT_MSEG LIKE MSEG OCCURS 0 WITH HEADER LINE.
DATA : IT_J_1IEXCDTL LIKE J_1IEXCDTL OCCURS 0 WITH HEADER LINE.
DATA : IT_J_1IGRXSUB LIKE J_1IGRXSUB OCCURS 0 WITH HEADER LINE.
DATA : IT_MSGE LIKE MSEG OCCURS 0 WITH HEADER LINE.
DATA : IT_LFA1 LIKE LFA1 OCCURS 0 WITH HEADER LINE.
DATA : IT_ADRC LIKE ADRC OCCURS 0 WITH HEADER LINE.
DATA : IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE.
data: fieldcatalog type slis_t_fieldcat_alv with header line,
it_listheader type slis_t_listheader,
it_events type slis_t_event,
it_fieldcat type slis_t_fieldcat_alv,
gd_tab_group type slis_t_sp_group_alv,
IS_layout type slis_layout_alv,
SELL_MODE TYPE SLIS_T_SP_GROUP_ALV,
gd_repid like sy-repid.
INCLUDE <symbol>.
INCLUDE <icon>.
*DATA : TEXT1(100) TYPE C.
*DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : V_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA : V_QTY LIKE EKPO-MENGE.
DATA : V_VAL LIKE MARA-NTGEW. " For calculation of Qty
DATA : V_VAL1 TYPE STRING. " For calculation of Qty
DATA : V_Q TYPE STRING. " Variable for calculating
" burning loss
DATA : V_WST TYPE STRING. " Variable 4 WasteM.
DATA : V_WST1 TYPE STRING. " Variable 4 WasteM.
DATA : V_SCPGN LIKE MSEG-MENGE.
DATA : V_WUNIT TYPE STRING.
DATA : V_QFPG1 TYPE STRING.
DATA : V_QFPG2 TYPE STRING.
DATA : V_AQTY TYPE STRING.
DATA : V_QTYR LIKE J_1IEXCDTL-MENGE.
DATA : V_QTYR1 TYPE STRING.
DATA : V_UNTQT TYPE STRING.
DATA : V_MEINS LIKE MSEG-MEINS.
DATA : V_MEINS1 LIKE MSEG-MEINS.
DATA : V_SCPGN1 TYPE STRING.
DATA : V_WSTMQ LIKE MSEG-MENGE.
DATA : V_WSTMQ1 TYPE STRING.
DATA : V_QFPGN LIKE MARA-NTGEW.
DATA : V_VALQ LIKE MARA-NTGEW.
DATA : V_UNITQ LIKE MARA-MEINS.
DATA : V_WGHT TYPE STRING.
DATA : V_WGHT1 TYPE STRING.
DATA : V_CHARG LIKE MSEG-CHARG.
DATA: TEXT TYPE STRING.
DATA: TEXT1 TYPE STRING.
DATA: TEXT2 TYPE STRING.
DATA :TEXT3 TYPE STRING.
DATA :TEXT4 TYPE STRING.
DATA:dat_frt(30).
SELECTION-SCREEN ************
SELECTION-SCREEN COMMENT /80(50) VER.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE tit2.
SELECT-OPTIONS: P_CHLN FOR IT_J_1IEXCDTL-EXNUM. "NO-EXTENSION
"NO INTERVALS OBLIGATORY.
SELECT-OPTIONS: P_DATE FOR IT_J_1IEXCHDR-BUDAT. "NO-EXTENSION
"NO INTERVALS OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK blk2.
SELECTION-SCREEN COMMENT /72(60) run.
DATA : BEGIN OF IT_FINAL OCCURS 1,
BUDAT type d, "1 Date of issue
MAKTX(40) TYPE C, "2Material Desc
CHAPID(22) TYPE C,
MENGE(18) TYPE C, "4 Qty removed weight
CHARG(25) TYPE C, "5 Identification Marks
ADRS(55) TYPE C," 6For Vendor Address
EXNUM LIKE J_1IEXCHDR-EXNUM, "7 Challan No. & Date
ADDLDATA1(40) TYPE C, "8 NatureProcessReq
DOCNO LIKE J_1IEXCHDR-DOCNO, "10 Document No.
CPUDT TYPE D, "9 Date of Receipt
V_QTY1(40) TYPE C, "10QtyofProcessedFinishedGoods
BURNING(12) TYPE C, "11 Burning Loss
WST_M(20) TYPE c, "12 Qty of waste material
ADDLDATA2(18) TYPE C,"13 Invoice No.&Date
V_PARTIC(25) TYPE C," 14Particulars of Payment
ADDLDATA2 LIKE J_1IEXCHDR-ADDLDATA2,"15 Invoice No.&Date
END OF IT_FINAL.
PERFORM INITIALZATION1.
PERFORM GET_DATA.
PERFORM CALL_FORM.
*& Form INITIALZATION
text
--> p1 text
<-- p2 text
form INITIALZATION1 .
CLEAR IT_FINAL.
CLEAR IT_J_1IEXCHDR.
CLEAR IT_MSEG.
CLEAR IT_J_1IEXCDTL.
CLEAR IT_J_1IGRXSUB.
CLEAR IT_ADRC.
CLEAR V_Q.
CLEAR V_SCPGN.
CLEAR V_WST.
CLEAR V_QFPG1.
CLEAR V_QFPG2.
CLEAR V_VAL.
CLEAR V_VAL1.
CLEAR V_AQTY.
CLEAR V_WUNIT.
CLEAR V_QTYR.
CLEAR V_UNTQT.
CLEAR V_SCPGN1.
CLEAR V_MEINS.
CLEAR V_WSTMQ.
CLEAR V_WSTMQ1.
CLEAR V_QFPGN.
CLEAR V_VALQ.
CLEAR V_UNITQ.
CLEAR V_WGHT.
CLEAR V_WGHT1.
CLEAR IT_FINAL[].
CLEAR IT_J_1IEXCHDR[].
CLEAR IT_MSEG[].
CLEAR IT_J_1IEXCDTL[].
CLEAR IT_J_1IGRXSUB[].
endform. " INITIALZATION
*****INITIALIZATION
INITIALIZATION.
tit2 = 'Selection Criteria'.
CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO
dat_frt.
CONCATENATE 'User ID : ' sy-uname ' Client ID : ' sy-mandt
' Run Date : ' dat_frt
INTO run SEPARATED BY space.
ver = 'Developed by CMC Limited. '.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form GET_DATA .
IF P_DATE <> ''.
SELECT *
FROM J_1IEXCHDR
INTO TABLE IT_J_1IEXCHDR
WHERE BUDAT IN P_DATE AND
TRNTYP = '57FC' AND " Transaction type
SRGRP = 40. " Series Group
ENDIF.
IF P_CHLN <> ''.
SELECT *
FROM J_1IEXCHDR
INTO TABLE IT_J_1IEXCHDR
WHERE EXNUM IN P_CHLN AND
TRNTYP = '57FC' AND " Transaction type
SRGRP = 40. " Series Group
ENDIF.
select *
FROM J_1IEXCDTL
INTO TABLE IT_J_1IEXCDTL
WHERE EXDAT IN P_DATE " Document No.
AND TRNTYP = '57FC'.
" Transaction type for subcontracting
LOOP AT IT_J_1IEXCHDR.
MOVE-CORRESPONDING IT_J_1IEXCHDR TO IT_FINAL.
select MATNR MAKTX CHAPID MENGE MEINS ADDLDATA1 EXNUM
FROM J_1IEXCDTL
INTO (IT_J_1IEXCDTL-MATNR, IT_FINAL-MAKTX,
IT_FINAL-CHAPID,V_QTYR, V_UNTQT,
IT_J_1IEXCDTL-ADDLDATA1, IT_J_1IEXCDTL-EXNUM)
WHERE DOCNO = IT_J_1IEXCHDR-DOCNO " Document No.
AND TRNTYP = '57FC'
" Transaction type for subcontracting
AND RDOC2 = IT_J_1IEXCHDR-RDOC. " Material Doc No.
IT_FINAL-MAKTX = IT_J_1IEXCDTL-MAKTX. " Material Desc
IT_FINAL-CHAPID = IT_J_1IEXCDTL-CHAPID. " Tariff Clasifi
IT_FINAL-MENGE = IT_J_1IEXCDTL-MENGE.
IT_FINAL-MEINS = IT_J_1IEXCDTL-MEINS.
IT_FINAL-ADDLDATA1 = IT_J_1IEXCDTL-ADDLDATA1. " Nature of proc
V_QTYR1 = V_QTYR.
CONCATENATE V_QTYR1 V_UNTQT INTO IT_FINAL-MENGE SEPARATED BY ''.
IF V_UNTQT = 'EA'.
SELECT SINGLE NTGEW GEWEI " VALUE, UNIT
FROM MARA
INTO (V_VALQ, V_UNITQ)
WHERE MATNR = IT_J_1IEXCDTL-MATNR.
V_WGHT = V_VALQ * V_QTYR.
V_WGHT1 = V_WGHT.
CONCATENATE V_WGHT1 V_UNITQ INTO V_WGHT1 SEPARATED BY ''.
CONCATENATE IT_FINAL-MENGE V_WGHT1 INTO IT_FINAL-MENGE
SEPARATED BY ' / '.
ENDIF.
SELECT SINGLE CHARG " Batch No.
FROM MSEG
INTO V_CHARG
WHERE MBLNR = IT_J_1IEXCHDR-RDOC AND " Material Doc No.
MATNR = IT_J_1IEXCDTL-MATNR AND
SHKZG = 'H'. " H- CREDIT
IT_FINAL-CHARG = V_CHARG.
CLEAR V_CHARG.
SELECT SINGLE REC_QTY MBLNR " Qtywaste material,mat docno.
FROM J_1IGRXSUB
INTO (IT_J_1IGRXSUB-REC_QTY, IT_J_1IGRXSUB-MBLNR)
WHERE EXNUM = IT_J_1IEXCHDR-EXNUM." AND
EXC_ZEILE = IT_J_1IEXCHDR-ZEILE.
SELECT SINGLE MENGE " QTY OF WASTE MATERIAL
FROM MSEG
INTO V_SCPGN " VARIABLE STORING QTY OF WASTE MTRL.
WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
AND BWART = 545.
V_WST = V_SCPGN.
SELECT SINGLE MENGE MEINS " QTY OF WASTE MATERIAL
FROM MSEG
INTO (V_WSTMQ, V_MEINS) "VARIABLE STORING QTYOFWASTEMTRL.
WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
AND BWART = 101.
V_WSTMQ1 = V_WSTMQ.
CONCATENATE V_WSTMQ1 V_MEINS INTO V_SCPGN1.
ADDING UNIT 'KG' INTO WASTE MATERIAL.
CONCATENATE V_WST 'KG' INTO IT_FINAL-WST_M.
SELECT SINGLE MATNR
FROM MSEG
INTO IT_MSEG-MATNR
WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
AND BWART = 101.
IF RECEIVED QTY IS IN EA THEN IT SHOULD COME IN KG ALSO
SELECT SINGLE NTGEW GEWEI " VALUE, UNIT
FROM MARA
INTO (V_VAL, V_WUNIT)
WHERE MATNR = IT_MSEG-MATNR.
V_VAL1 = V_VAL.
CONCATENATE V_VAL1 V_WUNIT INTO V_QFPG1 SEPARATED BY ''.
IT_FINAL-V_QTY1 = V_VAL * IT_J_1IGRXSUB-REC_QTY.
V_QFPG2 = V_VAL * IT_J_1IGRXSUB-REC_QTY.
V_QFPGN = V_QFPG2.
CONCATENATE V_QFPG2 V_WUNIT INTO V_QFPG2.
V_AQTY = IT_J_1IGRXSUB-REC_QTY.
IF V_QFPGN <> 0.
CONCATENATE V_SCPGN1 V_QFPG2 INTO IT_FINAL-V_QTY1 SEPARATED BY ' / '.
ELSE.
IT_FINAL-V_QTY1 = V_SCPGN1.
ENDIF.
BURNING LOSS
*Burning Loss = Qty-removed - ( Qty of processed finished goods +
Qty of waste material)
V_Q = V_QTYR - ( V_QFPGN + V_SCPGN ).
IF V_Q GE 0.
CONCATENATE V_Q 'KG' INTO IT_FINAL-BURNING
SEPARATED BY ''.
ELSE.
V_Q = 0.
IT_FINAL-BURNING = V_Q.
ENDIF.
MOVE-CORRESPONDING IT_J_1IEXCHDR TO IT_FINAL.
IT_FINAL-ADDLDATA1 = IT_J_1IEXCDTL-ADDLDATA1. " Nature of proc
APPEND IT_FINAL.
endselect.
LOOP AT IT_FINAL.
SELECT SINGLE adrnr "Adress Number
FROM lfa1
INTO IT_LFA1-adrnr
WHERE lifnr = IT_J_1IEXCHDR-LIFNR.
SELECT " Vendor Address
SINGLE name1 street city1 post_code1 tel_number fax_number
house_num1
FROM adrc
INTO (IT_ADRC-name1,IT_ADRC-street,IT_ADRC-city1,
IT_ADRC-post_code1,
IT_ADRC-tel_number,IT_ADRC-fax_number,IT_ADRC-house_num1)
WHERE addrnumber = it_lfa1-adrnr.
CONCATENATION OF VENDOR NAME & ADDRESS INTO ONE FIELD i.e ADRS.
CONCATENATE IT_ADRC-NAME1 IT_ADRC-STREET IT_ADRC-CITY1
IT_ADRC-POST_CODE1
INTO IT_FINAL-ADRS SEPARATED BY ''.
MODIFY IT_FINAL.
ENDLOOP.
***************CLEAR STATEMENT
CLEAR IT_FINAL.
CLEAR IT_J_1IEXCHDR.
CLEAR IT_MSEG.
CLEAR IT_J_1IEXCDTL.
CLEAR IT_J_1IGRXSUB.
CLEAR IT_ADRC.
CLEAR V_Q.
CLEAR V_SCPGN.
CLEAR V_WST.
CLEAR V_QFPG1.
CLEAR V_QFPG2.
CLEAR V_VAL.
CLEAR V_VAL1.
CLEAR V_AQTY.
CLEAR V_WUNIT.
CLEAR V_QTYR.
CLEAR V_UNTQT.
CLEAR V_SCPGN1.
CLEAR V_MEINS.
CLEAR V_WSTMQ.
CLEAR V_WSTMQ1.
CLEAR V_QFPGN.
CLEAR V_VALQ.
CLEAR V_UNITQ.
CLEAR V_WGHT.
CLEAR V_WGHT1.
ENDLOOP.
CLEAR IT_J_1IEXCHDR[].
CLEAR IT_MSEG[].
CLEAR IT_J_1IEXCDTL[].
CLEAR IT_J_1IGRXSUB[].
endform. " GET_DATA
ADD
form alv_events using events type slis_t_event.
data : wa_events type slis_alv_event.
clear wa_events.
wa_events-name = 'TOP_OF_PAGE'.
wa_events-form = 'TOP_OF_PAGE'.
append wa_events to it_events.
endform. "alv_events
*FORM FOR TOP OF PAGE
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader.
endform. "top_of_page
FORM fill_fieldcat USING f d o t to p c.
data wa_fieldcat type slis_fieldcat_alv.
statics pos like sy-index value 1.
pos = pos + 1.
clear wa_fieldcat.
MOVE : 1 TO WA_FIELDCAT-ROW_POS,
POS TO WA_FIELDCAT-COL_POS,
F TO WA_FIELDCAT-FIELDNAME,
D TO WA_FIELDCAT-SELTEXT_L,
O TO WA_FIELDCAT-OUTPUTLEN,
T TO WA_FIELDCAT-TABNAME,
TO TO WA_FIELDCAT-DO_SUM,
P TO WA_FIELDCAT-FIX_COLUMN,
C TO WA_FIELDCAT-EMPHASIZE.
move : 1 to wa_fieldcat-row_pos,
pos to wa_fieldcat-col_pos,
f to wa_fieldcat-fieldname,
d to wa_fieldcat-seltext_l,
o to wa_fieldcat-outputlen,
t to wa_fieldcat-tabname,
to to wa_fieldcat-do_sum,
p to wa_fieldcat-fix_column.
append wa_fieldcat to it_fieldcat.
ENDFORM. " fill_fieldcat
*& Form CALL_FORM
text
--> p1 text
<-- p2 text
form CALL_FORM .
perform alv_header using it_listheader.
perform alv_events using it_events.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'IT_FINAL'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = SY-REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_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.
For Columns Heading
LOOP AT IT_FIELDCAT INTO V_FIELDCAT.
CASE V_FIELDCAT-FIELDNAME.
WHEN 'BUDAT'.
V_FIELDCAT-SELTEXT_L = 'Date of Issue'.
WHEN 'MAKTX'.
V_FIELDCAT-SELTEXT_L = 'Description of goods (inputs)'.
WHEN 'CHAPID'.
V_FIELDCAT-SELTEXT_L = 'Tarrif Classification'.
WHEN 'MENGE'.
V_FIELDCAT-SELTEXT_L = 'Quantity Removed '.
WHEN 'CHARG'.
V_FIELDCAT-SELTEXT_L = 'Identification Marks, If any'.
WHEN 'ADRS'.
V_FIELDCAT-SELTEXT_L =
'Premises/Factory to which goods removed'.
WHEN 'EXNUM'.
V_FIELDCAT-SELTEXT_L = 'Challan No.'.
WHEN 'ADDLDATA1'.
V_FIELDCAT-SELTEXT_L = 'Nature of Processing required'.
WHEN 'CPUDT'.
V_FIELDCAT-SELTEXT_L = 'Date of Receipt'.
WHEN 'V_QTY1'.
V_FIELDCAT-SELTEXT_L = 'Qty of Processed Finished Goods '.
WHEN 'BURNING'.
V_FIELDCAT-SELTEXT_L = 'Process Loss'.
WHEN 'WST_M'.
V_FIELDCAT-SELTEXT_L = 'Quantity of Waste Material'.
WHEN 'ADDLDATA2'.
V_FIELDCAT-SELTEXT_L = 'Invoice No. & Date'.
WHEN 'V_PARTIC'.
V_FIELDCAT-SELTEXT_L = 'Particulars of Payment of Duty'.
V_FIELDCAT-REF_FIELDNAME = 'ERSDA'.
V_FIELDCAT-REF_TABNAME = 'J_1IEXCDTL'.
WHEN OTHERS. CONTINUE.
ENDCASE.
V_FIELDCAT-SELTEXT_S = V_FIELDCAT-SELTEXT_L.
V_FIELDCAT-SELTEXT_M = V_FIELDCAT-SELTEXT_L.
MODIFY IT_FIELDCAT FROM V_FIELDCAT.
ENDLOOP.
perform fill_layout_structure.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
IS_LAYOUT = IS_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = IT_EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 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. " CALL_FORM
*& Form FILL_LAYOUT_STRUCTURE
text
--> p1 text
<-- p2 text
form FILL_LAYOUT_STRUCTURE .
data: wa_event type slis_alv_event,
wa_listheader type slis_t_listheader.
clear is_layout.
is_layout-zebra = 'X'.
SELL_MODE = 'D'.
endform. " FILL_LAYOUT_STRUCTURE
*& Form ALV_HEADER
text
-->P_IT_LISTHEADER text
form ALV_HEADER using p_it_listheader.
data : wa_listheader type slis_listheader.
TEXT = 'Annexure - IV'.
clear wa_listheader.
wa_listheader-typ = 'H'.
move TEXT to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT1 = 'Account of Removal of inputs or partially processed goods'.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT1
to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT2 = 'under Sub Rule 5a of Rule of CENVAT Credit Rules, 2002'.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT2 to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT3 = '(to be maintened by assessee who sends raw '.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT3 to wa_listheader-info.
append wa_listheader to it_listheader.
TEXT4 = 'materials/semifinished goods.'.
clear wa_listheader.
wa_listheader-typ = 'S'.
move TEXT4 to wa_listheader-info.
append wa_listheader to it_listheader.
endform. " ALV_HEADER
Regards,
Gulrez Alam -
How to declare a variable in form
how to declare a variable in form?
Hi,
do you want to create variable in script or smartform?
In scripts to define a variable use the following declaration statement.
DEFINE &<VARIABLE_NAME>&
place this statement as command. we can assign initial value for this by adding VALUE ' ' to above statement.
If your requirement is for smartforms go to global declaration, create a variable there that will be applicable only for smartform.
Hope this will help you,
Regards,
Aswini. -
How to declare class variable with generic parameters?
I've got a class that declares a type parameter T. I know how to declare a static method, but this doesn't work for a static variable:
public class Test< T >
* Map of String to instances of T.
* error: '(' expected (pointing to =)
* <identifier> expected (pointing to () )
private final static < T > Map< String, T > MAP = new HashMap< String, T >();
* Get instance of type T associated with the given key.
public final static < T > T getType( String key )
return MAP.get( key );
}Edited by: 845859 on Mar 20, 2011 11:46 AMjveritas wrote:
I'm trying to create a generic polymorphic Factory class that contains boilerplate code.
I don't want to have to rewrite the registration code every time I have a different return type and parameter.I haven't seen a case yet where that is reasonable.
If you have hundreds of factories then something is wrong with your code, design and architecture.
If you have a factory which requires large number of a varying input types (producing different types) then something is probably wrong with your code and design.
A reasonable factory usage is one where you have say 20 classes to be created and you need to add a new class every 3 months. Along with additional functionality represented by the class itself and perhaps variances in usage. Thus adding about 3 lines of code to one class is trivial. Conversely if you have hundreds of classes to be created by the factory and you are adding them daily then it is likely that
1. Something is wrong with the architecture which requires a new class every day.
2. You should be using a dynamic mechanism for creation rather than static because you can't roll out a static update that often.
More than that the idiom that leads to factory creation is different for each factory. A factory that creates a database connection is substantially different than the one used in dynamic rules logic processing. A generic version will not be suitable for both.
Actualy the only case I know of where such a factory might be seem to be a 'good' idea is where someone has gotten it into their head that every class should be represented by an interface and every class created by a factory (its own factory.) And of course that is flawed.
Maybe you are looking for
-
"Password Missing" Enter the password for the account "iCloud"
After upgrading my iPhone 4 to iOS 6.0 and setting up as a 'new phone'...I've had this recurring problem with my iCloud mail. Despite entering my iCloud password successfully in settings as well as my Apple ID (same email/password), I continue to ge
-
I want to update lov value from text_item
Hi Expert, I have query regarding updating the LOV value which is populating every text_box. Gone through the discussion, bt I got the help if I have LOV button. If I have LOV in text_item nt in button then how could I write the execute_query Bcs whe
-
When i upload videos to iPhoto they are are pixelated
Well, not so much pixelated, but there is a banding across the image, especially when there is bright light or white in the shot. I know it's not a problem with my camera as I have tried to play the videos on the camera and it doesn't do this and I'
-
How do I set color in IndexColorModel for Graphics
I can't find a reasonable way to set the color so my test code is below: The IndexColorModel, BufferedImage, and Graphics2D construction is: IndexColorModel icm4=new IndexColorModel(4,16,r4,g4,b4); BufferedImage bi4=new BufferedImage(300,200,Buffered
-
Applescript to distinguish by IPTC in JPEG images
I am looking to find duplicate JPEG images I have out of thousands in a folder, to do this I will need to write an AppleScript capable of looking at the files IPTC:Header field in which the data will be the same. Is it possible to do this and how? Th