Smartform and QUAN variable
Hi,
i´m working with a smartform. In this smartform i get a subtotal of an amount field.
The question is that the result is OK but the output format is wrong (i get 1,000 instead of 1).
What should i do in order to get the right output format?
Best regards.
Hi,
first of all thanks fo your help.
The problem was that i hadn´t defined the variable properly.
Here´s how i solved the problem:
in gobal data tab i´ve defined my variable thus
VARIABLE NAME TYPIFICATION REF. TYPE
GS_QTY LIKE GS_IT_GEN_BATCH-DLV_QTY
GS_QUAN_UNIT LIKE GS_IT_GEN_BATCH-SALES_UNIT
and in currency/quantity fields tab i´ve written:
FIELD NAME REFERENCE FIELD DATA TYPE
GS_QTY GS_IT_GEN_BATCH-SALES_UNIT QUAN
Best regards.
Similar Messages
-
Adding commas in quan variable of smartforms
hi experts,
In my smartforms,i have a variable temp_menge which is having value 1000000 but i want to get it displayed as 1,000,000.How to write the same.?????
Thanks,
Gaurav
Edited by: Gaurav Kumar on Feb 26, 2008 2:30 PMHi,
There might be 2 possibilities. One is data type. Symbols of the DEC, CURR, INT, and QUAN data types are normally formatted with the a thousands separator character. The T option allows you to omit this separator character.
Syntax:
&symbol(T)&
The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.
&EKPO-MENGE& -> 1,234.560
&EKPO-MENGE(T)& -> 1234.560
So one thing is change your data type to TYPE P or remove the (T) from your code. This should work.
Reward points if helps.
Regards,
JLN -
SMARTFORM - Part of variable content missing in otf file
Hi colleagues,
In my smartform, I have variables, defined as STRING, which contains HTML coding to generate URL links in the final document.
The variable is correct and ends with '</a>'.
But in the otf file, the result is sometimes wrong. The variable is splitted into several lines (no problem), but the last line is somehow shorted... I only get '</'.
Due to that, end of URL is not recognized and the whole content below this unless link appears as part of the link.
This seems to be related to the length of the variable content.
If it is short enough (but this I could not insure), the code is complete and everything works fine.
Does this means that my url should be splitted to never exceed a certain limit (254 or 255 chr).?
thansk for your help,
BarbaraHi,
Thanks for feedback.
Lengh is the issue. If I split the single varaible into several to only have 255 chars in each of them, it is possible to not loose part of the content.
I try to put the two variables (part1 and part2) on the same line in SMARTFORM without any separators. This has exactly the same effect than if I use one varaible which exceed 255 chars. The content of the 2nd one is lost in the OTF.
I then insert a blank between them, and I do not loose anything in the OTF.
Unfortunatelly, due to the separator, the URL is also split in 2 parts on my final content, which is not really good.
Splitting the label is not beautiful, but not dangerous. Adding one space in the URL may leads to not working link.
I will try to consider this issue when preparing the content from the OTF file.
If you have any hints what to consider, I would appreciate.
Kind Regards,
barbara -
SmartForms - Window position variable during runtime?
Hello,
is it possible to create one window in smartforms and set
during runtime the position variable?
Otherwise i have to create around 70 little windows
The backround is: i create during a loop for each dataset a 2D-Barcodes. In our SAP system we create 2D-Barcodes like that:
- the Title of a window must start with LS_BARCODE....
- then in Lasersoft (thats a "printing"-software between SAP and the printer) this software reads this title LS_BARCODE and creates an 2D Barcode with the datas in the textfield below the window.
best regards,
jasminHello Jasmin,
Perhaps note 359009 will address your problem or provide you with a workaround, using the "late processing" type window.
Kind Regards,
Martin -
What are Smartforms and SAPscripts?
Hey Everyone,
Where do we use Smartforms and SAPscripts...how to we create these...if u have step step procedures that will be helpful...
Thanks in Advance...
Cheers:
JimSmartform is client indep.
Scripts is client dependent.
Smartform will generate function module.
Script will not.
Tcode for scripts is se71
Tcode for smartforms is smartforms
go to sap library ............ their u can find the step by step procedure............
SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can configure forms with data from an SAP System for the relevant business processes.
Execute transaction SMARTFORMS to start SAP Smart Forms.
Key Benefits of SAP Smart Forms:
SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time. You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
To make changes, use Drag & Drop, Copy & Paste, and select different attributes. These actions do not include writing of coding lines or using a Script language.
Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one. For Web publishing, the system provides a generated XML output of the processed form. Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
SAP Smart Forms also support postage optimizing.
Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
Example Forms Available in Standard SAP R/3
SF_EXAMPLE_01
Simple example; invoice with table output of flight booking for one customer
SF_EXAMPLE_02
Similar to SF_EXAMPLE_01 but with subtotals
SF_EXAMPLE_03
Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request.
Also check this step by step procedure to create SMARTFORMS:
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
Look through for example these links for details about Smart Forms:
http://www.sap-press.com/downloads/h955_preview.pdf
http://www.sap-basis-abap.com/sapsf001.htm
http://www.ossincorp.com/Black_Box/Black_Box_2.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://esnips.com/doc/7e67af5c-6188-4252-8613-41816756d560/from-sappres.pdf
http://esnips.com/doc/58566115-54a4-4405-8872-8de952e245e5/smartform.pdf
http://esnips.com/doc/13b7ae7a-b32c-4b96-b588-881859d4ac99/Template,Table,Loop,Command-in-Smartforms.doc
http://esnips.com/doc/97acb00a-e513-4611-91f0-c626f460bfc5/Smart_Form_Overview.pdf
http://esnips.com/doc/77a981b9-8fe3-4fbb-8101-67745c1fe60c/SMART-FORMS_shail.ppt
http://www.sapgenie.com/abap/smartforms.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
http://www.sapgenie.com/abap/smartforms.htm
http://www.sapgenie.com/abap/smartforms_described.htm
http://www.sapgenie.com/abap/smartforms_detail.htm
http://www.sapgenie.com/abap/smartforms_sapscript.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/SMARTFORMS_tutorial.html -
Hi all .,
I would like to attach to a smartform the text of another smartform and send both of them as ONE mail .
can some one tell if it's possible at all and if yes, in which format ? pdf , html....
and HOW to do it .
thanks and regards,
lilianeHi
check...
/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp
and the sample code
REPORT Ztest_SEND_SMARTFORMS .
Internal Table declarations
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,"To convert from 132 to 255
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZZZ_TEST1'
importing
fm_name = v_form_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 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.
i_otf[] = w_return-otfdata[].
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
Fehlerhandling
if sy-subrc <> 0.
endif.
loop at i_tline.
translate i_tline using '~'.
concatenate wa_buffer i_tline into wa_buffer.
endloop.
translate wa_buffer using '~'.
do.
i_record = wa_buffer.
append i_record.
shift wa_buffer left by 255 places.
if wa_buffer is initial.
exit.
endif.
enddo.
Attachment
refresh:
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear wa_objhead.
i_objbin[] = i_record[].
Create Message Body
Title and Description
i_objtxt = 'test with pdf-Attachment!'.
append i_objtxt.
describe table i_objtxt lines v_lines_txt.
read table i_objtxt index v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
clear i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
append i_objpack.
Attachment
(pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
Länge des Attachment ermitteln
describe table i_objbin lines v_lines_bin.
read table i_objbin index v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
append i_objpack.
clear i_reclist.
i_reclist-receiver = [email protected].
i_reclist-rec_type = 'U'.
append i_reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
CONTENTS_BIN = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
The user is provided with
a) file name
b) email address to send mail
and it sends ANY FILE (.xls,.pdf .xyz..)
Instantaneously !
4. Make two things first :
1. Include with the name : ZAMI_INCLFOR_MAIL
2. Report with the name : ZAM_TEMP147 (any name will do)
3. Activate both and execute (2)
4. After providing filename, email adress
5. Code for Include :
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
*---- CODE FOR PROGRAM
REPORT zam_temp147 .
INCLUDE zami_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
Reward points for useful Answers
Regards
Anji -
Trying to pass and object variable to a method
I have yet another question. I'm trying to display my output in succession using a next button. The button works and I get what I want using test results, however what I really want to do is pass it a variable instead of using a set number.
I want to be able to pass the object variables myProduct, myOfficeSupplies, and maxNumber to method actionPerformed so they can be in-turn passed to the displayResults method which is called in the actionPerformed method. Since there is no direct call to actionPerformed because it is called within one of the built in methods, I can't tell it to receive and pass those variables. Is there a way to do it without having to pass them through the built-in methods?
import javax.swing.JToolBar;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import javax.swing.JPanel;
import java.net.URL;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Panel extends JPanel implements ActionListener
protected JTextArea myTextArea;
protected String newline = "\n";
static final private String FIRST = "first";
static final private String PREVIOUS = "previous";
static final private String NEXT = "next";
public Panel( Product myProduct, OfficeSupplies myOfficeSupplies, int maxNumber )
super(new BorderLayout());
int counter = 0;
//Create the toolbar.
JToolBar myToolBar = new JToolBar( "Still draggable" );
addButtons( myToolBar );
//Create the text area used for output.
myTextArea = new JTextArea( 450, 190 );
myTextArea.setEditable( false );
JScrollPane scrollPane = new JScrollPane( myTextArea );
//Lay out the main panel.
setPreferredSize(new Dimension( 450, 190 ));
add( myToolBar, BorderLayout.PAGE_START );
add( scrollPane, BorderLayout.CENTER );
myTextArea.setText( packageData( myProduct, myOfficeSupplies, counter ) );
setCounter( counter );
} // End Constructor
protected void addButtons( JToolBar myToolBar )
JButton myButton = null;
//first button
myButton = makeNavigationButton( FIRST, "Display first record", "First" );
myToolBar.add(myButton);
//second button
myButton = makeNavigationButton( PREVIOUS, "Display previous record", "Previous" );
myToolBar.add(myButton);
//third button
myButton = makeNavigationButton( NEXT, "Display next record", "Next" );
myToolBar.add(myButton);
} //End method addButtons
protected JButton makeNavigationButton( String actionCommand, String toolTipText, String altText )
//Create and initialize the button.
JButton myButton = new JButton();
myButton.setActionCommand( actionCommand );
myButton.setToolTipText( toolTipText );
myButton.addActionListener( this );
myButton.setText( altText );
return myButton;
} // End makeNavigationButton method
public void actionPerformed( ActionEvent e )
String cmd = e.getActionCommand();
// Handle each button.
if (FIRST.equals(cmd))
{ // first button clicked
int counter = 0;
setCounter( counter );
else if (PREVIOUS.equals(cmd))
{ // second button clicked
counter = getCounter();
if ( counter == 0 )
counter = 5; // 5 would be replaced with variable maxNumber
setCounter( counter );
else
counter = getCounter() - 1;
setCounter( counter );
else if (NEXT.equals(cmd))
{ // third button clicked
counter = getCounter();
if ( counter == 5 ) // 5 would be replaced with variable maxNumber
counter = 0;
setCounter( counter );
else
counter = getCounter() + 1;
setCounter( counter );
displayResult( counter );
} // End method actionPerformed
private int counter;
public void setCounter( int number ) // Declare setCounter method
counter = number; // stores the counter
} // End setCounter method
public int getCounter() // Declares getCounter method
return counter;
} // End method getCounter
protected void displayResult( int counter )
//Test statement
// myTextArea.setText( String.format( "%d", counter ) );
// How can I carry the myProduct and myOfficeSupplies variables into this method?
myTextArea.setText( packageData( product, officeSupplies, counter ) );
myTextArea.setCaretPosition(myTextArea.getDocument().getLength());
} // End method displayResult
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event dispatch thread.
public void createAndShowGUI( Product myProduct, OfficeSupplies myOfficeSupplies, int maxNumber )
//Create and set up the window.
JFrame frame = new JFrame("Products");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Add content to the window.
frame.add(new Panel( myProduct, myOfficeSupplies, maxNumber ));
//Display the window.
frame.pack();
frame.setVisible( true );
} // End method createAndShowGUI
public void displayData( Product myProduct, OfficeSupplies myOfficeSupplies, int maxNumber )
JTextArea myTextArea = new JTextArea(); // textarea to display output
JFrame JFrame = new JFrame( "Products" );
// For loop to display data array in a single Window
for ( int counter = 0; counter < maxNumber; counter++ ) // Loop for displaying each product
myTextArea.append( packageData( myProduct, myOfficeSupplies, counter ) + "\n\n" );
JFrame.add( myTextArea ); // add textarea to JFrame
} // End For Loop
JScrollPane scrollPane = new JScrollPane( myTextArea ); //Creates the JScrollPane
JFrame.setPreferredSize(new Dimension(350, 170)); // Sets the pane size
JFrame.add(scrollPane, BorderLayout.CENTER); // adds scrollpane to JFrame
JFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); // Sets program to exit on close
JFrame.setSize( 350, 170 ); // set frame size
JFrame.setVisible( true ); // display frame
} // End method displayData
public String packageData( Product myProduct, OfficeSupplies myOfficeSupplies, int counter ) // Method for formatting output
return String.format( "%s: %d\n%s: %s\n%s: %s\n%s: %s\n%s: $%.2f\n%s: $%.2f\n%s: $%.2f\n%s: $%.2f",
"Product Number", myOfficeSupplies.getProductNumber( counter ),
"Product Name", myOfficeSupplies.getProductName( counter ),
"Product Brand",myProduct.getProductBrand( counter ),
"Number of Units in stock", myOfficeSupplies.getNumberUnits( counter ),
"Price per Unit", myOfficeSupplies.getUnitPrice( counter ),
"Total Value of Item in Stock is", myOfficeSupplies.getProductValue( counter ),
"Restock charge for this product is", myProduct.restockingFee( myOfficeSupplies.getProductValue( counter ) ),
"Total Value of Inventory plus restocking fee", myOfficeSupplies.getProductValue( counter )+
myProduct.restockingFee( myOfficeSupplies.getProductValue( counter ) ) );
} // end method packageData
} //End Class Panelmultarnc wrote:
My instructor has not been very forthcoming with assistance to her students leaving us to figure it out on our own.Aren't they all the same! Makes one wonder why they are called instructors. <sarcasm/>
Of course it's highly likely that enough information was imparted for any sincere, reasonably intelligent student to actually figure it out, and learn the subject in the process.
And if everything were spoonfed, how would one grade the performance of the students? Have them recite from memory
public class HelloWorld left-brace
indent public static void main left-parenthesis String left-bracket right-bracket args right-parenthesis left-brace
And everywhere that Mary went
The lamb was sure to go
db -
Use of Return and Notify_url variables offered by PayPal
I have been integrating PayPal into my application (ASP NET MVC) where I made some analysis about PayPal (went through their documentation about the integration). Created a PayPal sandbox account and can transfer the amount.What I want to know is about the `return` and `notify_url` variables. I have enabled `auto return` in my account and also enabled `PDT`. My form variable is like this:<input type="hidden" name="notify_url" value="http://localhost:xxx/xx/Notify">
<input type="hidden" name="return" value="http://localhost:xx/xx/Return">As I have surfed in net, what they state about `Return` and `notify_url` is:> The "return" URL to which PayPal redirects buyers’ browser after they complete their payments. For example, specify a URL on your site that displays a “Thank you for your payment” page. Default is nothing is specified – PayPal redirects the browser to a PayPal webpage. Note, you must have "Auto Return" enabled in your Account Profile settings in order for this variable to work.
>PayPal returns data back to your site via what they call IPN. Its really just a callback to a URL you specify. You can set this URL via the variable `notify_url` you can send to PayPal.From the above quotes what I understand is that PayPal will post `IPN` variables to `notify action` once the payment done before auto redirecting to the page I set (I mean customer may go the application page or they may close the session).But only return action alone hitting not the `Notify_url`.Correct me if I misunderstood the concept and let me know if it was still Unclear.Yes, it's not present in the code I have posted but I have tried this as well.
It didn't work, as expected, because soap/axis is on top of http and not https and because my proxy uses http as well (or at least that's what I have learned so far).
In fact, I have tried all combinations between http.\*, https.\*, and Authenticator without success.
I think the problem is more soap/axis related. The solution for axis2 seems somewhat 'trivial' (and well explained over the web) while it's not for axis1.
Regards
Rob
Edited by: RobR on Nov 29, 2007 4:37 AM
Edited by: RobR on Nov 29, 2007 9:56 AM -
Open module for managing property file and environment variables
Looking for an open module for managing property files and environment variables (like CLASSPATH) set in a shell script. For handeling properties (preserving comments, supporting includes, appending new entries, and more) I have looked at SuperProperties from openadaptor but find certain functionality lacking. As for interfacing with common shell scripts/files containing setting for CLASSPATH, JAVA_HOME, other system/application variables another type of object editor is needed. Maybe JFIG?
Any ideas are greatly welcomed.You seem wright, you hit a brick wall here with Air to find the location
of the command console on windows...
So in fact I never build an exe tool, but this little problem was a nice
case to test it and I tried it.:
I downloaded monodevelop
-GTK# for .NET 2.12.10*
-MonoDevelop 2.4.2*
from http://monodevelop.com/Download
created a console project and had an exe in 5 minutes !
You can download the findconsole tool and the projectfiles here:
http://greencollective.nl/temp/dump/findconsole_monoproject.zip
findconsole.exe will reveal the path/location of cmd.exe on a windows system.
Cheers,
Latcho -
Report in new page does not know of session and presentation variables
I have a question about GOURL.
I am using GOURL as a column function in one report (report A), so that when i click on that column it takes me to another report(report B) that open in new popup window.
the first report (A) also uses some session and presentation variables, which is also used by Report B as filters. I am curious that if I add these filters which are using variables to report B, why can't report B get the value of these, (it just errors out ) because it didn't found any value to those variables in the filter.
Becuase I am ending up with passing all these variables in GOURL and setting them as 'isprompted'.
Does this report (B) knows nothing else than what it finds in GOURL?
thanksIn a nutshell, if u use gourl then its parameters will be only using in navigated report. This is functionality
-
How to?? show smartform and generate pdf at the same time
hi experts,
how can i show the smartform and generate a pdf at the same time?? i have a control parameter gtotf in X and i generate the pdf but i want to show the smartform at the same time??
thx in advanceHi...
call fm <sf function name>
exporting...
importing..
tables..
now in the outputparam set the getotf as 'X'.
call the same FM again and get the otf data.
call fm <sf fm name> -
How to change font size in smartform and set layout of smartform
Dear abapers,
I want to change font size in smartform and also set the layout of smart form how can we do this.
Thank you sir.Hi,
you can do it first you need to goto smartforms tcode there click on radiobutton 'Style'.
Give any name and click on create. Right sideyou can find character format right click on it and create a node .A pop will raise gve a 2 characterlike z1 or a1 etc click on font tab gve size and font style and click on save and activate. Use this style in your smartform you can apply what ever styles created in styles you can use it in your smartform by that smartstyle name.
When we create text in output options give your smart style name and click on general attributes . Select your text and apply the style what thse size it should be and what the font style it should be.
Goto smartforms tcode and select formpainter in application bar set layout according to your requirement.
Thanks,
venkat -
How to change value of instance variable and local variable at run time?
As we can change value at run time using debug mode of Eclipse. I want to do this by using a standalone prgram from where I can change the value of a variable at runtime.
Suppose I have a class, say employee like -
class employee {
public String name;
employee(String name){
this.name = name;
public int showSalary(){
int salary = 10000;
return salary;
public String showName()
return name;
i want to change the value of instance variable "name" and local variable "salary" from a stand alone program?
My standalone program will not use employee class; i mean not creating any instance or extending it. This is being used by any other calss in project.
Can someone tell me how to change these value?
Please help
Regards,
Sujeet SharmaThis is the tutorial You should interest in. According to 'name' field of the class, it's value can be change with reflection. I'm not sure if local variable ('salary') can be changed - rather not.
-
Financial Reporting and substitution variable
Hello,
i have a problem with FR and substitution variable. I create the substitution variable in Essbase for example antYear but i dont'see in dimension layout in FR studio and workspace.
Thanks.You'll need to restart FR studio, after you have created the substitution variables. As the studio only performs one read of the sub var database on startup.
It also won't show up unless you assign a member to it.
Hope this helps.
Iain -
How can we download a smartform and sapscripts under a transport request.
hi abaper's
my requirement is that i have to download the transport request objects smartforms and sapscripts to do this i have to make a report, so that a person can run this report and enter the request number , then the objects smartform and sapscripts download automatically for him.
or is thr any standard report progrma available in sap system.
thanks & regards
pardeep kumarhi gopi
what is this i can read only 1 here.
Maybe you are looking for
-
I have tried everything that apple.com has told me. I have watched countless videos. I'm at a complete loss. I just want my ipod to work without destroying my computer. This "connect to itunes" screen is driving me nuts. Please HELP!!!
-
My HP Color LaserJet 2600n printer won't print a Microsoft Word document, nor a Microsoft Office Publisher, any longer. When I try printing a Word document in `either black or colors, the printer sends the paper through, but no print is on the paper.
-
I'm starting this thread so we can gather all the thing we want in Captivate 4 ! - speling check for closed captions : you can spell check your notes but not the closed captions! - CCs independant of sound : CCs are embedded in the audio file. If it
-
Port replicator screen resolution
I am using HP250 laptop with 2005pr usb port replicator. Using laptop stnad alone the screen is set to maximum resolution but when I attached the 2005pr the monitor res is dropped to 1280x720 max. It worked fine originally, this has only recently sta
-
Are you serious Blackberry? Doesn't sync with a Mac?
I was having all kinds of problems syncing my Blackberry Bold 9900 to my Mac. A blackberry tech told me that I should upgrade to the Blackberry 10, since it has no problems syncing to a Mac. Several hundred dollars and a few hours of frustration lat