Plz chk the code
==================================
PERFORM get_spool_number USING sy-repid
sy-uname
CHANGING mi_rqident.
=====================================
FORM get_spool_number USING f_repid
f_uname
CHANGING f_rqident.
DATA:
lc_rq2name LIKE tsp01-rq2name.
CONCATENATE f_repid+0(8)
f_uname+0(3)
INTO lc_rq2name SEPARATED BY '_'.
SELECT rqident FROM tsp01 WHERE rq2name = lc_rq2name
ORDER BY rqcretime DESCENDING.
f_rqident = tsp01-rqident.
EXIT.
ENDSELECT.
IF sy-subrc NE 0.
CLEAR f_rqident.
ENDIF.
ENDFORM." get_spool_number
Field list without INTO clause is not allowed . allowed. . allowed. .
is the error i m getting when i activate it..
what is the error in select query....
Hi,
try this
==================================
PERFORM get_spool_number USING sy-repid
sy-uname
CHANGING mi_rqident.
=====================================
FORM get_spool_number USING f_repid
f_uname
CHANGING f_rqident.
DATA: lc_rq2name LIKE tsp01-rq2name.
CONCATENATE f_repid+0(8) f_uname+0(3)
INTO lc_rq2name SEPARATED BY '_'.
SELECT rqident INTO tsp01-rqident FROM tsp01
WHERE rq2name = lc_rq2name
ORDER BY rqcretime DESCENDING.
f_rqident = tsp01-rqident.
EXIT.
ENDSELECT.
IF sy-subrc NE 0.
CLEAR f_rqident.
ENDIF.
ENDFORM." get_spool_number
Make sure that u have declared teh TABLES: tsp01.
Hope thsi solves ur problem.
Reward points and close the thread if ur problem got solved.
Similar Messages
-
hi
can any one execute the following code n tell me y its not workin...
actually the file is getting downloaded and it opens by excel but not with the pdf.
REPORT z_output_pdf.
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
matnr TYPE ekpo-matnr,
END OF t_ekpo.
DATA:wa_ekpo TYPE t_ekpo,
p_repid LIKE sy-repid,
it_ekpo TYPE STANDARD TABLE OF t_ekpo.
DATA : lv_repid TYPE sy-repid,
lv_uname TYPE sy-uname.
data:
mstr_print_parms like pri_params,
mc_valid(1) type c,
mi_bytecount type i,
mi_length type i.
data:
mtab_pdf like tline occurs 0 with header line,
mc_filename like rlgrap-filename.
lv_repid = sy-repid.
lv_uname = sy-uname.
SELECT ebeln matnr
FROM ekpo
INTO TABLE it_ekpo.
LOOP AT it_ekpo INTO wa_ekpo.
WRITE :/ wa_ekpo-ebeln, wa_ekpo-matnr.
ENDLOOP.
DATA: print_parameters TYPE pri_params,
valid_flag(1) TYPE c,
mi_rqident LIKE tsp01-rqident.
DATA: p_linsz TYPE sy-linsz VALUE 132, " Line size
p_paart TYPE sy-paart VALUE 'X_65_132'. " Paper Format
CALL FUNCTION 'GET_PRINT_PARAMETERS'
IMPORTING
out_parameters = print_parameters
valid = valid_flag
EXCEPTIONS
invalid_print_params = 2
OTHERS = 4.
*-- Explicitly set line width, and output format so that
*-- the PDF conversion comes out OK
print_parameters-linsz = p_linsz.
print_parameters-paart = p_paart.
print_parameters-pdest = 'LOCL'.
*SUBMIT (lv_repid) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS print_parameters
VIA SELECTION-SCREEN
AND RETURN.
*IF sy-subrc <> 0.
WRITE :' error'.
*ENDIF.
*-- Find out what the spool number is that was just created
PERFORM get_spool_number USING lv_repid
lv_uname
CHANGING mi_rqident.
*-- Convert Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = mi_rqident
no_dialog = space
dst_device = print_parameters-pdest
importing
pdf_bytecount = mi_bytecount
tables
pdf = mtab_pdf
exceptions
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
others = 12.
call function 'DOWNLOAD'
exporting
bin_filesize = mi_bytecount
filename = mc_filename
filetype = 'BIN'
importing
act_filename = mc_filename
tables
data_tab = it_ekpo.
write :' ============'.
FORM get_spool_number *
Get the most recent spool created by user/report *
--> F_REPID *
--> F_UNAME *
--> F_RQIDENT *
FORM get_spool_number USING f_repid
f_uname
CHANGING f_rqident.
DATA:
lc_rq2name LIKE tsp01-rq2name.
CONCATENATE f_repid+0(8)
f_uname+0(3)
INTO lc_rq2name SEPARATED BY '_'.
DATA : ls_tsp01 TYPE tsp01,
lt_tsp01 TYPE TABLE OF tsp01.
SELECT * FROM tsp01
INTO TABLE lt_tsp01
WHERE rq2name = lc_rq2name
ORDER BY rqcretime DESCENDING.
LOOP AT lt_tsp01 INTO ls_tsp01.
f_rqident = ls_tsp01-rqident.
EXIT.
ENDLOOP.
SELECT * FROM tsp01 WHERE rq2name = lc_rq2name
ORDER BY rqcretime DESCENDING.
f_rqident = tsp01-rqident.
EXIT.
ENDSELECT.
IF sy-subrc NE 0.
CLEAR f_rqident.
ENDIF.
ENDFORM." get_spool_number
plz chk n tell me where its goin wrong....
Message was edited by:
neha guptaHi neha,
i do it in this way:
REPORT ZGRO_ITAB_PDF_SPOOL.
DATA: BEGIN OF ITAB OCCURS 0,
TEXT(72),
END OF ITAB.
Länge der PDF-Datei in Byte
DATA: PDF_FILESIZE TYPE I.
DATA: BIN_FILESIZE TYPE I.
Druckparameter mit Gültigkeit
DATA: PARAMS LIKE PRI_PARAMS,
VALID TYPE C.
Spoolnummer
DATA: SPOOL_NR LIKE TSP01-RQIDENT,
SPOOL_NR_DEL LIKE TSP01_SP0R-RQID_CHAR.
PDF Ausgabetabelle
DATA: BEGIN OF PDF_OUTPUT OCCURS 0.
INCLUDE STRUCTURE TLINE.
DATA: END OF PDF_OUTPUT.
DATA: PROGRAM(128) TYPE C.
DATA: DATEI TYPE STRING VALUE 'D:TESTPDF.PDF'.
DATA: APPL TYPE STRING.
START-OF-SELECTION.
Druckparameter besorgen (hier für LOCA)
Line-size sollte entsprechende der Ausgabe gesetzt werden
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
DESTINATION = 'LOCA'
LINE_SIZE = 080
IMMEDIATELY = ' '
NO_DIALOG = 'X'
IMPORTING
OUT_PARAMETERS = PARAMS
VALID = VALID.
CHECK VALID <> SPACE.
Versorgen der internen Tabelle
READ REPORT 'ZGRO_ITAB_PDF_SPOOL' INTO ITAB.
Ausgabe der internen Tabelle mit den Druckparametern.
NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG NO-TITLE NO-HEADING.
LOOP AT ITAB.
WRITE:/ ITAB.
ENDLOOP.
NEW-PAGE PRINT OFF.
Spoolnummer besorgen
SPOOL_NR = SY-SPONO.
Konvertierung der Ausgabe nach PDF
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = SPOOL_NR
IMPORTING
PDF_BYTECOUNT = PDF_FILESIZE
TABLES
PDF = PDF_OUTPUT
EXCEPTIONS
ERR_NO_ABAP_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DESTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11
OTHERS = 12.
CHECK SY-SUBRC = 0.
SPOOL_NR_DEL = SPOOL_NR.
Spool wieder löschen
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
SPOOLID = SPOOL_NR_DEL.
BIN_FILESIZE = PDF_FILESIZE.
Download der Spools
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
EXPORTING
BIN_FILESIZE = BIN_FILESIZE
FILENAME = DATEI
FILETYPE = 'BIN'
CHANGING
DATA_TAB = PDF_OUTPUT[].
Programmpfad auf PC für PDF ermitteln
CALL FUNCTION 'SO_PROGNAME_GET_WITH_PATH'
EXPORTING
DOCTYPE = 'PDF'
IMPORTING
PATHNAME = PROGRAM
EXCEPTIONS
PATH_NOT_FOUND = 1
PROGRAM_NOT_FOUND = 2
NO_BATCH = 3
X_ERROR = 4
OTHERS = 5.
PDF ausführen
APPL = PROGRAM.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
EXPORTING
PARAMETER = DATEI
APPLICATION = APPL.
Programmende *
Regards, Dieter -
Plz chk the code wats wrong in it
hi
i m having itab with vbeln
and ztable with objnr and ordsent.
where objnr and vbeln are equal
so now when i find objnr EQ vbeln i have to modify the ztable-ordsent = ' '.
i have writen the followin code
LOOP AT lt_ztsd2marc INTO ls_ztsd2marc.
READ TABLE ct_success INTO ls_success WITH KEY ordnr =
ls_ztsd2marc-ordnr.
IF sy-subrc EQ 0.
ls_ztsd2marc-ordsent = ' '.
MODIFY TABLE lt_ztsd2marc FROM ls_ztsd2marc TRANSPORTING ordsent .
MODIFY ztsd2marc FROM TABLE lt_ztsd2marc.
IF sy-subrc EQ 0.
MESSAGE s112(z2).
ENDIF.
ENDIF.
ENDLOOP.
its updating it in work area but the changes are not gettin reflected in the internal table and not even in my ztable ztsd2marc.
plz tell me wat is wrong in this code?hi..
jus try the code below.. it'll def give the solution to ur question.
i've jus modified little of ur code that u posted.
LOOP AT lt_ztsd2marc INTO ls_ztsd2marc.
READ TABLE ct_success INTO ls_success WITH KEY ordnr =
ls_ztsd2marc-ordnr.
IF sy-subrc EQ 0.
ls_ztsd2marc-ordsent = ' '.
MODIFY TABLE lt_ztsd2marc FROM ls_ztsd2marc TRANSPORTING ordsent
where ordnr = ls_ztsd2marc-ordnr .
**MODIFY ztsd2marc FROM TABLE lt_ztsd2marc.
update ztsd2marc set ordsent = it_ztsd2marc-orsent
where ordnr = it_ztsd2marc-ordnr.
IF sy-subrc EQ 0.
MESSAGE s112(z2).
ENDIF.
ENDIF.
ENDLOOP.
all the best -
SAX problem(plz see the code given)
hi all,
i am using SAX parser for validating my xml file against the dtd,i am getting some errors that i am not able to make out.cud u plz help me.i am sending u my files.
------------------------java file------------------------------------
import java.io.*;
import org.xml.sax.*;
import org.xml.sax.helpers.DefaultHandler;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
public class Echo extends DefaultHandler
public static void main(String argv[]){
if (argv.length != 1) {
System.err.println("Usage: cmd filename");
System.exit(1);
// Use an instance of ourselves as the SAX event handler
//DefaultHandler handler=new DefaultHandler();
Echo handler=new Echo();
// Use the default (non-validating) parser
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating(true);
try {
// Set up output stream
out = new OutputStreamWriter(System.out, "UTF8");
// Parse the input
SAXParser saxParser = factory.newSAXParser();
saxParser.parse( new File(argv[0]), handler );
catch (SAXParseException spe) {
// Error generated by the parser
System.out.println("\n** Parsing error"
+ ", line " + spe.getLineNumber()
+ ", uri " + spe.getSystemId());
System.out.println(" " + spe.getMessage() );
}catch (Throwable t){
t.printStackTrace();
System.exit(0);
static private Writer out;
public void startDocument()
throws SAXException{
emit("<?xml version='1.0' encoding='UTF-8'?>");
nl();
public void endDocument()
throws SAXException{
try {
nl();
out.flush();
}catch (IOException e) {
throw new SAXException("I/O error", e);
public void startElement(String namespaceURI,
String sName, // simple name (localName)
String qName, // qualified name
Attributes attrs)
throws SAXException
String eName = sName; // element name
if ("".equals(eName)) eName = qName; // namespaceAware = false
emit("<"+eName);
if (attrs != null) {
for (int i = 0; i < attrs.getLength(); i++) {
String aName = attrs.getLocalName(i); // Attr name
if ("".equals(aName)) aName = attrs.getQName(i);
emit(" ");
emit(aName+"=\""+attrs.getValue(i)+"\"");
emit(">");
public void endElement(String namespaceURI,
String sName, // simple name
String qName // qualified name
throws SAXException
emit("</"+qName+">");
public void characters(char buf[], int offset, int len)
throws SAXException
String s = new String(buf, offset, len);
emit(s);
public void ignorableWhitespace(char buf[], int offset, int Len)
throws SAXException
nl();
//emit("IGNORABLE");
private void emit(String s)
throws SAXException
try {
out.write(s);
out.flush();
} catch (IOException e) {
throw new SAXException("I/O error", e);
private void nl()
throws SAXException
String lineEnd = System.getProperty("line.separator");
try {
out.write(lineEnd);
} catch (IOException e) {
throw new SAXException("I/O error", e);
public void error(SAXParseException e)
throws SAXParseException
throw e;
public void warning(SAXParseException e)throws SAXParseException{
System.out.println("WARNING : Line Number:- "+e.getLineNumber());
System.out.println("WARNING : Column Number:- "+e.getColumnNumber());
System.out.println("WARNING : System ID:- "+e.getSystemId());
System.out.println("WARNING : Public Number:- "+e.getPublicId());
--------------------------xml file------------------------------------
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE slideshow SYSTEM "echo.dtd">
<!-- A SAMPLE set of slides -->
<slideshow
title="Sample Slide Show"
date="Date of publication"
author="Yours Truly"
>
<![CDATA[Digram : frobmorten <------------ fuznaten
| <3> ^
| <1> | <1> = fozzle
V | <2> = framboze
Staten+ <3> = frenzle
<2>
]]>
<!-- TITLE SLIDE -->
<slide type="all">
<image src="my.gif" alt="this is my pic" type="image/gif"/>
<title>Wake up to WonderWidgets!</title>
</slide>
<!-- OVERVIEW -->
<slide type="all">
<title>Overview</title>
<item>WonderWidgets are great</item>
<item/>
<item>Who buys WonderWidgets</item>
</slide>
<slide type="all">
<title>Overview</title>
<item>Who buys WonderWidgets</item>
</slide>
</slideshow>
-----------------------------dtd file---------------------------------
<!ELEMENT slideshow (slide+)>
<!ATTLIST slideshow
title CDATA #IMPLIED
date CDATA #IMPLIED
author CDATA #IMPLIED
>
<!ELEMENT slide (image?,title, item*)>
<!ATTLIST slide type CDATA #IMPLIED>
<!ELEMENT title (#PCDATA)>
<!ELEMENT item (#PCDATA | item)* >
<!ELEMENT image EMPTY>
<!ATTLIST image
alt CDATA #IMPLIED
src CDATA #REQUIRED
type CDATA "image/gif"
>
-----------------------ERROR I AM GETTING IS--------------------------
<?xml version='1.0' encoding='UTF-8'?>
<slideshow title="Sample Slide Show" date="Date of publication" author="Yours Tr
uly">
Digram : frobmorten <------------ fuznaten
| <3> ^
| <1> | <1> = fozzle
V | <2> = framboze
Staten+ <3> = frenzle
<2>
<slide type="all">
<image src="my.gif" alt="this is my pic" type="image/gif"></image>
<title>Wake up to WonderWidgets!</title>
</slide>
<slide type="all">
<title>Overview</title>
<item>WonderWidgets are great</item>
<item></item>
<item>Who buys WonderWidgets</item>
</slide>
<slide type="all">
<title>Overview</title>
<item>Who buys WonderWidgets</item>
</slide>
org.xml.sax.SAXException: The content of element type "slideshow" must m
atch "(slide)+".
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.j
ava:979)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at Echo.main(Echo.java:28)
with my lot efforts i am not able to make out where i am wrong,plz do have a look on the codes.
thanx in advance
best regards
anshulHi i have consulted the XML spec and it is not possible to have a CDATA section as element content. A element declaration can have only content that is empty, ANY (i.e. can include any other declared elements in DTD), mixed (i.e. can contain PCDATA or child elements, or child elements. An element cannot include any character data which CDATA represents. i.e it is not valid to do <!ELEMENT slideshow CDATA>
The CDATA can only be used with an attribute declaration. Regard CDATA as a type definition for any attribute variables.
So what do i suggest. You could declare a separate element which has an attribute for the CDATA section
<!ELEMENT input (Name)>
<!ATTLIST input instructions CDATA #REQUIRED>
hope this helps. -
Hi all,
Friends please tell me what is the problem with this code.....
It is not giving what i want.......
I want only that row in the table to have orange background which contains the value 'check'..
but what it does is that it sets all the other rows as orange too....
but when i select all the rows in the table.....it does show the color of the cell which contains 'check' and the color of the rest of the cells which are set to highlight color...
please chk the following code and let me know if there is any error...
public class ErrorEntryCellRenderer extends DefaultTableCellRenderer {
/** Creates a new instance of ErrorEntryCellRenderer */
public ErrorEntryCellRenderer() {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component retValue;
retValue = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if(value instanceof String) {
if(((String)value).equalsIgnoreCase("check")) {
setBackground(Color.ORANGE);
validate();
return retValue;
}Thank you..
Message was edited by:
vaibhavpingleit doesnt work then...it does not paint any thing......
i did the following changes
public Component getTableCellRendererComponent(JTable table, Color c, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component retValue;
retValue = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if(value instanceof String) {
if(((String)value).equalsIgnoreCase("check")) {
setBackground(Color.ORANGE);
validate();
} else {
setBackground(c);
validate();
return retValue;
} -
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 -
SELECT T0.[AcctName], T1.[Debit], T2.[U_SLRemark], T3.[RefDate], T3.[Number], T4.[Name], T5.[U_Project] FROM OACT T0 INNER JOIN JDT1 T1 ON T0.AcctCode = T1.Account INNER JOIN VPM4 T2 ON T0.AcctCode = T2.AcctCode INNER JOIN OJDT T3 ON T1.TransId = T3.TransId, [dbo].[@OSLA] T4, [dbo].[@SLT1] T5
in output all the rows are repeating even i used distinct also
plz helphai,
Just try this,
SELECT T0.AcctCode,T0.AcctName, T1.Debit, T2.U_SLRemark, T3.RefDate, T3.Number, T4.Name, T5.U_Project FROM OACT T0 INNER JOIN JDT1 T1 ON T0.AcctCode = T1.Account INNER JOIN VPM4 T2 ON T0.AcctCode = T2.AcctCode INNER JOIN OJDT T3 ON T1.TransId = T3.TransId, dbo.@OSLA T4, dbo.@SLT1 T5 group by T0.AcctCode
Thanks. -
How to stop the encoding ?plz see the code and correct it
public class NewClass
/** Creates a new instance of NewClass */
public NewClass ()
StateHelper sh=null;
Processor p=null;
try
p=Manager.createProcessor (new URL ("file:///ring.wav"));
sh = new StateHelper (p);
p.configure ();
catch (NoProcessorException ex)
ex.printStackTrace ();
catch (IOException ex)
ex.printStackTrace ();
p.setContentDescriptor (new FileTypeDescriptor (FileTypeDescriptor.MPEG_AUDIO));
TrackControl track[] = p.getTrackControls ();
boolean encodingPossible = false;
for (int i = 0; i < track.length; i++)
try
track.setFormat (new AudioFormat (AudioFormat.MPEG));
encodingPossible = true;
catch (Exception e)
track[i].setEnabled (false);
if (!sh.realize (10000))
System.exit (-1);
DataSource source = p.getDataOutput ();
MediaLocator dest = new MediaLocator ("file://ring1.mpg");
DataSink filewriter = null;
try
filewriter = Manager.createDataSink (source, dest);
filewriter.open ();
filewriter.addDataSinkListener (new DataSinkListener ()
public void dataSinkUpdate (DataSinkEvent e)
if(e instanceof javax.media.datasink.EndOfStreamEvent)
DataSink ds=e.getSourceDataSink ();
try
ds.stop ();
System.out.println ("finished write");
catch (IOException ex)
ex.printStackTrace ();
filewriter.start ();
catch (NoDataSinkException e)
System.exit (-1);
catch (IOException e)
System.exit (-1);
catch (SecurityException e)
System.exit (-1);
p.start ();
p.addControllerListener (new ControllerAdapter ()
public void endOfMedia (EndOfMediaEvent e)
Controller controller = (Controller) e.getSource ();
controller.stop ();
controller.deallocate ();
System.out.println ("finished run through");
public static void main (String[] args)
new NewClass ();
o/p is "finished run through",the EndOfStreamEvent never occurs.please correct if anything is wrong.when i manually stop the program then only the encoded file appears on the disk. this has to used from the other class and i cannot afford to use exit().help me.Try this - it seems to work
public class NewClass
Processor p = null;
DataSink sink = null;
/** Creates a new instance of NewClass */
public NewClass ()
try{
p = Manager.createProcessor (new URL ("file:C:/WINDOWS/Media/Windows XP Startup.wav"));
p.addControllerListener (new ControllerAdapter ()
public void configureComplete(ConfigureCompleteEvent e){
System.out.println ("ConfigureCompleteEvent");
Processor p = (Processor)e.getSourceController();
processConfigured(p);
public void realizeComplete(RealizeCompleteEvent e){
System.out.println ("RealizeCompleteEvent");
Processor p = (Processor)e.getSourceController();
processrealized(p);
public void controllerClosed(ControllerClosedEvent e){
System.out.println ("ControllerClosedEvent");
public void endOfMedia (EndOfMediaEvent e)
System.out.println ("EndOfMediaEvent");
Processor p = (Processor)e.getSourceController();
p.stop();
public void stop(StopEvent e){
System.out.println ("StopEvent");
Processor p = (Processor)e.getSourceController();
p.close();
p.configure();
}catch (NoProcessorException ex){
ex.printStackTrace ();
}catch (IOException ex){
ex.printStackTrace ();
private void processrealized(Processor p){
MediaLocator dest = new MediaLocator("file:C:/Workspace/ring1.mpg");
try{
sink = Manager.createDataSink(p.getDataOutput(), dest);
sink.addDataSinkListener(new DataSinkListener(){
public void dataSinkUpdate(DataSinkEvent e){
if(e instanceof EndOfStreamEvent){
System.out.println ("EndOfStreamEvent");
sink.close();
sink.open();
sink.start();
}catch(Exception eX){
p.start();
private void processConfigured(Processor p){
p.setContentDescriptor (new FileTypeDescriptor (FileTypeDescriptor.MPEG_AUDIO));
TrackControl track[] = p.getTrackControls ();
boolean encodingPossible = false;
for (int i = 0; i < track.length; i++){
try{
track.setFormat (new AudioFormat (AudioFormat.MPEG));
encodingPossible = true;
}catch (Exception e){
track[i].setEnabled (false);
p.realize();
public static void main (String[] args)
new NewClass ();
` -
hi
SELECT SINGLE objky
FROM nast
INTO lv_objky
WHERE kappl EQ 'EF'
AND objky EQ lv_var
AND spras EQ 'EN'
AND parnr IN ('s7dclnt200', 's7qclnt450', 's7pclnt450')
AND parvw EQ 'LS'.
IF sy-subrc EQ 0.
endif.
this is my select query ..
in database i have the entry but i m getting sy-subrc not equal to 0. please let me know...Hello Neha,
Here the Variable lv_var should be similar to the value in that table.
Check this
SELECT SINGLE objky
FROM nast
INTO lv_objky
WHERE kappl EQ 'EF'
AND objky EQ lv_var " Chekc here
AND spras EQ 'EN'
AND parnr IN ('s7dclnt200', 's7qclnt450', 's7pclnt450')
AND parvw EQ 'LS'.
IF sy-subrc EQ 0.
endif.
REgards,
Vasanth -
Plz check the code and tell me necessary modifications
report Z_PHANIBDC2
no standard page heading line-size 255.
include bdcrecx1.
PARAMETERS:P_FILE LIKE RLGRAP-FILENAME DEFAULT
'C:Documents and Settingssarath.vempatiDesktopphani1.TXT' OBLIGATORY
DATA: BEGIN OF RECORD1 OCCURS 0,
LIFNR(018),
BURKS(011),
KTOKK(014),
ANRED(014),
NAME1(014),
SURTL(014),
STRAS(012),
ORT01(040),
LAND1(013),
SPRAS(019),
KUNNR(015),
BANKL(012),
BANKS(018),
AKONT(022),
ZTERM(012),
MAHNA(016),
END OF RECORD1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = 'P_FILE '
* DEF_PATH = ' '
MASK = ',*.*,*.*. '
MODE = 'O'
TITLE = 'GET FILENAME '
IMPORTING
FILENAME = P_FILE
* RC =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
START-OF-SELECTION.
*LOOP AT RECORD1 FROM 2.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
* CODEPAGE = ' '
FILENAME = 'P_FILE '
FILETYPE = 'DAT'
* HEADLEN = ' '
* LINE_EXIT = ' '
* TRUNCLEN = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* DAT_D_FORMAT = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = RECORD1
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
DATA : RECORD LIKE RECORD1 OCCURS 0 WITH HEADER LINE.
DATA : RECORD3 LIKE RECORD1 OCCURS 0 WITH HEADER LINE.
DATA : LIFNR1 LIKE LFA1-LIFNR.
LOOP AT RECORD1.
IF RECORD1-LIFNR <> ''.
LIFNR1 = RECORD1-LIFNR.
RECORD3-LIFNR = RECORD1-LIFNR.
RECORD3-BURKS = record1-BURKS.
APPEND RECORD3.
ELSE.
RECORD3-LIFNR = LIFNR1.
RECORD3-BURKS = record1-BURKS.
APPEND RECORD3.
ENDIF.
ENDLOOP.
DELETE RECORD1 WHERE LIFNR = ''.
RECORD[] = RECORD1[].
DATA VAR1(15).
DATA VAR2(15).
DATA COUNT(2).
DATA COUNT1(2) VALUE 1.
DATA VAR3(16).
DATA VAR4(16).
DATA VAR5(16).
DELETE ADJACENT DUPLICATES FROM RECORD COMPARING LIFNR BURKS.
write:/ 'phani'.
*IF SY-SUBRC <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
perform open_group.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
record1-lifnr.
perform bdc_field using 'RF02K-BUKRS'
RECORD1-BURKS.
perform bdc_field using 'RF02K-KTOKK'
RECORD1-KTOKK.
perform bdc_field using 'RF02K-REF_LIFNR'
RECORD1-LIFNR.
perform bdc_field using 'RF02K-REF_BUKRS'
RECORD1-BURKS.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-TELX1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-ANRED'
'RECORD1-ANRED'.
perform bdc_field using 'LFA1-NAME1'
'RECORD1-NAME1'.
perform bdc_field using 'LFA1-SORTL'
'RECORD1-SORTL'.
perform bdc_field using 'record1-STRAS'
'RECORD1-STRAS'.
perform bdc_field using 'LFA1-ORT01'
'RECORD1-ORT01'.
perform bdc_field using 'LFA1-LAND1'
'RECORD1-LAND1'.
perform bdc_field using 'LFA1-SPRAS'
'RECORD1-SPRAS'.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-KUNNR'
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKL(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'LFBK-BANKS(01)'
'IN'.
perform bdc_field using 'LFBK-BANKL(01)'
'RECORD1-BANKL'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'record1-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02K' '0210'.
perform bdc_field using 'BDC_CURSOR'
'record1-AKONT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR'
'record1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR'
'record1-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'XK01'.
perform close_group.report Z_PHANIBDC2
no standard page heading line-size 255.
include bdcrecx1.
DATA: BEGIN OF RECORD1 OCCURS 0,
LIFNR(018),
BURKS(011),
KTOKK(014),
ANRED(014),
NAME1(014),
SURTL(014),
STRAS(012),
ORT01(040),
LAND1(013),
SPRAS(019),
KUNNR(015),
BANKL(012),
BANKS(018),
AKONT(022),
ZTERM(012),
MAHNA(016),
END OF RECORD1.
<b>perform upload.</b>
perform open_group.
loop at recored.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
record1-lifnr.
perform bdc_field using 'RF02K-BUKRS'
RECORD1-BURKS.
perform bdc_field using 'RF02K-KTOKK'
RECORD1-KTOKK.
perform bdc_field using 'RF02K-REF_LIFNR'
RECORD1-LIFNR.
perform bdc_field using 'RF02K-REF_BUKRS'
RECORD1-BURKS.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-TELX1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-ANRED'
'RECORD1-ANRED'.
perform bdc_field using 'LFA1-NAME1'
'RECORD1-NAME1'.
perform bdc_field using 'LFA1-SORTL'
'RECORD1-SORTL'.
perform bdc_field using 'record1-STRAS'
'RECORD1-STRAS'.
perform bdc_field using 'LFA1-ORT01'
'RECORD1-ORT01'.
perform bdc_field using 'LFA1-LAND1'
'RECORD1-LAND1'.
perform bdc_field using 'LFA1-SPRAS'
'RECORD1-SPRAS'.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-KUNNR'
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKL(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'LFBK-BANKS(01)'
'IN'.
perform bdc_field using 'LFBK-BANKL(01)'
'RECORD1-BANKL'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'record1-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02K' '0210'.
perform bdc_field using 'BDC_CURSOR'
'record1-AKONT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR'
'record1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR'
'record1-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'XK01'.
endloop.
perform close_group.
<b>form upload.</b>
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = ' '
FILETYPE = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = RECORD1
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
DATA : RECORD LIKE RECORD1 OCCURS 0 WITH HEADER LINE.
DATA : RECORD3 LIKE RECORD1 OCCURS 0 WITH HEADER LINE.
DATA : LIFNR1 LIKE LFA1-LIFNR.
LOOP AT RECORD1.
IF RECORD1-LIFNR <> ''.
LIFNR1 = RECORD1-LIFNR.
RECORD3-LIFNR = RECORD1-LIFNR.
RECORD3-BURKS = record1-BURKS.
APPEND RECORD3.
ELSE.
RECORD3-LIFNR = LIFNR1.
RECORD3-BURKS = record1-BURKS.
APPEND RECORD3.
ENDIF.
ENDLOOP.
DELETE RECORD1 WHERE LIFNR = ''.
RECORD[] = RECORD1[].
DATA VAR1(15).
DATA VAR2(15).
DATA COUNT(2).
DATA COUNT1(2) VALUE 1.
DATA VAR3(16).
DATA VAR4(16).
DATA VAR5(16).
DELETE ADJACENT DUPLICATES FROM RECORD COMPARING LIFNR BURKS.
write:/ 'phani'.
*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. -
i create an id. on review option when i enter visa card and security code, it always gives an error msg "Invalid Secruity code". but i use this code for money withdraw from ATM and for shopping also. plz tell the solution ????
The code they are asking for is the last three digits of the number on the back of the card (you don't use this when using an ATM or presenting the card in shops).
-
Plz send me the code of interctive ALV report
Hi
plz send me the code of interctive ALV report
thanks in advance
rachuHi
<u><b>For More alv report examples check these Tcodes <i>LIBS, BIBS</i>Here u can find more number of examples on alv reports of different kinds</b></u>
Check this sample code
TYPE-POOLS: SLIS.
*type declaration for values from ekko
TYPES: BEGIN OF I_EKKO,
EBELN LIKE EKKO-EBELN,
AEDAT LIKE EKKO-AEDAT,
BUKRS LIKE EKKO-BUKRS,
BSART LIKE EKKO-BSART,
LIFNR LIKE EKKO-LIFNR,
END OF I_EKKO.
DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
WA_EKKO TYPE I_EKKO.
*type declaration for values from ekpo
TYPES: BEGIN OF I_EKPO,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
MENGE LIKE EKPO-MENGE,
MEINS LIKE EKPO-MEINS,
NETPR LIKE EKPO-NETPR,
END OF I_EKPO.
DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
WA_EKPO TYPE I_EKPO .
*variable for Report ID
DATA: V_REPID LIKE SY-REPID .
*declaration for fieldcatalog
DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
* declaration for events table where user comand or set PF status will
* be defined
DATA: V_EVENTS TYPE SLIS_T_EVENT,
WA_EVENT TYPE SLIS_ALV_EVENT.
* declartion for layout
DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
* declaration for variant(type of display we want)
DATA: I_VARIANT TYPE DISVARIANT,
I_VARIANT1 TYPE DISVARIANT,
I_SAVE(1) TYPE C.
*PARAMETERS : p_var TYPE disvariant-variant.
*Title displayed when the alv list is displayed
DATA: I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
DATA: I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
INITIALIZATION.
V_REPID = SY-REPID.
PERFORM BUILD_FIELDCATLOG.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
START-OF-SELECTION.
PERFORM DATA_RETRIEVAL.
PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
PERFORM DISPLAY_ALV_REPORT.
*& Form BUILD_FIELDCATLOG
* Fieldcatalog has all the field details from ekko
FORM BUILD_FIELDCATLOG.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'EBELN'.
WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'AEDAT'.
WA_FIELDCAT-SELTEXT_M = 'DATE.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'BUKRS'.
WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'BUKRS'.
WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKKO'.
WA_FIELDCAT-FIELDNAME = 'LIFNR'.
WA_FIELDCAT-NO_OUT = 'X'.
WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "BUILD_FIELDCATLOG
*& Form EVENT_CALL
* we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM EVENT_CALL.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
* EXCEPTIONS
* LIST_TYPE_WRONG = 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. "EVENT_CALL
*& Form POPULATE_EVENT
* Events populated for TOP OF PAGE & USER COMAND
FORM POPULATE_EVENT.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'USER_COMMAND'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
ENDIF.
ENDFORM. "POPULATE_EVENT
*& Form data_retrieval
* retreiving values from the database table ekko
FORM DATA_RETRIEVAL.
SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
ENDFORM. "data_retrieval
*& Form bUild_listheader
* text
* -->I_LISTHEADEtext
FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA HLINE TYPE SLIS_LISTHEADER.
HLINE-INFO = 'this is my first alv pgm'.
HLINE-TYP = 'H'.
ENDFORM. "build_listheader
*& Form display_alv_report
* text
FORM DISPLAY_ALV_REPORT.
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_GRID_TITLE = I_TITLE_EKKO
* I_GRID_SETTINGS =
* IS_LAYOUT = ALV_LAYOUT
IT_FIELDCAT = I_FIELDCAT[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* i_default = 'ZLAY1'
I_SAVE = 'A'
* is_variant = i_variant
IT_EVENTS = V_EVENTS
TABLES
T_OUTTAB = IT_EKKO
* 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. "display_alv_report
*& Form TOP_OF_PAGE
* text
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER
* i_logo =
* I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
* text
* -->R_UCOMM text
* -->, text
* -->RS_SLEFIELDtext
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
PERFORM BUILD_FIELDCATLOG_EKPO.
PERFORM EVENT_CALL_EKPO.
PERFORM POPULATE_EVENT_EKPO.
PERFORM DATA_RETRIEVAL_EKPO.
PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
PERFORM DISPLAY_ALV_EKPO.
ENDCASE.
ENDFORM. "user_command
*& Form BUILD_FIELDCATLOG_EKPO
* text
FORM BUILD_FIELDCATLOG_EKPO.
WA_FIELDCAT-TABNAME = 'IT_EKPO'.
WA_FIELDCAT-FIELDNAME = 'EBELN'.
WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_EKPO'.
WA_FIELDCAT-FIELDNAME = 'EBELP'.
WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MENGE'.
WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'MEINS'.
WA_FIELDCAT-SELTEXT_M = 'UOM'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'I_EKPO'.
WA_FIELDCAT-FIELDNAME = 'NETPR'.
WA_FIELDCAT-SELTEXT_M = 'PRICE'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. "BUILD_FIELDCATLOG_EKPO
*& Form event_call_ekpo
* we get all events - TOP OF PAGE or USER COMMAND in table v_events
FORM EVENT_CALL_EKPO.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
* EXCEPTIONS
* LIST_TYPE_WRONG = 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. "event_call_ekpo
*& Form POPULATE_EVENT
* Events populated for TOP OF PAGE & USER COMAND
FORM POPULATE_EVENT_EKPO.
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
ENDFORM. "POPULATE_EVENT
*& Form TOP_OF_PAGE
* text
FORM F_TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHEADER
* i_logo =
* I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
*& Form USER_COMMAND
* text
* -->R_UCOMM text
* -->, text
* -->RS_SLEFIELDtext
*retreiving values from the database table ekko
FORM DATA_RETRIEVAL_EKPO.
SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
ENDFORM.
FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
DATA: HLINE1 TYPE SLIS_LISTHEADER.
HLINE1-TYP = 'H'.
HLINE1-INFO = 'CHECKING PGM'.
ENDFORM.
FORM DISPLAY_ALV_EKPO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_TITLE_EKPO
* I_GRID_SETTINGS =
* IS_LAYOUT =
IT_FIELDCAT = I_FIELDCAT[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT =
I_SAVE = 'A'
* IS_VARIANT =
IT_EVENTS = V_EVENTS
TABLES
T_OUTTAB = IT_EKPO
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.
Try this links...
http://www.****************/Tutorials/ALV/ALVMainPage.htm
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
Reward all helpful answers
Regards
Pavan
Message was edited by:
Pavan praveen -
Plz provide me the code for TreeExpensionListener mehod's
Hello all,
I am trying to write the code for TreeExpensionListener methods treeExpanded(TreeExpansionEvent evt) and treeCollapsed(TreeExpansionEvent event) i want whole code for when i open the window i ll get a perticular node would be expanded.
Waiting for replys,
brijeshm_pmTableModel = new JTreeTableModel("root");
m_pmListTable = new JTreeTable(m_pmTableModel);
m_pmListTable.getTree().addTreeSelectionListener(this);
m_pmListTable.getTree().addTreeExpansionListener(this);
JScrollPane scrollPane = new JScrollPane();
scrollPane.getViewport().add(m_pmListTable);
This is the piece of code i am using there is a treetable, i just want like, whenver sommething got change on server site that table would be update, actallu its updating but...if node is open and any child of that node is get updat then that node is getting close, means again to see the changes i have to open that node, thats i dont want. With updating it should expend the node......
thanks for reply.....plz share the idea
brijesh -
I want to add BWART field from AUFM table to the DS:2LIS_04_P_COMP.
The AUFM table has key fields as :MBLNR,MJAHR and ZEILE.Can someone plz help with the code to put in the existing function module.I see that both 2LIS_04_P_COMP and AUFM have common field AUFNR process order.
Plz help ASAP.I want to add BWART field from AUFM table to the DS:2LIS_04_P_COMP.
The AUFM table has key fields as :MBLNR,MJAHR and ZEILE.Can someone plz help with the code to put in the existing function module.I see that both 2LIS_04_P_COMP and AUFM have common field AUFNR process order.
Plz help ASAP. -
Install error -look at the code. plz help
I have the simple applet that I'm able to compile and load on to a JCOP10 cartd. When I try to install the applet so that I can start interacting with it, I get the following error. How do I go beyond this point? I'll appreciate your help.
JCOP shell
Load report:
747 bytes loaded in 0.0 seconds
effective code size on card:
+ package AID 6
+ applet AIDs 13
+ classes 21
+ methods 470
+ statics 0
+ exports 0
overall 510 bytes
end
/set-var J 0
while ${J} < ${PKG_${I}_APP_COUNT}
install -i ${PKG_${I}_APP_${J}_INST_AID} -q C9#(${PKG_${I}_APP_${J}_INST_DATA}) ${PKG_${I}_AID} ${PKG_${I}_APP_${J}_AID}
=> 80 E6 0C 00 24 06 11 11 11 11 11 11 06 22 22 22 ....$........"""
22 22 22 06 22 22 22 22 22 33 01 00 0B C9 09 23 """."""""3.....#
42 38 47 36 74 63 76 73 00 00 B8G6tcvs..
(0 msec)
<= 6A 80 j.
Status: Wrong data
Error code: 6a80 (Wrong data)
Offending APDU: 6A80
Here is the code.
* Package: myWallet
* Filename: MyWallet.java
* Class: MyWallet
* Date: Jan 23, 2004 2:01:58 PM
package myWallet;
import javacard.framework.*;
//import javacardx.framework.*;
public class MyWallet extends Applet
/* constants declaration */
// code of CLA byte in the command APDU header
final static byte Wallet_CLA =(byte)0x80;
// codes of INS byte in the command APDU header
final static byte VERIFY = (byte) 0x20;
final static byte CREDIT = (byte) 0x30;
final static byte DEBIT = (byte) 0x40;
final static byte GET_BALANCE = (byte) 0x50;
// maximum balance
final static short MAX_BALANCE = (byte)0x7FFF;
// maximum transaction amount
final static byte MAX_TRANSACTION_AMOUNT =(byte)0x007F;
// maximum number of incorrect tries before the
// PIN is blocked
final static byte PIN_TRY_LIMIT =(byte)0x03;
// maximum size PIN
final static byte MAX_PIN_SIZE =(byte)0x08;
// signal that the PIN verification failed
final static short SW_VERIFICATION_FAILED = 0x6300;
// signal the the PIN validation is required
// for a credit or a debit transaction
final static short SW_PIN_VERIFICATION_REQUIRED = 0x6301;
// signal invalid transaction amount
// amount > MAX_TRANSACTION_AMOUNT or amount < 0
final static short SW_INVALID_TRANSACTION_AMOUNT = 0x6A83;
// signal that the balance exceed the maximum
final static short SW_EXCEED_MAXIMUM_BALANCE = 0x6A84;
// signal the the balance becomes negative
final static short SW_NEGATIVE_BALANCE = 0x6A85;
/* instance variables declaration */
OwnerPIN pin;
short balance;
private MyWallet (byte[] bArray,short bOffset,byte bLength)
// It is good programming practice to allocate
// all the memory that an applet needs during
// its lifetime inside the constructor
pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);
byte iLen = bArray[bOffset]; // aid length
bOffset = (short) (bOffset+iLen+1);
byte cLen = bArray[bOffset]; // info length
bOffset = (short) (bOffset+cLen+1);
byte aLen = bArray[bOffset]; // applet data length
// The installation parameters contain the PIN
// initialization value
pin.update(bArray, (short)(bOffset+1), aLen);
register();
} // end of the constructor
public static void install(byte[] bArray, short bOffset, byte bLength){
// create a Wallet applet instance
MyWallet me = new MyWallet(bArray, bOffset, bLength);
me.register(bArray, bOffset, bLength);
} // end of install method
public boolean select()
// The applet declines to be selected
// if the pin is blocked.
if ( pin.getTriesRemaining() == 0 )
return false;
return true;
}// end of select method
public void deselect() {
// reset the pin value
pin.reset();
public void process(APDU apdu) {
// APDU object carries a byte array (buffer) to
// transfer incoming and outgoing APDU header
// and data bytes between card and CAD
// At this point, only the first header bytes
// [CLA, INS, P1, P2, P3] are available in
// the APDU buffer.
// The interface javacard.framework.ISO7816
// declares constants to denote the offset of
// these bytes in the APDU buffer
byte[] buffer = apdu.getBuffer();
// check SELECT APDU command
buffer[ISO7816.OFFSET_CLA] = (byte)(buffer[ISO7816.OFFSET_CLA] & (byte)0xFC);
if ((buffer[ISO7816.OFFSET_CLA] == 0) &&
(buffer[ISO7816.OFFSET_INS] == (byte)(0xA4)) )
return;
// verify the reset of commands have the
// correct CLA byte, which specifies the
// command structure
if (buffer[ISO7816.OFFSET_CLA] != Wallet_CLA)
ISOException.throwIt
(ISO7816.SW_CLA_NOT_SUPPORTED);
switch (buffer[ISO7816.OFFSET_INS]) {
case GET_BALANCE: getBalance(apdu);
return;
case DEBIT: debit(apdu);
return;
case CREDIT: credit(apdu);
return;
case VERIFY: verify(apdu);
return;
default: ISOException.throwIt (ISO7816.SW_INS_NOT_SUPPORTED);
} // end of process method
private void credit(APDU apdu)
// access authentication
if ( ! pin.isValidated() )
ISOException.throwIt(
SW_PIN_VERIFICATION_REQUIRED);
byte[] buffer = apdu.getBuffer();
// Lc byte denotes the number of bytes in the
// data field of the command APDU
byte numBytes = buffer[ISO7816.OFFSET_LC];
// indicate that this APDU has incoming data
// and receive data starting from the offset
// ISO7816.OFFSET_CDATA following the 5 header
// bytes.
byte byteRead =
(byte)(apdu.setIncomingAndReceive());
// it is an error if the number of data bytes
// read does not match the number in Lc byte
if ( ( numBytes != 1 ) || (byteRead != 1) )
ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
// get the credit amount
byte creditAmount = buffer[ISO7816.OFFSET_CDATA];
// check the credit amount
if ( ( creditAmount > MAX_TRANSACTION_AMOUNT)
|| ( creditAmount < 0 ) )
ISOException.throwIt
(SW_INVALID_TRANSACTION_AMOUNT);
// check the new balance
if ( (short)( balance + creditAmount) > MAX_BALANCE )
ISOException.throwIt
(SW_EXCEED_MAXIMUM_BALANCE);
// credit the amount
balance = (short)(balance + creditAmount);
} // end of deposit method
private void debit(APDU apdu)
// access authentication
if ( ! pin.isValidated() )
ISOException.throwIt
(SW_PIN_VERIFICATION_REQUIRED);
byte[] buffer = apdu.getBuffer();
byte numBytes =
(byte)(buffer[ISO7816.OFFSET_LC]);
byte byteRead =
(byte)(apdu.setIncomingAndReceive());
if ( ( numBytes != 1 ) || (byteRead != 1) )
ISOException.throwIt
(ISO7816.SW_WRONG_LENGTH);
// get debit amount
byte debitAmount =
buffer[ISO7816.OFFSET_CDATA];
// check debit amount
if ( ( debitAmount > MAX_TRANSACTION_AMOUNT)
|| ( debitAmount < 0 ) )
ISOException.throwIt
(SW_INVALID_TRANSACTION_AMOUNT);
// check the new balance
if ( (short)( balance - debitAmount ) < (short)0 )
ISOException.throwIt(SW_NEGATIVE_BALANCE);
balance = (short) (balance - debitAmount);
} // end of debit method
private void getBalance(APDU apdu) {
byte[] buffer = apdu.getBuffer();
// inform system that the applet has finished
// processing the command and the system should
// now prepare to construct a response APDU
// which contains data field
short le = apdu.setOutgoing();
if ( le < 2 )
ISOException.throwIt
(ISO7816.SW_WRONG_LENGTH);
//informs the CAD the actual number of bytes
//returned
apdu.setOutgoingLength((byte)2);
// move the balance data into the APDU buffer
// starting at the offset 0
buffer[0] = (byte)(balance >> 8);
buffer[1] = (byte)(balance & 0xFF);
// send the 2-byte balance at the offset
// 0 in the apdu buffer
apdu.sendBytes((short)0, (short)2);
} // end of getBalance method
private void verify(APDU apdu) {
byte[] buffer = apdu.getBuffer();
// retrieve the PIN data for validation.
byte byteRead =(byte)(apdu.setIncomingAndReceive());
// check pin
// the PIN data is read into the APDU buffer
// at the offset ISO7816.OFFSET_CDATA
// the PIN data length = byteRead
if ( pin.check(buffer, ISO7816.OFFSET_CDATA,byteRead) == false )
ISOException.throwIt(SW_VERIFICATION_FAILED);
} // end of validate method
} // end of class WalletHow do I set a breakpoint in my install method in order to identify the error?
I've tried changing my install method and making it look exactly like the sample wallet applications accompanying the javacard kit, but I'm still getting the same error? here else could be the possible source of the error?
Thomas
Maybe you are looking for
-
This would apply to Intel and non-Intel computers. I backed up my hard drive. When I rebooted at the end pressing on the "C" key my sign on screen came up. At this point I found that neither my wireless mouse nor the wireless keyboard would work. I h
-
How shoud I connect my iPad with my iPhone via bluetooh
How should I connect my iPad with my iPhone via bluetooth.???
-
What info is stored by Oracle in v$session.program?
Hi all, I was trying to query V$session.program, and it appears that Oracle sometimes stores valid values like for example: "PSAPPSRV@PSA1H31 (TNS V1-V3)" and sometimes just '?' instead, like for example: "? @PSA1H31 (TNS V1-V3)" Please I need to kno
-
Help in Query(Urgent)
I have a query like below Select name from name where Number = 10; Name Eric Jelly I need to display the result like Name Eric Jelly ANy help plz
-
What is the easiest or best way to copy a char array into a string?