How to read a alv grid row data from standard program
Hi All,
I am working on transaction LBK1. Actually when you will open this transaction in the left hand side it will show you the data in tree. When you click on a notification node it will show the relevant data in right side. In which there is a operation tab . In this tab the data comes in alv grid. If user selects a row then I have to get that selected row value. There is also a toolbar above on the tree side. There are some buttons which execute our implementation class where I can put the code.
Can anyone please help me out? How I can read that selected row in our class/method?
Thanks in advance.
Best Regards
Ritu
Setting and getting selected rows (Columns) and read line contents
You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similiar methods for columns.
Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows fronm the table. In the examples below the grid table is named gi_sflight.
Data declaratrion:
DATA:
Internal table for indexes of selected rows
gi_index_rows TYPE lvc_t_row,
Information about 1 row
g_selected_row LIKE lvc_s_row.
Example 1: Reading index of selected row(s) and using it to read the grid table
CALL METHOD go_grid->get_selected_rows
IMPORTING
et_index_rows = gi_index_rows.
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines = 0.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
textline1 = 'You must choose a valid line'.
EXIT.
ENDIF.
LOOP AT gi_index_rows INTO g_selected_row.
READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
ENDIF.
ENDLOOP.
Example 2: Set selected row(s).
DESCRIBE TABLE gi_index_rows LINES l_lines.
IF l_lines > 0.
CALL METHOD go_grid->set_selected_rows
exporting
it_index_rows = gi_index_rows.
ENDIF.
Similar Messages
-
How to pass the selected table row data from popup to source view
Hi ,
I have requirement of passing the data from popup view to source. , searching some data in popup view and displaying in table,
Like i am passing some input and click search button will display the data in table, when select any of the row in the table and click on the another button , i should be able to pass the select row to the source view and also should close the popup.
When i implement , In the popup windiw, when i enter the customer no, and click on search button, it is closing the popup itslef. not able to see the data in popup.
Can u tell me what is that soultion.
Regards
VijayHi Harsimran
Thanks for the reply,
1) Source view
In "Source View" i have input field called Customer_no. But, the end user will not have any idea , what customer no to enter. so i am searching the customer no in the popup view.
1) Customer_no( This is an inputfiled , to get the customer no from the popup view)
2) Get Customer NO( This is a button to call the popup view)
"Get Customer NO" This button action will open the popup view.
In this popup, i have
1) Input field (To enter the search term)
2) Search (To seach the customer no based on the search term)
3) Table ( To display the search data)
4) Button in Table tool bar called "Select" .( To close the popup view after selected the required data in the table to pass it back to the source view).
so in the popup view what happening is, when i click on the search button itself , it is closing the popupview by transfering the first row of the tbale ,with out select the required row in the table.
i need to close the window after click on the "Select" button in the toolbar , after selected the required row data to trasfer in the table.
Can u pelase tell me what are the modifcations i need to do it.
Regards
Vijay -
How to read Production Order Long Text data in ABAP program
Hi friends,
I have the issue in reading the ' Long Text ' tab view data of production order
in CO03 transaction.Please can some body help me out to get this in ABAP program.
Regards,
Rajesh Akarteok goto the long text, double click it, or use the small pencil, so that you proceed to the text editor.
Once you are there, use the menu: goto->head
a small popup will come up, stating the information you need.
what you need is OBJECT, ID, Language and NAME.
with those information you can feed the FM READ_TEXT.
and woooohooo there you go -
How to read the pop-dialog window data in adf
HI All,
Using the jdev 11.1.1.6.
I have two questions here :
1) How to read the selected table row data from the Pop -dialog window .
2)hOw can i forward to another URL view/view after selecting the data on dialog window and then click 'ok".
NOte : One of the blog says ' we cant apply the action and actionListener on button ,if we apply showPopupbehavious ,SO how can i forard to another page/URL view ? ,
scenario:
Upon click of some button , infomration ll be displayed on pop-dialog window and then user will select the any one of the row and click "OK"
. based on some data check i should forward it to the view/urlView .
any hits highly appriciated
thanks1) How to read the selected table row data from the Pop -dialog window .simple . get the employeevo and jobvo with relationship(fk or association/viewlink) drop the employee vo as af:table. show a detail icons at the end of column. make popup with show popup behaviour with lazyuncached drop the af:dialog it wiil show the details in job of concern employee
2)hOw can i forward to another URL view/view after selecting the data on dialog window and then click 'ok".
NOte : One of the blog says ' we cant apply the action and actionListener on button ,if we apply showPopupbehavious ,SO how can i forard to another page/URL view ? ,can you show the blo url to me.
grasp things.
http://hazem-adf-tips.blogspot.in/
https://blogs.oracle.com/jdeveloperpm/entry/how-to_efficiently_redirect_to_an_adf_faces_view_using_adf_controller
http://adf-lk.blogspot.in/2011/06/oracle-adf-how-to-redirect-url-in-bean.html
http://adfdeveloper.blogspot.in/2011/07/adf-auto-redirect-while-still-passing.html
http://www.slideshare.net/baigsorcl/oracle-adf-task-flows-for-beginners
http://www.techartifact.com/blogs/2012/03/adf-jsf-some-handy-code-for-backing-beans.html -
Hi experts.
Can someone assist me with information on using ALV grid for data input. Please give a simple example if possible.
I am mainly interested in the part in which we can transfer data from the grid changing the internal table's data.Try this code:
REPORT z_demo_alv_jg.
TYPE-POOLS *
TYPE-POOLS: slis.
INTERNAL TABLES/WORK AREAS/VARIABLES *
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
w_field TYPE slis_fieldcat_alv,
p_table LIKE dd02l-tabname,
dy_table TYPE REF TO data,
dy_tab TYPE REF TO data,
dy_line TYPE REF TO data.
FIELD-SYMBOLS *
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa> TYPE ANY,
<dyn_field> TYPE ANY,
<dyn_tab_temp> TYPE STANDARD TABLE.
SELECTION SCREEN *
PARAMETERS: tabname(30) TYPE c,
lines(5) TYPE n.
START-OF-SELECTION *
START-OF-SELECTION.
Storing table name
p_table = tabname.
Create internal table dynamically with the stucture of table name
entered in the selection screen
CREATE DATA dy_table TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_table->* TO <dyn_table>.
IF sy-subrc <> 0.
MESSAGE i000(z_zzz_ca_messages) WITH ' No table found'.
LEAVE TO LIST-PROCESSING.
ENDIF.
Create workarea for the table
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
Create another temp. table
CREATE DATA dy_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_tab->* TO <dyn_tab_temp>.
SORT i_fieldcat BY col_pos.
Select data from table
SELECT * FROM (p_table)
INTO TABLE <dyn_table>
UP TO lines ROWS.
REFRESH <dyn_tab_temp>.
Display report
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_PF_STATUS'
TABLES
t_outtab = <dyn_table>
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
*& Form SET_PF_STATUS
Setting custom PF-Status
-->RT_EXTAB Excluding table
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'Z_STANDARD'.
ENDFORM. "SET_PF_STATUS
*& Form user_command
Handling custom function codes
-->R_UCOMM Function code value
-->RS_SELFIELD Info. of cursor position in ALV
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Local data declaration
DATA: li_tab TYPE REF TO data,
l_line TYPE REF TO data.
Local field-symbols
FIELD-SYMBOLS:<l_tab> TYPE table,
<l_wa> TYPE ANY.
Create table
CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN li_tab->* TO <l_tab>.
Create workarea
CREATE DATA l_line LIKE LINE OF <l_tab>.
ASSIGN l_line->* TO <l_wa>.
CASE r_ucomm.
When a record is selected
WHEN '&IC1'.
Read the selected record
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
rs_selfield-tabindex.
IF sy-subrc = 0.
Store the record in an internal table
APPEND <dyn_wa> TO <l_tab>.
Fetch the field catalog info
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'Z_DEMO_PDF_JG'
i_structure_name = p_table
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 0.
Make all the fields input enabled except key fields*
w_field-input = 'X'.
MODIFY i_fieldcat FROM w_field TRANSPORTING input
WHERE key IS INITIAL.
ENDIF.
Display the record for editing purpose
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
it_fieldcat = i_fieldcat
i_screen_start_column = 10
i_screen_start_line = 15
i_screen_end_column = 200
i_screen_end_line = 20
TABLES
t_outtab = <l_tab>
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
Read the modified data
READ TABLE <l_tab> INDEX 1 INTO <l_wa>.
If the record is changed then track its index no.
and populate it in an internal table for future
action
IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
<dyn_wa> = <l_wa>.
i_index = rs_selfield-tabindex.
APPEND i_index.
ENDIF.
ENDIF.
ENDIF.
When save button is pressed
WHEN 'SAVE'.
Sort the index table
SORT i_index.
Delete all duplicate records
DELETE ADJACENT DUPLICATES FROM i_index.
LOOP AT i_index.
Find out the changes in the internal table
and populate these changes in another internal table
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
IF sy-subrc = 0.
APPEND <dyn_wa> TO <dyn_tab_temp>.
ENDIF.
ENDLOOP.
Lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc = 0.
Modify the database table with these changes
MODIFY (p_table) FROM TABLE <dyn_tab_temp>.
REFRESH <dyn_tab_temp>.
Unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table.
ENDIF.
ENDCASE.
rs_selfield-refresh = 'X'.
ENDFORM. "user_command -
How to send the ALV GRID output to spool by using the print button in std t
How to send the ALV GRID output to spool by using the print button in standard tool bar.
We have created a button in the va02 transaction. If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept. But i am unable to send the output to spool using the print button in the standard tool bar.
I am able to display the Print parameter dialog box but i am not able to send it to spool.
Kindly help.
Thanks In Advance.
G.V.RamanaHi Shaik,
There is not properties button in my print screen.
MODULE user_command_0900 INPUT.
WHEN 'EXCEL'.
PERFORM excel_download.
WHEN 'PRI'.
PERFORM print_output.
form Print_output.
CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
EXPORTING
columns = 80
device = 'ANY '
lines = 65
maxpenality = 1999
TABLES
layouts = lt_layouts1
EXCEPTIONS
unknown_device = 1
OTHERS = 2.
IF sy-subrc = 0.
LOOP AT lt_layouts1.
IF lt_layouts1-penality < 1000 AND
lt_layouts1-penality < l_min_penality.
l_layout = lt_layouts1-layout.
l_min_penality = lt_layouts1-penality.
ENDIF.
ENDLOOP.
IF NOT l_layout IS INITIAL.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
mode = 'CURRENT'
line_size = 80 "#EC *
new_list_id = l_new_list_id
no_dialog = l_no_dialog
layout = l_layout
IMPORTING
out_archive_parameters = rs_arc_params
out_parameters = rs_pri_params
valid = l_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc NE 0. " INS SLIN
ENDIF. " INS SLIN
IF rs_pri_params-linsz LT 80 OR
rs_pri_params-linsz LT gt_stack-s_lprint-width.
gt_stack-print_line_break = 'X'.
ELSE.
CLEAR gt_stack-print_line_break.
ENDIF.
IF l_valid NE 'X'.
rs_pri_params = ls_pri_params_sav.
rs_arc_params = ls_arc_params_sav.
ENDIF.
ENDIF.
ENDIF.
endform. " Print_output
CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
EXPORTING
is_layout = gs_layout_cost_tot_grand
CHANGING
it_fieldcatalog = gt_fcat_cost_tot_grand[]
it_outtab = gt_cost_tot_grand[].
Please check my code -
How to make users to select the date from calendar control only, by my making the date text field read only (don't want to let users type the date) in date time control in external list in sharepoint 2010. I am looking for a solution which can
be done through sharepoint desginer / out of the box.
thanks.Congratulate you got the solution by yourself. I am new to a
WinForms calendar component, I feel so helpless on many problems even I'd read many tutorials. This question on the
calendar date selection did me a great favor. Cheers. -
How to download the ALV Hierchial Tree Data to an Excel sheet.
Hi All,
Can any body please let me ,if there is any possibility to know How to download the ALV Hierchial Tree Data to an Excel sheet.
If yes, please let me know how could this can b acheived.
Regards,
Rohini.Hi Rohini
There is no such functionality provided by SAP to download ALV Tree Hierarichal Tree into excel sheet .
If you had this kind of senario then i can propose one solution create two radio buttons one is to display in ALV Tree Format and the other is classical report which you can download it for futher process
Regards
Hitesh Batra -
How to Customize the Message "No Row Returned" from a Report
Hi,
I've been trying to customize the Message "No Row Returned" from a Report.
First i followed the instructions in Note:183131.1 -
How to Customize the Message "No Row Returned" from a Report
But of course the OWA_UTIL.REDIRECT_URL in this solution did not work (in a portlet) and i found the metalink document 228620.1 which described how to fix it.
So i followed the "fix" in the document above and now my output is,..
"Portlet 38,70711 responded with content-type text/plain when the client was requesting content-type text/html"
So i search in Metalink for the above and come up with,...
Bug 3548276 PORTLET X,Y RESPONDED WITH CONTENT-TYPE TEXT/PLAIN INSTEAD OF TEXT/HTML
And i've read it and read it and read it and read it and can't make heads or tails of what it's saying.
Every "solution" seems to cause another problem that i have to fix. And all i want to do is customize the Message "No Row Returned" from a Report. Please,...does anyone know how to do this?My guess is that it only shows the number of rows it has retrieved. I believe the defailt is for it to only retrieve 50 rows and as you page through your report it retrieves more. So this would just tell you how many rows was retireved, but probably not how many rows the report would contain if you pages to the end. Oracle doesn't really have a notion of total number of rows until the whole result set has been materialized.
-
How do I transfer my applications and data from one Mac to another?
I am buying a new Macbook, anyone know how do I transfer my applications and data from old MacBook to New one?
Or you can be guided bt this 'officail' Apple support document:
http://support.apple.com/kb/PH4441
Ciao.
Csound 1 greetings: Nothing wrong with a little plagiarism. -
recently had to purchase a replacement phone a friend of mine had backed up the data on the lost phone to his Mac laptop how do I get that backed up data from the lost iPhone that's on his Mac laptop to my new replacement phone? Please give step by step instructions xoxoxo
And my iTunes sign in is also screwed up... It is underneath my friends email (the one with my backed up data on his Mac laptop) HOW DO I CHANGE THIS SO THAT I CAN DOWNLOAD APP's again...I suspect unless he had some items in iCloud backup then they are gone. Connecting an iPhone to a different library from that to which it was previously connected will result in the device asking if you want to erase it.
-
how do i get my songs and data from my old mac onto my pc so that i can copy it onto my new ipod touch
jrswish wrote:
When I plugged in my new one it cleared all my song and apps out of my current itunes.
Are you sure of that? Check in the Library. Click on the Apps icon to see all apps. Similarly click on the Music icon to see the songs. -
Load Grid with data from System.Data.DataTable
Hi all.
A have a System.Data.DataTable e need load a grid with data from this DataTable.
How Load a Grid with data from System.Data.DataTable?Hi Francisco,
actually i don't think that you can use a .NET datatable to fill a business one grid.
the business one has it's own datatable.
in c# it would look like this:
oForm.DataSources.DataTables.Add("MyDataTable");
((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).DataTable = oForm.DataSources.DataTables.Item("MyDataTable");
oForm.DataSources.DataTables.Item(0).ExecuteQuery("SELECT Field FROM [dbname].dbo.TABLE");
((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).CollapseLevel = 1;
((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).AutoResizeColumns();
((SAPbouiCOM.Grid)(oForm.Items.Item("grid").Specific)).SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single;
good night
lg David -
How will write SQL query to fetch data from each Sub-partition..
Hi All,
Anyone does have any idea about How to write SQL query to fetch data from Sub-partition.
Actually i have one table having composite paritition(Range+list)
Now if i want to fetch data from main partition(Range) the query will be
SELECT * FROM emp PARTITION(q1_2005);
Now i want to fetch data at sub-partition level(List) .But i am not able to get any SQL query for that.
Pls help me to sort out.
Thanks in Advance.
AnwarSELECT * FROM emp SUBPARTITION(sp1);
-
How can we transfer huge amount of data from database server to xml format
hi guru
how can we transfer huge amount of data from database server to xml format.
regards
subhasis.Create ABAP coding
At first we create the internal table TYPES and DATA definition, we want to fill with the XML data. I have declared the table "it_airplus" like the structure from XML file definition for a better overview, because it is a long XML Definition (see the XSD file in the sample ZIP container by airplus.com)
*the declaration
TYPES: BEGIN OF t_sum_vat_sum,
a_rate(5),
net_value(15),
vat_value(15),
END OF t_sum_vat_sum.
TYPES: BEGIN OF t_sum_total_sale,
a_currency(3),
net_total(15),
vat_total(15),
vat_sum TYPE REF TO t_sum_vat_sum,
END OF t_sum_total_sale.
TYPES: BEGIN OF t_sum_total_bill,
net_total(15),
vat_total(15),
vat_sum TYPE t_sum_vat_sum,
add_ins_val(15),
total_bill_amount(15),
END OF t_sum_total_bill.TYPES: BEGIN OF t_ap_summary,
a_num_inv_det(5),
total_sale_values TYPE t_sum_total_sale,
total_bill_values TYPE t_sum_total_bill,
END OF t_ap_summary.TYPES: BEGIN OF t_ap,
head TYPE t_ap_head,
details TYPE t_ap_details,
summary TYPE t_ap_summary,
END OF t_ap.DATA: it_airplus TYPE STANDARD TABLE OF t_ap
*call the transformation
CALL TRANSFORMATION ZFI_AIRPLUS
SOURCE xml l_xml_x1
RESULT xml_output = it_airplus
.see the complete report: Read data from XML file via XSLT program
Create XSLT program
There are two options to create a XSLT program:
Tcode: SE80 -> create/choose packet -> right click on it | Create -> Others -> XSL Transformation
Tcode: XSLT_TOOL
For a quick overview you can watch at the SXSLTDEMO* programs.
In this example we already use the three XSLT options explained later.
As you can see we define a XSL and ASX (ABAP) tags to handle the ABAP and XML variables/tags. After "
Maybe you are looking for
-
Using Microsoft Outlook to receive a report from ABAP...
Guys may you please have a look at this coding of myne, i want to send a report as an e-mail(my outlook inbox) but when i execute it nothing is happening if there is any configuration that has to be done please can anyone send me the steps to do that
-
Hello Whenever i try to look at a webpage that has an applet embedded in it (using any browser) i get kicked out of the browser. I know this has something to do with the java plug in. As the Java cuppa coffee icon appears in the bottom right of the t
-
How to Write Off Stock at Subcontractor's End
Hi Friends, Few parts are shown at Subcontractors End in the System which has actually been consumed(returned). Now we want to remove those stock from Subcontractors stock. How can we write off those stock??? These are very old stocks, is there any o
-
Nokia N95 8GB - Mail4Exchange: "System error.Try a...
Good morning. We currently have 3 Nokia N95 8GB within the company that use Mail for exchange 2.3. One of the handsets suddenly started to receive the above error on synchronising. The other 2 handsets are working perfectly and i have done a software
-
Yahoo mail loads slow, very slow
yahoo mail is very slow loading---other sites OK == URL of affected sites == http://