How to add check box in the ALV list
dear Experts,
i have a requirement.
i want show the check boxes in my ALV list.
can u please give the solution.
thanks
TYPE-POOLS: slis.
*---internal tables
DATA: BEGIN OF it_flight OCCURS 0,
SEL, " add a single character field in the final output table
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight,
*--internal tables for alv
it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fieldcat,
layout TYPE slis_layout_alv,
it_sort type slis_t_sortinfo_alv,
wa_sort like line of it_sort.
DATA: BEGIN OF it_flight_sel OCCURS 0,
SEL,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight_sel.
data: wa_flight like it_flight.
In the layout set give the name of the field
whose checkbox will be created ( SEL as it has 1 char only )
layout-box_fieldname = 'SEL'.
*---start-of-selection .
START-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'IT_FLIGHT'
i_inclname = sy-repid
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
*----get data
SELECT carrid
connid
fldate
seatsmax
seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
UP TO 20 ROWS.
wa_fcat-do_sum = 'X'.
MODIFY it_fieldcat FROM wa_fcat TRANSPORTING do_sum
WHERE fieldname = 'SEATSOCC' .
wa_sort-fieldname = 'CARRID'.
wa_sort-group = 'UL'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
clear wa_sort.
wa_sort-fieldname = 'CONNID'.
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
clear wa_sort.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
is_layout = layout
it_fieldcat = it_fieldcat
it_sort = it_sort
TABLES
t_outtab = it_flight
EXCEPTIONS
program_error = 1.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
WHEN '&IC1'. "'&DATA_SAVE'. "user presses SAVE
loop at it_flight into wa_flight.
if wa_flight-Sel EQ 'X'.
collecting records in table it_flight_sel to process further
append wa_flight to it_flight_sel.
clear wa_flight.
TYPE-POOLS: slis.
*---internal tables
DATA: BEGIN OF it_flight OCCURS 0,
SEL, " add a single character field in the final output table
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight,
*--internal tables for alv
it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fieldcat,
layout TYPE slis_layout_alv,
it_sort type slis_t_sortinfo_alv,
wa_sort like line of it_sort.
DATA: BEGIN OF it_flight_sel OCCURS 0,
SEL,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight_sel.
data: wa_flight like it_flight.
In the layout set give the name of the field
whose checkbox will be created ( SEL as it has 1 char only )
layout-box_fieldname = 'SEL'.
*---start-of-selection .
START-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'IT_FLIGHT'
i_inclname = sy-repid
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
*----get data
SELECT carrid
connid
fldate
seatsmax
seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
UP TO 20 ROWS.
wa_fcat-do_sum = 'X'.
MODIFY it_fieldcat FROM wa_fcat TRANSPORTING do_sum
WHERE fieldname = 'SEATSOCC' .
wa_sort-fieldname = 'CARRID'.
wa_sort-group = 'UL'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
clear wa_sort.
wa_sort-fieldname = 'CONNID'.
wa_sort-subtot = 'X'.
wa_sort-up = 'X'.
APPEND wa_sort TO it_sort.
clear wa_sort.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
is_layout = layout
it_fieldcat = it_fieldcat
it_sort = it_sort
TABLES
t_outtab = it_flight
EXCEPTIONS
program_error = 1.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
WHEN '&IC1'. "'&DATA_SAVE'. "user presses SAVE
loop at it_flight into wa_flight.
if wa_flight-Sel EQ 'X'.
collecting records in table it_flight_sel to process further
append wa_flight to it_flight_sel.
clear wa_flight.
Please follow the code.
Similar Messages
-
How to add a button on the ALV LIST pop up
Hi ,
Can any one help me to add a button on the ALV list which is a pop up using ABAP Objects.
Thanks in advance.
Regards,
Kavya.HI ,
I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list but still I am unable to get any additional button on the output ALV popup.
Please help.
Regards,
Kavya. -
How to add check box to the forms in scripts
Hello experts,
i got one requirement. to add a check box to the form. how can we add a check box in form. is it possible to adda check box in scripts?
thanks in advance.Hi Pammi,
In a window go for text elements & then go for change editor & use the following:
Insert->Characters->SAP symbols->SYM_CHECKBOX
It will not show checkbox in print preview. Take a printout.
Ashven -
How to add check box in SAP B1 grid controls..
hi all,
Anyone know how to add check box in SAP grid control?
It will be great if you could show me some sample code.
thanks.
regards,
sohchHi Sohch,
1. First of all you should define the Column in a matrix as it_CHECK_BOX. Like
oColumns = oMatrix.Columns
oColumn = oColumns.Add("chk_YesNo", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX)
oColumn.TitleObject.Caption = "YesNo"
oColumn.Width = 60
oColumn.Editable = True
2. Bind it with a DBDataSource as defined
oColumn = oColumns.Item("chk_YesNo")
oColumn.DataBind.Bind("UDTable", "U_YesNo")
3. Make Sure that the value that is being put into the Database is either 'Y' or 'N'.
Hope this Helps
Rizwan Hafeez
Team Lead
SAP Addon Development Section
Abacus Consulting - Pakistan -
How to handle the check box in the alv tree display
Hello,
in my ALV Tree Report i have a check box in the output.
I have one check box in the selection screen as select all .
if this is selected then all the check boxes in the output must be selected that is (X).
am using CL_GUI_ALV_TREE for this.
Please give me some input how to make that check boxes 'X' in the above mentioned case.
With Regards,
Sumodh.PSumodh,
check this
Re: Select all checkbox in ALV tree
please search before posting
Thanks
Bala Duvvuri -
How to add check box to list screen in SYCLO Agentry?
Hi,
How can I add a check box to the list screen. I want to add a new column which allows the user to select the check box.
I have tried with "Allow Multi-Row Select" option. When I selected this option I am getting an error
"The For Object defined for the "Transmit" action is invalid. 'None' is not a valid choice since the Multi-Row Selection option for the list screen is enabled."
-ShyamIs the list screen in transaction screenset or Object?
You can't use the field type button in a list screen. But what you can do is take a 16 x 16 image, with a checked box not checked.
Users will not be able just to check the box to enable it or not. You need to have an action linked to a button to the selected row, or you can have an action fire if the user double checks the row.
Stephen -
Creation of check boxes in the ALV report
Hi All,
With all your support i'm gaining more knowledge, thank's for that,
in my ALV report i want to create a check boxes if the check boxs are elected and processed then the particular records is going to disappear,
How can we do this,
Thanks & Regards
Krishnahi,
i have done this one.please check my code.
TYPE-POOLS : slis.
TYPES : BEGIN OF st_ekko,
ebeln TYPE ekko-ebeln, "Purchasing Document Number
bstyp TYPE ekko-bstyp, "Purchasing Document Category
bsart TYPE ekko-bsart, "Purchasing Document Type
aedat TYPE ekko-aedat, "record created on
ernam TYPE ekko-ernam, "Person who Created the Object
check(1),
END OF st_ekko.
TYPES : BEGIN OF st_ekpo,
ebeln TYPE ekko-ebeln,
ebelp TYPE ekpo-ebelp, "Item Number of Purchasing Document
ematn TYPE ekpo-ematn, "Material number
matkl TYPE ekpo-matkl, "Material group
netpr TYPE ekpo-netpr, "Net price in purchasing document
END OF st_ekpo.
TYPES : BEGIN OF st_ebeln,
ebeln TYPE ekpo-ebeln,
END OF st_ebeln.
TYPES : BEGIN OF st_eine,
ebeln TYPE ekko-ebeln,
ekorg TYPE eine-ekorg,
ekgrp TYPE eine-ekgrp,
END OF st_eine.
TYPES : BEGIN OF st_check,
check(1),
END OF st_check.
DATA : it_ekpo TYPE STANDARD TABLE OF st_ekpo,
it_ekko TYPE STANDARD TABLE OF st_ekko,
wa_ekko LIKE LINE OF it_ekko,
it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat,
wa_layout TYPE slis_layout_alv,
it_events TYPE slis_t_event,
st_event LIKE LINE OF it_events,
it_listheadr TYPE slis_t_listheader ,
wa_listheadr LIKE LINE OF it_listheadr,
st_printparams TYPE slis_print_alv,
it_sortinfo TYPE slis_t_sortinfo_alv,
wa_sortinfo LIKE LINE OF it_sortinfo,
it_ekposortinfo TYPE slis_t_sortinfo_alv,
wa_ekposortinfo LIKE LINE OF it_ekposortinfo,
it_filter TYPE slis_t_filter_alv,
it_ebeln TYPE STANDARD TABLE OF st_ebeln,
it_eine TYPE STANDARD TABLE OF st_eine,
wa_eine TYPE st_eine,
it_popup TYPE STANDARD TABLE OF st_eine,
wa_popup TYPE st_eine,
it_check TYPE STANDARD TABLE OF st_check,
wa_check TYPE st_check.
DATA : v_ebeln TYPE ekko-ebeln.
SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE tit.
SELECT-OPTIONS: so_ebeln FOR v_ebeln OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b.
INITIALIZATION
INITIALIZATION.
tit = text-000.
AT SELECTION-SCREEN ON
AT SELECTION-SCREEN ON so_ebeln.
PERFORM validate_ebeln.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM get_ekko_data.
PERFORM get_eine_data.
END-OF-SELECTION
END-OF-SELECTION.
PERFORM populate_fieldcat1.
PERFORM populate_layout.
PERFORM get_eventlist.
PERFORM get_ekkosortinfo.
PERFORM ekkodisplay_onalv.
*& Form POPULATE_FIELDCAT1
FORM populate_fieldcat1.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-seltext_l = text-004.
wa_fieldcat-no_zero = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'BSTYP'.
wa_fieldcat-seltext_l = text-005.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'BSART'.
wa_fieldcat-seltext_l = text-006.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'AEDAT'.
wa_fieldcat-seltext_l = text-007.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'ERNAM'.
wa_fieldcat-seltext_l = text-008.
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. "POPULATE_FIELDCAT1
*& Form populate_fieldcat2
FORM populate_fieldcat2 .
CLEAR wa_fieldcat.
CLEAR it_fieldcat.
REFRESH it_fieldcat.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-seltext_l = text-004.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-no_zero = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'EBELP'.
wa_fieldcat-seltext_l = text-009.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'EMATN'.
wa_fieldcat-seltext_l = text-010.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'MATKL'.
wa_fieldcat-seltext_l = text-011.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-seltext_l = text-012.
wa_fieldcat-datatype = 'CURR'. "Obligatory to perform SUM
wa_fieldcat-do_sum = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. "populate_fieldcat2
*& Form GET_EVENTLIST
FORM get_eventlist.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events[]
EXCEPTIONS
list_type_wrong = 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 it_events WITH KEY name = slis_ev_pf_status_set INTO st_event.
IF sy-subrc EQ 0.
st_event-form = 'SET_PF_STATUS1'.
APPEND st_event TO it_events.
CLEAR st_event.
ENDIF.
READ TABLE it_events WITH KEY name = slis_ev_end_of_page INTO st_event.
IF sy-subrc EQ 0.
st_event-form = 'END_OF_PAGE'.
APPEND st_event TO it_events.
CLEAR st_event.
ENDIF.
ENDFORM. "GET_EVENTLIST
*& Form ekpodisplay_onalv
FORM ekpodisplay_onalv .
IF it_ekpo[] IS INITIAL.
MESSAGE 'NO DATA FOUND' TYPE 'I'.
ELSE.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'AT_USER_COMMAND1'
i_callback_top_of_page = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = I_STRUCTURE_NAME
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_GRID_TITLE
I_GRID_SETTINGS = I_GRID_SETTINGS
is_layout = wa_layout
it_fieldcat = it_fieldcat
IT_EXCLUDING = IT_EXCLUDING
IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS
it_sort = it_ekposortinfo[]
IT_FILTER = IT_FILTER
IS_SEL_HIDE = IS_SEL_HIDE
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = IS_VARIANT
it_events = it_events
IT_EVENT_EXIT = IT_EVENT_EXIT
IS_PRINT = IS_PRINT
IS_REPREP_ID = IS_REPREP_ID
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS = IT_ALV_GRAPHICS
IT_HYPERLINK = IT_HYPERLINK
IT_ADD_FIELDCAT = IT_ADD_FIELDCAT
IT_EXCEPT_QINFO = IT_EXCEPT_QINFO
IR_SALV_FULLSCREEN_ADAPTER = IR_SALV_FULLSCREEN_ADAPTER
IMPORTING
E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER
ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER
TABLES
t_outtab = it_ekpo
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.
ENDIF.
ENDFORM. "ekpodisplay_onalv
*& Form SET_PF_STATUS1
FORM set_pf_status1 USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'MENU' excluding rt_extab. "Copy from SALV .
ENDFORM. "SET_PF_STATUS1
*& Form SET_PF_STATUS
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD' excluding rt_extab. "Copy from SALV .
ENDFORM. "SET_PF_STATUS
*& Form AT_user_command
FORM at_user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname EQ 'EBELN'.
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
SELECT ebeln ebelp ematn matkl netpr
FROM ekpo
INTO TABLE it_ekpo
WHERE ebeln EQ wa_ekko-ebeln.
PERFORM populate_fieldcat2.
PERFORM populate_layout2.
PERFORM get_ekposortinfo.
PERFORM ekpodisplay_onalv.
ELSE.
MESSAGE i020(z50871msg) WITH text-013.
ENDIF.
WHEN 'SE16'.
CALL TRANSACTION 'SE16'.
WHEN 'SE37'.
CALL TRANSACTION 'SE37'.
WHEN 'DISP'.
PERFORM get_popupdata.
PERFORM get_popupfcat.
PERFORM display_popup.
ENDCASE.
ENDFORM. "AT_user_command
*& Form TOP_OF_PAGE
FORM top_of_page.
REFRESH it_listheadr.
wa_listheadr-typ = 'H'.
wa_listheadr-info = text-001.
APPEND wa_listheadr TO it_listheadr.
CLEAR wa_listheadr.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheadr[]
i_logo = 'ENJOYSAP_LOGO'. "From OAER transaction
ENDFORM. "TOP_OF_PAGE
*& Form build_print_params
FORM build_print_params.
st_printparams-reserve_lines = '3'. "Lines reserved for footer
st_printparams-no_coverpage = 'X'.
ENDFORM. "build_print_params
*& Form end_of_page
FORM end_of_page.
REFRESH it_listheadr.
wa_listheadr-typ = 'H'.
wa_listheadr-info = sy-pagno.
APPEND wa_listheadr TO it_listheadr.
CLEAR wa_listheadr.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheadr[].
ENDFORM. "end_of_page
*& Form GET_EKPOSORTINFO
FORM get_ekposortinfo.
wa_ekposortinfo-up = 'X'.
wa_ekposortinfo-spos = 1.
wa_ekposortinfo-fieldname = 'EBELP'.
wa_ekposortinfo-tabname = 'EKPO'.
APPEND wa_ekposortinfo TO it_ekposortinfo.
CLEAR wa_ekposortinfo.
wa_ekposortinfo-up = 'X'.
wa_ekposortinfo-spos = 2.
wa_ekposortinfo-fieldname = 'EMATN'.
wa_ekposortinfo-tabname = 'EKPO'.
APPEND wa_ekposortinfo TO it_ekposortinfo.
CLEAR wa_ekposortinfo.
ENDFORM. "GET_EKPOSORTINFO
*& Form POPULATE_LAYOUT
FORM populate_layout.
wa_layout-colwidth_optimize = 'X'. "column width
wa_layout-zebra = 'X'.
wa_layout-no_hline = 'X'.
wa_layout-no_vline = 'X'.
wa_layout-cell_merge = 'X'.
wa_layout-box_fieldname = 'CHECK'.
wa_layout-box_tabname = 'IT_EKKO'.
wa_layout-window_titlebar = 'PURCHASE ORDER HEADER DETAILS'.
ENDFORM. "POPULATE_LAYOUT
*& Form get_EKKOsortinfo
FORM get_ekkosortinfo.
wa_sortinfo-up = 'X'.
wa_sortinfo-spos = 1.
wa_sortinfo-fieldname = 'EBELN'.
wa_sortinfo-tabname = 'EKKO'.
APPEND wa_sortinfo TO it_sortinfo.
CLEAR wa_sortinfo.
wa_sortinfo-up = 'X'.
wa_sortinfo-spos = 2.
wa_sortinfo-fieldname = 'BSTYP'.
wa_sortinfo-tabname = 'EKKO'.
APPEND wa_sortinfo TO it_sortinfo.
CLEAR wa_sortinfo.
wa_sortinfo-up = 'X'.
wa_sortinfo-spos = 3.
wa_sortinfo-fieldname = 'AEDAT'.
wa_sortinfo-tabname = 'EKKO'.
APPEND wa_sortinfo TO it_sortinfo.
CLEAR wa_sortinfo.
ENDFORM. "get_EKKOsortinfo
*& Form EKKODISPLAY_ONALV
FORM ekkodisplay_onalv.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS1'
i_callback_user_command = 'AT_USER_COMMAND'
is_layout = wa_layout
it_fieldcat = it_fieldcat
it_sort = it_sortinfo[]
it_filter = it_filter
it_events = it_events[]
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. "EKKODISPLAY_ONALV
*& Form validate_ebeln
FORM validate_ebeln.
SELECT ebeln
FROM ekpo
INTO TABLE it_ebeln
WHERE ebeln IN so_ebeln.
IF sy-subrc NE 0.
MESSAGE e020(z50871msg) WITH text-014.
ENDIF.
ENDFORM. "validate_ebeln
*& Form populate_layout2
FORM populate_layout2 .
CLEAR wa_layout.
wa_layout-colwidth_optimize = 'X'. "column width
wa_layout-zebra = 'X'.
wa_layout-no_hline = 'X'.
wa_layout-no_vline = 'X'.
wa_layout-cell_merge = 'X'.
wa_layout-window_titlebar = 'PURCHASE ORDER DETAILS SECOND SCREEN'.
ENDFORM. " populate_layout2
*& Form GET_POPUPDATA
FORM get_popupdata .
LOOP AT it_ekko INTO wa_ekko WHERE check = 'X'.
READ TABLE it_eine INTO wa_eine WITH KEY ebeln = wa_ekko-ebeln.
IF sy-subrc NE 0.
MESSAGE i020(z50871msg) WITH text-015 wa_ekko-ebeln .
ELSE.
wa_popup-ebeln = wa_eine-ebeln.
wa_popup-ekorg = wa_eine-ekorg.
wa_popup-ekgrp = wa_eine-ekgrp.
APPEND wa_popup TO it_popup.
ENDIF.
ENDLOOP.
ENDFORM. " GET_POPUPDATA
*& Form GET_POPUPFCAT
FORM get_popupfcat .
CLEAR wa_fieldcat.
REFRESH it_fieldcat.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-seltext_l = text-004.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'EKORG'.
wa_fieldcat-seltext_l = text-016.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-fieldname = 'EKGRP'.
wa_fieldcat-seltext_l = text-017.
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. " GET_POPUPFCAT
*& Form DISPLAY_POPUP
FORM display_popup .
LOOP AT it_ekko INTO wa_ekko WHERE check EQ 'X'.
wa_check-check = wa_ekko-check.
APPEND wa_check TO it_check.
ENDLOOP.
IF it_check[] IS INITIAL.
MESSAGE i020(z50871msg) WITH text-018.
ENDIF.
IF NOT it_popup[] IS INITIAL.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = text-003
i_allow_no_selection = 'X'
i_scroll_to_sel_line = 'X'
i_tabname = 'IT_POPUP'
it_fieldcat = it_fieldcat
i_callback_program = sy-repid
TABLES
t_outtab = it_popup
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.
ENDIF.
REFRESH it_check.
REFRESH it_popup.
ENDFORM. " DISPLAY_POPUP
*& Form get_ekko_data
FORM get_ekko_data .
SELECT ebeln bstyp bsart aedat ernam
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE it_ekko
WHERE ebeln IN so_ebeln.
IF sy-subrc NE 0.
MESSAGE e020(z50871msg) WITH text-019.
ENDIF.
ENDFORM. " get_ekko_data
*& Form get_eine_data
FORM get_eine_data .
SELECT ebeln ekorg ekgrp
FROM eine
INTO TABLE it_eine
WHERE ebeln IN so_ebeln.
ENDFORM. " get_eine_data
*& Form at_user_command1
FORM at_user_command1 USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'SE16'.
CALL TRANSACTION 'SE16'.
WHEN 'SE37'.
CALL TRANSACTION 'SE37'.
ENDCASE.
regards,
pavan t. -
How to add check boxes on plant data /storage tab of MM01/02/03 transaction
Hello experts,
I want to add check boxes on plant data /storage tab of MM01/02/03 transaction.
How can we achieve this?
Thanks for your help in advance!Hi Shriram Nimbolkar ,
Go to tranx code : MM01 /MM02 / MM03
1 ) System-->Status , here copy the program
2) Go to abap editor ,specify the program name and copy the package
3) Go to CMOD or SMOD
CMOD>Utilites-> SAP Enanchements, Here specify the package and execute it..
4) Displays multiple exists,
check the suitable exists and insert the code in particular screen...
Reg
Siva Prasad -
How to process check box in classical ALV
Hi,
I have one requirement wherein I am using Reuse_ALV_GRID_DISPLAY..I have a checkbox as a field and I have a push button as UPDATE...
If I select the rows in the ALV list using checkbox and if i click the Update button, I have to continue processing based on the checked rows..how will i capture the rows which are selected in ALV list...
Thanks in Adavance,
Saranya.Hi Saranya
Plz try the following logic.
" Display data on the screen
" Alternative to it u can display the data usign REUSE_ALV_LIST_DISPLAY
" FM as well
Data : len type i .
loop at itab. " contains data to b displayed
write : / a as checkbox,itab-<f1>,itab-<f2>,...........,itab-<fn>.
endloop.
describe table itab lines len.
at line-selection.
do len times.
read line sy-index field value a itab-<f1>, itab-<f2>,...........,itab-<fn>.
if a = 'X'.
write : /5 itab-<f1>, itab-<f2>,...........,itab-<fn>.
endif.
enddo.
Plz try this and revert in case of issues .
Regards
Pankaj -
How to add check box in table control?
Dear frnds,
In our requirement i am used tablec ontrol for dialog programming, but i am confused about addition of check box as fields in table control.
Any help are welcome from your side.Hi,
Chk this demo program: DEMO_DYNPRO_TABCONT_LOOP_AT
& RSDEMO02.
Another way:
Go to the edit mode of the screen select the table control column you want to make it as check box and follow the menu EDIT->CONVERT->check box.
(make sure that column definition in itab/ddtab is of size 1 char)
Also chek out this link:
Add Check box in Table control
Hope these help you.
Regards,
Anjali -
How to Prepopulate check boxes in the process form
Hi All,
I need to prepopulate "Change Password at next login" in the AD Process Form. i.e. if some one select this check box in the user creation form and create a user, i need to prepopulate it in the AD process Form. Currently, it is not prepopulated. So, it is not updated on the Active Directory. I'm using AD Connector pack 9.1.1 .
I need to prepopulate the "User must change the password at next logon" check box in the AD Process Form. I have done the prepopulate on text fields. They are working fine.
But, stuck with this check box prepopulation.....
Can anyone help me on this issue....
Regards,
Chaturanga
Edited by: chaturanga on Sep 9, 2009 2:35 PMEven if you get the checkbox right it is not entirely clear that the connector will read the box correctly. It all depends on how the connector code was written.
An alternative is to set the LDAP attribute through a custom connector. Email me if you want example code for this.
Best regards
-Martin -
How to implement Check box in the Rtf based on the value from XML datafield
Hello All ,
It would be great if any one can help me in implementing check box in the rtf based on the data filed value from the XML data.
I need to get in the out put checked boxes like what we say Radio button Yes or No ( If Yes it should be marked ).
If any one worked on this please help us...
Thanks in Advance...Did you check the user guide,
we have a section over there :)
http://blogs.oracle.com/xmlpublisher/2007/05/22 -
How to add a Field to the Result List in Activity
Hello Experts !
We are on CRM 7.0. I want to add a field to the Result List of Activity (Component: BT126S_APPT / View: ApptSR). This field is the address of the "Employee Responsible".
So, how can I add a field to the Result List? AET is not a relevant tool for us because we don't want to create an attribute it already exist in the BOL. We just have to enhance the result list with BOL existing attributes.
Also, after I add the field, I will need to populate my field with Data via some method.
Thanks in Advance to all !
Mariano.-
SAP.Hi Mariano,
The component was missing some technical data. Implement sap notes 1226612, 1363752, and then follow the manual procedure shown below.
u2022 Execute transaction SE11.
u2022 Choose the Radio button "Data Type" and enter value
"CRMST_QUERY_R_ACT_BTIL" in the Data Type field.
u2022 Click on "Change" button.
u2022 Position the cursor before the Includes added to this structure. Click
On the "+" button to add a new attribute.
u2022 Enter the following details in the newly added blank row.
Component: PERSON_RESP_LIST
Component Type: CRMT_PERSON_RESP_LIST.
u2022 Save the changes and activate the structure.
u2022 Add the "Employee Responsible" field to the View configuration.
u2022 Open the BSP application BT126S_APPT.
u2022 Double-click on the view BT126S_APPT/ApptSR in the left side panel.
u2022 Choose tab "Configuration" in right side panel.
u2022 Choose the right configuration by using the "Choose Configuration" button.
u2022 Click on the Edit button.
u2022 Add the "Employee Responsible" attribute from the "Available fields" list to "Displayed fields" list.
u2022 Save the changes
Regards
Krishna -
How to handle check box click in ALV grid
Hi Experts,
I use ALV grid using FM.
I have list of delivery note items with one custom field as check-box. When I check the checkbox, all other lines related to the same delivery note should be automaticaly checked.
Is there any event or function code, where I can handle single click to checkbox?
Thanks®ards,
JirkaHI
you can use following code in user command function .
DATA :BEGIN OF IT_MAINDATA OCCURS 0,
MAINDATA(1),
IT_RD1(1),
END OF IT_MAINDATA.
data: V_INDEX TYPE I.
DESCRIBE TABLE itab LINES LINE.
DO. " line times.
READ LINE SY-INDEX FIELD VALUE Iitab-RD1.
IF SY-SUBRC NE 0. EXIT. ENDIF.
CHECK V_INDEX > 0.
CHECK itab-RD1 = 'X'.
MODIFY itab INDEX V_INDEX.
IT_MAINDATA-IT_RD1 = Iitab-RD1.
ENDDO.
i think is work.
regards,
Abhi -
How to capture check box click in ALV
Hi,
I have requirement in which after displaying the ALV out put, immediately when the check box is checked i need to capture it and proceed with further coding with that input.
Check box click is not getting captured in "USER COMMAND or LINE SELECTION"
Could you please suggest a way.
Regards
venkatesh.Venkatesh,
If you are using cl_gui_alv_grid you need to register "change" event to catch the checkbox change.
you do so with this method of cl_gui_alv_grid class :
register_edit_event( i_event_id = cl_gui_alv_grid=>mc_evt_modified ).
event handler class
class lcl_event_receiver definition.
public section.
methods:
user_command for event user_command of cl_gui_alv_grid
importing e_ucomm, "#EC NEEDED
data_changed for event data_changed of cl_gui_alv_grid
importing er_data_changed e_onf4 e_onf4_before e_onf4_after e_ucomm,"#EC NEEDED
endclass.
global data
data: o_event_receiver type ref to lcl_event_receiver.
data: goo_grid type ref to cl_gui_alv_grid.
At the displaying of your grid / register the change event and set handlers
goo_grid->register_edit_event( i_event_id = cl_gui_alv_grid=>mc_evt_modified ).
set handler:
o_event_receiver->user_command for goo_grid,
o_event_receiver->data_changed for goo_grid.
hope this helps...
regards
Maybe you are looking for
-
Ongoing WiFi issues and Apple Support's lack of support!
Hi All, I bought my MacBook Air in July/August 2012 (i7, 8GB RAM, 256 GB HDD, Mountain Lion). Since the first day, I have had issues with wifi connectivity. My primary use was at the university in Australia, where I had frequent drop outs and at time
-
TSA dented my MacBook Pro, what to do?
OK, I just got back from LaGuardia airport in NYC and I just now notice that TSA dented my laptop. When my laptop was going through the X-Ray I heard a thud as they were pulling out my Mac. I didn't see anything wrong with it, so I put it back in my
-
What is the best way to clean dust from unibody MacBook?
I have the aluminum late 2008 MacBook (basically like the pro, except not). I've realized that I keep finding myself in dusty situations, and while I don't think it's affected my MacBook too much, I think a basic clean is in order. Anyone know the be
-
Adding parameter to existing CR report
Hi everybody, I created a CR report based on a SAP query. Then I changed this query by adding a variable. This variable appeared as a new parameter in Crystal but I can't get values from the master data for this parameter. When I select the InfoObjec
-
How can I squeeze a clip in between another clip?
I'm not sure if there is a better way to explain my question than simply writing it out: Imagine Clips A, B and C A=====B======C===== I want to move C between A and B so it looks like this: A=====C=====B====== Notice how C just gets nicely squeezed b