Disable Checkbox in OO ALV
hi experts,
after some processing of my alv, for records that are flagged, i will need to diable the checkbox.
LOOP AT gt_rec_item INTO ls_alv WHERE locked_flag = 'X'.
l_tabix = sy-tabix.
REFRESH lt_celltab.
ls_celltab-fieldname = 'CHECKBOX'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
INSERT ls_celltab INTO TABLE lt_celltab.
INSERT lines of lt_celltab INTO TABLE ls_alv-celltab.
MODIFY gt_rec_item FROM ls_alv.
CALL METHOD g_grid->refresh_table_display.
by using the above codes, it does change the checkbox to be disabled, but it doesnt show in my alv.
Hi Weishan,
I think that you are forgetting to update your main data table.
You are building new style tables, but you have to reapply these style tabs to the corresponding rows of your internal table, and <i>then</i> call refresh_table_display.
Hope this helps...
Phil
Similar Messages
-
Disable checkbox in hirarichal ALV
In my report I am displaying hirarichal ALV (without OOPS) with checkboxes at both header level and item level. Processing is like user select a header row and few of its items rows by selecting the respective checkboxes and hits a button which does some functionality.
What I need is after hitting that button those selected checkbox( both header and item rows) should become disable. I am able to disable header level checkox by changing its value to '0' . But the same '0' value when I am passing to Item row checkboxes, they are not getting disabled. I have tried values like '-' but still item level checkboxes are not getting disabled. Kindly help.
Regards,
RajneeshHi Weishan,
I think that you are forgetting to update your main data table.
You are building new style tables, but you have to reapply these style tabs to the corresponding rows of your internal table, and <i>then</i> call refresh_table_display.
Hope this helps...
Phil -
Checkbox problem in ALV toolbar
Hello all,
I hv added a checkbox in my alv toolbar using classes.
i.e. MOVE 'NO_DEFECTS' TO ls_toolbar-function.
MOVE 'No Defects' TO ls_toolbar-quickinfo.
MOVE 'No Defects' TO ls_toolbar-text.
MOVE 5 TO ls_toolbar-butn_type.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
Alv is displaying in one subscreen.
My problem is my checkbox is displaying as a button instead of a check box and also i want to know how can i check whether my checkbox is active or not.
I want to disable some buttons in the alv toolbar based on this checkbox.
Thanks in advance.
regards,
LokeshHi,
To disable the buttons in the toolbar, In the ALV events exclude the fcodes of the buttons you want to disable and pass it to the
to the program like the below statement
set pf-status 'STDPOPBX_FULLSCREEN' excluding lt_extab
of program 'SAPLKKBL'.
To use the check box pass the ls_toolbar-ICON as ICON_WD_CHECK_BOX.
Regards,
Kranthi -
Checkbox field in ALV for REUSE_ALV_GRID_DISPLAY
how to handle Checkbox field in ALV for REUSE_ALV_GRID_DISPLAY????
For example Alv has displayed 400 entries if user checks 4 entries and wants to donwload only those 4 entries from ALV using Copy to local file option then how should it be done. please provide some help...REPORT YHRMR_LTC_TAXABLE NO STANDARD PAGE HEADING LINE-SIZE 120.
TYPE-POOLS: SLIS.
Start of Data Declaration *
DATA: G_PLVAR TYPE PLVAR.
DATA: P_MONTH TYPE TFMATAGE.
DATA: TOTAL_NO TYPE I.
DATA: TOTAL_NO_SUM TYPE I.
DATA: COUNT_15 TYPE I.
DATA: COUNT_15_SUM TYPE I.
DATA: COUNT_LTC TYPE I.
DATA: COUNT_LTC_SUM TYPE I.
DATA: COUNT_ERROR_IT15 TYPE I.
DATA: COUNT_ERROR_IT15_SUM TYPE I.
DATA: COUNT_ERROR_LTC TYPE I.
DATA: COUNT_ERROR_LTC_SUM TYPE I.
DATA: COUNT_ENTRY_IT15 TYPE I.
DATA: COUNT_ENTRY_IT15_SUM TYPE I.
--LOCAL TABLE TYPE--
DATA: T_DATA_LTC LIKE YHRMT_LTC OCCURS 0 WITH HEADER LINE.
DATA: T_DATA_LTC_NEW LIKE YHRMT_LTC OCCURS 0 WITH HEADER LINE.
DATA: T_PA0015 LIKE PA0015 OCCURS 0 WITH HEADER LINE.
DATA: T_P0015 LIKE PA0015 OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF T_FINAL OCCURS 0,
CHECK_BOX(1),
MANDT TYPE MANDT,
PERNR TYPE PERSNO,
ABKRS TYPE ABKRS,
PERSK TYPE PERSK,
WAGETYPE TYPE LGART,
LTCSTART TYPE YAJAHR,
LTCEND TYPE YYAJAHR,
FLAG TYPE YCHAR1,
SEQNR TYPE SEQNR,
LEVSTART TYPE URBEG,
LEVEND TYPE BDATU_052R,
PAYDATE TYPE YBEGDA,
AMOUNTPAY TYPE AMUNT,
TAXYR TYPE PHK_TAXYR,
DOCUNO TYPE YCHAR20,
DOCUDATE TYPE YENDDA,
VOUCHNO TYPE YCHAR20,
APDATE TYPE BPS_APPDA,
CANCEL_MOD TYPE YCANCELMOD,
LTC_IND TYPE ATZH1,
APPL_TAG TYPE YAPPTAG,
CANCEL_DATE TYPE AEDTM,
CANCEL_USER TYPE AENAM,
LASTCHANGE TYPE AEDTM,
USERNAME TYPE AENAM,
END OF T_FINAL.
DATA: BEGIN OF T_PA0001 OCCURS 0,
PERNR LIKE PA0001-PERNR,
ABKRS LIKE PA0001-ABKRS,
END OF T_PA0001.
--Message Part Declaration--
DATA: BEGIN OF T_SUCCESS OCCURS 0,
PERNR TYPE PERSNO,
MESSAGE(50) TYPE C,
END OF T_SUCCESS.
DATA: BEGIN OF T_ERROR OCCURS 0,
PERNR TYPE PERSNO,
MESSAGE(50) TYPE C,
END OF T_ERROR.
--TABLE TYPE OF SLIS TYPE-GROUP--
DATA: G_FLD TYPE SLIS_T_FIELDCAT_ALV,
G_EV TYPE SLIS_T_EVENT,
G_SORT TYPE SLIS_T_SORTINFO_ALV,
G_LST TYPE SLIS_T_LISTHEADER.
DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
I_EVENTS TYPE SLIS_T_EVENT,
GD_REPID LIKE SY-REPID.
--STRUCTURE TYPE OF SLIS TYPE-GROUP--
DATA: L_EV TYPE SLIS_ALV_EVENT.
CONSTANTS : C_PF TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',
C_UCOM TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
*---- Start Change by Bibek/Shankar Dated : 12-03-2008 via cmr no : J/08/03/062/1.
DATA: L_ENDDATE LIKE SY-DATUM.
*---- End Change by Bibek/Shankar Dated : 12-03-2008 via cmr no : J/08/03/062/1.
End of Data Declaration *
Start of Selection screen Parameters *
SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-002.
*START CHANGE BY SHAYARI ON 18.02.2008, CMR No.:- J/08/02/323
PARAMETERS:P_ABKRS LIKE PA0001-ABKRS OBLIGATORY.
*END CHANGE BY SHAYARI ON 18.02.2008, CMR No.:- J/08/02/323
*START CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT 1(78) TEXT-006 FOR FIELD P_LES.
PARAMETER P_LES RADIOBUTTON GROUP RB1.
SELECTION-SCREEN END OF LINE.
*END CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT 1(78) TEXT-003 FOR FIELD P_ONE.
PARAMETER P_ONE RADIOBUTTON GROUP RB1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT 1(78) TEXT-004 FOR FIELD P_TWO.
PARAMETER P_TWO RADIOBUTTON GROUP RB1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 1.
SELECTION-SCREEN COMMENT 1(78) TEXT-005 FOR FIELD P_MORE.
PARAMETER P_MORE RADIOBUTTON GROUP RB1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK A.
End of Selection screen Parameters *
*Get Plan Version
CALL FUNCTION 'RH_GET_PLVAR'
IMPORTING
PLVAR = G_PLVAR.
PERFORM CLEAR.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
IV_DATE = SY-DATUM
IMPORTING
EV_MONTH_BEGIN_DATE =
EV_MONTH_END_DATE = L_ENDDATE.
SELECT *
FROM YHRMT_LTC
INTO TABLE T_DATA_LTC
WHERE FLAG = '1'
AND WAGETYPE = '1640'
AND LEVEND LE L_ENDDATE
AND PAYDATE GE '20080101'.
If SY-SUBRC <> 0.
MESSAGE I398(00) with 'No Records to display '.
ENDIF.
DELETE T_DATA_LTC WHERE LEVEND = '00000000'.
*START CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
*For Less Than One Month from Leave End Date
IF P_LES = 'X'.
LOOP AT T_DATA_LTC.
CLEAR P_MONTH.
CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
EXPORTING
BEG_DA = T_DATA_LTC-LEVEND
END_DA = SY-DATUM
IMPORTING
NO_MONTH = P_MONTH.
IF P_MONTH LT '1'.
T_FINAL-MANDT = T_DATA_LTC-MANDT.
T_FINAL-PERNR = T_DATA_LTC-PERSONNELNO.
T_FINAL-PERSK = T_DATA_LTC-PERSK.
T_FINAL-WAGETYPE = T_DATA_LTC-WAGETYPE.
T_FINAL-LTCSTART = T_DATA_LTC-LTCSTART.
T_FINAL-LTCEND = T_DATA_LTC-LTCEND.
T_FINAL-FLAG = T_DATA_LTC-FLAG.
T_FINAL-SEQNR = T_DATA_LTC-SEQNR.
T_FINAL-LEVSTART = T_DATA_LTC-LEVSTART.
T_FINAL-LEVEND = T_DATA_LTC-LEVEND.
T_FINAL-PAYDATE = T_DATA_LTC-PAYDATE.
T_FINAL-AMOUNTPAY = T_DATA_LTC-AMOUNTPAY.
T_FINAL-TAXYR = T_DATA_LTC-TAXYR.
T_FINAL-DOCUNO = T_DATA_LTC-DOCUNO.
T_FINAL-DOCUDATE = T_DATA_LTC-DOCUDATE.
T_FINAL-VOUCHNO = T_DATA_LTC-VOUCHNO.
T_FINAL-APDATE = T_DATA_LTC-APDATE.
T_FINAL-CANCEL_MOD = T_DATA_LTC-CANCEL_MOD.
T_FINAL-LTC_IND = T_DATA_LTC-LTC_IND.
T_FINAL-APPL_TAG = T_DATA_LTC-APPL_TAG.
T_FINAL-CANCEL_DATE = T_DATA_LTC-CANCEL_DATE.
T_FINAL-CANCEL_USER = T_DATA_LTC-CANCEL_USER.
T_FINAL-LASTCHANGE = T_DATA_LTC-LASTCHANGE.
T_FINAL-USERNAME = T_DATA_LTC-USERNAME.
APPEND T_FINAL.
CLEAR T_FINAL.
ENDIF.
ENDLOOP.
*For One Month from Leave End Date
ELSEIF P_ONE = 'X'.
LOOP AT T_DATA_LTC.
CLEAR P_MONTH.
CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
EXPORTING
BEG_DA = T_DATA_LTC-LEVEND
END_DA = SY-DATUM
IMPORTING
NO_MONTH = P_MONTH.
IF P_MONTH EQ '1' AND P_MONTH LT '2'.
T_FINAL-MANDT = T_DATA_LTC-MANDT.
T_FINAL-PERNR = T_DATA_LTC-PERSONNELNO.
T_FINAL-PERSK = T_DATA_LTC-PERSK.
T_FINAL-WAGETYPE = T_DATA_LTC-WAGETYPE.
T_FINAL-LTCSTART = T_DATA_LTC-LTCSTART.
T_FINAL-LTCEND = T_DATA_LTC-LTCEND.
T_FINAL-FLAG = T_DATA_LTC-FLAG.
T_FINAL-SEQNR = T_DATA_LTC-SEQNR.
T_FINAL-LEVSTART = T_DATA_LTC-LEVSTART.
T_FINAL-LEVEND = T_DATA_LTC-LEVEND.
T_FINAL-PAYDATE = T_DATA_LTC-PAYDATE.
T_FINAL-AMOUNTPAY = T_DATA_LTC-AMOUNTPAY.
T_FINAL-TAXYR = T_DATA_LTC-TAXYR.
T_FINAL-DOCUNO = T_DATA_LTC-DOCUNO.
T_FINAL-DOCUDATE = T_DATA_LTC-DOCUDATE.
T_FINAL-VOUCHNO = T_DATA_LTC-VOUCHNO.
T_FINAL-APDATE = T_DATA_LTC-APDATE.
T_FINAL-CANCEL_MOD = T_DATA_LTC-CANCEL_MOD.
T_FINAL-LTC_IND = T_DATA_LTC-LTC_IND.
T_FINAL-APPL_TAG = T_DATA_LTC-APPL_TAG.
T_FINAL-CANCEL_DATE = T_DATA_LTC-CANCEL_DATE.
T_FINAL-CANCEL_USER = T_DATA_LTC-CANCEL_USER.
T_FINAL-LASTCHANGE = T_DATA_LTC-LASTCHANGE.
T_FINAL-USERNAME = T_DATA_LTC-USERNAME.
APPEND T_FINAL.
CLEAR T_FINAL.
ENDIF.
ENDLOOP.
*For Two Month from Leave End Date
ELSEIF P_TWO = 'X'.
LOOP AT T_DATA_LTC.
CLEAR P_MONTH.
CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
EXPORTING
BEG_DA = T_DATA_LTC-LEVEND
END_DA = SY-DATUM
IMPORTING
NO_MONTH = P_MONTH.
IF P_MONTH EQ '2' AND P_MONTH LT '3'.
T_FINAL-MANDT = T_DATA_LTC-MANDT.
T_FINAL-PERNR = T_DATA_LTC-PERSONNELNO.
T_FINAL-PERSK = T_DATA_LTC-PERSK.
T_FINAL-WAGETYPE = T_DATA_LTC-WAGETYPE.
T_FINAL-LTCSTART = T_DATA_LTC-LTCSTART.
T_FINAL-LTCEND = T_DATA_LTC-LTCEND.
T_FINAL-FLAG = T_DATA_LTC-FLAG.
T_FINAL-SEQNR = T_DATA_LTC-SEQNR.
T_FINAL-LEVSTART = T_DATA_LTC-LEVSTART.
T_FINAL-LEVEND = T_DATA_LTC-LEVEND.
T_FINAL-PAYDATE = T_DATA_LTC-PAYDATE.
T_FINAL-AMOUNTPAY = T_DATA_LTC-AMOUNTPAY.
T_FINAL-TAXYR = T_DATA_LTC-TAXYR.
T_FINAL-DOCUNO = T_DATA_LTC-DOCUNO.
T_FINAL-DOCUDATE = T_DATA_LTC-DOCUDATE.
T_FINAL-VOUCHNO = T_DATA_LTC-VOUCHNO.
T_FINAL-APDATE = T_DATA_LTC-APDATE.
T_FINAL-CANCEL_MOD = T_DATA_LTC-CANCEL_MOD.
T_FINAL-LTC_IND = T_DATA_LTC-LTC_IND.
T_FINAL-APPL_TAG = T_DATA_LTC-APPL_TAG.
T_FINAL-CANCEL_DATE = T_DATA_LTC-CANCEL_DATE.
T_FINAL-CANCEL_USER = T_DATA_LTC-CANCEL_USER.
T_FINAL-LASTCHANGE = T_DATA_LTC-LASTCHANGE.
T_FINAL-USERNAME = T_DATA_LTC-USERNAME.
APPEND T_FINAL.
CLEAR T_FINAL.
ENDIF.
ENDLOOP.
*For More than Two Month from Leave End Date
ELSEIF P_MORE = 'X'.
LOOP AT T_DATA_LTC.
CLEAR P_MONTH.
CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
EXPORTING
BEG_DA = T_DATA_LTC-LEVEND
END_DA = SY-DATUM
IMPORTING
NO_MONTH = P_MONTH.
IF P_MONTH GT '2' .
T_FINAL-MANDT = T_DATA_LTC-MANDT.
T_FINAL-PERNR = T_DATA_LTC-PERSONNELNO.
T_FINAL-PERSK = T_DATA_LTC-PERSK.
T_FINAL-WAGETYPE = T_DATA_LTC-WAGETYPE.
T_FINAL-LTCSTART = T_DATA_LTC-LTCSTART.
T_FINAL-LTCEND = T_DATA_LTC-LTCEND.
T_FINAL-FLAG = T_DATA_LTC-FLAG.
T_FINAL-SEQNR = T_DATA_LTC-SEQNR.
T_FINAL-LEVSTART = T_DATA_LTC-LEVSTART.
T_FINAL-LEVEND = T_DATA_LTC-LEVEND.
T_FINAL-PAYDATE = T_DATA_LTC-PAYDATE.
T_FINAL-AMOUNTPAY = T_DATA_LTC-AMOUNTPAY.
T_FINAL-TAXYR = T_DATA_LTC-TAXYR.
T_FINAL-DOCUNO = T_DATA_LTC-DOCUNO.
T_FINAL-DOCUDATE = T_DATA_LTC-DOCUDATE.
T_FINAL-VOUCHNO = T_DATA_LTC-VOUCHNO.
T_FINAL-APDATE = T_DATA_LTC-APDATE.
T_FINAL-CANCEL_MOD = T_DATA_LTC-CANCEL_MOD.
T_FINAL-LTC_IND = T_DATA_LTC-LTC_IND.
T_FINAL-APPL_TAG = T_DATA_LTC-APPL_TAG.
T_FINAL-CANCEL_DATE = T_DATA_LTC-CANCEL_DATE.
T_FINAL-CANCEL_USER = T_DATA_LTC-CANCEL_USER.
T_FINAL-LASTCHANGE = T_DATA_LTC-LASTCHANGE.
T_FINAL-USERNAME = T_DATA_LTC-USERNAME.
APPEND T_FINAL.
CLEAR T_FINAL.
ENDIF.
ENDLOOP.
ENDIF.
****Payroll Area Put
SELECT PERNR ABKRS FROM PA0001
INTO CORRESPONDING FIELDS OF TABLE T_PA0001
FOR ALL ENTRIES IN T_FINAL
WHERE PERNR = T_FINAL-PERNR
AND ABKRS = P_ABKRS
AND BEGDA LE SY-DATUM
AND ENDDA GE SY-DATUM.
LOOP AT T_FINAL.
READ TABLE T_PA0001 WITH KEY PERNR = T_FINAL-PERNR.
IF SY-SUBRC = 0.
T_FINAL-ABKRS = T_PA0001-ABKRS.
MODIFY T_FINAL.
CLEAR T_FINAL.
ENDIF.
ENDLOOP.
CLEAR T_FINAL.
DELETE T_FINAL WHERE ABKRS = ''.
*Output Form ALV List
PERFORM ALV.
*& Form ALV
FORM ALV .
PERFORM BUILD_FIELDCATALOG.
PERFORM BUILD_EVENT.
PERFORM DISPLAY_DATA.
ENDFORM. " ALV
*& Form BUILD_FIELDCATALOG
FORM BUILD_FIELDCATALOG .
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'PERNR'.
FIELDCATALOG-SELTEXT_M = 'Personnel number'.
FIELDCATALOG-COL_POS = 1.
FIELDCATALOG-OUTPUTLEN = 17.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'ABKRS'.
FIELDCATALOG-SELTEXT_M = 'Payroll Area'.
FIELDCATALOG-COL_POS = 2.
FIELDCATALOG-OUTPUTLEN = 17.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'LTCSTART'.
FIELDCATALOG-SELTEXT_M = 'LTC Start year'.
FIELDCATALOG-COL_POS = 3.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'LTCEND'.
FIELDCATALOG-SELTEXT_M = 'LTC End year'.
FIELDCATALOG-COL_POS = 4.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'LEVSTART'.
FIELDCATALOG-SELTEXT_M = 'Start of leave'.
FIELDCATALOG-COL_POS = 5.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'LEVEND'.
FIELDCATALOG-SELTEXT_M = 'End of leave'.
FIELDCATALOG-COL_POS = 6.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'AMOUNTPAY'.
FIELDCATALOG-SELTEXT_M = 'Amount'.
FIELDCATALOG-DO_SUM = 'X'.
FIELDCATALOG-COL_POS = 7.
FIELDCATALOG-OUTPUTLEN = 13.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'PAYDATE'.
FIELDCATALOG-SELTEXT_M = 'Payment Date'.
FIELDCATALOG-COL_POS = 8.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
FIELDCATALOG-TABNAME = 'T_FINAL'.
FIELDCATALOG-FIELDNAME = 'APPL_TAG'.
FIELDCATALOG-SELTEXT_M = 'Application Tag '.
FIELDCATALOG-COL_POS = 9.
FIELDCATALOG-OUTPUTLEN = 15.
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.
*Check Box Field Add
CLEAR GD_LAYOUT.
GD_LAYOUT-BOX_FIELDNAME = 'CHECK_BOX'.
GD_LAYOUT-BOX_TABNAME = 'T_FINAL'.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_EVENT
FORM BUILD_EVENT .
*Event Handler
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = G_EV
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ELSE.
READ TABLE G_EV INTO L_EV WITH KEY NAME = SLIS_EV_PF_STATUS_SET.
IF SY-SUBRC = 0.
MOVE C_PF TO L_EV-FORM.
MODIFY G_EV FROM L_EV INDEX SY-TABIX TRANSPORTING FORM.
ENDIF.
READ TABLE G_EV INTO L_EV WITH KEY NAME = SLIS_EV_USER_COMMAND.
IF SY-SUBRC = 0.
MOVE C_UCOM TO L_EV-FORM.
MODIFY G_EV FROM L_EV INDEX SY-TABIX TRANSPORTING FORM.
ENDIF.
ENDIF.
ENDFORM. " BUILD_EVENT
*& Form DISPLAY_DATA
FORM DISPLAY_DATA .
GD_REPID = SY-REPID.
CLEAR I_EVENTS. REFRESH I_EVENTS.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
I_CALLBACK_PF_STATUS_SET = C_PF
I_CALLBACK_USER_COMMAND = C_UCOM
IS_LAYOUT = GD_LAYOUT
IT_FIELDCAT = FIELDCATALOG[]
IT_EVENTS = G_EV
TABLES
T_OUTTAB = T_FINAL.
ENDFORM. " DISPLAY_DATA
FORM PF_STATUS_SET *
FORM PF_STATUS_SET USING RX_TAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'LTC'.
ENDFORM. "PF_STATUS_SET
FORM USER_COMMAND *
FORM USER_COMMAND USING R_UCOM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOM.
WHEN 'POST'.
PERFORM POST_IT15_LTC_TABLE.
ENDCASE.
ENDFORM. "USER_COMMAND
*& Form POST_IT15_LTC_TABLE
FORM POST_IT15_LTC_TABLE .
ENDFORM. " POST_IT15_LTC_TABLE
*& Form clear
FORM CLEAR .
CLEAR T_DATA_LTC.
REFRESH T_DATA_LTC.
CLEAR T_DATA_LTC_NEW.
REFRESH T_DATA_LTC_NEW.
CLEAR T_FINAL.
REFRESH T_FINAL.
CLEAR T_PA0015.
REFRESH T_PA0015.
CLEAR T_SUCCESS.
REFRESH T_SUCCESS.
CLEAR T_ERROR.
REFRESH T_ERROR.
CLEAR G_PLVAR.
CLEAR P_MONTH.
CLEAR COUNT_15.
CLEAR COUNT_15_SUM.
CLEAR COUNT_LTC.
CLEAR COUNT_LTC_SUM.
CLEAR TOTAL_NO.
CLEAR TOTAL_NO_SUM.
CLEAR COUNT_ERROR_IT15.
CLEAR COUNT_ERROR_IT15_SUM.
CLEAR COUNT_ERROR_LTC.
CLEAR COUNT_ERROR_LTC_SUM.
CLEAR COUNT_ENTRY_IT15.
CLEAR COUNT_ENTRY_IT15_SUM.
ENDFORM. " clear -
Disable delete button in ALV grid
Hi Experts,
I have a functionality to disable some buttons in alv grid such as delete row,cut,print etc.
I know how to exclude them by using it_toolbar_excluding , but I need to disable them.
Can you please let me know how to handle this.
I am displaying the ALV grid by calling the method set_table_for_first_display.
Thanks in Advance
PrasanthHi,
By using below code you can disable any button in ALV display
data : tool_wa_exclude type ui_func.
tool_wa_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
append tool_wa_exclude to tool_it_exclude .
call method grid2->set_table_for_first_display
exporting
it_toolbar_excluding = tool_it_exclude
changing
it_outtab = it_ekpo
it_fieldcatalog = it_fcat
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
U need to pass tool_it_exclude internal table to method for displaying -
Grey out(disable) a row in ALV grid
Hi,
I want to know how to grey out(disable) row wise in ALV grid display.
i..e.. Few rows in ALV grid display shoud be editable and few rows non editable based on certain condition.
How do we do that....Please help.
Thanks in advance.Hi,
Since fieldcatalog is used to modify coloum and not the row, the fieldcatalog would not solve the problem.
Thankyou. -
Disable checkbox in output report
hi gurus
I have display checkbox with tick in front of row in output at simple report program. My query is that I want to do disable checkbox whose are on tick in output screen.
Please suggest me how can I do ?
Best Regards.
Pravinhey pravin tryout this code and each time u select checkbox press f8 .
REPORT hide_unhide_box
selection-SCREEN : begin of block b2 with frame.
PARAMETERS: chk1 as CHECKBOX MODIF ID M1,
chk2 as CHECKBOX MODIF ID M1 DEFAULT 'X'.
SELECTION-SCREEN:END OF BLOCK b2.
AT SELECTION-SCREEN OUTPUT.
if chk1 eq 'X'.
loop AT SCREEN.
if screen-group1 = 'M1'.
screen-invisible = 1.
endif.
MODIFY SCREEN.
ENDLOOP.
endif.
If usefull please reward with points .
thanks and regards
Anoop Gupta -
After selecting the value from the list box, want to disable checkbox
hi guru,
After selecting the value from the list box, want to disable checkbox and custom control textbox(container) in module pool.
so please help me on this.
thanx,
manin PBO,
loop at screen.
if screen-name = your textbox's name.
screen-input = 0.
modify screen.
endif.
endloop. -
Disable checkbox for some records in a datasource
Hi,
I am having a datatable which is binded to a datasource. There is a check box for every record in the list. Check on some records and click the submit button. After that i want the records i have already submitted to be disabled(checkbox disabled) when the page is refreshed. Is there any way to do it. plz help. Thanks in advanceI would have a table field to store the submitted items, so that when you open the page you can compare with that field and use <html:checkbox disabled="true"....> for the submitted records. I think it will work out. Is this only just for that session?
-
Bug : Datatable with disabled checkboxes
Hello,
I was able to implement a datatable with modify, delete links for each row.
The following code works:
<h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
<h:column>
<f:facet name="header"><h:output_text value=" " /></f:facet>
<h:command_link action="#{DataScreen.modifyAction}">
<h:output_text value="#{DataScreen.modifyLabel" />
</h:command_link>
<f:facet name="footer"><h:output_text value=" " /></f:facet>
</h:column>
<h:column>
<f:facet name="header"><h:output_text value=" " /></f:facet>
<h:command_link action="#{DataScreen.deleteAction}">
<h:output_text value="#{DataScreen.deleteLabel" />
</h:command_link>
<f:facet name="footer"><h:output_text value=" " /></f:facet>
</h:column>
<h:column>
<f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
<h:output_text value="#{DataScreen.column1}" />
<f:facet name="footer"><h:output_text value=" " /></f:facet>
</h:column>
<h:column>
<f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
<h:output_text value="#{DataScreen.column2}" />
<f:facet name="footer"><h:output_text value=" " /></f:facet>
</h:column>
</h:data_table>But, I added a third column of type boolean, which is displayed as a disabled checkbox.
The table is displayed properly in the browser. But, when I click on the modify, delete links,
the corresponding action method (DataScreen.modifyAction() or DataScreen.deleteAction())
is not called.
<h:data_table id="DataTable" value="#{DataScreen.records}" var="record">
<h:column>
<f:facet name="header"><h:output_text value=" " /></f:facet>
<h:command_link action="#{DataScreen.modifyAction}">
<h:output_text value="#{DataScreen.modifyLabel" />
</h:command_link>
<f:facet name="footer"><h:output_text value=" " /></f:facet>
</h:column>
<h:column>
<f:facet name="header"><h:output_text value=" " /></f:facet>
<h:command_link action="#{DataScreen.deleteAction}">
<h:output_text value="#{DataScreen.deleteLabel" />
</h:command_link>
<f:facet name="footer"><h:output_text value=" " /></f:facet>
</h:column>
<h:column>
<f:facet name="header"><h:output_text value="Column1_Header" /></f:facet>
<h:output_text value="#{DataScreen.column1}" />
<f:facet name="footer"><h:output_text value=" " /></f:facet>
</h:column>
<h:column>
<f:facet name="header"><h:output_text value="Column2_Header" /></f:facet>
<h:output_text value="#{DataScreen.column2}" />
<f:facet name="footer"><h:output_text value=" " /></f:facet>
</h:column>
<h:column>
<f:facet name="header"><h:output_text value="Column3_Header" /></f:facet>
<h:selectboolean_checkbox value="#{DataScreen.column3}" disabled="true" />
<f:facet name="footer"><h:output_text value=" " /></f:facet>
</h:column>
</h:data_table>I would be glad to know if there is any workaround.
Thanks,
AjayI forgot to mention that there is no error message in the log file. The same page is displayed again
after clicking on the Modify or Delete Link.
If I remove the third column (disabled checkbox), the modify and delete links work fine. -
Multiple checkbox selection in ALV and updating internal table
Dear Expert,
Can anyone tell me how to handle the multiple checkbox selection in ALV Grid report and then updating the internal table.
I tried the option but it works only when i select only 1 row in ALV.
DO L_LINES TIMES.
read table icoas index rs_selfield-tabindex.
if sy-subrc = 0.
ICOAS-NOCHK = 'X'.
modify ICOAS INDEX rs_selfield-tabindex TRANSPORTING NOCHK.
ENDIF.
ENDDO.
Requires help....
Regards & Thanx,
Bhupathi.Hi,
Use this method to capture the check box event. Write this once you create your grid using CREATE OBJECT grid1.
DATA: GRID1 TYPE REF TO CL_GUI_ALV_GRID,
CALL METHOD grid1->register_edit_event
EXPORTING
i_event_id = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED
EXCEPTIONS
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.
LOOP AT T_GRIDDETAILS INTO WA_GRIDDETAILS.
IF WA_GRIDDETAILS-CHECKBOX = 'X'.
"Do your operation
ENDIF.
CLEAR WA_GRIDDETAILS.
ENDLOOP. -
Setting the color of a disabled checkbox...
Hi,
how do I set the color of a (disabled) JCheckBox because the following code does not work for me:
jCheckBox1.setForeground(Color.BLACK);The background is that I don't want to have the checkbox in this grey (disabled) style, instead it should look like a "normal" checkbox (but disabled).
Any ideas?
Best regards
- StephanWindowsLookAndFeel uses native APIs to draw most of the controls. So, a disabled checkbox under Windows LAF will use the same API as the native disabled checkbox. You can install a custom JXLayer on that checkbox to prevent all the events from being passed to it - not the cleanest solution, but it will get you there (and make your users annoyed that they can't click on that checkbox).
-
How to add an editable checkbox to an alv grid
Hi..
I need to add an editable checkbox to a alv grid.
I wouls appreciatet it if anyone could provide some sample code.
The standard example BCALV_EDIT_05 is an oops example... I need a simple example
Please help
thanks
Karenhi
after you pass a field as checkbox in fieldcat
then in layout populate edit
ex wa_layout-edit = 'X'.
try the following code
REPORT ZALV5.
TYPE-POOLS: slis.
tables: mara.
DATA: begin of it_mara OCCURS 0,
matnr like mara-matnr,
mbrsh like mara-mbrsh,
matkl like mara-matkl,
meins like mara-meins,
ersda like mara-ersda,
ernam like mara-ernam,
W_CHK type c ,
END OF it_mara.
*data: it_mara like mara occurs 0 with header line.
data:it_feildtab type slis_t_fieldcat_alv,
wa_fieldcat type slis_fieldcat_alv.
*DATA: i_private TYPE slis_data_caller_exit,
data: i_selfield TYPE slis_selfield,
W_exit(1) TYPE c.
PARAMETERS: p_title TYPE sy-title default 'ALV'.
START-OF-SELECTION.
SELECT matnr mbrsh matkl meins ersda ernam FROM mara
INTO corresponding fields of table it_mara.
wa_fieldcat-col_pos = '1'.
wa_fieldcat-fieldname = 'W_CHK'.
*wa_FIELDCAT-KEY = 'X'.
*wa_fieldcat-tabname = 'IT_MARA'.
*wa_fieldcat-seltext_s = 'units of measure'.
wa_fieldcat-checkbox = 'X'.
APPEND wa_fieldcat TO it_feildtab.
CLEAR wa_fieldcat .
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-tabname = 'IT_MARA'.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-key = 'X'.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-seltext_s = 'no'.
APPEND wa_fieldcat TO it_feildtab.
CLEAR wa_fieldcat .
wa_fieldcat-col_pos = '3'.
wa_fieldcat-fieldname = 'MBRSH'.
*wa_FIELDCAT-KEY = 'X'.
wa_fieldcat-tabname = 'IT_MARA'.
wa_fieldcat-seltext_s = 'Ind.sec'.
APPEND wa_fieldcat TO it_feildtab.
CLEAR wa_fieldcat .
wa_fieldcat-col_pos = '4'.
wa_fieldcat-fieldname = 'MATKL'.
*wa_FIELDCAT-KEY = 'X'.
wa_fieldcat-tabname = 'IT_MARA'.
wa_fieldcat-seltext_s = 'Description'.
APPEND wa_fieldcat TO it_feildtab.
CLEAR wa_fieldcat .
wa_fieldcat-col_pos = '5'.
wa_fieldcat-fieldname = 'MEINS'.
*wa_FIELDCAT-KEY = 'X'.
wa_fieldcat-tabname = 'IT_MARA'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-seltext_s = 'units of measure'.
APPEND wa_fieldcat TO it_feildtab.
CLEAR wa_fieldcat .
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = p_title
i_selection = 'X'
i_zebra = 'X'
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
i_checkbox_fieldname = 'W_CHK'
I_LINEMARK_FIELDNAME =
I_SCROLL_TO_SEL_LINE = 'X'
i_tabname = 'IT_MARA'
i_structure_name = 'IT_MARA'
IT_FIELDCAT = it_feildtab
IT_EXCLUDING =
I_CALLBACK_PROGRAM =
I_CALLBACK_USER_COMMAND =
IS_PRIVATE = I_PRIVATE
IMPORTING
es_selfield = i_selfield
e_exit = w_exit
TABLES
t_outtab = it_mara
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE i000(0k) WITH sy-subrc.
ENDIF.
LOOP AT it_mara WHERE W_CHK = 'X'.
WRITE: / it_mara-ersda, it_mara-ernam.
ENDLOOP.
reward if helpful
prasanth -
Catch Checkbox in Heirachycal ALV
Hi All
I am Displaying my output in Heirachycal ALV. It has checkbox at header and item level. I need a functionality that is user selects checkbox at header, all the line item checkboxes should get selected.
I need a event or something to catch the checkbox selection. Because checkbox selection doesnt fire user command..
Could you please hepl me on this issue.
Thanks.Hello Sachin
The following coding shows how to mark/unmark checkboxes in an ALV tree (<b>CL_GUI_ALV_TREE</b>). The method handles event <b>CHECKBOX_CHANGE</b>.
METHOD handle_checkbox_change .
* define local data
DATA:
lw_child TYPE lvc_nkey,
lt_children TYPE lvc_t_nkey,
l_wa_outtab_line TYPE zfr_calc_marge_detail,
l_wa_item_layout TYPE lvc_s_layi,
lt_item_layout TYPE lvc_t_layi,
l_wa_item_layout_c TYPE lvc_s_laci,
lt_item_layout_c TYPE lvc_t_laci.
" The user marks or unmarks a checkbox on the ALV tree. The status
" (marked / unmarked) is "inherited" to the child nodes.
" Get sub-tree of selected node (i.e. the node where the checkbox was changed)
CALL METHOD sender->get_subtree
EXPORTING
i_node_key = node_key
IMPORTING
et_subtree_nodes = lt_children.
" NOTE: the sender is the ALV tree instance
LOOP AT lt_children INTO lw_child.
REFRESH: lt_item_layout.
CLEAR: l_wa_outtab_line.
* Knoten und Item-Layout lesen
CALL METHOD sender->get_outtab_line
EXPORTING
i_node_key = lw_child
IMPORTING
e_outtab_line = l_wa_outtab_line
* E_NODE_TEXT =
et_item_layout = lt_item_layout
* ES_NODE_LAYOUT =
EXCEPTIONS
node_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.
READ TABLE lt_item_layout INTO l_wa_item_layout
WITH KEY fieldname = cl_gui_alv_tree=>c_hierarchy_column_name
class = cl_gui_column_tree=>item_class_checkbox.
IF ( syst-subrc = 0 ).
l_wa_item_layout-chosen = checked. " 'status' of changed checkbox
MODIFY lt_item_layout FROM l_wa_item_layout INDEX syst-tabix.
REFRESH: lt_item_layout_c.
LOOP AT lt_item_layout INTO l_wa_item_layout.
MOVE-CORRESPONDING l_wa_item_layout TO l_wa_item_layout_c.
l_wa_item_layout_c-u_chosen = 'X'. " update CHOSEN field
APPEND l_wa_item_layout_c TO lt_item_layout_c.
ENDLOOP.
CALL METHOD sender->change_node
EXPORTING
i_node_key = lw_child
i_outtab_line = l_wa_outtab_line
* IS_NODE_LAYOUT =
it_item_layout = lt_item_layout_c
* I_NODE_TEXT =
* I_U_NODE_TEXT =
EXCEPTIONS
node_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.
ENDIF.
ENDLOOP.
" Sending changes to the frontend
CALL METHOD sender->frontend_update.
ENDMETHOD.
Regards
Uwe -
ALV Grid - Hiding the values of a feild and disabling checkboxs
Hello,
I have a report that requires the need to hide certain fields in an ALV report as well as checkbox in certain rows.
So example I want to turn the ALV's output from ....
PO Number
PO Item
450000001
001
450000001
002
450000001
003
450000002
001
450000002
002
[ ] = checkbox
to the desired output below ...
PO Number
PO Item
450000001
001
002
003
450000002
001
002
so baically I want to do 2 things
1. Hide the values of certain fields if the value from the previous row is identital and ...
2. .... only include checkboxes for each new value of that column by either hiding (preferable) or disabling them.
Hope to hear from all of you soon.
Thank you all and good day.Hi Chad Cheng,
U have a variable IT_SORT in the FM REUSE_ALV_GRID_DISPLAY.
IT_SORT -fieldname = ur fieldname 1.
IT_SORT-up = 'X' or IT_SORT-Down = 'X'.
Append it_sort.
IT_SORT -fieldname = ur fieldname 2.
IT_SORT-up = 'X' or IT_SORT-Down = 'X'.
Append it_sort.
awrd points if helpful
Bhupal
Maybe you are looking for
-
I HAD A PO SCENARIO WHERE I AM GETTING THE MATERIAL AT FREE OF COST. FOR THAT I HAVE TO PAY FREIGHT CHARGES. FURTHER WE NEED TO UPDATE GOODS RECEIPT , STOCKS AND ISSUES ALSO. PLEASE ADVISE IN THIS REGARD FOR CREATION OF PO .
-
it will load after I x it out, but when I open hotmail, it loads, and reloads, and acts as though it has a virus. in the address bar a message keeps flashing saying something about javascript. I've tried everything.
-
How to maitain size and position of a panel in lookout?
To my project, i need to show several panels at same time. The user no to be able to rezise or move panel of their position. Sombody can help me? By the way, i'm using lookout 4.5 build 19
-
I called Verizon before leaving the US and was told I could pay as I go for phone service with my iPhone 5. I cannot get on to any service here in Germany.
-
Where is the data of the sample in BIEE?
i know there are A - Sample Sales Data (XML) and B - Sample Fcst Data (XML) in the Administrator of BIEE . but where is the original data about the "sales". may be a XML file or in the oracle BI and oracle BIdata files which is created after install