Explain the code
Hi there
Could someone explain the following piece of code to me.
Yes I have looked everywhere but it is very hard to get some decent information on the serial port.
Thanks in advance
import java.io.*;
import java.util.*;
import javax.comm.*;
public class SimpleWrite {
static Enumeration portList;
static CommPortIdentifier portId;
static String messageString = "Hello, world!\n";
static SerialPort serialPort;
static OutputStream outputStream;
public static void main(String[] args) {
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
// if (portId.getName().equals("COM1")) {
if (portId.getName().equals("/dev/term/a")) {
try {
serialPort = (SerialPort)
portId.open("SimpleWriteApp", 2000);
} catch (PortInUseException e) {}
try {
outputStream = serialPort.getOutputStream();
} catch (IOException e) {}
try {
serialPort.setSerialPortParams(9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {}
try {
outputStream.write(messageString.getBytes());
} catch (IOException e) {}
}
Thanks for that
Will you give me an explanation of the following:
import java.io.*;
import java.util.*;
import javax.comm.*;
public class SimpleRead implements Runnable, SerialPortEventListener {
static CommPortIdentifier portId;
static Enumeration portList;
InputStream inputStream;
SerialPort serialPort;
Thread readThread;
public static void main(String[] args) {
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
// if (portId.getName().equals("COM1")) {
if (portId.getName().equals("/dev/term/a")) {
SimpleRead reader = new SimpleRead();
public SimpleRead() {
try {
serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
} catch (PortInUseException e) {}
try {
inputStream = serialPort.getInputStream();
} catch (IOException e) {}
try {
serialPort.addEventListener(this);
} catch (TooManyListenersException e) {}
serialPort.notifyOnDataAvailable(true);
try {
serialPort.setSerialPortParams(9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {}
readThread = new Thread(this);
readThread.start();
public void run() {
try {
Thread.sleep(20000);
} catch (InterruptedException e) {}
public void serialEvent(SerialPortEvent event) {
switch(event.getEventType()) {
case SerialPortEvent.BI:
case SerialPortEvent.OE:
case SerialPortEvent.FE:
case SerialPortEvent.PE:
case SerialPortEvent.CD:
case SerialPortEvent.CTS:
case SerialPortEvent.DSR:
case SerialPortEvent.RI:
case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
break;
case SerialPortEvent.DATA_AVAILABLE:
byte[] readBuffer = new byte[20];
try {
while (inputStream.available() > 0) {
int numBytes = inputStream.read(readBuffer);
System.out.print(new String(readBuffer));
} catch (IOException e) {}
break;
}
Similar Messages
-
Cffunction and how to ? can someone explain the code to me line by line
Hello i went to get this online and i want to test it.
the udf is supposed to
* CSVFormat accepts the name of an existing query and
converts it to csv format.
* Updated version of UDF orig. written by Simon Horwith
my question how to break it down.
can someone explain the code to me line by line
thankssilviasalsa wrote:
> thanks
>
> but line by line
>
> what is
> if(ArrayLen(Arguments) GTE 2) qualifier = Arguments[2];
> if(ArrayLen(Arguments) GTE 3 AND Len(Arguments[3]))
columns = Arguments[3];
> returnValue[1] = ListQualify(columns, qualifier);
> ArrayResize(returnValue, query.recordcount + 1);
> columns = ListToArray(columns);
> for(i = 1; i LTE query.recordcount; i = i + 1)
> {
> rowValue = ArrayNew(1);
> ArrayResize(rowValue, ArrayLen(columns));
> for(j = 1; j LTE ArrayLen(columns); j = j + 1)
> rowValue[j] = qualifier & query[columns[j]]
& qualifier;
> returnValue[i + 1] = ArrayToList(rowValue);
> }
> returnValue = ArrayToList(returnValue, Chr(13));
> return returnValue;
> }
>
> thanks
Apparently this UDF takes two optional parameters so that one
can define
(A) a text "qualifier" to use in the CSV file, this is
usually the
single quote|tick ['] mark - but sometimes one wants this to
be a
different character and (B) what columns to use in the
output in case
one does not want to use all the columns in the record set
in the
outputted CSV file.
The if statements are checking for these optional parameters
and if
found setting the values in them to internal variables.
These
variables are then used in the rest of the logic to create
the CSV output.
HTH
Ian -
Can you explain the code ?
Hi friends i have got a code its working fine but i am not getting the concept in the code can any one tell which line is the ITAB declaration and which lines are workarea declarations of the structure.
TYPES: BEGIN OF ST_ZWS,
RADIO TYPE C,
DESCRIPTION TYPE ZRIF_WS-DESCRIPTION,
END OF ST_ZWS.
DATA: IT_ST TYPE TABLE OF ST_ZWS,
WA_ST TYPE ST_ZWS,
IT_ZWS TYPE ZWS,
WA_ZWS TYPE ZWS.
Please explain the code here...hello
the code is as follows:
This part of the code defines structure st_zws.
TYPES: BEGIN OF ST_ZWS,
RADIO TYPE C,
DESCRIPTION TYPE ZRIF_WS-DESCRIPTION,
END OF ST_ZWS.
Based on the above defined structure, this statement defines one internal table
DATA: IT_ST TYPE TABLE OF ST_ZWS,
This statement defines work area to the above defined Internal table
WA_ST TYPE ST_ZWS,
This statement defines another internal table with reference to ZWS
IT_ZWS TYPE ZWS,
This statement defines workare to the above defined internal table
WA_ZWS TYPE ZWS.
cheers!!! -
REPORT zfi_vendor_ageing
NO STANDARD PAGE HEADING
LINE-COUNT 58
line-size 168
MESSAGE-ID zh_msg.
D A T A B A S E T A B L E S D E C L A R A T I O N
TABLES: lfa1, " Vendor Master (General)
t001, " Company Codes
rfpdo.
I N T E R N A L T A B L E S D E C L A R A T I O N S *
Internal Table for Vendor Open Items Data
DATA: BEGIN OF int_bsik OCCURS 0,
lifnr LIKE bsik-lifnr, " Vendor Number
name1 LIKE lfa1-name1, " Vendor Name
shkzg LIKE bsik-shkzg, " Dr/Cr Indicator
belnr LIKE bsik-belnr, " Document Number
xblnr LIKE bsik-xblnr, " Ref Doc No
blart LIKE bsik-blart, " Document Type
zfbdt LIKE bsik-zfbdt, " Base Line Date
zbd1t LIKE bsik-zbd1t, " Due date1
zbd2t LIKE bsik-zbd2t, " Due Date2
zbd3t LIKE bsik-zbd3t, " Due Date3
waers LIKE bsik-waers, " Currency
dmbtr LIKE bsik-dmbtr, " Amount in Local Curr
END OF int_bsik.
Internal Table for Amounts Sum Up Data
DATA: BEGIN OF int_final OCCURS 0,
lifnr LIKE bsik-lifnr, " Vendor Number
name1 LIKE lfa1-name1, " Vendor Name
total1 LIKE bsik-dmbtr, " Amount in Local Curr
total2 LIKE bsik-dmbtr, " Amount in Local Curr
total3 LIKE bsik-dmbtr, " Amount in Local Curr
total4 LIKE bsik-dmbtr, " Amount in Local Curr
total5 LIKE bsik-dmbtr, " Amount in Local Curr
total6 LIKE bsik-dmbtr, " Amount in Local Curr
total LIKE bsik-dmbtr, " Amount in Local Curr
END OF int_final.
D A T A D E C L A R A T I O N S
DATA : v_flag, " Flag
v_gtotal1 LIKE bsik-dmbtr, " Amount Totals
v_gtotal2 LIKE bsik-dmbtr, " Amount Totals
v_gtotal3 LIKE bsik-dmbtr, " Amount Totals
v_gtotal4 LIKE bsik-dmbtr, " Amount Totals
v_gtotal5 LIKE bsik-dmbtr, " Amount Totals
v_gtotal6 LIKE bsik-dmbtr, " Amount Totals
v_gtotal LIKE bsik-dmbtr, " Amount Totals
v_subtotal1 LIKE bsik-dmbtr, " Amount Totals
v_subtotal2 LIKE bsik-dmbtr, " Amount Totals
v_subtotal3 LIKE bsik-dmbtr, " Amount Totals
v_subtotal4 LIKE bsik-dmbtr, " Amount Totals
v_subtotal5 LIKE bsik-dmbtr, " Amount Totals
v_subtotal6 LIKE bsik-dmbtr, " Amount Totals
v_subtotal LIKE bsik-dmbtr, " Amount Totals
v_date LIKE bsik-zfbdt, " Due Date
v_tage1(4), " Age 30 days
v_tage2(4), " Age 60 days
v_tage3(4), " Age 90 days
v_fir(15), " Column Text1
v_sec(15), " Column Text2
v_thir(15), " Column Text3
v_four(17), " Column Text4
v_fidd(4), " Days field1
v_sedd(4), " Days field2
v_thdd(4), " Days field3
v_fodd(4), " Days field4
v_str TYPE SY-LISEL, " String
v_str1(11), " String
v_tage(3), " String
v_date1(10). " Date field
R A N G E D E C L A R A T I O N S
RANGES: r_date1 FOR bsik-zfbdt, " Date Range 1
r_date2 FOR bsik-zfbdt, " Date Range 2
r_date3 FOR bsik-zfbdt, " Date Range 3
r_date4 FOR bsik-zfbdt. " Date Range 4
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr. "Vendor account
PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
"Open items at key date
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
SELECTION-SCREEN END OF BLOCK b3.
A T S E L E C T I O N S C R E E N *
AT SELECTION-SCREEN.
Validate the screen fields
PERFORM validate_flds.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Fetch main data
PERFORM fetch_data.
T O P O F P A G E
Header
TOP-OF-PAGE.
PERFORM header.
E N D O F P A G E
Footer
END-OF-PAGE.
ULINE.
T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
Top of Page in Secondary List
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM header1.
A T L I N E S E L E C T I O N *
AT LINE-SELECTION.
Perform Line Selections
PERFORM line_selection.
E N D O F S E L E C T I O N
END-OF-SELECTION.
List generation
PERFORM basic_list.
*& Form validate_flds
Validation of Selection Screen fields
FORM validate_flds .
Validate Vendor Code
CLEAR lfa1-lifnr.
SELECT lifnr UP TO 1 ROWS
INTO lfa1-lifnr
FROM lfa1
WHERE lifnr IN s_lifnr AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Vendor Code range'(023).
ENDIF.
Validate Company Code
CLEAR t001-bukrs.
SELECT bukrs UP TO 1 ROWS
INTO t001-bukrs
FROM t001
WHERE bukrs = p_bukrs AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e021. " Invalid Company Code range
ENDIF.
IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 1 greater'(004)
'than Column# 2 or 3 or 4'(005).
ENDIF.
*column 2
IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 2 greater'(006)
'than Column# 3 or 4'(007).
ENDIF.
*column3
IF ( p_tage3 > p_tage4 ).
MESSAGE e999 WITH 'Column 3 greater'(008)
'than Column#4'(009).
ENDIF.
ENDFORM. " validate_flds
*& Form fetch_data
Fetching Data from Database Tables
FORM fetch_data .
Date Range Population
r_date1-sign = 'I'.
r_date1-option = 'BT'.
r_date1-low = p_allgst.
r_date1-high = r_date1-low + p_tage1.
APPEND r_date1.
r_date2-sign = 'I'.
r_date2-option = 'BT'.
r_date2-low = r_date1-high + 1.
r_date2-high = r_date1-low + p_tage2.
APPEND r_date2.
r_date3-sign = 'I'.
r_date3-option = 'BT'.
r_date3-low = r_date2-high + 1.
r_date3-high = r_date1-low + p_tage3.
APPEND r_date3.
r_date4-sign = 'I'.
r_date4-option = 'BT'.
r_date4-low = r_date3-high + 1.
r_date4-high = r_date1-low + p_tage4.
APPEND r_date4.
Select the Vendor Open Items data from BSIK
SELECT l~lifnr
l1~name1
b~waers
b~dmbtr
b~zfbdt
b~zbd1t
b~zbd2t
b~zbd3t
b~belnr
b~xblnr
b~shkzg
b~blart
INTO CORRESPONDING FIELDS OF TABLE int_bsik
FROM lfb1 AS l INNER JOIN lfa1 AS l1
ON llifnr = l1lifnr
INNER JOIN bsik AS b
ON llifnr = blifnr AND
lbukrs = bbukrs
WHERE l~lifnr IN s_lifnr AND
l~bukrs = p_bukrs and
b~zfbdt le p_allgst.
IF SY-SUBRC <> 0.
MESSAGE i000 WITH 'No Data found'(027).
ENDIF.
Removing the date limit to get the due items in the past
DELETE int_bsik WHERE
( blart NE 'RE' AND blart NE 'KR' ) OR
shkzg NE 'H'.
SORT int_bsik BY lifnr.
ENDFORM. " fetch_data
*& Form header
Display the Report Columns
FORM header .
v_tage1 = p_tage1 + 1.
v_tage2 = p_tage2 + 1.
v_tage3 = p_tage3 + 1.
v_fidd = p_tage1.
v_sedd = p_tage2.
v_thdd = p_tage3.
v_fodd = p_tage4.
MOVE v_fodd0(4) TO v_fodd1(3).
v_fodd+0(1) = space.
CONCATENATE '1 to'(010) v_fidd INTO v_fir.
CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Summary of Ageing Analysis for Vendor Open Invoices as on'(013)
v_date1 into v_str separated by space.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
FORMAT COLOR 1 INTENSIFIED.
WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
50(101) 'Invoices Due For(In Days)'(014) CENTERED,
151 sy-vline, 168 sy-vline .
WRITE :/1 sy-vline, 2(11) 'Vendor#'(015) CENTERED,
13 sy-vline ,14(35) 'Vendor Name'(016) CENTERED,
49 sy-vline,
50(101) sy-uline,151 sy-vline,
152(16) 'Total'(017) CENTERED,
168 sy-vline.
WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
50(16) v_fir CENTERED, 66 sy-vline,
67(16) v_sec CENTERED, 83 sy-vline,
84(16) v_thir CENTERED, 100 sy-vline,
101(16) v_four CENTERED, 117 sy-vline,
118(16) v_str1 centered, 134 sy-vline,
135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
168 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
ENDFORM. " header
*& Form basic_list
Display the Basic List
FORM basic_list .
NEW-PAGE LINE-SIZE 168.
LOOP AT int_bsik.
CLEAR v_date.
IF int_bsik-zbd3t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd3t.
ELSE.
IF int_bsik-zbd2t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd2t.
ELSE.
v_date = int_bsik-zfbdt + int_bsik-zbd1t.
ENDIF.
ENDIF.
IF int_bsik-zbd1t = ' '.
v_date = int_bsik-zfbdt.
ENDIF.
IF v_date IN r_date1.
int_final-total1 = int_final-total1 + int_bsik-dmbtr.
ELSEIF v_date IN r_date2.
int_final-total2 = int_final-total2 + int_bsik-dmbtr.
ELSEIF v_date IN r_date3.
int_final-total3 = int_final-total3 + int_bsik-dmbtr.
ELSEIF v_date IN r_date4.
int_final-total4 = int_final-total4 + int_bsik-dmbtr.
ELSEif v_date > r_date4-high.
int_final-total5 = int_final-total5 + int_bsik-dmbtr.
ELSEif v_date < p_allgst.
int_final-total6 = int_final-total6 + int_bsik-dmbtr.
ENDIF.
AT END OF lifnr.
v_flag = 1.
ENDAT.
IF v_flag = 1.
int_final-lifnr = int_bsik-lifnr.
int_final-name1 = int_bsik-name1.
int_final-total = int_final-total1 + int_final-total2 +
int_final-total3 + int_final-total4 + int_final-total5 +
int_final-total6.
APPEND int_final.
v_gtotal1 = v_gtotal1 + int_final-total1.
v_gtotal2 = v_gtotal2 + int_final-total2.
v_gtotal3 = v_gtotal3 + int_final-total3.
v_gtotal4 = v_gtotal4 + int_final-total4.
v_gtotal5 = v_gtotal5 + int_final-total5.
v_gtotal6 = v_gtotal6 + int_final-total6.
v_gtotal = v_gtotal + int_final-total.
WRITE: /1 sy-vline,
2 int_final-lifnr COLOR 4 INTENSIFIED ON,
13 sy-vline,
14 int_final-name1 COLOR 4 INTENSIFIED ON,
49 sy-vline.
DATA : v_rem.
v_rem = sy-tabix MOD 2.
IF v_rem NE 0.
FORMAT COLOR 2 INTENSIFIED.
WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsik-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsik-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsik-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsik-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsik-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsik-waers,
168 sy-vline.
ELSE.
WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsik-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsik-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsik-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsik-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsik-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsik-waers,
168 sy-vline.
ENDIF.
FORMAT COLOR OFF.
HIDE int_final.
CLEAR int_final.
v_flag = 0.
ENDIF.
AT LAST.
WRITE : /1(168) sy-uline.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
49 sy-vline, 50 v_gtotal1 CURRENCY int_bsik-waers,
66 sy-vline, 67 v_gtotal2 CURRENCY int_bsik-waers,
83 sy-vline, 84 v_gtotal3 CURRENCY int_bsik-waers,
100 sy-vline,101 v_gtotal4 CURRENCY int_bsik-waers,
117 sy-vline,118 v_gtotal5 CURRENCY int_bsik-waers,
134 sy-vline,135 v_gtotal6 CURRENCY int_bsik-waers,
151 sy-vline,152 v_gtotal CURRENCY int_bsik-waers,
168 sy-vline.
HIDE : v_gtotal1,
v_gtotal2,
v_gtotal3,
v_gtotal4,
v_gtotal5,
v_gtotal6,
v_gtotal.
ENDAT.
FORMAT COLOR OFF.
ENDLOOP.
WRITE : /1(168) sy-uline.
ENDFORM. " basic_list
*& Form line_selection
When double clicked on the line display the seconday list
FORM line_selection .
NEW-PAGE LINE-SIZE 206.
Sy-lsind = 1.
DATA : v_rem,v_cnt LIKE sy-tabix.
v_cnt = 0.
SORT int_bsik BY belnr zfbdt.
LOOP AT int_bsik WHERE lifnr EQ int_final-lifnr.
v_rem = v_cnt MOD 2.
CLEAR v_date.
IF int_bsik-zbd3t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd3t.
ELSE.
IF int_bsik-zbd2t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd2t.
ELSE.
v_date = int_bsik-zfbdt + int_bsik-zbd1t.
ENDIF.
ENDIF.
IF int_bsik-zbd1t = ' '.
v_date = int_bsik-zfbdt.
ENDIF.
IF v_rem NE 0.
format color 2 intensified.
WRITE :/1 sy-vline, 2 int_bsik-belnr,
12 sy-vline,13 int_bsik-lifnr,
23 sy-vline,24 int_bsik-name1,
59 sy-vline,60 int_bsik-xblnr,
76 sy-vline,77 int_bsik-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline, 189 sy-vline,
190 int_bsik-dmbtr CURRENCY int_bsik-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
ENDIF.
format color off.
ELSE.
WRITE :/1 sy-vline, 2 int_bsik-belnr,
12 sy-vline,13 int_bsik-lifnr,
23 sy-vline,24 int_bsik-name1,
59 sy-vline,60 int_bsik-xblnr,
76 sy-vline,77 int_bsik-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline,189 sy-vline,
190 int_bsik-dmbtr CURRENCY int_bsik-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
ENDIF.
ENDIF.
FORMAT COLOR OFF.
v_cnt = v_cnt + 1.
ENDLOOP.
WRITE : /1(206) sy-uline.
v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
+ v_subtotal4 + v_subtotal5 + v_subtotal6.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline,
2(85) 'Total'(017) CENTERED CURRENCY int_bsik-waers ,
87 sy-vline,
88 v_subtotal1 CURRENCY int_bsik-waers,
104 sy-vline,
105 v_subtotal2 CURRENCY int_bsik-waers,
121 sy-vline,
122 v_subtotal3 CURRENCY int_bsik-waers,
138 sy-vline,
139 v_subtotal4 CURRENCY int_bsik-waers,
155 sy-vline,
156 v_subtotal5 CURRENCY int_bsik-waers,
172 sy-vline,
173 v_subtotal6 CURRENCY int_bsik-waers,
189 sy-vline,
190 v_subtotal CURRENCY int_bsik-waers,
206 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(206) sy-uline.
CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
ENDFORM. " line_selection
*& Form header1
Secondary List Header
FORM header1 .
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Details of Ageing Analysis for Vendor Open Invoices as on'(024)
v_date1 into v_str separated by space.
FORMAT COLOR 1 intensified.
WRITE :/1(206) sy-uline.
WRITE :/1 sy-vline,12 sy-vline ,
23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
88(101) 'Invoices Due For(In Days)'(014) CENTERED,
189 sy-vline,206 sy-vline.
WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
12 sy-vline, 13(10) 'Vendor#'(015) CENTERED,
23 sy-vline, 24(35) 'Vendor Name'(016) CENTERED,
59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
87 sy-vline, 88(101) sy-uline,
189 sy-vline,190(16) 'Total'(017) CENTERED,
206 sy-vline.
WRITE : /1 sy-vline, 12 sy-vline,
23 sy-vline,59 sy-vline,
76 sy-vline,87 sy-vline,
88(16) v_fir CENTERED, 104 sy-vline,
105(16) v_sec CENTERED, 121 sy-vline,
122(16) v_thir CENTERED, 138 sy-vline,
139(16) v_four CENTERED, 155 sy-vline,
156(16) v_str1 CENTERED,
172 sy-vline,
173(16) 'Already Overdue'(018) CENTERED,
189 sy-vline,
206 sy-vline.
format color off.
WRITE : /1(206) sy-uline.
ENDFORM. " header1Hi
Account Payables(AP) data related vendor invoices is stored in BSIK and BSAK tables
SO fetching the data from those tables for the given vendor and the bucket selected (as I told this ageing is calculated in daysbuckets) and display and the totals at the end of the vendor
go through the code it is easily understandable as we are fetching data just from table BSIK and vendor tables LFA1 LFB1.
<b>Reward points for useful Answers</b>
Regards
Anji -
What will be the output of the following code? Can I get some detail explanation?
class A{
void show(){
System.out.println("A");
interface my{
public void show();
class B extends A{
B(my m){
m.show();
public void show(){
System.out.println("B");
public class test implements my{
public void show(){
System.out.println("test");
public static void main(String args[]){
test t=new test();
B b=new B(t);
b.show();
}ThanksWhat will be the output of the following code? Can I
get some detail explanation?Well, I guess you were not able to figure out HOW you got that output. Should have been a li'l more clear in your question. Never mind now... here is my understanding of the code.
1) The program starts at main()
2) creates an object for test called t (does nothing more than this since it does not have a constructor defined by you!!)
3)creates an object for B whose constructor takes an object argument of type my. you send t becuase test implements my.
4)calls the show method of m in the constructor.
5)now, where is the definition of show() for m? Its in test. So now, that show() is executed and hence "test" is printed first.
6)all done, it comes back to the main() to go to the next statement.
7)calls the show() of b.
8)this version of show asks to print "B" and hence the output.
Was this detailed explanation enough? I hope so... ;-) -
Can someone explain the code for having the Accordion panels closed?
I located the answer to my own question (how to get all the accordion panels to remain closed when the browser opens) but I still don't understand the answer. Can someone explain this?
This feature is only supported when using variable height panels, so you must pass a false into the Accordion's constructor for the "useFixedPanelHeights" constructor options, and a -1 for the "defaultPanel" option:
<script type="test/javascript">
var acc1 = new Spry.Widget.Accordion ("Acc1", { useFixPanelHeights: false, defaultPanel: -1});
</script>
AngelaGPDMTR25 wrote:
I located the answer to my own question (how to get all the accordion panels to remain closed when the browser opens) but I still don't understand the answer. Can someone explain this?
This feature is only supported when using variable height panels, so you must pass a false into the Accordion's constructor for the "useFixedPanelHeights" constructor options, and a -1 for the "defaultPanel" option:
<script type="test/javascript">
var acc1 = new Spry.Widget.Accordion ("Acc1", { useFixPanelHeights: false, defaultPanel: -1});
</script>
Angela
Hi Angela,
You are right, the only way it will work is by setting the fixed height to false. As for the for the default panel option, -1 is not a panel and if you had 3 panels we could have used the number 3 (panel1 = 0) or 99 or whatever as long as there is no panel with that number. If we had used the number 1 for instance, then the 2nd panel would be opened by default.
Hope this helps.
Ben -
Please explain the code given .....
FileInputStream fstream = new FileInputStream("Emp.txt");
DataInputStream dstream = new DataInputStream(fstream);
BufferedReader bf = new BufferedReader(new InputStreamReader(dstream));
String data = null;
String comma = ",";
while((data = bf.readLine()) != null)http://java.sun.com/docs/books/tutorial/essential/io/streams.html
-
Hi there,
I am new in Project Siena. I need to start an app ASAP, a simple one, using Project siena, but I can´t find any information explaining the code.
What is the name of the code which is used in behaviors, properties etc? (html, jquery, jscript)
Where can i find documentation explaining how to write simple sentences using the code? For isntance, i need to know how to hide an image after click (on select) a button.
Many thanks,
MarcoHello Marco,
You can access all the documentation and visuals / function descriptions via the following page
http://www.microsoft.com/en-us/projectsiena/Documentation.aspx
As a starter and addressing your second question and to make that as "sexy" as possible
1. add an image control to the screen and select your image
2. click the image control and open the express view (bottom right) and look for the "Visible" property
3. change the value to
imgVisible
in order to declare a variable
4. add a button control to your screen
in the onSelect of the button add
If(imgVisible=true,UpdateContext({imgVisible:true});UpdateContext({imgVisible:false}),UpdateContext({imgVisible:false});UpdateContext({imgVisible:true}))
within the ifvalue and elsevalue the toggle is to be done twice as to make sure it is applied
5. in order to make sure your image is shown the moment you go on the screen, click somewhere in the screen and in the onVisible of the screen add the following
UpdateContext({imgVisible:false});UpdateContext({imgVisible:true})
This should answer your question.
Regards
StonyArc
http://www.stonyarc.com http://www.xboxlivenation.com Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This is beneficial to other community members
reading the thread. -
HI all,
Can anyone explain the logic in the code ?
This is to display the pages numbers in page 1 of 4
page 2 of 4
format.
i got this code in one of the forum.
if the lineno is less then 64, then why the control is not executing lines_left and its followed by statements ?
REPORT zreport_pages LINE-SIZE 80 LINE-COUNT 65(1) NO STANDARD PAGE HEADING.
DATA: imara TYPE TABLE OF mara WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
PARAMETERS: p_check TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
PERFORM get_data.
PERFORM write_report.
END-OF-PAGE.
PERFORM end_of_page.
*FORM GET_DATA .
FORM get_data.
SELECT * INTO CORRESPONDING FIELDS OF TABLE imara
FROM mara UP TO 315 ROWS.
ENDFORM. "get_data
*FORM WRITE_REPORT .
FORM write_report.
DATA: xpage(4) TYPE c.
DATA: lines_left TYPE i.
LOOP AT imara.
WRITE:/ imara-matnr.
AT LAST.
IF sy-linno < 64.
lines_left = ( sy-linct - sy-linno ) - 1.
SKIP lines_left.
sy-pagno = sy-pagno - 1.
ELSEIF sy-linno = 64.
SKIP 1.
sy-pagno = sy-pagno - 1.
ENDIF.
ENDAT.
ENDLOOP.
WRITE sy-pagno TO xpage LEFT-JUSTIFIED.
DO sy-pagno TIMES.
READ LINE 65 OF PAGE sy-index.
REPLACE '****' WITH xpage INTO sy-lisel.
MODIFY CURRENT LINE.
ENDDO.
ENDFORM. "write_report
**Form end_of_page .
FORM end_of_page.
WRITE:/32 'Test Program', AT 62 'Page:', AT 67 sy-pagno, 'of', '****'.
ENDFORM. "end_of_page
Thanks in advance
krupaliHi KR,
This program just displays first 315 MATNR values from MARA.
Every page consists of 65 lines. At bottom of every page, page number and total page number want to be displayed.
It is checked that last page is filled or incomplete.
If incomplete, those lines are skipped, Just to display page number.
Before that at the end of every page, "PAGE NO 1 OF ****" will be displayed.
After filling last page, the 'TOTAL NUMBER OF PAGES' at the end of every page '*****' replaced by original value.
Regards,
R.Nagarajan. -
Need Explaination for the Code
I would like to understand the declaration part of the code and also the flow below
DATA: L_S_RANGE Type RSR_S_RANGESID,
DATA: LOC_VAR_RANGE like RRRANGEEXIT
what is L_S_RANGE and RSR_S_RANGESID ?
what is LOC_VAR_RANGE and RRRANGEXIT ?
l_s_range-low
l_s_range -high
l_s_range -sign = 'I'.
l_s_range - opt = 'BT'. or 'EQ'
APPEND l_s_range to E_T_RANGE.Hi,
what is L_S_RANGE and RSR_S_RANGESID ?
See the Structure in SE11: RRRANGESID
TYPES: RSR_S_RANGESID TYPE rrrangesid,
RSR_T_RANGESID TYPE Rsdd_T_RANGE,
RSR_S_RANGEK TYPE RRrange,
RSR_T_RANGEK TYPE RRKG_T_RANGEK,
RSR_S_RANGES TYPE RRKG_S_RANGES,
RSR_T_RANGES TYPE RRKG_T_RANGES.
what is LOC_VAR_RANGE and RRRANGEXIT ?
See the Structure in SE11: RRRANGEEXIT
Thanks
Reddy -
Need help to explain these codes!!! Urgently!!!
Hi anyone who's here to help...I am doing my Final year project report now...i dunno how to explain these codes in word...can anyone tell me what it means? what are these codes for...? what does each paragraph indicate?
thanks.
sorry, maybe i only insert pieces of the codes and its vague...ok, in this source code...what i dun understand is....i have cut and paste the sections of codes which i dun understand as below..
bcoz this codes are passed down from my seniors who had graduated...and my task is to explain these codes in the form of a report without me having any background on programming...i tried asking some frens...its either they dunno or forgotten...this is my last hope...thanks again...thanks..
* new added code */
Thread scroller; //for looping purpose
int loopcounter,count;
// thread is to allow the program to be called every and then.
public void init()
/*new added code */
loopcounter=0;[list]
**like whats does "thread scroller" means? Looping purpose? what's looping then?
**also, i've tried on changing the "Loopcounter = 0" to other numbers like 2 and 5...and when i run it on the appletviewer..my image simply runs out of my page...
[list]
*And this part...what does it mean?
/*new added code*/
public void start() {
if (scroller == null) {
scroller = new Thread(this);
scroller.start();
} [list]
for this section here, i really dunno what it says.. "public void start"--start what? scroller again? new Thread(this)?
[list]
public void stop() {
if (scroller != null) {
scroller.stop();
scroller = null;
} [list]
I dunno about this section also.. stops wat??
[list]
public void run() {
try {Thread.currentThread().sleep(100);}
catch (InterruptedException e){}
for (count=0; count <= 400; ) {
try {Thread.currentThread().sleep(20);}
catch (InterruptedException e){}
rm.load();
} [list]
wat is it runing here? try? catch? for? wat does it mean?????
[list]
public void destroy(){;}
public void update(Graphics g){paint(g);}
}[list]
now this.. wat is it destroying?? updateing wat???
[list]
this is my whole program like...
import java.awt.*; /*Contains all of the classes for creating user
interfaces and for painting graphics and images.*/
import java.applet.*; /*Provides the classes necessary to create an applet and the
classes an applet uses to communicate with its applet context.*/
/* Loadable is required for RealMedia so that it know that this code
can load images and sounds and has the startUp() method
/* HotSpotListener is required to let HotSpot call hotSpotEvent(HotSpot) when it
has been clicked
//runnable is for looping purpose ....to animate the text or images.
public class LibraryTest extends Applet implements Loadable, HotSpotListener, Runnable
// RealMedia will load and save images and sounds.
// It will also give information on the loading process.
RealMedia rm;
// Four buttons that can be clicked on.
HotSpot hs1,hs2,hs3,hs4;
// 1 will show image 0 and 1 will show image 1.
int x =0;
/* new added code */
Thread scroller; //for looping purpose
int loopcounter,count;
// thread is to allow the program to be called every and then.
public void init()
/*new added code */
loopcounter=0;
// We'll place the buttons ourselves.
setLayout(null);
setBackground(Color.white);
// create the RealMedia object
rm = new RealMedia(this);
//Start adding all image files you will use
// image0 called pic_black
rm.add("pic_black.jpg","image0");
rm.add("EG3165 Tutorial 1.jpg","image0_1");
rm.add("Question.jpg","image0_2");
rm.add("Solution.jpg","image0_3");
rm.add("Exercise.jpg","image0_4");
//rm.add("cute.gif","image0_5");
rm.add("mac-win.gif","image0_6");
rm.add("walking-floppy.gif","image0_7");
rm.add("eg3165_t001ver03_00.gif","image1");
rm.add("eg3165_t001ver03_01.gif","image2");
rm.add("eg3165_t001ver03_02.gif","image3");
rm.add("eg3165_t001ver03_03.gif","image4");
rm.add("eg3165_t001ver03_04.gif","image5");
rm.add("eg3165_t001ver03_05.gif","image6");
rm.add("eg3165_t001ver03_06.gif","image7");
rm.add("eg3165_t001ver03_07.gif","image8");
rm.add("eg3165_t001ver03_08.gif","image9");
// Start button with 4 images
// 1 Default state, mouseOver and mouseClick state.
rm.add("1st.gif");
rm.add("1st.gif");
rm.add("1st.gif");
// 2 Other button
rm.add("prev.gif");
rm.add("prev.gif");
rm.add("prev.gif");
// 3
rm.add("next.gif");
rm.add("next.gif");
rm.add("next.gif");
// 4
rm.add("last.gif");
rm.add("last.gif");
rm.add("last.gif");
// load the images now
rm.load();
public void startUp()
// button 1
hs1 = new HotSpot(this);
hs1.setImage(rm.get("1st.gif"),1);
hs1.setImage(rm.get("1st.gif"),2);
hs1.setImage(rm.get("1st.gif"),3);
hs1.setBounds(200,515,40,38);
// same for button 2
hs2 = new HotSpot(this);
hs2.setImage(rm.get("prev.gif"),1);
hs2.setImage(rm.get("prev.gif"),2);
hs2.setImage(rm.get("prev.gif"),3);
hs2.setBounds(250,515,40,38);
// same for button 3
hs3 = new HotSpot(this);
hs3.setImage(rm.get("next.gif"),1);
hs3.setImage(rm.get("next.gif"),2);
hs3.setImage(rm.get("next.gif"),3);
hs3.setBounds(300,515,40,38);
// same for button 4
hs4 = new HotSpot(this);
hs4.setImage(rm.get("last.gif"),1);
hs4.setImage(rm.get("last.gif"),2);
hs4.setImage(rm.get("last.gif"),3);
hs4.setBounds(350,515,40,38);
// Place them
add(hs1);
add(hs2);
add(hs3);
add(hs4);
// Repaint makes sure they are immediately visible.
hs1.repaint();
hs2.repaint();
hs3.repaint();
hs4.repaint();
// Here the images are drawn.
public void paint(Graphics g)
g.setColor(Color.white);
// When it is still loading show a loading message.
if (!rm.isLoaded())
g.drawString("loading file "+rm.getCurrent(),20,20);
g.drawString("of "+rm.getTotalFiles(),20,40);
g.drawString("Percent: "+rm.getPercent(),20,60);
g.fillRect(20,80,rm.getPercent(),20);
// Otherwise draw image1 or 2
else
if (x == 0)
//place images using x-coordinates, y-coordinates.
g.drawImage(rm.get("image0"),20,20,this);
g.drawImage(rm.get("image0_1"),80+loopcounter,100+loopcounter,this);
g.drawImage(rm.get("image0_2"),190+loopcounter,175+loopcounter,this);
g.drawImage(rm.get("image0_3"),240+loopcounter,220+loopcounter,this);
g.drawImage(rm.get("image0_4"),290+loopcounter,265+loopcounter,this);
//g.drawImage(rm.get("image0_5"),150+loopcounter,285+loopcounter,this);
g.drawImage(rm.get("image0_6"),400,370,200,100,this);
g.drawImage(rm.get("image0_7"),100,300,this);
loopcounter+=2;
if (loopcounter == 50)
loopcounter = 0;
// if loopcounter+=2, coordinate=x+loopcounter, y+loopcounter.
/* e.g. round 1, loopcounter=0, coordinate=1,3 */
/* e.g. round 2, loopcounter=2, coordinate=3,5 */
/* e.g. round 3, loopcounter=4, coordinate=7,9 */
else if (x == 1)
g.drawImage(rm.get("image1"),20,20,this);
else if (x == 2)
g.drawImage(rm.get("image2"),20,20,this);
else if (x == 3)
g.drawImage(rm.get("image3"),20,20,this);
else if (x == 4)
g.drawImage(rm.get("image4"),20,20,this);
else if (x == 5)
g.drawImage(rm.get("image5"),20,20,this);
else if (x == 6)
g.drawImage(rm.get("image6"),20,20,this);
else if (x == 7)
g.drawImage(rm.get("image7"),20,20,this);
else if (x == 8)
g.drawImage(rm.get("image8"),20,20,this);
else if (x == 9)
g.drawImage(rm.get("image9"),20,20,this);
// This method is called when a button has been clicked.
public void hotSpotEvent(HotSpot hs)
// if it was button 1 show image1.
if (hs == hs1)
x = 1;
// else show image2
else if (hs == hs2)
{x = x - 1;
if ( x <= 1 ) x = 1;
else if (hs == hs3)
{x = x + 1;
if ( x >= 9 ) x = 9;
else
x = 9;
// and repaint to show them.
repaint();
// Necessary for RealMedia to load your images
public Image loadImage(String file)
return getImage(getCodeBase(),file);
// Also required but not used this time.
public AudioClip loadAudio(String file)
return getAudioClip(getDocumentBase(),file);
/*new added code*/
public void start() {
if (scroller == null) {
scroller = new Thread(this);
scroller.start();
public void stop() {
if (scroller != null) {
scroller.stop();
scroller = null;
public void run() {
try {Thread.currentThread().sleep(100);}
catch (InterruptedException e){}
for (count=0; count <= 400; ) {
try {Thread.currentThread().sleep(20);}
catch (InterruptedException e){}
rm.load();
public void destroy(){;}
public void update(Graphics g){paint(g);}
}Thread scroller;//for looping purpose
**like whats does "thread scroller" means? Looping purpose? what's looping then?So, you don't know what a variable declaration is, and you don't know what looping is, and you're unable to find out other than by having somebody here tell you (your school has no library, no bookstore, and no access to google--only to the Java forums).
Either your school is absolutely backwards and useless, or you're a stupid lazy git who deserves to fail the course. Either way, somebody here posting an answer for you is not going to help you.
The following might.
Sun's basic Java tutorial
Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's Thinking in Java (Available online.)
Joshua Bloch's Effective Java
Bert Bates and Kathy Sierra's Head First Java. This one has been getting a lot of very positive comments lately. -
Report Problem need to fix the code
Hello Expert
I am new to apex, I was given a task to interpret the code and fix the problem.
This Apex application has a list of value where the user select the institution as a drop down list menu. After selecting the institution the main report below the drop down list will be populated based on the selection. The problem is that when the user insert record for standalone program, this insert don't appear on the report when the user select the instituion.
can someone look at the code below and explain to me line by line what it does and how can I twick it to solve this problem? I am cloue less and I need expert help
select dt.*
,case when dt.delivery_location is null then null
else htf.anchor ('javascript:void(0);'
,'<img src=#APP_IMAGES#location.png
title=''' ||dt.delivery_location || '''
alt=''' ||dt.delivery_location || '''
height=24 width=24/>'
end dl_hover
from (
select
CASE WHEN INDEP_DEGREE = 'Y' THEN
CASE WHEN Dt.DEGREE_ACRONYM IN ('AACC','ASCC') then
da.DESCRIPTION || ' with an Emphasis Area of ' ||
NVL(Mt.DESCRIPTION,cC.DESCRIPTION)
ELSE
nvl(dt.description, da.DESCRIPTION)
END
ELSE
CASE WHEN Dt.DEGREE_LEVEL IN ('V','A') THEN
nvl(dt.description, da.DESCRIPTION ) || ' with an Option in ' ||
NVL(Mt.DESCRIPTION,Cc.DESCRIPTION)
WHEN Dt.DEGREE_LEVEL IN ('E','C','Z','F') THEN
nvl(dt.description, da.DESCRIPTION ) || ' in ' ||
NVL(Mt.DESCRIPTION,Cc.DESCRIPTION)
ELSE
nvl(dt.description, da.DESCRIPTION ) || ' with a Major in ' ||
NVL(Mt.DESCRIPTION,Cc.DESCRIPTION)
END
END
degree_name
--,'???' emphasis_area
,nvl(mt.cip_code,dt.cip_code) cip_code
,nvl(mt.hours, dt.hours) total_credit_hours
-- ,dt.deactivated status
,case when nvl(mt.deactivated,dt.deactivated) = 'A' then 'Active'
when nvl(mt.deactivated,dt.deactivated) = 'D' then 'Deactivated'
when nvl(mt.deactivated,dt.deactivated) = 'T' then 'Terminated'
WHEN NVL(mt.deactivated,dt.deactivated) = 'I'
THEN 'Inactive'
else null
end status
--,dt.degree_level program_type
,dl.description program_type
,dt.coop_indicator coop_indicator
,nvl(mt.approval_date,dt.approval_date) approval_date
,nvl(mt.implemented,dt.implemented) implemented
,nvl(mt.implementation_date, dt.implementation_date) implementation_date
,nvl(mt.delivery_mode ,dt.delivery_mode) delivery_mode
,(select rtrim(replace(replace(xmlagg(xmlelement("C" ,c.cixxvext_name)).getclobval() ,'<C>' ,'') ,'</C>' ,'
 ') ,'
 ') C
from degree_transaction_details dtd
,cixxvext c
where (dtd.degree_transaction_id = case when INDEP_DEGREE= 'Y' then dt.degree_id else mt.major_id end )
and c.cixxvext_ext_site_cd = dtd.detail_value
and dtd.record_type= case when INDEP_DEGREE = 'Y' then 'DEGREE' else 'MAJOR' end ) delivery_location
,dt.degree_id degree_id
,'Comparison Report' comparison_report
,apex_util.prepare_url ('f?p=&APP_ID.:2:&SESSION.::&DEBUG.:2:P2_FICE_CODE,P2_DEGREE_ID:&P1_FICE_CODE.,'||dt.degree_id) edit_link
,apex_util.prepare_url ('f?p=&APP_ID.:4:&SESSION.::&DEBUG.:RP,4:P4_DEGREE_ID:'||dt.degree_id) cr_link
,dt.description
,mt.major_id major_id
,nvl(mt.online_percentage,dt.online_percentage) online_percent
,nvl(mt.last_inst_review,dt.last_inst_review) last_inst_review
from degree_transactions dt,
degree_acronyms da,
major_transactions mt,
degree_levels dl,
cip_codes cc
where dt.degree_id = mt.degree_id
and mt.cip_code = cc.cip_code
and dl.degree_level = nvl(mt.degree_level,dt.degree_level)
and dt.degree_acronym = da.degree_acronym
and dt.Fice_code = da.fice_code
and dt.degree_level = da.degree_level
and dt.deactivated in ('A','D')
and mt.deactivated in ('A','D')
and dt.fice_code = :P1_FICE_CODE
and dt.show_inst = 'Y'
) dt
order by dt.description nulls firstYou said:
"I was able to debug the code in SQL Developer." Does this mean that you:
ran the code, got results
then set indep_degree to 'Y' on a row in your database
ran the code again and saw the results you are looking for?
If true, your code is working and should operate the same in APEX.
So if your code is working, we need to understand what processes are running on the form and when they are firing.
Jeff -
I bought my new Macbook on July 23, so that qualified me for the free Lion software update. I entered in all my info and then accidently clicked out of the screen before I wrote down the code to redeem it. I tried to do it again but of course it said my system had already been issued a redeem code. Is there a way I can get it back so I can get the update for free?
Hi,
See Here for Contacting Customer Service
Mac Apps Store Customer Service
http://www.apple.com/support/mac/app-store/contact.html?form=account
Explain your situation to them...
Cheers -
Can anyone please explain this code to me?
I am a new (junior)programmer?Can anyone please explain this code to me in lame terms? I am working at a client location and found this code in a project.
_file name is AtccJndiTemplate.java_
Why do we use the Context class?
Why do we use the properties class?
package org.atcc.common.utils;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.springframework.jndi.JndiTemplate;
public class AtccJndiTemplate extends JndiTemplate
private static Logger logger = Logger.getLogger(AtccJndiTemplate.class.getName());
private String jndiProperties;
protected Context createInitialContext()
throws NamingException
Context context = null;
InputStream in = null;
Properties env = new Properties();
logger.info("Load JNDI properties from classpath file " + this.jndiProperties);
try
in = AtccJndiTemplate.class.getResourceAsStream(this.jndiProperties);
env.load(in);
in.close();
catch (NullPointerException e) {
logger.warning("Did not read JNDI properties file, using existing properties");
env = System.getProperties();
} catch (IOException e) {
logger.warning("Caught IOException for file [" + this.jndiProperties + "]");
throw new NamingException(e.getMessage());
logger.config("ENV: java.naming.factory.initial = " + env.getProperty
("java.naming.factory.initial"));
logger.config("ENV: java.naming.factory.url.pkgs = " + env.getProperty
("java.naming.factory.url.pkgs"));
logger.info("ENV: java.naming.provider.url = " + env.getProperty
("java.naming.provider.url") + " timeout=" + env.getProperty("jnp.timeout"));
context = new InitialContext(env);
return context;
public String getJndiProperties()
return this.jndiProperties;
public void setJndiProperties(String jndiProperties)
this.jndiProperties = jndiProperties;
}Hi,
JNDI needs some property such as the
java.naming.factory.initial
java.naming.provider.url
which are needed by the
InitialContext(env);
where env is a properties object
Now if you can not find the physical property file on the class path
by AtccJndiTemplate.class.getResourceAsStream(this.jndiProperties);
where the String "jndiProperties" get injected by certain IOC ( inverse of control container ) such as Spring framework
if not found then it will take the property from the system which will come from the evniromental variables which are set during the application start up i.e through the command line
java -Djava.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory -Danother=value etc..
I hope this could help
Regards,
Alan Mehio
London,UK -
How to create an audit trail file and what is it ( pls see the code)
All my System.out.println statements , should be printed in an audit file , instead of printing to a console .
How and where in the program , i should create a file and how should i write System.out.println statements output to it .
Pls help me with the code .
//Start the main method
public static void main(String[] args){
if(!(args.length == 3 || args.length == 4))
System.out.println("Usage: java Load_data @baseyr @rateyr @caseID [@infile]");
System.exit(1);
String baseYr = args[0];
String rateYr = args[1];
String param3 = args[2];
System.out.println("The base year is :"+baseYr);
System.out.println("The rate year is :"+rateYr);
if(param3.compareToIgnoreCase("max") == 0)
caseID=25;
System.out.println("The CaseID begins at :"+caseID);
else if(param3.compareToIgnoreCase("one") == 0)
System.out.println("Warning : I am assuming the CaseID as 1");
//caseID=1;
inFile = (args.length == 4) ? args[3] : "C\\UDS_YYYY.txt";
System.out.println("The Input file we are using is :"+inFile);
goodOutFile = "C:/Documents and Settings/Desktop/Program/GOOD_LOAD.txt";
badOutFile = "C:/Documents and Settings/Desktop/Program/BAD_LOAD.txt";
inFormat = "C:/Documents and Settings/Desktop/Program/FORMAT.csv";
//Here I call the Load_data method.
new Load_data();
System.out.println("The number of records written to good O/P FIle :" +goodRecord);
System.out.println("The number of records written to bad O/P FIle :" +badRecord);
System.out.println("")
}1sai wrote:
However, a better choice would be to use log4j which support rolling log files and more control over what output goes where in what format.
Can U pls explain this ,or where i can learn abt this .
Thank UTry clicking on the link BigDaddyLoveHandles provided you in the previous reply.
Your hands must get tired with your hiney sitting on them all day, huh?
Maybe you are looking for
-
How to find the user belongs to ?
Hi all, i want to find the user in which role he belongs to ? in which view we can find these information? pls help me Thanks Regards, M.Murali...
-
Printer prints at a slant on cards
The last three HP printers I have had all have printed text at a slight slant when printing on cards (4 X 6 inches and other sizes too). Does anyone have a solution to this? My current printer is an Officejet 4500. Thanks!
-
Truncating old partitions in the table.
Hi, Can you pls helpme out in writing a job/script(procedure) to truncate 6 older partitons with date range partition 'YYYY-MM' in the table!!! Thanks,
-
I'm going to purchase a GoPro HD Hero2 helmet cam , can i down load footage straight to iMovie 11 event browser or is this going to be a problem ?
-
Get operation details of transaction CO02
Hello Experts, I need operation details of an production order (CO02). I try for BAPI and function modules and get the operation details also. But I need the value of user defined fields also, that I did not get through those BAPIs. If someone know a