Webdynpro Table
Dear All
I have a webdynpro application having a Table Control in it. Table Controll has four columns and 10 rows filled with data.
How can I passed this in SAP R/3 using BAPI.Source Code used for this purpose is also appreciated.
Thanks
Hello Adnan,
Since you are passing the table; you have to create a structure in context that will be assigned to the export parameter of BAPI. Only what you need is to assign the table contents to the BAPI Input node.
Rest of the things will be taken care by Adaptive RFC model.
Regards
Vinod V
Similar Messages
-
How to Display the content of Excel file into Webdynpro Table
Hi Experts
I am following the Blog to upload a file in to the webdynpro context,but my problem is after uploading a excel file i need to extract the content from that Excel file and that content should be displayed in the webdynpro table.Can any body please guide me how to read the content from excel and to Display in the Table.
Thanks and Regards
KalyanHI,
Take for example, if Excel file contains 4 fields,
Add jxl.jar to JavaBuild path and Use this snippet
File f=new File("sample.xls");
Workbook w=Workbook.getWorkbook(f);
Sheet sh=w.getSheet(0);
int cols=sh.getColumns();
int rows=sh.getRows();
Cell c=null;
String s1=null;
String s2=null;
String s3=null;
String s4=null;
ArrayList al=new ArrayList();
int j=0;
for(int i=1;i<rows;i++)
ITableElement table=wdContext.createTableElementz
s1=sh.getCell(0,i).getContents();
s2=sh.getCell(1,i).getContents();
s3=sh.getCell(2,i).getContents();
s4=sh.getCell(3,i).getContents();
table.setName(s1);
table.setAddress(s2);
table.setDesignation(s3);
table.setDummy(s4);
al.add(j,table);
j++;
wdContext.nodeTable().bind(al);
Regards
LakshmiNarayana -
WebDynpro Table Contents to Adobe:
Hi ,
I have WebDynpro Table element containing lots of data and on click of button it has to open in Adobe and display all the contents in Adobe Table. The problem is that i receive only one record which is lead selected in WebDynpro table. In Adobe i used one Subform ( Content type is flowed) and a table element.
Expecting right ans.
Thanks
Vinod V
Points waiting.Hi, Vinod,
Really its surprising. Everything is fine, then y its not working. here I have created a sample application regarding u r problem. Its working fine. While i am giving Updatepdf it shows only one record. In generate pdf, It shows all the records. Possible, Try to create your Interactive form again as its a simple one.
GS -
Currency Key Reference field in WebDynpro Table Column
Hi Experts,
I am using a WebDynpro table (not ALV) showing multiple currency fields in a single row - each one potentially referencing a different currency key e.g. Japanese Yen and USD in a single row.
My currency context attributes are already defined as currency types, but how can I assign different currency key references to each of my currency context attributes? Or is this somehow done as a property of the table column UI element?
Thanks for your help,
PeterHi Kris,
You answer is very helpful, but I do have a question about going the DDIC route. So you are saying that if I take a DDIC structure into my context with multiple currency keys as reference fields for multiple currency fields, then my WebDynpro context will know exactly which currency key is the reference for which currency field without having do do this programatically as you described? If that's true, can I bring a whole DDIC structure over to the context and then delete the 'Dictionary Structure' refrence from my context node, so that I can add my own additional fields to the context node? E.g. in the case of DDIC structure VBAP can I get all my currency fields and their reference fields from the DDIC from VBAP and then delete 'VBAP' as a 'Dictionary Structure' from my context node and add my own custom fields. The fields I would have brought in from VBAP still retain their type and everything after the deletion of 'VBAP' as a 'Dictionary Structure', so my question is will it also retain the node_info of what currency key goes with what field?
Please let me know if you happend to have done this before.
Thanks,
Peter -
How to make 2 lines in a webdynpro table cell?
Hi
Is it possiable to create a WebDynpro Table Call that can contains 2 lines in 1 cell ?Hi Ami,
There are a limited number of UI elements that you may use for a Table Cell Editor, however, with a TextView, you can display text that includes a line break.
The line break is achieved by including the carriage-return-line-feed characters in the Table's data source...
LOOP AT lt_flight_tab ASSIGNING <f>.
CONCATENATE 'Line One' cl_abap_char_utilities=>cr_lf 'Line Two' INTO <f>-test.
ENDLOOP.
Cheers,
Amy -
Hi Colleagues.
Im using NW 7.0 Java webdynpro
Can I use dynamic pagination for java webdynpro table. I found an article explaining the same with NW7.1.
Is there any option the functionality available in NW 7.0
Thanks
BalaHi
PLease check this article link
https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0d6c30a-c99e-2b10-f09b-c9a00b7e78c6&overridelayout=true
Also check this blog link
/people/bertram.ganz/blog/2008/11/27/web-dynpro-java-table-paging-unleashed-optimizing-heavy-table-performance
Regards
Ruturaj
Edited by: Ruturaj Inamdar on Jul 31, 2009 1:32 PM -
Regarding excel file download from webdynpro table element
Hi All,
I want steps to do excel download from webdynpro table element.
Thanks in advance.
Regards,
Muneesh Gitta.Hi Gitta,
There are 2 ways in doing it, one is using GUI DOWNLOAD FM or using class clwd_runtime_services.
DATA:
node_node_alv TYPE REF TO if_wd_context_node,
elem_node_alv TYPE REF TO if_wd_context_element,
stru_node_alv TYPE wd_this->element_node_alv,
itab_node_alv TYPE TABLE OF wd_this->element_node_alv..
navigate from <CONTEXT> to <NODE_ALV> via lead selection
@TODO handle not set lead selection
IF ( node_node_alv IS INITIAL ).
ENDIF.
get all declared attributes
node_node_alv->get_static_attributes_table(
IMPORTING
table = itab_node_alv ).
DATA:
node_file_download TYPE REF TO if_wd_context_node,
elem_file_download TYPE REF TO if_wd_context_element,
stru_file_download TYPE wd_this->element_file_download ,
item_fname LIKE stru_file_download-fname.
navigate from <CONTEXT> to <FILE_DOWNLOAD> via lead selection
node_file_download = wd_context->get_child_node( name = wd_this->wdctx_file_download ).
get element via lead selection
elem_file_download = node_file_download->get_element( ).
get single attribute
elem_file_download->get_attribute(
EXPORTING
name = `FNAME`
IMPORTING
value = item_fname ).
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = item_fname
FILETYPE = 'ASC'
TABLES
data_tab = itab_node_alv.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
OR
check this blog for
Re: Export to Excel Sheet functionality -
Hello,
I have a couple of clarifications on webdynpro table features.
1.webdynpro table heading currently comes only as one row.Is it possible to store the values in 2 rows.?
2.I would like to incorporate scrolling on webdynpro table both horizontally and vertically.Whe scrolling is incorporated vertically,is it possible to keep the header always on the screen,even when the webdynpro is scrolled down?
regards
JohHi,
Check this link,
Re: WebDnpro Table + Scroll
John -
Webdynpro table with dropdow list
hi experts,
i wanna webdynpro table rows have their dropdow list,and each row have it's own list values
how can i do
best regards
zlfHi,
I hope you already have a Solution, if not try the following:
1-Create a node"table"(0-n) in the context_View
2-Create 2 attribute in this node.
- The first"List_atr" to show the list
- The second "save_atr" to save the value selected from the list
3- Create a Table in the Layout_View, bind it dateSource to the node"table" in context_view
3.1- Add a Column in the Table (Layout_View),
+ add a TableCelEditor "DropDownByKey" elt to this Column,
+ bind the "selectedKey" of this Elt to the first"List_atr" in the node"table" in the context Node
+ Add a eventhandler(method)"onvalSelected" to the Events "onSelect" of this elt
3.1-implement the method "onvalSelected"
here tel ur view ctrl to save the value selected in the second "save_atr" in the context_View
example code:
wdContext.currentTableElement().setsave_atr( wdContext.currentTableElement().getshow_atr());
So if you know how to populate the first "show_atr" with some list, coo. So if the user selected one value in the dropdown list, the method will save it in the cell of the table row and so on for each rows.
If you have another questions just asked.
Best Regards
Glap -
hi experts,
How to Store and fetch the data from oracle BD and after fetching i want to display that result in webdynpro table and storing is also from webdynpro view interface.
can anybody help me on end to end procdure how can i achive.
Advance Thank you,
vijaiHi vijay,
<b> using EJB and connect with oracle.</b>
the step by step procedure is follow how to connect with oracle
1) Open the J2EE perspective
2) Create an EJB Module project
3) Right click on ejbModule, create a new EJB (select your EJB type)
4) While creating the ejb itself, you can add business methods by clicking Next in the UI. Another option is after creating the ejb, write the method in the bean, then select the method from ejb-jar.xml -> <bean name> ->method. Right click and select propogate to local & remote.
5) Double click on ejb-j2ee-engine.xml. select your bean and specify a Jndi name for eg: MyJndi.
6) Right click on the EJB project and add classes12.zip file (provided by Oracle) to its build path. (under libraries tab). Also check the same file under Order & Export.
7) Create an Enterprise Application project.
8) Right click on the EJB module project and select add to EAR project, then select the created EAR project.
9) Right click on the EJB project, select Build EJB Archive
10) Right click on the EAR project, select Build Application Archive
11) Open the WebDynpro perspective, open a new project, right click on the project ->properties. Do the following configurations :-
Java Build path - select the EJB project from projects , check the selected project under Order & Export
Project references select the EAR project
WebDynpro references select sharing references tab, click add & make an entry as : <vendor>/<EAR project name without .ear extension>
You can find the vendor name under application-j2ee-engine.xml file of the EAR project. By default it is sap.com. So if my EAR projects name is ABC, my entry would look like sap.com/ABC
12) Now the configurations are over and the EJB can be invoked by writing the client code inside the webdynpro component. Like:
InitialContext context = new InitialContext();
Object obj = context.lookup("MyJndi");
MyEJBHome home = MyEJBHome)PortableRemoteObject.narrow(obj,MyEJBHome.class);
MyEJB mybean = home.create();
int a = 0;
a= mybean.add(10,15);
wdContext.currentContextElement().setSum(a);
where MyEJB is my EJB name and MyJndi is my JNDI name
To connect to Oracle , you can write the usual Java code (given below) as a business methos of the ejb (similar to add() method in the example). And access it like mybean.<businessMethodName>().
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("your query");
i hope that the above steps are useful for u.
Regards,
P.Manivannan. -
How to Sort single column in webdynpro table
Hi all
I have requirement as follows.
i have webdynpro table with the following columns like Date,firstname,lastname,address etc.
now when i run the the application the table is populating the data at runtime that is fine.
i need as soon as table is loaded , Date field in the table should be displayed the values in the decending order...i have the requirement as follows...
how to sort the single column in table ...by default the values of the column displayed with decending order as soon as table displays at runtime....i dont want to click any button specific button to do the sort for that column
Regards
binduHi, I solved the same problem by modifying the sort() method in the default TableSorter class so that it takes a column id and direction rather than an event.
I assume you have read the TableSorter tutorial.
Like this. (This was done on nw ce 7.1 btw but may work on older versions as well.
Oh and then you just call the sort method right after you have made the request
//Code that goes into controller/view to execute sorting
wdContext.currentContextElement().getPensionplanTableSorter().sort("MyColumnId", "Up", wdContext.nodePensionPlan());
//Part of TableSorter.java
//The original method that needs an event. Now it just calls the new method
public void sort(IWDCustomEvent wdEvent, IWDNode dataSource) {
// find the things we need
String columnId = wdEvent.getString("selectedColumn");
String direction = wdEvent.getString("sortDirection");
sort(columnId, direction, dataSource);
//This is the new method.
public void sort(String columnId, String direction, IWDNode dataSource) {
if (columnId == null || direction == null ) {
return;
IWDTableColumn column = (IWDTableColumn) table.getView().getElement(columnId);
NodeElementByAttributeComparator elementComparator =
(NodeElementByAttributeComparator) comparatorForColumn.get(column);
if (elementComparator == null){
//not a sortable column
column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
return;
// sorting
elementComparator.setSortDirection(WDTableColumnSortDirection.valueOf(direction));
dataSource.sortElements(elementComparator); -
WebDynpro 中Table的column的换行.
dear all.
WebDynpro 中Table的column的长度太长了,有没有换行属性?
Edited by: Leo Wang on Jan 19, 2009 7:31 AM首先要把Table的width属性设备成一个定值,或者将TableColumn的width属性设成一个定值,然后再将Column中的TableCellEditor设成TextView,然后再将TextView的wrapping属性设成true,当TextView中的文本长度超过了Column的长度后,TextView就会自动换行,这样就可以达到换行的目的了。
-
Anymore example of WebDynpro table to Excel format
Hi, experts!
These day I am interested in Webdynpro for java.
But I am not good at java
Who can give me easy example for WebDynpro table to Excel?
Thanks in advance!HI,
Please post this [WebDynpro For JAVA forum|Web Dynpro Java;. You have more chances there to get a quick reply.
regards
Senthivel -
Dynamic rows in ABAP webdynpro table
hi all
I've got a question. I have a webdynpro with a table.
This table is feed by a node. The number of rows of this node is dynamic.
I had seen in the properties of the table object that the number of visible rows can be set.
But is there also a method to set this number of rows dynamicly? So when the node has 20 rows
the table object is also set to show 20 rows and when there are none, the table
only shows the header of the table.
Currently the table always shows 5 rows, without checking how many rows there actually are.
Does any of you know how to do this?
kind regards,
Anton PierhagenHi Anton ,
You can use the method SET_VISIBLE_ROW_COUNT() of the class cl_wd_table for setting the visible row count dynamically.
In the WDDOMODIFY view , you can get the reference of the table UI element used and proceed.
DATA lo_table TYPE cl_wd_table.
lo_table ?= view->get_element( ID = 'name_of_table_in_the_view').
lo_table->SET_VISIBLE_ROW_COUNT(value = 5)."Here the value you can decide based on your data.
But this method is not recommended as it directly deals with the view's elements and will be very difficult for the person maintaining the code.
Instead create a attribute which can store a number and bind the visible row count property to this attribute.
set this attribute with the values based on the data.(as in number of visible rows you would want to see.)
Thanks,
Aditya -
Abap WebDynpro: Table Maintenance Generator ??
...in ABAP Dictionary there is a tool for generating Table Maintenance for classical "Screen Painter" Dynpro. Is there (or will there ever be?) a similiar tool for generating Table Maintenance for WebDynpro ?
Have a look at [this|"Table Maintenance Generator" for WD4A?; thread - nothing new until now afaik.
Regards,
TW -
RFC data into WebDynpro Table based on Page selected by user in Portal
Hi All
I am new to webdynpro. we are developing an application in which we are supposed sent two parameters to RFC to retrive data. Two parameters are Role (plant) and page names(Sub - plant).
Finally there should only one RFC for whole application which takes parameters when user selects a role and page inside a role.
How can I do this. Please help me.Hi,
1. Develop an RFC at the backend SAP system, which takes in 2 input ( plant and sub-plant) and gives the list of results as a table.
2. Create a model in the WD Java application to call the RFC.
3. call the rfc, get the output and print the result in a table designed in the view.
There is a sample application which can be found here
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/creating%20a%20web%20dynpro%20application%20accessing%20abap%20functions.pdf
This does a similar application which you are trying to do. This takes in 2 input parameters from the user 'Departure city' and 'Arrival city' and prints the list if flights. If you go thru this sample application, you can develop urs very easily.
You can even get the source code of this project in the following link
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#15 [original link is broken]
Click 'download from SDN' in the link above.
Hope this helps you
Regards,
Sharadha
Maybe you are looking for
-
How can I limit the User not to create OPPT for a given BP grouping
Hi , We did create a Business Partner grouping (BUT000-BU_GROUP) and wish to block the user to create an Opportunity ( Transaction Type OPPT ) for this Business Partner grouping ? How can we do that ?
-
802.1x/EAP-TLS Fragmentation across VPN tunnel
I am having an issue authenticating users via 802.1x/EAP-TLS across an IPSec tunnel. I am using route-based VPN with SVTI configuration on a 2921 and 1941. I have the following settings defined: - Under the tunnel interfaces: - MTU 1390 - MSS 1350 -
-
Can a subscript be sorted aside from the value iself?
Example after creating 3 one dimentional arrays a and passing those three arrays to a method. The method will accept a user input from the keyboard. The input has to be matched with a paticular array value.How can I match an input with a specific arr
-
Embedding a .flv inside of a SWF?
1.) Why would you want to embed a .flv inside of a SWF? 2.) Do you need to do this if you want to place small video clips inside of a SWF? Thanks.
-
I just bought an iPad mini with retina and I tried to make a new account unfortunately I can't due to the billing info there's no none option what should I do.