From ALV list to Selection-screen
Hi,
I have problem in coming back to selection screen after displaying ALV List.
In ALV list i'm using check box option to delete selected records. After deletion I'm displaying the remaining records with one more call to ALV function module.
As this is not a secondary list i'm not able to use SY-LSIND and even call selection-screen or leave to screen 0 are not working.
could you please help me out.
Thanks,
Vinay.
Hi
You don't have to show the remaining records in another ALV.
In the user command sub-routine we will be passing the parameter RS_SELFIELD TYPE SLIS_SELFIELD.
When you delete the rows from the internal table in the user command set the refresh field to on.
RS_SELFIELD-REFRESH = 'X'.
Please let me know if it works.
Thanks,
Naren
Similar Messages
-
Return from ALV Grid to Selection screen
hi,
I want to go back from ALV grid to selection screen.
I am using the following code:
WHEN 'BACK'.
CALL METHOD grid1->refresh_table_display.
CALL METHOD grid1->free.
CALL METHOD custom_container1->free.
CALL SELECTION-SCREEN 1000.
it is working,but when i press BACK button from selection screen to program it is showing ERROR IN FLUSH 4 Error.
Also I tried with method FLUSH
WHEN 'BACK'.
CALL METHOD grid1->refresh_table_display.
CALL METHOD grid1->free.
CALL METHOD custom_container1->free.
CALL METHOD cl_gui_cfw=>flush.
it's still showing same Error.
Please help on this.
Regards,
SankarHi,
My grid name is grid1.
I tried with :
DATA grid1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = grid1.
CALL METHOD grid1->check_changed_data.
CALL METHOD grid1->refresh_table_display.
LEAVE TO SCREEN 0.
Even, I tried with declaring another grid : grid2
DATA grid1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = grid1.
CALL METHOD grid1->check_changed_data.
CALL METHOD grid1->refresh_table_display.
LEAVE TO SCREEN 0.
In both cases, I am getting the following Error : OBJECTS_OBJREF_NOT_ASSIGNED -
How to fetch data from ALV to another Selection Screen
hi...
i need to export the two fields that is VBELN and POSNR to some other selection screen of a transaction which is triggered by pressing a button on ALV...
Could u please let me know ki how can i transport these two fields to the screen of that transaction which is 'MASS ORDER CHANGE' transaction...
Regards:
Gaurav Aroratry this program:
IF NOT p_vbeln IS INITIAL.
PERFORM set_data USING 'P_VBELN' p_vbeln '' 'S' 'I' 'EQ'.
ENDIF.
<b> SUBMIT zprogram
USING SELECTION-SET xvar
* xvar is variant name in program zprogram
WITH SELECTION-TABLE seltab
AND RETURN.</b>
FORM set_data USING pr_selname
pr_value_low
pr_value_high
pr_kind
pr_sign
pr_option.
CLEAR seltab_wa.
MOVE: pr_selname TO seltab_wa-selname,
pr_kind TO seltab_wa-kind,
pr_sign TO seltab_wa-sign,
pr_option TO seltab_wa-option.
IF NOT pr_value_low IS INITIAL.
MOVE pr_value_low TO seltab_wa-low.
ENDIF.
IF NOT pr_value_high IS INITIAL.
MOVE pr_value_high TO seltab_wa-high.
ENDIF.
APPEND seltab_wa TO seltab.
ENDFORM. "set_data -
Hello All,
Please suggest me is there any way to extract the data from ALV LIST.
For example:
SUBMIT XXX WITH SELECTION-TABLE rspar_tab AND RETURN.
This XXX program gives the result in alv list.Once it returns back to original program i want to fetch the results.
Thanks and Best Regards,
VinothHi Vinoth...
SUBMIT XXX WITH SELECTION-TABLE rspar_tab AND RETURN.
Whether ur submit program (XXX) is standard or Zreport?
1, If it is standard means u need to copy the program in to ZXXX..
And now change the ZXXX.
Fetch where the final Internal table is populating for output display..
There u need to Export that internal table ..
eg:
export g_t_belege1 to memory id 'ZSARA'.
export bestand1 to memory id 'ZSARA1'.
1,g_t_belege1
2,bestand1
these are internal tables in the Submit program (ZXXX)..
Now u may come to ur original program..
and import this..
import g_t_belege1 from memory id 'ZSARA'.
import bestand1 from memory id 'ZSARA1'.
g_t_belege1,bestand1 these internal table structures sholud be same as Submit program structures..
Else.. it may give Dump ..
Now u may process the internal tables g_t_belege1,bestand1 by ur wish..
2,
If it Zreport means no need to copy ..
Just export into one id and import in ur original program.
Hope it will helps..
Reward if it is useful means.
Regards
Bala..
Message was edited by:
S Balasubramanian -
How to remove a Sort button from ALV List
Hi Experts,
How to remove sort button from ALV List.
I have requirement where I need to remove the sort button from ALV list.
Kindly give me useful clues.
Higher points will be awarded for the useful inputs.
Thanks in Advance,
DharaniHi dharani,
1. UP and Down Sort Button will get removed.
2. Important code is marked in bold
3. Just copy paste.
4.
report abc.
TYPE-POOLS : slis.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvfcwa TYPE slis_fieldcat_alv.
<b>data : excl type SLIS_T_EXTAB.
data : exclwa type SLIS_EXTAB.</b>
data : begin of itab occurs 0.
include structure usr02.
data : end of itab.
START-OF-SELECTION.
select * from usr02
into table itab.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB'
i_inclname = sy-repid
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
<b>*----
IMPORTANT
fcodes to remove
Up and Down Sort Button
exclwa-fcode = '&OUP'.
append exclwa to excl.
exclwa-fcode = '&ODN'.
append exclwa to excl.</b>
Display
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
<b>IT_EXCLUDING = excl</b>
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
regards,
amit m. -
Get Selections From ALV on Multiple Selection Mode
Hi,
How can i get values of selected rows from ALV that has selection '0..n' (multiple selection) ?
Can somebody help me pls?
Thanks.Hi Nurullah,
Steps to make multiple rows selectable in ALV:
1) Create the selection property of the node that you are binding to the DATA node as o..n
2) Un-check the, "Initialization Lead Selection" checkbox for the node which you are using to bind to the DATA node
3) In the WDDOINIT method specify the ALV's selection mode as MULTI_NO_LEAD. It is important that you set the selection mode to MULTI_NO_LEAD or else in the end you would be capturing 1 row lesser than the total number of rows the user has selected. This is because 1 of the rows would have the LeadSelection property & our logic wouldnt be reading the data for that row. Check the example code fragment as shown below:
DATA lo_value TYPE REF TO cl_salv_wd_config_table.
lo_value = lo_interfacecontroller->get_model( ).
CALL METHOD lo_value->if_salv_wd_table_settings~set_selection_mode
EXPORTING
value = cl_wd_table=>e_selection_mode-MULTI_NO_LEAD.
Steps to get the multiple rows selected by the user
In order to get the multiple rows which were selected by the user you will just have to call the get_selected_elements method of if_wd_context_node. So as you can see its no different from how you would get the multiple rows selected by the user in a table ui element. First get the reference of the node which you have used to bind to the ALV & then call this method on it. Check the example code fragment below:
METHOD get_selected_rows .
DATA: temp TYPE string.
DATA: lr_node TYPE REF TO if_wd_context_node,
wa_temp TYPE REF TO if_wd_context_element,
ls_node1 TYPE wd_this->element_node_flighttab,
lt_node1 TYPE wd_this->elements_node_flighttab.
lr_node = wd_context->get_child_node( name = 'NODE_FLIGHTTAB' ).
" This would now contain the references of all the selected rows
lt_temp = lr_node->get_selected_elements( ).
LOOP AT lt_temp INTO wa_temp.
" Use the references to get the exact row data
CALL METHOD wa_temp->get_static_attributes
IMPORTING
static_attributes = ls_node1.
APPEND ls_node1 TO lt_node1.
CLEAR ls_node1.
ENDLOOP.
ENDMETHOD.
Hope this helps resolve your problem.
Regards,
Uday -
Jump from alv report to qa03 screen based on PRUEFLOS field
Hi experts,
I developed one alv report ,in that one field name is PRUEFLOS (inspection lot number).I want to jump from alv report
to QA03 screen based on PRUEFLOS field.I wrote in this way but i didn't get.
FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
CASE SELFIELD-FIELDNAME.
WHEN 'PRUEFLOS'.
READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
SET PARAMETER ID 'QLS' FIELD T_FINAL-PRUEFLOS.
CALL TRANSACTION 'QA03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM.
what is the problem ?pls help me in this.Hi Ram,
Recheck:
1) You have passed 'FORM USER_COMMAND' in 'I_CALLBACK_USER_COMMAND' while calling f.m. for ALV displa, and
2) You have checked the value of user command, i.e.
FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
CASE SY-UCOMM.
WHEN '&IC1'.
CASE SELFIELD-FIELDNAME.
WHEN 'PRUEFLOS'.
READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
SET PARAMETER ID 'QLS' FIELD T_FINAL-PRUEFLOS.
CALL TRANSACTION 'QA03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDCASE.
ENDFORM.
Regards,
Birendra -
Jump from alv report to cor2 screen
Hi experts,
I develop one alv report ..i want to jump from alv report to COR2 screen when click on order number(field name is AUFNR).
i wrote code in this way.
FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD
CASE SELFIELD-FIELDNAME.
WHEN 'AUFNR'.
READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
SET PARAMETER ID 'AUF' FIELD T_FINAL-AUFNR.
CALL TRANSACTION 'COR2' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM.
but it is not working properly,when u click on any order number it is going only the same order number(in cor2 screen).
what is the problem? set par id (AUF) EXIST IN TPARA table compulsalory or it is created automatically?
pls help me in this . If possible pls send the code.Hi,
I have already mentioned both ways, but ok, once again.
A. how I found parameter ID ANR:
1.) run transaction COR2
2.) set cursor to field "Process order"
3.) press F1 button
4.) performance assistant displays
5.) press "Technical Information"
6.) technical information displays
7.) in field "Parameter ID" you can see parameter ID assigned to a screen field
B. how I found parameter ID BR1:
1.) switch on debugger
2.) run transaction COR2
3.) put a breakpoint on "GET PARAMETER" statement
4.) debugger stops on every GET PARAMETER statement in PBO of COR2
5.) there you can see that BR1 is used for field AUFNR
Basically first mentioned way is sufficient, because system gets parameter value from parameter ID assigned to a screen element automatically. But in this case a value is overwritten by coding in PBO of COR2.
Hope it helps.
Regrds,
Adrian -
Run alv report without selection screen in background
Hello Every body,
i programmed a ALV Report without selection screen, and i want to create a job for this alv report.
Any help?
Thank u.
Ouail.Hi Steve,
Can you tell me where i have to put your code?
this is my abap code:
START-OF-SELECTION.
p_filref = '\\SAPSERVER\f\SAFT\ivat\FI_Extract_1000_20140709_102346_910.XML'.
PERFORM copy_from_xml_to_itab TABLES it_ref_file
ref_xml_data
USING p_filref.
**Begin Extraction File
SUBMIT ZZ_FI_IVAT_EXTRACTOR
WITH p_bukrs EQ '1000'
WITH p_gjahr EQ '1998'
WITH filepath EQ '\\SAPSERVER\f\SAFT\iVAT_Extractie\'
WITH cldata eq space
AND RETURN.
DATA: FILE_TABLE TYPE TABLE OF SDOKPATH,
DIR_TABLE TYPE TABLE OF SDOKPATH.
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
DIRECTORY = '\\SAPSERVER\f\SAFT\iVAT_Extractie\'
FILTER = '*.*'
TABLES
FILE_TABLE = FILE_TABLE
DIR_TABLE = DIR_TABLE
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
"get file name
LOOP AT FILE_TABLE INTO p_filref.
ENDLOOP.
CONCATENATE '\\SAPSERVER\f\SAFT\iVAT_Extractie\' p_filref INTO path.
PERFORM copy_from_xml_to_itab TABLES t_ext_file
ext_xml_data
USING path.
PERFORM fill_xml_tab_in .
perform build_fieldcatalog.
PERFORM compare_data_ref_ext.
PERFORM send_email.
perform display_alv_report.
PERFORM delete_extraction_file.
in the perform copy_from_xml_to_itab TABLES it_ref_file......, i use this code:
CREATE OBJECT gcl_xml.
*Upload XML File
CALL METHOD gcl_xml->import_from_file
EXPORTING
filename = p_filref
RECEIVING
retcode = gv_subrc.
IF gv_subrc = 0.
CALL METHOD gcl_xml->render_2_xstring
IMPORTING
retcode = gv_subrc
stream = gv_xml_string
size = gv_size.
IF gv_subrc = 0.
REFRESH gt_xml_data[].
* Convert XML to internal table
CALL FUNCTION 'SMUM_XML_PARSE'
EXPORTING
xml_input = gv_xml_string
TABLES
xml_table = gt_xml_data
return = gt_return.
ENDIF.
ENDIF. -
What r the list of selection screen events
What r the list of selection screen events
hi,
chk out the following links...
http://help.sap.com/saphelp_nw04/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/content.htm
http://www.sap-img.com/abap/different-types-of-selection-screens.htm
Regards,
Viji -
I cannot dowload all fields from ALV list to Excel - urgent, please help me
I developed a report and displayed in ALV list using FM 'REUSE_ALV_GRID_DISPLAY'.The list contains 200 fields.But when i am trying to download in EXCEL file from ALV list, it is unable to download all the fields from ALV list into EXCEL.
Thanks in advance,
Katta.is your list having packed decimals or any fields which are of large length (around 128 char)?
It can happen so. -
Display list on selection-screen
Hello everyone,
I've got a question concerning selection screen. I want to know, if there is a way to display list/table on selection screen after user input. Specifically, when user enters for example 30 invoice numbers into select-options, I need those 30 numbers displayed on the same selection screen.
Thanks in advanceinstead u can print selection screen....along with output.....
for this....
You can use given function module to print your
selection screen
RS_REFRESH_FROM_SELECTOPTIONS
>This will get Current contents of selection screen
RS_LIST_SELECTION_TABLE
>This will Generates list according to values in selection table(RSPARAMS)
Sample
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = p_repid
TABLES
selection_table = it_int_tab
EXCEPTIONS
not_found = 1
no_report = 2
OTHERS = 3.
IF sy-subrc EQ 0.
WRITE:1 'Selection Criteria'(i19),
/1 sy-uline(18),
/1 'Variant Name'(i21),
23 sy-slset.
*-- This function module lists the Selection Screen contents
CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
EXPORTING
report = p_repid
seltext = 'X'
newpage = space
TABLES
sel_tab = it_int_tab
EXCEPTIONS
sel_tab_empty = 1
OTHERS = 2. -
Display alv grids in selection screen based on the user event
Hi All,
I am workign on displaying ALV in same selection screen.I am able to display the ALV in selection screen.
But i have 2 buttons in my selection screen 'Create' and 'change'.
When i click on create i need with some type of data and when i click on 'change' my alv grid another type of data.Ex: if i click on crate mara data should be dispalyed when i click on change makt table data should be dispalyed and also i have user defined buttons are in my grids.
So i have used 2 containers to dispaly to different data.I am able to display the perfectly but the problem is first time when i click on create the grid is displaying when i click on change button the create alv grid is displaying down and change data is dispalying up.
I need only one alv grid at a time.Can anybody please let me know how can i do this.
Thanks,
TaraginiHello,
Also I would suggest if it is relevant data maintain in one interntal table and show/hide based on condition
through fieldcatalog (NO_OUT) parameter.
Thanks -
From ALV output list to selection screen
Hi,
I created one ALV report.
After executing the program, it displays an ALV list.
When I click on the back/exit/cancel buttons on the screen, it should take me to the selection screen.
But that is not happening. it is taking to one screen which shows the report heading. IF i click back/cancel/exit buttons in this screen, it is taking me to the selection screen.
I checked the program for any write statement, but therre are no write statements.
Even i tried to remove the end-of-selection event in the program. but not working.
Can any one help me on this how to overcome this issue.
Thank you.
Kumarhi check this example...
REPORT zalv_sel_screen .TABLES: mara.DATA: BEGIN OF i_alv OCCURS 0,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
groes TYPE mara-groes,
maktx TYPE makt-maktx,
END OF i_alv.DATA: alv_container TYPE REF TO cl_gui_docking_container.
DATA: alv_grid TYPE REF TO cl_gui_alv_grid.
DATA: layout TYPE lvc_s_layo.
DATA: fieldcat TYPE lvc_t_fcat.PARAMETERS: p_check.INITIALIZATION. PERFORM get_data.AT SELECTION-SCREEN OUTPUT. DATA: variant TYPE disvariant.
DATA: repid TYPE sy-repid. repid = sy-repid. variant-report = sy-repid.
variant-username = sy-uname. layout-zebra = 'X'.
layout-edit_mode = 'X'. CHECK alv_container IS INITIAL. CREATE OBJECT alv_container
EXPORTING repid = repid
dynnr = sy-dynnr
side = alv_container->dock_at_left
extension = 1500. CREATE OBJECT alv_grid
EXPORTING
i_parent = alv_container.* ALV Specific. Data selection.
Populate Field Catalog
PERFORM get_fieldcatalog. CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
is_layout = layout
is_variant = variant
i_save = 'U'
i_structure_name = 'I_ALV'
CHANGING
it_outtab = i_alv[]
it_fieldcatalog = fieldcat[].
START-OF-SELECTION.
FORM GET_DATA
FORM get_data. SELECT * INTO CORRESPONDING FIELDS OF TABLE i_alv
FROM mara
INNER JOIN makt
ON maramatnr = maktmatnr
UP TO 100 ROWS
WHERE makt~spras = sy-langu. SORT i_alv ASCENDING BY matnr.ENDFORM. "get_data***************************************************************
Form Get_Fieldcatalog - Set Up Columns/Headers
FORM get_fieldcatalog. DATA: ls_fcat TYPE lvc_s_fcat.
REFRESH: fieldcat. CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Number'.
ls_fcat-fieldname = 'MATNR'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '18'.
ls_fcat-fix_column = 'X'.
ls_fcat-key = 'X'.
ls_fcat-col_pos = '1'.
APPEND ls_fcat TO fieldcat. CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Type'.
ls_fcat-fieldname = 'MTART'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '10'.
ls_fcat-fix_column = 'X'.
ls_fcat-key = 'X'.
ls_fcat-col_pos = '2'.
APPEND ls_fcat TO fieldcat. CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Group'.
ls_fcat-fieldname = 'MATKL'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '12'.
ls_fcat-col_pos = '3'.
APPEND ls_fcat TO fieldcat. CLEAR: ls_fcat.
ls_fcat-reptext = 'Size'.
ls_fcat-fieldname = 'GROES'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '30'. ls_fcat-col_pos = '4'.
APPEND ls_fcat TO fieldcat. CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Description'.
ls_fcat-fieldname = 'MAKTX'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '40'. ls_fcat-col_pos = '5'.
APPEND ls_fcat TO fieldcat.ENDFORM. "get_fieldcatalog
regards,
venkat -
Query on retrieving data back to the program from ALV List
Hi Group,
I have a requirement to send the details of the selected data as an ALV list to the user.
Then, the user selects either 1 or 2 or all or none back to the program from the ALV.
Thing is that,
1) when the user selects ( Icon ) to choose all the fields, they were not getting checked and in turn, I was not been able to read the records as checked in the program ( this is for All selection records ).
2) And also, I am not able to get the records checked ( incase of the user selects all fields ).
In short, I should be able to read the records which were checked and process only that records.
please let me know if you have any queries on the same.
Thank you very much in advance for the help.
Regards,
Vishnu.hi,
try like this
TABLES: ekko.
TYPE-POOLS: slis.
TYPES: BEGIN OF t_ekko,
sel, "stores which row user has selected
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
fieldcatalog1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
DATA : BEGIN OF det_tab OCCURS 0,
ebeln LIKE ekpo-ebeln,
END OF det_tab.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
FORM build_layout.
gd_layout-box_fieldname = 'SEL'.
"set field name to store row selection
gd_layout-edit = 'X'. "makes whole ALV table editable
gd_layout-zebra = 'X'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_STAT'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
TABLES
t_outtab = it_ekko
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
UP TO 10 ROWS
FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE it_ekko.
ENDFORM. " DATA_RETRIEVAL
FORM USER_COMMAND *
--> R_UCOMM *
--> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'EBELN'.
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
WHEN 'DET'. "user presses SAVE
CLEAR det_tab.
REFRESH det_tab.
LOOP AT it_ekko INTO wa_ekko WHERE sel = 'X'.
MOVE-CORRESPONDING wa_ekko TO det_tab.
APPEND det_tab.
ENDLOOP.
PERFORM build_cat.
PERFORM dis_data.
ENDCASE.
ENDFORM. "user_command
*& Form set_stat
text
-->RT_EXTAB text
FORM set_stat USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
ENDFORM. "set_stat
*& Form build_cat
text
FORM build_cat.
CLEAR fieldcatalog1.
REFRESH fieldcatalog1.
fieldcatalog1-fieldname = 'EBELN'.
fieldcatalog1-tabname = 'DET_TAB'.
fieldcatalog1-seltext_m = 'Order No.'.
fieldcatalog1-outputlen = 10.
APPEND fieldcatalog1 TO fieldcatalog1.
CLEAR fieldcatalog1.
ENDFORM. "build_cat
*& Form dis_data
text
FORM dis_data.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZTEST_DS'
it_fieldcat = fieldcatalog1[]
i_save = 'X'
TABLES
t_outtab = det_tab.
ENDFORM. "dis_data
here i have created one button(DET) in toolbar along with all the buttons of ALV..
when i click on this i am getting detail list....
reward if usefull....
Maybe you are looking for
-
IMessage beta loose all saved conversations when I open and close a window.
iMessage beta looses all saved conversations when I open and close a window. Just reporting this bug... Could not find anyother place to do it. Jonathan
-
How do I hide the an original app.
I have an iphone 3G updated to 4.2 . I have not been able to open 'Bosspreff' to hide one of the icons on the phone. Is there some other way to move them off the home screen?
-
Reconciliation error: ORA-00903: invalid table name
I am facing this error, below: SELECT * FROM WHERE ORC_KEY = ? AND UD_RES_P_KEY = ?: java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name Is it a product issue from OIM 9.1.0.2? best regards, Robert
-
Hi, want to call an iview in an iframe in the wd. How can i do that. I don't want to use the server name in the pcd because I have to adjust it everytime the project is transported to an other server. regards
-
Support for JSTL Expression Language?
Is JSF going to support Expression Language ?