Problem in GUI status of ALV Grid
Hello All Experts,
I have a following issue.
Am displaying a report using REUSE_ALV_GRID_DISPLAY. I have copied the GUI status from standard GUI STANDARD_FULLSCREEN. Now when i dispaly the report i get select all ICON just before my first column(Marked in red below). i do not need this icon, i have checked in my GUI status also this icon does not exist. can you please help me how to remove this icon.
This is how i have declared the field catalog for my first column.
fieldcatalog-fieldname = text-013.
fieldcatalog-seltext_m = text-014.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 3.
fieldcatalog-emphasize = gc_x.
fieldcatalog-key = gc_x.
fieldcatalog-checkbox = gc_x.
fieldcatalog-edit = gc_x.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
Am really thankful to your resposes.
Regards,
Satish
i tested with
REUSE_ALV_GRID_DISPLAY and it works fine as you want
report ztestalv.
type-pools:
slis.
data:
i_usr02 type table of usr02,
afield type slis_fieldcat_alv,
sp_group type slis_sp_group_alv,
t_listheader type slis_t_listheader with header line,
t_layout type slis_layout_alv,
t_fieldcat type slis_t_fieldcat_alv,
t_spec_groups type slis_t_sp_group_alv,
event type slis_alv_event,
t_events type slis_t_event,
g_variant like disvariant,
gx_variant like disvariant,
g_exit(1) type c,
g_save(1) type c,
g_repid like sy-repid,
msgtyp like sy-msgty,
lt_dynpread like dynpread occurs 1 with header line.
start-of-selection.
select * from usr02 into table i_usr02
up to 200 rows.
end-of-selection.
t_layout-detail_initial_lines = 'X'.
t_layout-detail_popup = 'X'.
t_layout-f2code = 'PIC1'.
t_layout-get_selinfos = 'X'.
t_layout-group_change_edit = 'X'.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'USR02'
changing
ct_fieldcat = t_fieldcat
exceptions
others = 4.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = 'ZTESTALV'
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USR_CMD'
i_structure_name = 'USR02'
is_layout = t_layout
it_fieldcat = t_fieldcat
it_special_groups = t_spec_groups
i_default = 'X'
i_save = g_save
is_variant = g_variant
it_events = t_events
tables
t_outtab = i_usr02
exceptions
program_error = 1
others = 2.
make sure your field ls_layout-box_fieldname is blank, as you using the checkbox
Similar Messages
-
Problem in pf status in alv grid
Hi ,
In alv grid in fm reuse_alv_grid_display under parameter I_CALLBACK_PF_STATUS_SET = STATUS
FORM STATUS_SET USING LS_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'XYZ' EXCLUDING EXTAB.
ENDFORM.
Now i have to set back & exit button in my std toolbar.
I double clicked on XYZ & then control moves to menu painter & i defined all above mentioned button in application toolbar.
I activated but the mentioned buttons are not displaying in output.
Anybody will suggest me what i have to do in this case??hi
good
go through this links
http://sap.ittoolbox.com/code/archives.asp?i=10&d=3603&a=s
http://sap.ittoolbox.com/code/archives.asp?i=10&d=1917&a=s
this ll give you complete idea about the pf status in alv.
thanks
mrutyun^ -
Screen GUI Status Query ( ALV Grid)
Hi All,
I am having an ALV grid on a screen .
I want to check the contents of the grid at the press of enter button, at present i have to press the check button available on the ALV grid to check the contents of the grid.
Pls suggestMake sure that you set "ENTER" as the key which is to trigger the edit event.
call method alv_grid->set_table_for_first_display
exporting
is_layout = lt_layout
it_toolbar_excluding = lt_exclude
changing
it_outtab = ialv[]
it_fieldcatalog = fieldcat[].
<b>
* If cancelling points, register "ENTER" as event
* and create the event receiver
call method alv_grid->register_edit_event
exporting
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
</b>
* create Event Receiver
create object event_receiver.
* handler for ALV grid
set handler event_receiver->handle_data_changed for alv_grid.
Regards,
Rich Heilman -
Regarding PF Status In ALV Grid Dispaly
Hi..
Can you please tell me how to set PF status in ALV Grid Display.
Regards
Sandeep.hi,
if u use REUSE_ALV_LIST_DISPLAY copy the standard GUI-Status named STANDARD from function group SALV in your program
if u use REUSE_ALV_GRID_DISPLAY_LVC or REUSE_ALV_GRID_DISPLAY copy the standard GUI-Status named STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN in your program
after that you cas set the pf-status in this way:
>CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
> EXPORTING
> i_callback_program = sy-cprog
> i_callback_pf_status_set = 'STATUS'
> i_callback_user_command = 'USERCOMMAND'
> is_layout = st_layout
> it_fieldcat = st_fieldcat
> TABLES
> t_outtab = outtab
or
>CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
> EXPORTING
> i_callback_program = sy-cprog
> i_callback_pf_status_set = 'STATUS'
> i_callback_user_command = 'USERCOMMAND'
> is_layout_lvc = wa_slis_layout
> it_fieldcat_lvc = tb_slis_fieldcat
> TABLES
> t_outtab = tb_app
where USERCOMMAND and STATUS are 2 forms in your program.
>FORM status USING pfstat TYPE slis_t_extab.
> SET PF-STATUS 'STANDARD' EXCLUDING pfstat.
>ENDFORM.
>
> ...
>
>FORM usercommand USING okcode LIKE sy-ucomm
> wa_selfield TYPE slis_selfield.
> CASE okcode.
> ....
> ENDCASE
>ENDFORM.
Bye.
Marco -
Can anyone tell me how to use GUI status in ALV report.
Can anyone tell me how to use GUI status in ALV report. I want to use buttons in ALV report.
Juheb,
see the link
http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
Adding a button on the ALV grid using OOPs
check these sites.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproABAP-ALVControllingStandard+Buttons&
chk this.
alv-pfstatus:
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_pfstatus.htm
then how to capture that button click.
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_ucomm.htm
REPORT ZTESTALV.
TYPE-POOLS: SLIS.
*- Fieldcatalog
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV..
*- For Events
DATA:IT_EVENTS TYPE SLIS_T_EVENT.
DATA: X_FIELDCAT TYPE LVC_S_FCAT,
X_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV.
DATA:X_LAYOUT TYPE LVC_S_LAYO.
"{ FOR DISABLE
DATA: LS_EDIT TYPE LVC_S_STYL,
LT_EDIT TYPE LVC_T_STYL.
"} FOR DISABLE
DATA: BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
HANDLE_STYLE TYPE LVC_T_STYL, "FOR DISABLE
<b> BUTTON(10),</b>
END OF IT_VBAP.
DATA: LS_OUTTAB LIKE LINE OF IT_VBAP.
SELECT VBELN
POSNR
UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
FROM VBAP.
DATA:L_POS TYPE I VALUE 1.
CLEAR: L_POS.
L_POS = L_POS + 1.
<b>X_FIELDCAT-SELTEXT = 'Button'.
x_fieldcat-fieldname = 'BUTTON'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
X_FIELDCAT-style = X_FIELDCAT-style bit-xor
cl_gui_alv_grid=>MC_STYLE_BUTTON bit-xor
cl_gui_alv_grid=>MC_STYLE_ENABLEd.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.</b>
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'VBELN'.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
x_fieldcat-ref_field = 'VBELN'.
x_fieldcat-ref_table = 'VBAK'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'POSNR'.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
"{FOR DISABLE HERE 6ROW IS DISABLED
SY-TABIX = 6.
LS_EDIT-FIELDNAME = 'VBELN'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 10.
INSERT LS_EDIT INTO TABLE LT_EDIT.
*LS_EDIT-FIELDNAME = 'POSNR'.
*LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
*LS_EDIT-STYLE2 = SPACE.
*LS_EDIT-STYLE3 = SPACE.
*LS_EDIT-STYLE4 = SPACE.
*LS_EDIT-MAXLEN = 6.
*INSERT LS_EDIT INTO TABLE LT_EDIT.
INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
MODIFY IT_VBAP INDEX SY-TABIX FROM LS_OUTTAB TRANSPORTING
HANDLE_STYLE .
X_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
"} UP TO HERE
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT_LVC = X_LAYOUT
IT_FIELDCAT_LVC = IT_FIELDCAT
TABLES
T_OUTTAB = IT_VBAP[]
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.
Don't forget to reward if useful.... -
How to capture the checkbox status in ALV Grid display
I need some immediate help regarding Grid ALV.
My Requirement: I need to display an ALV grid report along with checkboxes. Further, I need to provide an option wherein the user can checkboxes and select the records that I need to process further (by clicking the process button on the ALV Report).
My Query: The problem here is that I am not able to capture the status of the checkboxes. This means that I am not able to capture which of the records have been selected by checking their resp checkboxes.
Solutions that I have tried: I have tried capturing the same at user command by checking the value in slis_selfield. But all the records show the value as 1 for the checkbox field.
Kinldy suggest how to go about it.
I am not using Object Oriented ALV. Please suggest something to be used in ALV Grid display in 4.6C version.
Regards,
NamrataHere is a Sample code , it might help you
TABLES : sflight.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
w_repid = sy-repid.
DATA: BEGIN OF it_sflight OCCURS 0,
checkbox(1),
carrid LIKE sflight-carrid,
END OF it_sflight.
*layout
DATA: wa_layout TYPE slis_layout_alv.
*field catalog
DATA: it_fieldcatalog TYPE slis_t_fieldcat_alv,
wa_fieldcatalog TYPE slis_fieldcat_alv.
START-OF-SELECTION.
SELECT carrid FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_sflight.
END-OF-SELECTION.
CLEAR it_fieldcatalog.
REFRESH it_fieldcatalog.
wa_fieldcatalog-fieldname = 'CHECKBOX'.
wa_fieldcatalog-outputlen = '3'.
wa_fieldcatalog-col_pos = '1'.
wa_fieldcatalog-seltext_m = 'Chk'.
wa_fieldcatalog-checkbox = 'X'.
wa_fieldcatalog-edit = 'X'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'CARRID'.
wa_fieldcatalog-outputlen = '10'.
wa_fieldcatalog-col_pos = '2'.
wa_fieldcatalog-seltext_m = 'Carrid'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
is_layout = wa_layout
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcatalog
TABLES
t_outtab = it_sflight
EXCEPTIONS
program_error = 1
OTHERS = 2.
*& Form USER_COMMAND
FORM user_command USING p_ucomm TYPE sy-ucomm
p_selfld TYPE slis_selfield.
CASE p_ucomm.
WHEN '&DATA_SAVE'.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref1.
CALL METHOD ref1->check_changed_data.
LOOP AT it_sflight WHERE checkbox = 'X'.
DELETE it_sflight INDEX sy-tabix.
ENDLOOP.
p_selfld-refresh = 'X'.
ENDCASE.
ENDFORM. "user_command -
Problem creating an excel with ALV GRID
Hi all,
this is my problem:
i have an ALV GRID in which I display several columns in a proper order, es : A B C D E F G
when i create an excel from this display i obtain a different order of the columns!
in particular the 3 columns which represent numeric values (es C D E) are the last 3 colums in the excel, instead in the alv grid this 3 comuns stay in the middle!
so in the excel i obtain : A B F G C D E!!!!
please can anyone help me to fix this problem?hi,
if you do a debugging it will go into the function module alv_xxl_call.
in this we can find the code as below.
catch system-exceptions import_mismatch_errors = 1.
import l_xxl_toggle_date from database ltdx(XL) id
'bcalv_xxl_toggle_date'.
endcatch.
here place a break point and check what value is it coming for this variable l_xxl_toggle_date.
if it is coming as X. then this problem will arrive.
here manually change the variable to space and check , the output will be coming perfectly.
if value is coming as X.
THEN WE CAN DO ONE THING.
HERE we are having a report bcalv_toggle_date which MUST EXECUTED ONCE ONLY.
WHEN IT IS EXECUTED IT DOES NOT DISPLAY ANYTHING.
after executing once the variable will be changed from X TO SPACE.
but we must run this report as other program excel sheet download order might get disturbed.
my might suggestion copy thwe standard gui to custom one and right a code for that excel icon in your code as shown below.
we need to copy the function module alv_xxl_call and comment the code
catch system-exceptions import_mismatch_errors = 1.
import l_xxl_toggle_date from database ltdx(XL) id
'bcalv_xxl_toggle_date'.
endcatch.
if l_xxl_toggle_date is initial.
and endif of the above if.
WHEN 'XXL'.
DATA : v_fieldcat TYPE STANDARD TABLE OF kkblo_fieldcat.
DATA : wa_fieldcat TYPE kkblo_fieldcat.
DATA : w_fieldcat LIKE LINE OF gt_fieldcat.
DATA : g_sort TYPE slis_t_sortinfo_alv.
DATA : g_filter TYPE slis_t_filter_alv.
DATA : a_fieldcat TYPE slis_t_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
IMPORTING
es_layout = gs_layout
et_fieldcat = a_fieldcat[]
et_sort = g_sort
et_filter = g_filter
es_variant = gs_variant.
DELETE a_fieldcat WHERE no_out = 'X'.
LOOP AT a_fieldcat INTO w_fieldcat.
MOVE-CORRESPONDING w_fieldcat TO wa_fieldcat.
APPEND wa_fieldcat TO v_fieldcat.
ENDLOOP.
CALL FUNCTION 'ZALV_XXL_CALL'
EXPORTING
i_tabname = 'IT_FINAL'
IS_LAYOUT =
it_fieldcat = v_fieldcat[]
I_CALLBACK_TOP_OF_PAGE =
I_TITLE =
I_MODE =
TABLES
it_outtab = it_final
EXCEPTIONS
FATAL_ERROR = 1
NO_DISPLAY_POSSIBLE = 2
OTHERS = 3. -
Hello Experts!
I've created a screen with an alv_grid and a custom pf_status, I have a custome button defined in the pf_status, I need to pass the command executed from the pf_status to the alv_grid.
Is this possible?
My user refuses to use the alv_grid toolbar.Hi there
Do the following
1) separate off the functions you want the standard SAP GUI (SE41) to do - I usually choose the standard 3 buttons BACK, EXIT, CANCEL and just use these in your PAI. ( You set the status in the PBO)
2) Now for the Grid toolbars you need to define event handlers for ON TOOLBAR, and ON USER COMMAND and have methods for these. You need to register the events as well.
I'm using my own ALV GRID class but it refrences CL_GUI_ALV_GRID so you could code something like this..
in the constructor
the variable z_object is simply a refrence to type cl_gui_alv_grid. GRID1 is also defined as a reference to cl_gui_alv_grid.
As an import parameter to the constructor I also pass the name of the program - which is quite useful as I can then in various methods of the class do a Perfom (XXXX) in program (yyyy) if found.
method constructor .
create object grid_container1
exporting
* container_name = 'CCONTAINER1'.
container_name = cfname.
create object grid1
exporting
i_parent = grid_container1.
set handler z_object->on_user_command for grid1.
set handler z_object->on_toolbar for grid1.
set handler z_object->handle_data_changed for grid1.
set handler z_object->handle_data_changed_finished for grid1.
set handler z_object->on_dubbelklik for grid1.
set handler z_object->on_hotspot for grid1.
call method grid1->register_edit_event
exporting
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
endmethod.
Now for the on_toolbar and on_user_command methods.
method on_toolbar .
type-pools icon.
clear ls_toolbar.
move 0 to ls_toolbar-butn_type.
move 'EXCEL' to ls_toolbar-function.
move space to ls_toolbar-disabled.
move icon_xxl to ls_toolbar-icon.
move 'Excel' to ls_toolbar-quickinfo.
move 'EXCEL' to ls_toolbar-text.
append ls_toolbar to e_object->mt_toolbar.
perform toolbar in program (caller) if found
using e_object.
endmethod.
method on_user_command .
* FOR EVENT before_user_command OF cl_gui_alv_grid
* IMPORTING
* e_ucomm
* sender
case e_ucomm.
when 'EXIT'.
leave program.
when 'EXCEL'.
call method me->download_to_excel.
when 'SAVE'.
when 'PROC'.
call method me->process.
when 'REFR'.
call method me->refresh.
when 'SWITCH'.
call method me->switch.
when 'TEST'.
call method me->get_cell.
endcase.
endmethod.
The toolbar event is particularly useful if you want to add / remove standard functionality to the standard toolbar.
As I've definedined my class with SE24 rather than inline code then I don't need the FOR EVENT statement in the method -- if your class is ïn line "i.e part of the abap" then you'll need those statements..
When you now press one of the grid toolbar buttons your ON_USER_COMMAND Method will be executed with the FCODE assigned to the button passed as a parameter e_ucomm.
You can also intercept the Standard SAP ALV toolbars as well as the on user command event gets handled BEFORE the SAP code.
For example as I previously posted you can intercept say the standard sort ascending button (code &SORT_ASC) issue a popup and carry on.
Cheers
jimbo -
Facing probelm in PF status in ALV Grid display
HI,
i have created a ALV grid intractive report in that i have a check box and Traffice lights , when user select the check box and press save then then traffice light color should changes to green it's doing well..but my problem is..for second time display i am calling same function module to display with chnaged traffice light color.here my probelm is after second time display when i press back it's taking me to first list not to the selection-screen. pls suggest me wot to do now for directly going to selection-screen.
Thanks,
saleem.
points to awarded for all usefull answers.Hi again,
1.
<b> and press save then</b> then traffice light color should changes to green it's doing well..but
U must have written some code
when the BOLD occurs.
2. This must be the call back command
(FORM subrouritine, which the alv call backs,
on a user command)
3. In the same u have to write.
4. For your reference,
just copy paste this code.
a) it will show records from t001 table
b) if u double-click on any row,
it will change the 2nd column to 'CLICKED'
and refresh the data again.
(it won't show alv once more in new screen)
c) then when u do back, it will go back.
d) See BOLD code.
5.
REPORT abc.
TYPE-POOLS : slis.
Data
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE t001.
DATA : flag tyPE c,
END OF itab.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvly TYPE slis_layout_alv.
Select Data
SELECT * FROM t001 INTO TABLE itab.
*------- Field Catalogue
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.
Display
alvly-box_fieldname = 'FLAG'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = alvfc
i_callback_program = sy-repid "<-------Important
i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
is_layout = alvly
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
CALL BACK FORM
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
IMPORTANT.
<b>
data : m type sy-index.
m = whatrow-tabindex.
itab-butxt = 'CLICKED'.
modify itab index m.
whatrow-refresh = 'X'.</b>
ENDFORM. "ITAB_user_command
regards,
amit m. -
Problem While Saving the editable ALV GRID
Dear Experts,
I have a scenario in which i am display the ALV(using class) with some data in the custom container of module pool screen in the non-editable mode.Also i have save and edit buttons.If i click the edit button i have written the code to edit the some columns in the ALV grid, it is working fine.After editing it,when i click the save button then ALV has to refreshed with edited data and then it should go to non editable mode but it is not working.I have written the code for changing the editable ALv to non editable mode as follows :
call method c_alvgd->set_ready_for_input
exporting
i_ready_for_input = 0.
*****Row and column of the alv are refreshed after changing values
stable-row = 'X'.
stable-col = 'X'.
*REfreshed ALV display with the changed values
*This ALV is non editable and contains new values
call method c_alvgd->refresh_table_display
exporting
is_stable = stable
exceptions
finished = 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.
Could you Suggest me solution for this issue ?
Thanks & Regards,
R.Dhineshraj.Dhinesh,
I suppose that you are able to get your changes values on screen but not able to get your field in DISPLAY mode from editable mode, let me know if this is not your problem.
When you press SAVE, after the PAI, again PBO will run and hence the editable code for that field will overwrite which will keep it editable.
So, do something like this.
data: gv_edit value 'X'..... "global variable in TOP include
PBO....
loop at ...
if gv_edit = 'X'.
CALL METHOD lo_alv->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
else.
CALL METHOD lo_alv->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
endif.
endloop.
PAI.
when 'SAVE'.
gv_edit = space.
When 'EDIT'.
gv_edit = 'X'.
Regards,
Diwakar -
Hai i copied standard gui status in my alv report.
i hav req. to do..when i click on exit(%EX) and cancel(RW)it should appear pop-up window..with two buttons "do u want to exit". if yes..should exit the report and if no..continue with current screen.
i have 6 secondary lists..should i write the code in all the 6 ucomm(s) or only once is needed.?
plz give me code for this.??hai check my code...i added like this. its not working
FORM usecomm USING ucomm LIKE sy-ucomm fields TYPE slis_selfield.
case sy-ucomm.
when '%EX' OR 'RW'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'EXIT'
DIAGNOSE_OBJECT = ' '
text_question = 'Do u want to exit?'
TEXT_BUTTON_1 = 'Ja'(001)
ICON_BUTTON_1 = ' '
TEXT_BUTTON_2 = 'Nein'(002)
ICON_BUTTON_2 = ' '
DEFAULT_BUTTON = '1'
DISPLAY_CANCEL_BUTTON = 'X'
USERDEFINED_F1_HELP = ' '
START_COLUMN = 25
START_ROW = 6
POPUP_TYPE =
IMPORTING
ANSWER =
TABLES
PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 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.
endcase.
CASE ucomm.
WHEN '&IC1'.
IF fields-fieldname = 'SALES_OFF'.
READ TABLE tbl_basic_list INDEX fields-tabindex.
SELECT vkgrp FROM s707
INTO TABLE tbl_first_list
FOR ALL ENTRIES IN tbl_basic_list
WHERE vkbur EQ tbl_basic_list-vkbur
AND vkbur EQ fields-value.
SELECT bezei FROM tvgrt INTO CORRESPONDING FIELDS OF TABLE
tbl_first_list WHERE vkgrp = tbl_first_list-vkgrp AND
spras = sy-langu.
SELECT avkgrp bbezei INTO CORRESPONDING FIELDS OF TABLE
tbl_first_list FROM s707 AS a INNER JOIN tvgrt AS b
ON avkgrp = bvkgrp
WHERE b~spras = sy-langu
AND a~vkbur = fields-value.
DELETE ADJACENT DUPLICATES FROM tbl_first_list.
APPEND tbl_first_list.
IF NOT tbl_first_list IS INITIAL.
LOOP AT tbl_first_list.
CONCATENATE tbl_first_list-vkgrp '-'
tbl_first_list-bezei INTO
tbl_first_list-sgroup
SEPARATED BY space.
concatenate tbl_first_list-vkgrp+0(1)
tbl_first_list-vkgrp+2(1) into
tbl_first_list-sort.
MODIFY tbl_first_list INDEX sy-tabix.
ENDLOOP.
ENDIF.
ELSE.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = repid
txt1 = sy-subrc
txt2 = 'No data found!'
TXT3 = ' '
TXT4 = ' '
ENDIF.
PERFORM fcat_first_list.
PERFORM fieldcat_sort USING gs_sort[].
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-cprog
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USECOMM1'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
is_layout = layout
it_fieldcat = fcat1[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = gs_sort[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = events1[]
IT_EVENT_EXIT =
IS_PRINT = gs_print
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = tbl_first_list
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.
CASE sy-subrc.
WHEN '1'.
MESSAGE s000.
WHEN OTHERS.
MESSAGE s001.
ENDCASE.
ENDIF.
ENDCASE.
ENDFORM.
Make corrections...it's not working here -
How can we set GUI STATUS in a alv program using oops...Is there any method we need to use for this ????
Hi,
Just call screen from your program as below .
call screen 9001.
In the PBO of the screen,write the following code
MODULE status_9001 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'ZTITLE'.
ENDMODULE. " STATUS_9001 OUTPUT -
Problem with print preview in alv grid
Hello all,
I have to display base unit of measure(meins) in alv grid output. i am using a conversion routine to convert it from ST TO PC before display.After executing the report i am getting the correct data. the problem is when i select the print preview
alv list is displayed. in that the unit of measure pc is not displayed, it is comming as '*******. what i came to know is the same conversion routine is triggered in the standard program for the display. so it canot convert that.
so please help me out in solving this.
Thanks in advance,
Sarathi sarath,
this is an example code try using the statement before displaying, i think it works.
*example cdoe.
LOOP AT i_grp1 INTO wa_grp1.
AT NEW tknum.
READ TABLE i_grp1 intto wa_grp1 index sy-tabix.
SUM.
MOVE-CORRESPONDING wa_grp1 TO wa_grp2.
APPEND wa_grp2 TO i_grp2.
ENDAT.
ENDLOOP. -
Problems with F4 help in ALV grid
Hi all,
I am trying to create a F4 help for the field Payee number in my reprot output (ALV Grid OO), i am able to get the window for selection of the value in the F4 help , but i am unable to pass the value back on to the screen.
I need to insert the selected value from the F4 help and aslo need to populate the Name of the payee into the Payee field.
Can some one help me in finding what error have i done in the code.
Thanks in advance for all.
I have the following code
*& Include ZRMM_ALV_TOP *
data: gc_control100 type ref to cl_gui_custom_container,
gc_control101 type ref to cl_gui_custom_container.
data: gi_outtab100 type table of ty_purchase.
data: g_cont0100 type ref to cl_gui_custom_container,
g_grid0100 type ref to cl_gui_alv_grid, " For Screen 100 Grid
gi_fcat0100 type lvc_t_fcat, " Field Catalog for Screen 100
gi_sort0100 type lvc_t_sort,
g_lout0100 type lvc_s_layo.
data: okcode_100 like sy-ucomm,
save_0100 like sy-ucomm,
okcode_200 like sy-ucomm,
save_0200 like sy-ucomm.
types: begin of f4_itab_type,
LIFNR type lifnr,
BUKRS type name1,
end of f4_itab_type.
data: f4_itab type table of f4_itab_type,
ls_f4_itab type f4_itab_type.
data : it_IZEMTAB type table of IZEMTAB,
wa_IZEMTAB type IZEMTAB.
Class Definitions.
class event_receiver_0100 definition.
PUBLIC SECTION.
types: begin of onf4_event_parameters_type,
c_fieldname type lvc_fname,
cs_row_no type lvc_s_roid,
cr_event_data type ref to cl_alv_event_data,
ct_bad_cells type lvc_t_modi,
c_display type char01,
end of onf4_event_parameters_type.
data: fieldcatalog type lvc_t_fcat.
data : f4_alv type ref to cl_gui_alv_grid,
f4_cont type ref to cl_gui_custom_container.
data: f4_params type onf4_event_parameters_type.
METHODS:
ON_F4 FOR EVENT ONF4 of cl_gui_alv_grid
importing sender
e_fieldname
e_fieldvalue
es_row_no
er_event_data
et_bad_cells
e_display.
on_data_changed for event
data_changed of cl_gui_alv_grid
importing e_onf4
e_onf4_before
e_onf4_after
er_data_changed
e_ucomm
sender.
endclass. "lcl_event_receiver DEFINITION
data: gs_variant type disvariant,
gc_save value 'A',
gs_toolbar TYPE stb_button,
gs_toolbar1 type stb_button,
gs_toolbar2 type stb_button.
DATA : T_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.
DATA : event_receiver_0100 TYPE REF TO EVENT_RECEIVER_0100.
Class Implementation.
class event_receiver_0100 implementation.
For f4 help.
method on_f4.
data: ls_outtab type ty_purchase.
field-symbols <itab> type lvc_t_modi.
data: ls_modi type lvc_s_modi,
ls_f4_itab type f4_itab_type.
f4_params-c_fieldname = e_fieldname.
f4_params-cs_row_no = es_row_no.
f4_params-cr_event_data = er_event_data.
f4_params-ct_bad_cells = et_bad_cells.
f4_params-c_display = e_display.
read table it_purchase into ls_outtab index f4_params-cs_row_no-row_id.
Clear f4_itab[].
CALL FUNCTION 'FI_VENDOR_ALTERN_PAYERS_READ'
EXPORTING
I_LIFNR = ls_outtab-lifnr
I_BUKRS = ls_outtab-bukrs
TABLES
T_ZEMTAB = it_izemtab.
clear f4_itab[].
if not ls_outtab-lifnr is initial.
loop at it_izemtab into wa_izemtab.
ls_f4_itab-LIFNR = wa_izemtab-empfb.
ls_f4_itab-BUKRS = wa_izemtab-name1.
append ls_f4_itab to f4_itab.
endloop.
endif.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'LIFNR'
DYNPPROG = sy-repid
DYNPNR = '100'
WINDOW_TITLE = 'f4 help for PAYEE'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = f4_itab
RETURN_TAB = T_RETURN.
IF SY-SUBRC <> 0.
ENDIF.
assign f4_params-cr_event_data->m_data->* to <itab>.
ls_modi-row_id = f4_params-cs_row_no-row_id.
read table f4_itab into ls_f4_itab index es_row_no-row_id.
if not f4_itab is initial.
ls_modi-row_id = es_row_no-row_id.
ls_modi-value = ls_f4_itab-LIFNR.
ls_modi-FIELDNAME = 'LIFNR'.
append ls_modi to <itab>.
ls_modi-row_id = es_row_no-row_id.
ls_modi-value = ls_f4_itab-BUKRS.
ls_modi-FIELDNAME = 'NAME1'.
append ls_modi to <itab>.
endif.
er_event_data->m_event_handled = 'X'.
ENDMETHOD.
*--ENDMETHOD SHOW_F4--
endclass. "lcl_event_receiver IMPLEMENTATIONI have used the following FM for F4 help on editable ALV grid column and it worked fine.Try the below.
Call function for Input helps
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = text-049
i_selection = c_check
i_zebra = c_check
i_screen_start_column = 55
i_screen_end_column = 125
i_screen_start_line = 10
i_screen_end_line = 20
i_tabname = c_fcat_str
it_fieldcat = tl_fieldcat
IMPORTING
es_selfield = wal_selfield
TABLES
t_outtab = tl_code
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSEIF sy-subrc = 0 AND NOT wal_selfield IS INITIAL.
wl_index = wal_selfield-tabindex.
READ TABLE tl_code ASSIGNING <l_code>
INDEX wl_index.
IF sy-subrc = 0.
<l_fgis_lots>-status = <l_code>.
ENDIF.
ENDIF.
ENDIF. -
Background Execution Problem-Docking Container with 2 ALV Grids in one scre
Hi Friends,
I have created 2 ALV Grids in one screen - one below another using DOCKING CONTAINER.
The objects are 'g_dock_cont' and 'g_dock_cont1'.
I am getting the foreground output as expected with 2 ALV Grids.
While executing in background (F9), I am getting only output of first ALV grid. Second ALV is not getting displayed in BACKGROUND(F9) mode.
How to solve this.
FORM create_objects.
* Materials with data
IF g_dock_cont IS INITIAL.
IF sy-batch NE 'X'.
*CREATE THE OBJECT FOR DOCKING CONTAINER
CREATE OBJECT g_dock_cont
EXPORTING
side = cl_gui_docking_container=>dock_at_top
extension = 300.
ENDIF.
*CREATE THE OBJECT FOR ALV GRID
CREATE OBJECT g_alvgrid
EXPORTING i_parent = g_dock_cont.
wa_layout-grid_title =
'Materials with Data'.
ENDIF.
IF NOT I_DETAIL[] IS INITIAL.
CALL METHOD g_alvgrid->set_table_for_first_display
EXPORTING
IS_VARIANT = WA_VARIANT_STX
IS_LAYOUT = wa_layout
CHANGING
it_outtab = I_DETAIL
IT_FIELDCATALOG = LIT_FIELDCATALOG[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF sy-subrc <> 0.
ENDIF.
ENDIF.
*MATERIALS WITHOUT DATA
IF g_dock_cont1 IS INITIAL.
IF sy-batch NE 'X'.
*CREATE THE OBJECT FOR DOCKING CONTAINER
CREATE OBJECT g_dock_cont1
EXPORTING
side = cl_gui_docking_container=>dock_at_bottom
extension = 300.
ENDIF.
*CREATE THE OBJECT FOR ALV GRID
CREATE OBJECT g_alvgrid1
EXPORTING i_parent = g_dock_cont1.
wa_layout1-grid_title =
'Materials without Data'.
ENDIF.
IF NOT I_MARA[] IS INITIAL.
CALL METHOD g_alvgrid1->set_table_for_first_display
EXPORTING
IS_LAYOUT = wa_layout1
CHANGING
it_outtab = I_MARA
IT_FIELDCATALOG = i_fieldcat[]
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDFORM. " create_objects
Regards,
Viji.Hi,
What i was saying is that you need to code again for background mode of execution.
AT END OF SELECTION.
IF SY-BATCH EQ 'X'.
PERFORM DISPLAY1.
PERFORM DISPLAY2.
In DISPLAY1 use REUSE_ALV_LIST_DISPLAY to display data from outtab1.
In DISPLAY2 use REUSE_ALV_LIST_DISPLAY to display data from outtab2.
For example : execute this report in background mode.this will not execute in online mode.
After execution you will get two spools one for KNA1 and one for LFA1 data. Spool can be controlled via IS_PRINT structure.
report zrbackground.
data gt_lfa1 type standard table of lfa1.
data gt_kna1 type standard table of kna1.
start-of-selection.
select * from lfa1 into table gt_lfa1 up to 10 rows.
select * from kna1 into table gt_kna1 up to 20 rows.
end-of-selection.
if sy-batch eq 'X'.
perform display_lfa1.
perform display_kna1.
endif.
*& Form DISPLAY_LFA1
text
--> p1 text
<-- p2 text
form display_lfa1 .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
i_structure_name = 'LFA1'
tables
t_outtab = gt_lfa1
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_LFA1
*& Form DISPLAY_KNA1
text
--> p1 text
<-- p2 text
form display_kna1 .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = sy-repid
i_structure_name = 'KNA1'
tables
t_outtab = gt_kna1
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_KNA1
Please let me know if its not clear or you need more info.
Thanks,
Abhishek
Edited by: abhishek sinha on May 8, 2009 7:42 PM
Edited by: abhishek sinha on May 8, 2009 8:45 PM
Maybe you are looking for
-
I added a new iPod and now iTunes won't recognize my old iPod
My old iPod's battery is just about dead. It is about three years old; I will send it to Apple for a new battery. In the meantime, I bought a new 5th generation iPod, 60 GB. It's great! Eventually the old iPod will be my work iPid and the new one wil
-
How Can I Get All The Telemarketers To Stop Calling And Texting My Cellphone?
My number is on the Do Not Call List, has been since its inception. I file complaints, and it seems I get more calls after I file a complaint. Right now there are 8 different numbers that call constantly, selling a Home Security system and it is a
-
File name for append processing mode with time stamp
Hi Experts we are doing file to file scenario using the processing mode as Append. the requirement for us to append the files and we need to have new file name with time stamp added to the appended file.but in the processing mode of the file adapter
-
MSCS and Kernel patches: Can someone please refresh my memory?
Greetings, We run 4.7 Ent on a 2-node MSCS Cluster (SQL). I need to do a kernel upgrade, but I have forgotten the precise distribution of kernel files outside of the "run" directory for the cluster. I understand they are: Main Kernel Files shared_dri
-
Flex 2, FDS 2.5 and CF 8
Hi everyone, I am starting to retract my brain from an intense 2 days to figure out how to use Flex with Coldfusion. I am using Coldfusion 8 Beta (this part is good, don't need help for CF itself). I am also using Flex Builder 2 (with chart but this