HELP: JSP simple examples
Hi:
i am a newbie to JSP and am trying to come up with few SIMPLE example JSP pages QUICKLY e.g.
-using URL variables
-form submission
-email
etc.
could you give reference to simple code or tutorial which covers it.
appreciate your help
-Z
Did you try downloading Tomcat and running through their examples? They're pretty elementary, show all the examples you mention (including an email example) and show the source code.
Download/install Tomcat, get it running, and go to http://localhost:8080/examples/jsp/ for the JSP examples.
Similar Messages
-
Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory
Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it.
Alex D
Applications Engineer
National Instruments -
Need help with a very simple example. Trying to reference a value
Im very new to Sql Load and have created this very simple example of what I need to do.
I just want to reference the ID column from one table to be inserted into another table as DEV_ID.
Below are my: 1) Control File, 2) Datafile, 3) Table Description, 4) Table Description
1) CONTROL FILE:
LOAD DATA
INFILE 'test.dat'
APPEND
INTO TABLE p_ports
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
DEV_id REF(CONSTANT 'P_DEVICES',NAME),
NAME FILLER ,
PORT_NO
2) DATAFILE:
COMM881-0326ES09,6
3) TABLE DESCRIPTION:
SQL> describe p_ports
Name Null? Type
ID NOT NULL NUMBER(10)
DEV_ID NOT NULL NUMBER(10)
PORT_NO NUMBER(3)hi,
i managed to do this for my app. (think i referred to viewTransitions sample code and modified quite a bit)
i can't remember this well cos i did this quite a while back, but i will try to help as much as possible
1) from the appdelegate i initialize a root controller (view controller class)
2) this root controller actually contains two other view controllers, let's call it viewAController and viewBController, for the screens which u are going to toggle in between. and there's also a function, let's call it toggleMenu, which will set the menus to and fro. i copied this whole chunk from the sample code. it actually defines the code on what to do, i.e. if current view is A switch to B and vice versa.
3) inside the controller files, you need to implement the toggleMenu function too, which basically calls the rootController's toggleMenu
4) we also need viewA and viewB files(view class)
5) need to add the .xib files for the respective views and link them up to the controller class. i did not use the .xib files for ui layout though, because of my app's needs. however, it will not work properly without the .xib files.
5) inside the view class of both views, i.e. viewA.m and viewB.m, you need to create a button, that will call the toggleMenu function inside the respective controller class.
it will look something like this:
[Button addTarget:ViewAController action:@selector(toggleMenu:) forControlEvents:UIControlEventTouchUpInside];
so the flow is really button (in view)-> toggleMenu(viewController) -> toggleMenu(rootController)
i'm sorry it sounds pretty hazy, i did this part weeks before and can't really remember. i hope it helps. -
Trying to create a simple example. Need Help!
I'm trying to create a very simlpe examlpe using Swing components to illustrate a MVC architecture.
I have a JFrame containing a JTree and a JButton.
What I'd like to happen is when I click the JButton the JTree model is changed in some fashion and the the view is refreshed due to the models change.
If anyone out there has a simple example of any MVC architecture involving Swing components I'd love to see it.
ThxSure, look at any of the Sun tutorials. For example, look in your API documentation for JTree; it has a link to a tutorial about how to use JTree.
-
Help,JSP and SERVLETS!
hello:
i've downloaded ECLIPSE 3.2,TOMCAT 5.5 .
i tried to build simples examples o servlets but i failed could you please tell me how to proceed?i'm new at this plus i've got a project to do with all this so plz can you give some links to go,i tried but no links was clear.
i've got to give to my professor an examples executed (servlets,jsp)
thank youHISSO wrote:
i wil give up on talking about stupid gossip
you must act professional and i you can't help it's ok
so plz i juste want help
i'm so busy finishing my studies
when it comes to talk about development with tomcat and eclipse together i'm new so i need some advices,so plz let's be serious!
i'm working hard to finish my project!Try to communicate less like a monkey with electrodes attached to it's genitals. This means stop using words like "plz" and write "please" instead.
If you want specific help with a specific problem then you should ask a specific question. "help, JSP and SERVLETS" is not a specific question. And you should also note that if your specific question is about Tomcat specifically or Eclipse specifically then you are in the wrong place to begin with.
So do you want to try again? -
Seeking simple example pl/sql to create text file from table data
hello,
I am hoping someone can provide very simple example of creating a file on my local harddrive using a pl/sql program. The basic steps are as follows:
First, I store some text in a varchar2 variable like this:
1. select sometext into otextvar from mytable where recordid = 1;
Second, I want this text to become a file in my data directory:
2. c:\data\sometext.txt
The second step is where I need help.
Any suggestions are greatly appreciated.Use this function
It will create for you a file in your /home/oracle directory with sysdate name and will insert all table names in it
CREATE OR REPLACE PROCEDURE my_proc AS
CURSOR cursor1 IS
SELECT table_name from all_tables;
CURSOR cursor2 IS
SELECT sysdate from dual;
rec1 cursor1%ROWTYPE;
rec2 cursor2%ROWTYPE;
created_file_name VARCHAR2(100);
file_name utl_file.file_type;
BEGIN
OPEN cursor2;
LOOP
FETCH cursor2 INTO rec2;
EXIT WHEN cursor2%NOTFOUND;
created_file_name:=rec2.sysdate;
file_name := utl_file.fopen('/home/oracle', created_file_name,'W');
OPEN cursor1;
LOOP
FETCH cursor1 INTO rec1;
EXIT WHEN cursor1%NOTFOUND;
utl_file.putf(file_name, '%s\n',rec1.TABLE_NAME);
END LOOP;
utl_file.fclose(file_name);
END LOOP;
END my_proc;
SQL>exec my_proc; -
I need some simple examples to start with for Oracle ESB
Hi All,
Please share some simple examples to startwith for Oracle ESB.
I need to understand, what are the files are created, once created an ESB project.
What is the use of the files how to edit them with out using JDeveloper.
Iam trying to create a simple example.
I would like to create a file which has only "HELLO" in that file, simple text file inside a folder "INPUT" in my c:\ drive.
I wanted to create a ESB service which picks up the file and add a string to it like "HELLO" + "ESB" and drop this file into "OUTPUT" folder in c:\ drive.
How do i do that. I tried to do it when i deploy the integration server connection is gettting hit badly. I dont see that connection any more and i dont see that connection in my JDeveloper.
I dont want to start with existing code.
Please help
Regards,
Vijay.B
Message was edited by:
Vijay.B
Message was edited by:
Vijay.BHi,
If you want to do it from scratch you can basically do the following:
Make sure you have created an application server and integration server connection in JDeveloper.
1) Create a new JDeveloper project of type ESB project.
2) Possibly add a ESB System/Group (open the esb file and click "Create System/Group") to group ESB projects.
3) Create an XML schema describing your input XML file. Probably one element of type xsd:string.
4) Create an example XML file which is well-formed and valid according to the XSD from step 3.
5) Create a new File adapter (inbound/read). A routing service is automatically created.
6) Create a new File adapter (outbound/write).
7) Create a routing rule in the routing service in which you invoke the write method of the outbound file adapter. Possibly add a transformation using the XSL mapper.
8) Deploy the ESB project to the server.
9) Drop your XML file (from step 4) in the directory in which the inbound file adapter is polling.
10) If it is ok, the file should be picked up, transformed and dropped in the outbound directory. A new ESB instance should be visible in the ESB console.
See what files are generated on the filesystem in each of the above steps.
Regards, Ronald -
Can't get "Simple Example Doclet" to run -- Cannot find
I am trying to run the "Simple Example Doclet" at http://java.sun.com/j2se/1.3/docs/tooldocs/javadoc/overview.html.
It appears to compile ok, but when I go to run it I get the message "javadoc: Cannot find doclet class ListClass".
Listed below is:
1. The execution command and error message
2. The version (output of javadoc -J-version)
3. The javac compile command and input and output files
All directories have been kept the same as in the example.
Any help would be appreciated.
Thanks
1. C:\jdk1.3>javadoc -doclet ListClass -classpath C:\jdk1.3\lib\tools.jar MyClass.java
javadoc: Cannot find doclet class ListClass
1 error
2. javadoc -J-version
gives
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode).
3. javac -classpath C:\jdk1.3\lib\tools.jar ListClass.java
appears to give good compile ....
e. g. Input source file ListClass.java is as follows:
import com.sun.javadoc.*;
public class ListClass {
public static boolean start(RootDoc root) {
ClassDoc[] classes = root.classes();
for (int i = 0; i < classes.length; ++i) {
System.out.println(classes);
return true;
and.....
decompiled ListClass.class file is as follows:
// Decompiled by DJ v2.8.8.54 Copyright 2000 Atanas Neshkov Date: 10/11/2001 4:09:46 PM
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: ListClass.java
import com.sun.javadoc.RootDoc;
import java.io.PrintStream;
public class ListClass
public ListClass()
public static boolean start(RootDoc rootdoc)
com.sun.javadoc.ClassDoc aclassdoc[] = rootdoc.classes();
for(int i = 0; i < aclassdoc.length; i++)
System.out.println(aclassdoc[i]);
return true;Sorry to be so late in getting back to you .. I was on vacation.
ListClass is in the current directory. I did get it to work however... In order to get it to work I had to do two things:
1. use -docletpath (even thought it was in the current path) e. g. -docletpath C:\jdk1.3\ListClass.jar
AND
2. Make the class file a jar file -- I could not get it to work otherwise.
p.s. the typo was a decompiler error. -
What forum might be useful in solving this issue:
Simple Examples of data connectivity and transfer of data from an .asp.vb to javascript in an .aspx fileThey'll help you here in the Microsoft ASP.net forums.
http://forums.asp.net/
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights. -
I need an simple example on java-Oracle8i entreprise
Hi,
Could anyone give me an simple example of a Java method which will be loaded into Oracle.
Let say, the method will read the email address based on employee_ID from a table called Employee. Thank you very much for all your help.
Hellenie
PS: I would like to see java code and to see how it could call a table without having to deal with connection object ,statement,etc...
nullThis is the example from the Oracle's 8.1.6 Documentation - Java Stored pocedures Developer's guide -
step 1 :
import java.sql.*;
import java.io.*;
import oracle.jdbc.driver.*;
public class RowCounter {
public static int rowCount (String tabName) throws SQLException {
Connection conn = new OracleDriver().defaultConnection();
// here is the connection made
String sql = "SELECT COUNT(*) FROM " + tabName;
int rows = 0;
try {
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery(sql);
// same old createStatement, executeQuery ...
while (rset.next()) {rows = rset.getInt(1);}
rset.close();
stmt.close();
} catch (SQLException e) {System.err.println(e.getMessage());}
return rows;
Step 2:
use loadjava command line utility and
specify the class name, username/password to
load the code into the database.
step 3:
On sql prompt, the class and method name are
mapped to stored procedure
CREATE FUNCTION row_count (tab_name VARCHAR2) RETURN NUMBER
AS LANGUAGE JAVA
NAME 'RowCounter.rowCount(java.lang.String) return int';
You can invoke the procedure using CALL method from SQL prompt.
Cheers,
Adithya
null -
I need a simple example of shopping cart(newbie)
Has any one come across a simple example of shopping cart and the process
behind it i.e. from jsp to ejb. So far I have looked at the buybeans example
and it still is not clear the approach that was used.
I would be greatful for any assistance thank you
Kenneth A-AdjeiTake a look at:
http://java.sun.com/docs/books/tutorial/servlets/overview/example.html
"Ken Adjei" <[email protected]> wrote in message
news:3960a901$[email protected]..
Has any one come across a simple example of shopping cart and the process
behind it i.e. from jsp to ejb. So far I have looked at the buybeansexample
and it still is not clear the approach that was used.
I would be greatful for any assistance thank you
Kenneth A-Adjei -
Simple example code connect Ldap server...
Hi all.
I am beginning working with Ldap.
Please help me a simple example source code to connect with Ldap server.
I install Ldap administrator and see a public Server : ldap://directory.d-trust.de:389 How to connect it ?
Thanks in advance
DiegoHi ThuCT,
Just have a read of the following links :
http://www.javaworld.com/javaworld/jw-03-2000/jw-0324-ldap.html
http://java.sun.com/products/jndi/tutorial/ldap/index.html -
Simple Examples on ABAP Objects without using include or function modules
Hi,
I am new to ABAP. I need simple example codes on ABAP Objects. It should not have Includes or Function Modules. Just simple codes, using local & global classes, interfaces etc. I searched the forum and even <<the site that shall not be mentioned>>, but did not find a solution. Kindly help please.
Regards,
Smruthi.
Edited by: Matt on Mar 1, 2009 1:20 PM - forbidden site reference removedHello Smruthi
If you go to the Forum Search and choose the forum ABAP Objects then serach for ZUS_SDN and you will find many of my simple sample reports.
These reports usually do not contain any includes but they may call function modules which makes perfectly sense. For example, if you are still doing a direct table SELECT instead of using an available BAPI (or class) to get a business object then this is a clear sign of poor (=non-ABAP-OO) programming.
Regards
Uwe -
Dear All
please send a simple example of JList using Event Handling.
Thanks in advance.Rajsarawat wrote:
Dear All ...
Thanks in advance.I love how Rajsarawat conscientiously always comes back to his threads to personally thank folks who contribute. That will surely motivate me to help him as much as possible in the future. Good job, Rajsarawat! -
Can anyone plz send a simple example of interactive reports
Hi gurus,
Can anyone plz send a simple example of interactive reports using subscreenswhich contains at line-selection, at user-command, pf and other commands.
Thanks in advance.Hi,
* Macro definition
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = &2.
ls_fieldcat-cfieldname = &3.
ls_fieldcat-qfieldname = &4.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
TYPE-POOLS: slis. " ALV Global types
TYPES:
BEGIN OF ty_vbak,
vkorg TYPE vbak-vkorg, " Sales organization
kunnr TYPE vbak-kunnr, " Sold-to party
vbeln TYPE vbak-vbeln, " Sales document
netwr TYPE vbak-netwr, " Net Value of the Sales Order
waerk TYPE vbak-waerk, " Currency
END OF ty_vbak,
BEGIN OF ty_vbap,
vbeln TYPE vbap-vbeln, " Sales document
posnr TYPE vbap-posnr, " Sales document item
matnr TYPE vbap-matnr, " Material number
arktx TYPE vbap-arktx, " Short text for sales order item
kwmeng TYPE vbap-kwmeng, " Order quantity
vrkme TYPE vbap-vrkme, " Quantity Unit
netwr TYPE vbap-netwr, " Net value of the order item
waerk TYPE vbap-waerk, " Currency
END OF ty_vbap.
DATA :
gs_vbak TYPE ty_vbak,
* Data displayed in the first list
gt_vbak TYPE TABLE OF ty_vbak,
* Data displayed in the second list
gt_vbap TYPE TABLE OF ty_vbap.
SELECT-OPTIONS :
s_vkorg FOR gs_vbak-vkorg, " Sales organization
s_kunnr FOR gs_vbak-kunnr, " Sold-to party
s_vbeln FOR gs_vbak-vbeln. " Sales document
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max. "#EC NEEDED
PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
v_1 = 'Maximum of records to read'.
START-OF-SELECTION.
PERFORM f_read_data_vbak.
PERFORM f_display_data_vbak.
* Form f_read_data_vbak
FORM f_read_data_vbak.
SELECT vkorg kunnr vbeln netwr waerk
INTO CORRESPONDING FIELDS OF TABLE gt_vbak
UP TO p_max ROWS
FROM vbak
WHERE kunnr IN s_kunnr
AND vbeln IN s_vbeln
AND vkorg IN s_vkorg
and vbtyp = 'C'. " C = Sales Orders.
ENDFORM. " F_READ_DATA_VBAK
* Form f_display_data_vbak
FORM f_display_data_vbak.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv.
* Build the field catalog
m_fieldcat 'VKORG' 'VBAK' '' ''.
m_fieldcat 'KUNNR' 'VBAK' '' ''.
m_fieldcat 'VBELN' 'VBAK' '' ''.
m_fieldcat 'NETWR' 'VBAK' 'WAERK' ''.
m_fieldcat 'WAERK' 'VBAK' '' ''.
* Display the first list
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = lt_fieldcat
TABLES
t_outtab = gt_vbak.
ENDFORM. " F_DISPLAY_DATA_VBAK
* FORM USER_COMMAND *
FORM user_command USING u_ucomm TYPE syucomm
us_selfield TYPE slis_selfield. "#EC CALLED
CASE u_ucomm.
WHEN '&IC1'.
READ TABLE gt_vbak INDEX us_selfield-tabindex INTO gs_vbak.
CHECK sy-subrc EQ 0.
PERFORM f_read_data_vbap. " Read data from VBAP
PERFORM f_display_data_vbap.
ENDCASE.
ENDFORM. " USER_COMMAND
* Form f_read_data_vbap
FORM f_read_data_vbap.
SELECT vbeln posnr matnr arktx kwmeng vrkme netwr waerk
INTO CORRESPONDING FIELDS OF TABLE gt_vbap
FROM vbap
WHERE vbeln = gs_vbak-vbeln.
ENDFORM. " F_READ_DATA_VBAP
* Form f_display_data_vbap
FORM f_display_data_vbap.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv.
* Build the field catalog
m_fieldcat 'VBELN' 'VBAP' '' ''.
m_fieldcat 'POSNR' 'VBAP' '' ''.
m_fieldcat 'MATNR' 'VBAP' '' ''.
m_fieldcat 'ARKTX' 'VBAP' '' ''.
m_fieldcat 'KWMENG' 'VBAP' '' 'VRKME'.
m_fieldcat 'VRKME' 'VBAP' '' ''.
m_fieldcat 'NETWR' 'VBAP' 'WAERK' ''.
m_fieldcat 'WAERK' 'VBAP' '' ''.
* Display the second list
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = lt_fieldcat
TABLES
t_outtab = gt_vbap.
ENDFORM. " F_DISPLAY_DATA_VBAP
2nd example
* Macro definition
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = &2.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
TYPE-POOLS: slis. " ALV Global types
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max. "#EC NEEDED
PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
TYPES:
* Data displayed in the first list
BEGIN OF ty_kna1,
kunnr TYPE kna1-kunnr, " Customer number
name1 TYPE kna1-name1, " Customer name
ort01 TYPE kna1-ort01, " Customer city
END OF ty_kna1,
* Data displayed in the second list
BEGIN OF ty_vbak,
vkorg TYPE vbak-vkorg, " Sales organization
kunnr TYPE vbak-kunnr, " Sold-to party
vbeln TYPE vbak-vbeln, " Sales document
netwr TYPE vbak-netwr, " Net Value of the Sales Order
END OF ty_vbak,
* Data displayed in the third list
BEGIN OF ty_vbap,
vbeln TYPE vbap-vbeln, " Sales document
posnr TYPE vbap-posnr, " Sales document item
matnr TYPE vbap-matnr, " Material number
arktx TYPE vbap-arktx, " Short text for sales order item
kwmeng TYPE vbap-kwmeng, " Order quantity
netwr TYPE vbap-netwr, " Net value of the order item
END OF ty_vbap.
DATA:
gs_kna1 TYPE ty_kna1,
gt_kna1 TYPE TABLE OF ty_kna1,
gs_vbak TYPE ty_vbak,
gt_vbak TYPE TABLE OF ty_vbak,
gt_vbap TYPE TABLE OF ty_vbap.
INITIALIZATION.
v_1 = 'Maximum of records to read'.
START-OF-SELECTION.
PERFORM f_read_data_kna1.
END-OF-SELECTION.
PERFORM f_display_data_kna1.
* Form f_read_data_kna1
FORM f_read_data_kna1.
* Read customer data with a least one order
SELECT kunnr name1 ort01 INTO TABLE gt_kna1
FROM kna1 AS k
UP TO p_max ROWS
WHERE EXISTS
( SELECT kunnr FROM vbak WHERE kunnr = k~kunnr ).
ENDFORM. " F_READ_DATA_KNA1
* Form f_display_data_kna1
FORM f_display_data_kna1.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv.
* Build the field catalog
m_fieldcat 'KUNNR' 'KNA1'.
m_fieldcat 'NAME1' 'KNA1'.
m_fieldcat 'ORT01' 'KNA1'.
* Display the first list
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND_KNA1'
it_fieldcat = lt_fieldcat
TABLES
t_outtab = gt_kna1.
ENDFORM. " F_DISPLAY_DATA_KNA1
* FORM USER_COMMAND_KNA1 *
FORM user_command_kna1 USING u_ucomm TYPE sy-ucomm
us_selfield TYPE slis_selfield."#EC CALLED
CASE u_ucomm.
WHEN '&IC1'.
READ TABLE gt_kna1 INDEX us_selfield-tabindex INTO gs_kna1.
CHECK sy-subrc EQ 0.
PERFORM f_read_data_vbak. " Read data from VBAK
PERFORM f_display_data_vbak. " Display orders
ENDCASE.
ENDFORM. " USER_COMMAND_KNA1
* Form f_read_data_vbak
FORM f_read_data_vbak.
SELECT vkorg kunnr vbeln netwr
INTO TABLE gt_vbak
FROM vbak
UP TO p_max ROWS
WHERE kunnr = gs_kna1-kunnr.
ENDFORM. " F_READ_DATA_VBAK
* Form f_display_data_vbak
FORM f_display_data_vbak.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv.
* Build the field catalog
m_fieldcat 'VKORG' 'VBAK'.
m_fieldcat 'KUNNR' 'VBAK'.
m_fieldcat 'VBELN' 'VBAK'.
m_fieldcat 'NETWR' 'VBAK'.
* Display the second list
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND_VBAK'
it_fieldcat = lt_fieldcat
TABLES
t_outtab = gt_vbak.
ENDFORM. " F_DISPLAY_DATA_VBAK
* FORM USER_COMMAND_VBAK *
FORM user_command_vbak USING u_ucomm TYPE sy-ucomm
us_selfield TYPE slis_selfield."#EC CALLED
CASE u_ucomm.
WHEN '&IC1'.
READ TABLE gt_vbak INDEX us_selfield-tabindex INTO gs_vbak.
CHECK sy-subrc EQ 0.
PERFORM f_read_data_vbap. " Read data from VBAP
PERFORM f_display_data_vbap. " Display items
ENDCASE.
ENDFORM. " USER_COMMAND_VBAK
* Form f_read_data_vbap
FORM f_read_data_vbap.
SELECT vbeln posnr matnr arktx kwmeng netwr
INTO TABLE gt_vbap
FROM vbap
WHERE vbeln = gs_vbak-vbeln.
ENDFORM. " F_READ_DATA_VBAP
* Form f_display_data_vbap
FORM f_display_data_vbap.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv.
* Build the field catalog
m_fieldcat 'VBELN' 'VBAP'.
m_fieldcat 'POSNR' 'VBAP'.
m_fieldcat 'MATNR' 'VBAP'.
m_fieldcat 'ARKTX' 'VBAP'.
m_fieldcat 'KWMENG' 'VBAP'.
m_fieldcat 'NETWR' 'VBAP'.
* Display the third list
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = lt_fieldcat
TABLES
t_outtab = gt_vbap.
ENDFORM. " F_DISPLAY_DATA_VBAP
3rd Example
** Macro definition*
*DEFINE m_fieldcat.*
*add 1 to ls_fieldcat-col_pos.*
*ls_fieldcat-fieldname = &1.*
*ls_fieldcat-ref_tabname = &2.*
*append ls_fieldcat to lt_fieldcat.*
*END-OF-DEFINITION.*
*CONSTANTS :*
*c_x VALUE 'X'.*
*TYPE-POOLS: slis. " ALV Global types*
*TYPES:*
** Data displayed in the first list*
*BEGIN OF ty_vbak,*
*vkorg TYPE vbak-vkorg, " Sales organization*
*kunnr TYPE vbak-kunnr, " Sold-to party*
*vbeln TYPE vbak-vbeln, " Sales document*
*netwr TYPE vbak-netwr, " Net Value of the Sales Order*
*END OF ty_vbak,*
** Data displayed in the popup list*
*BEGIN OF ty_vbap,*
*posnr TYPE vbap-posnr, " Sales document item*
*matnr TYPE vbap-matnr, " Material number*
*arktx TYPE vbap-arktx, " Short text for sales order item*
*kwmeng TYPE vbap-kwmeng, " Order quantity*
*netwr TYPE vbap-netwr, " Net value of the order item*
*END OF ty_vbap.*
*DATA :*
*g_vkorg TYPE vbak-vkorg,*
*g_kunnr TYPE vbak-kunnr,*
*g_vbeln TYPE vbak-vbeln,*
*gt_vbak TYPE TABLE OF ty_vbak,*
*gt_vbap TYPE TABLE OF ty_vbap.*
*SELECT-OPTIONS :*
*s_vkorg FOR g_vkorg, " Sales organization*
*s_kunnr FOR g_kunnr, " Sold-to party*
*s_vbeln FOR g_vbeln. " Sales document*
*SELECTION-SCREEN :*
*SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max. "#EC NEEDED*
*PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.*
*SELECTION-SCREEN END OF LINE.*
*INITIALIZATION.*
*v_1 = 'Maximum of records to read'.*
*START-OF-SELECTION.*
*PERFORM f_read_data_vbak.*
*PERFORM f_display_data_vbak.*
** Form f_read_data_vbak*
*FORM f_read_data_vbak.*
*SELECT vkorg kunnr vbeln netwr*
*INTO TABLE gt_vbak*
*FROM vbak*
*UP TO p_max ROWS*
*WHERE kunnr IN s_kunnr*
*AND vbeln IN s_vbeln*
*AND vkorg IN s_vkorg.*
*ENDFORM. " F_READ_DATA_VBAK*
** Form f_display_data_vbak*
*FORM f_display_data_vbak.*
*DATA:*
*ls_fieldcat TYPE slis_fieldcat_alv,*
*lt_fieldcat TYPE slis_t_fieldcat_alv.*
** Build the field catalog*
*m_fieldcat 'VKORG' 'VBAK'.*
*m_fieldcat 'KUNNR' 'VBAK'.*
*m_fieldcat 'VBELN' 'VBAK'.*
*m_fieldcat 'NETWR' 'VBAK'.*
** Display the first list*
*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'*
*EXPORTING*
*i_callback_program = sy-cprog*
*i_callback_user_command = 'USER_COMMAND'*
*it_fieldcat = lt_fieldcat*
*TABLES*
*t_outtab = gt_vbak.*
*ENDFORM. " F_DISPLAY_DATA_VBAK*
** FORM USER_COMMAND **
*FORM user_command USING u_ucomm TYPE sy-ucomm*
*us_selfield TYPE slis_selfield. "#EC CALLED*
*DATA:*
*ls_vbak TYPE ty_vbak.*
*CASE u_ucomm.*
*WHEN '&IC1'.*
*READ TABLE gt_vbak INDEX us_selfield-tabindex INTO ls_vbak.*
*CHECK sy-subrc EQ 0.*
*PERFORM f_read_data_vbap " Read data from VBAP*
*USING ls_vbak-vbeln.*
*PERFORM f_display_data_vbap.*
*ENDCASE.*
*ENDFORM. " USER_COMMAND*
** Form f_read_data_vbap*
*FORM f_read_data_vbap USING u_vbeln TYPE vbeln_va.*
*SELECT posnr matnr arktx kwmeng netwr*
*INTO TABLE gt_vbap*
*FROM vbap*
*WHERE vbeln = u_vbeln.*
*ENDFORM. " F_READ_DATA_VBAP*
** Form f_display_data_vbap*
*FORM f_display_data_vbap.*
*DATA:*
*ls_private TYPE slis_data_caller_exit,*
*ls_fieldcat TYPE slis_fieldcat_alv,*
*lt_fieldcat TYPE slis_t_fieldcat_alv.*
** Build the field catalog*
*m_fieldcat 'POSNR' 'VBAP'.*
*m_fieldcat 'MATNR' 'VBAP'.*
*m_fieldcat 'ARKTX' 'VBAP'.*
*m_fieldcat 'KWMENG' 'VBAP'.*
*m_fieldcat 'NETWR' 'VBAP'.*
*ls_private-columnopt = c_x. " Optimize width*
** Display items in a POPUP*
*CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'*
*EXPORTING*
*i_selection = ' '*
*i_tabname = 'GT_VBAP'*
*it_fieldcat = lt_fieldcat*
*is_private = ls_private*
*TABLES*
*t_outtab = gt_vbap.*
*ENDFORM. " F_DISPLAY_DATA_VBAP*
***************** END OF PROGRAM Z_ALV_GRID_AND_POPUP *******************
reward if helpful
raam
Maybe you are looking for
-
Print Preview in InDesign?
Sorry, I thought this would be simple to find by searching, but it appears that each page with an answer on it has Print Preview at the bottom, so I'm getting a huge number of unrelated hits! I'm converting publications from Ventura Publisher 10 to
-
How to declare ranges on ECC6.0
Hi All, i have probelm with the ranges statement in ECC 6.0 i have declared the renages like below. RANGES: RA_BZOBJ FOR KEKO_WA-BZOBJ. Using like this: RA_BZOBJ-SIGN = C_INCL. RA_BZOBJ-OPTION = C_EQ. RA_BZOBJ-LOW = WA_KEKO_DATA-BZOBJ.
-
hi, I am designing a payslip in that title should show month in text like 'pay slip for -march 2007'. How it can be done. I am designing layout in PE51. Regards, Karthik.k
-
Installation error - Oracle Database 10g Express Edition
Hi - I've just tried to install Oracle Database 10g Express Edition from the Oracle website and I'm getting this error. Error 1327 Invalid Drive: I:\ . I've googled the error but can't find much. It seems that the path is hardcoded into the msi insta
-
I have an iPad 2 and I am unable to activate my face time account. Despite having the correct ID and password. Any suggestions?