How to insert check box fields in a htmlb: tableview
Hi,
Can anybody tell me how to insert check box fields in a htmlb: tableview in a sequence of rows in a table view. How to generate the sequence no for the checkbox inorder to know the row that is checked.
Thanks in advance,
Aruna.
Here is the code which has the custom "Checkbox" in the tableview & Triggers the event. <b>You can identify the checkbox based on cell ID (p_cell_id)</b> in the method "IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START" & Based on the event name + Cell ID. Look at the code & let me know if you any issue.
<b>Layout:</b>
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content id = "content"
design = "design2002+design2003"
controlRendering = "SAP"
rtlAutoSwitch = "true"
forceEncode = "ENABLED" >
<htmlb:page title="Test " >
<htmlb:form>
<%
data TV_ITERATOR Type Ref To zcl_itr.
data iterator type ref to IF_HTMLB_TABLEVIEW_ITERATOR.
create object tv_iterator exporting appl_cons = application.
iterator = tv_iterator.
%>
<htmlb:tableView id = "fligts"
headerText = "Flight"
width = "100"
headerVisible = "true"
design = "alternating"
visibleRowCount = "10"
fillUpEmptyRows = "true"
showNoMatchText = "true"
filter = "server"
sort = "server"
onHeaderClick = "MyEventHeaderClick"
table = "<%= APPLICATION->itab %>"
iterator = "<%= ITERATOR %>" />
</htmlb:form>
</htmlb:page>
</htmlb:content>
<b>Event Handling:</b>
DATA: EVENT_ID1 TYPE REF TO IF_HTMLB_DATA.
EVENT_ID1 = CL_HTMLB_MANAGER=>GET_EVENT_EX( REQUEST ).
CASE EVENT_ID1->EVENT_SERVER_NAME.
IF NOT event_id1 IS INITIAL.
if event_id1->server_event+0(9) = 'chkevent'.
SPLIT event_id1->server_event AT '-' INTO v_event v_dummy v_row v_col.
endif.
endif.
method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS.
CLEAR p_column_definitions.
CLEAR p_overwrites.
DATA: tv_column TYPE TABLEVIEWCONTROL.
tv_column-COLUMNNAME = 'FLDATE'.
tv_column-edit = 'X'.
tv_column-sort = 'X'.
tv_column-TITLE = 'Flight Date'.
tv_column-WIDTH = '100'.
APPEND tv_column TO p_column_definitions.
CLEAR tv_column.
tv_column-edit = 'X'.
tv_column-COLUMNNAME = 'CONNID'.
tv_column-TITLE = 'Conn.ID'.
tv_column-WIDTH = '70'.
tv_column-HORIZONTALALIGNMENT = 'center'.
APPEND tv_column TO p_column_definitions.
CLEAR tv_column.
tv_column-edit = 'X'.
tv_column-COLUMNNAME = 'CHECKBOX1'.
tv_column-TITLE = 'Check Box'.
tv_column-WIDTH = '30'.
tv_column-HORIZONTALALIGNMENT = 'center'.
APPEND tv_column TO p_column_definitions.
endmethod.
METHOD IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
DATA: L_EVENT TYPE STRING.
CASE P_TABLEVIEW_ID.
WHEN 'fligts'.
CASE P_COLUMN_KEY.
WHEN 'CHECKBOX1'.
* CONCATENATE 'chk_event' '123' '2323' INTO L_EVENT SEPARATED BY '-' .
CONCATENATE 'chkevent' p_cell_id INTO l_event SEPARATED BY '-'.
P_REPLACEMENT_BEE = CL_HTMLB_CHECKBOX=>FACTORY( ID = P_CELL_ID
ONCLICK = L_EVENT CHECKED = 'false' ).
ENDCASE.
ENDCASE.
ENDMETHOD.
Hope this will solve your problem.
<b><i>* Reward each helpful answer.</i></b>
Raja T
Message was edited by:
Raja T
Similar Messages
-
How to insert check box value in table?
Hi all
kindly help me how to insert check box value in database. what code i have to use as i am new in programing.
thanx in advanceHi,
There is no "Check box" in a table, a check box is a GUI (Graphical user interface) item.
What you want is to store a boolean value in a table. For that you can use the varchar2(1) datatype and store Y or N. (or anything else)
(you cannot define boolean as a datatype for a column).
If you're using a front-end application like apex then it might be useful for you to read the documentation about chekc boxes :
http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/check_box.htm#CHDDFBFH
(for the rest if it's Oracle Forms then everything is already said).
Edited by: user11268895 on Aug 17, 2010 10:44 AM -
How to insert check box in pages?
This may be a dumb question, but how to insert check box in Pages? Thanks
Hi ...
Try this thread > Checkboxes in Pages?: Apple Support Communities -
How to Insert check box value into database column
Hi All,
I had checkbox group in a region which is using an LOV......and having 18 items in that lov.
i.e. Total 18 checkboxes in Total. User has to select only 2 checkboxes from that 18.
I created two columns for storing two values of checkboxes. How to insert two selectives in two columns.........Moreover, How to give the query i.e. how to know which values are selected.
Please Help me in achieving this. apart from the two columns (Focus1,Focus2) .......One more column(l_spo_val) is there which is a foreign key.
My Insert Statement is like this:
INSERT INTO SPO_RESEARCH_FOCUS VALUES(l_spo_val
,:P4_RESEARCH_LIST_1
,:P4_RESEARCH_LIST_2);
Please narrate the code if possible.
Thanks,
Sekhar.Hi Denes,
I saw the example in your workspace and it is the same what exactly i want and instead of storing in one column i want to store the two selected values into two different columns. Also i need to restrict the selection of checkboxes upto 2 only. So If the user tries to select the third check box it doesnt have to accept.
Even I am ready to change my table as according to your example i.e. creating only one column. Store the values of selection into that column.
I was unable to see how u wrote the logic (Code) for your example in your workspace. It helps alot if you provide me the code for that example(Multi Checkbox One Column).
I was facinated after watching your examples in your workspace and am very much interested to know more about Apex.
Please help me insolving this as it is long pending issue for my requirement.
Thanks a lot again,
Sekhar.
Edited by: Sekhar Nooney on Mar 26, 2009 4:35 AM -
How do you get different check box fields to display based upon a list box selection?
I am a relative newbie with LifeCycle Designer ES using v.8.2.1 to create interactive forms to replace manual hardcopies. I am working on a form that has a few pull down list boxes. I want different check box fields to display based upon the selection of an item from one of the pull down lists.
Any guidance on the best way to accomplish this would be greatly appreciated.Hi,
Here is a sample with script in the change event of the dropdown. You may want to clear previous checkbox choices once the subform is hidden.
It is good to group objects in a subform - that way you only need to hide the subform and not each object in turn.
Good luck,
Niall -
How to print Check Box in smartform
HI,
How to print check box in smartforms. I am using Include Sap Symbol but in the print it is coming as #. Do we need to do any setting like we do for barcode?
Thanks
Raghavendrahi,
u can print a check box in different ways.. by inserting symbols and making window as check box..
once go through the thread u will get to k now differnt ways
putting checkboxes in smartform?
Please Close this thread.. when u r problem is solved. Reward all Helpful answers
Regards
Naresh Reddy K -
How to display check box in atable control
hi
here is my requirement
how can i display check box in table control and also when i check that check box it has to dispaly one pop up screen with the records of table control row
points will be rewarded
Thanks&Regards
Nagesh.ParuchuriHi,
See this code for how to display check box in atable control
*---- Table declaration.
TABLES: KNA1.
CONTROLS TC1 TYPE TABLEVIEW USING SCREEN 200.
CONTROLS TC2 TYPE TABLEVIEW USING SCREEN 300.
*---- Data declaration.
DATA:OKCODE LIKE SY-UCOMM.
DATA:V_KNA1 LIKE KNA1.
*DATA:ERROR TYPE C.
*---- Internal Table declaration.
DATA:BEGIN OF IT_TAB OCCURS 0,
CHK,
VBELN TYPE VBELN_VA,
KUNNR TYPE KUNAG,
ERDAT TYPE ERDAT,
AUDAT TYPE AUDAT,
VBTYP TYPE VBTYP,
END OF IT_TAB.
DATA:BEGIN OF IT_TAB1 OCCURS 0,
VBELN TYPE VBELN_VA,
POSNR TYPE POSNR_VA,
MATNR TYPE MATNR,
MATWA TYPE MATWA,
PMATN TYPE PMATN,
END OF IT_TAB1.
*& Module USER_COMMAND_0100 INPUT
MODULE USER_COMMAND_0100 INPUT.
OKCODE = SY-UCOMM.
CASE OKCODE.
WHEN 'DISP' OR SPACE.
SELECT *
FROM VBAK
INTO CORRESPONDING FIELDS OF TABLE IT_TAB
WHERE KUNNR = KNA1-KUNNR.
IF SY-SUBRC <> 0.
MESSAGE 'No sales document exists'(001) TYPE 'I'.
ENDIF.
LEAVE TO SCREEN 200.
CLEAR OKCODE.
*--- To leave Transaction
WHEN 'BACK' .
LEAVE PROGRAM.
CLEAR OKCODE.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module validate_kunnr INPUT
MODULE VALIDATE_KUNNR INPUT.
V_KNA1 = KNA1.
SELECT SINGLE *
FROM KNA1
WHERE KUNNR = KNA1-KUNNR.
*-----Process error condition
IF SY-SUBRC <> 0.
CLEAR KNA1.
KNA1-KUNNR = V_KNA1-KUNNR.
CASE OKCODE..
WHEN 'BACK' OR 'EXIT' .
LEAVE PROGRAM.
ENDCASE.
MESSAGE 'Customer Does Not Exist'(002) TYPE 'I'.
LEAVE TO SCREEN 100.
ENDIF.
ENDMODULE. " validate_kunnr INPUT
*& Module STATUS_0100 OUTPUT
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'PF'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0200 INPUT
MODULE USER_COMMAND_0200 INPUT.
CASE OKCODE.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE TO SCREEN 100.
CLEAR OKCODE.
CLEAR IT_TAB1.
WHEN 'DISP' .
CLEAR OKCODE.
READ TABLE IT_TAB WITH KEY CHK = 'X'.
IF SY-SUBRC = 0.
SELECT VBELN POSNR MATNR MATWA PMATN
FROM VBAP
INTO TABLE IT_TAB1
WHERE VBELN = IT_TAB-VBELN.
IF SY-SUBRC = 0.
SORT IT_TAB.
DESCRIBE TABLE IT_TAB LINES TC1-LINES.
LEAVE TO SCREEN 300.
ELSE.
MESSAGE E016(YBHV).
ENDIF.
ELSE.
MESSAGE 'Please select one record' TYPE 'I'.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Module STATUS_0200 OUTPUT
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'PF3'.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module USER_C.OMMAND_0300 INPUT
text
MODULE USER_COMMAND_0300 INPUT.
SET PF-STATUS 'PF3'.
CASE OKCODE.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
CLEAR OKCODE.
LEAVE TO SCREEN 200.
ENDCASE.
ENDMODULE. " USER_COMMAND_0300 INPUT
*& Module modify INPUT
MODULE MODIFY INPUT.
MODIFY IT_TAB INDEX TC1-CURRENT_LINE.
ENDMODULE. " modify INPUT
*& Module okcode OUTPUT
text
MODULE OKCODE OUTPUT.
CLEAR OKCODE.
ENDMODULE. " okcode OUTPUT
Reward Pointsa If usefull
Regards
Fareedas -
How to create check box in tabular form
Dear Friends
i have craeaed tabular form .Recently all column are default text field but i want to change some column from text field to check box .
i have try it with simple check box but there is no option to pass return value in to table.
How to create check box in tabular from.
select
"CLAIM_ID",
"CLAIM_ID" CLAIM_ID_DISPLAY,
"EMPLOYEE_ID",
"CLAIM_DATE",
"START_FROM",
"END_TO",
"REIMB_NAME",
"REIMB_AMOUNT",
"REMARK",
"ACTIVE_FLAG",
"STATUS",
"APPROVE_NO",
"APPROVE_FLAG"
from "EMP_REIMBURSEMENT_DTL
{code}
i want to change column from text field to Check box
Cplumn Name :
1.ACTIVE_FLAG Return value 'Y'
2.STATUS Return Value "APPROVE"
How to pass it with check box in tabular form.
ThanksVisit this demo app:
http://apex.oracle.com/pls/otn/f?p=31517:1
Section VI has a lot of tabular form stuff with checkbox handling.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
https://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
. How to put Check box in every row in Table
Hi Friends,
I have one doubt in Webdynpro with java. How to put Check box in every row in Table?
For Exam My requirement is I am getting BAPI from ECC System. So I have to go given input details in first view and output details in SecondView. So in Second View I will taken Table that data will displayed in rows. I need each and every row first I need check box.
Here Select Check Box of particular row then click GetData button. That row data will be displayed in one popup window.
In table suppose 6 rows available in table. Every Row first Check box available.
empid, name, sal ,firstname, last Name
empid, name, sal ,firstname, last Name
empid, name, sal ,firstname, last Name
How to put Check box in every row in Table? can you send any examples applications
Regards
VijayHi Friend,
When we are getting BAPI From ECC System. that BAPI Have nodes and Attribues...in under node we can't create "CheckBox"
attribute.
So i am doing like this.I am create on Checbox attribue out side of Node. Check Box data type is boolean.
next i am creating table ( that table having rows and columns) Right click on table-->Click on Insert GroupedColumn->again right click on nsert GroupedColumn---> Here Select Check Box.
Okay...here i am getting one problem. i have got Check boxes .But i am select check box in first row. that time all check boxes will be selected.
i need select first row check box that only first row will be selected suppose i selected second row check box that only second will be selected.
i need this can u help me....
Regards
Vijay -
How to get check box in alv output
hi gurus
can anyone explian me how to get check box in alv output
it should not be a pop up window
i want to get in output itself
tahnk you
regards
kals.Hi
by using rs_selfield
ty to call dynamic subroutine..
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield. "#EC CALLED
read table rs-selfield with key cond = 'X'
endform.
see the below example
REPORT Z_GET_REFRESH no standard page heading.
type-pools : slis.
tables : makt,
mara.
data : i_fieldcat type slis_t_fieldcat_alv.
CONSTANTS :
gc_refresh TYPE syucomm VALUE '&REFRESH'.
data : begin of i_makt occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of i_makt.
data : v_repid like sy-repid,
g_user_command type slis_formname value 'USER_COMMAND',
g_status_set type slis_formname value 'SET_PF_STATUS',
lt_event_exit TYPE slis_t_event_exit,
ls_event_exit TYPE slis_event_exit.
DATA:LC_GLAY TYPE LVC_S_GLAY.
select-options s_matnr for mara-matnr .
start-of-selection.
select matnr maktx from makt into table i_makt
where matnr in s_matnr.
end-of-selection.
Fill the fieldcatlog
perform fill_field.
Call the FM
perform call_fm.
*& Form fill_field
text
--> p1 text
<-- p2 text
FORM fill_field.
data wa_fieldcat type slis_fieldcat_alv.
clear : wa_fieldcat.
wa_fieldcat-tabname = 'I_MAKT'.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-outputlen = '18'.
wa_fieldcat-seltext_l = 'Material #'.
wa_fieldcat-col_pos = '1'.
append wa_fieldcat to i_fieldcat.
clear : wa_fieldcat.
wa_fieldcat-tabname = 'I_MAKT'.
wa_fieldcat-fieldname = 'MAKTX'.
wa_fieldcat-outputlen = '40'.
wa_fieldcat-seltext_l = 'Material Desc'.
wa_fieldcat-col_pos = '2'.
append wa_fieldcat to i_fieldcat.
ENDFORM. " fill_field
*& Form call_fm
text
--> p1 text
<-- p2 text
FORM call_fm.
v_repid = sy-repid.
LC_GLAY-EDT_CLL_CB = 'X'.
CLEAR ls_event_exit.
ls_event_exit-ucomm = gc_refresh. " Refresh
ls_event_exit-after = 'X'.
APPEND ls_event_exit TO lt_event_exit.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = g_status_set
I_CALLBACK_USER_COMMAND = g_user_command
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 = LC_GLAY
IS_LAYOUT =
IT_FIELDCAT = i_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT = lt_event_exit
IS_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 = i_makt
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. " call_fm
FORM USER_COMMAND *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield. "#EC CALLED
data i_RSPARAMS like RSPARAMS occurs 0.
CASE R_UCOMM.
WHEN '&IC1'.
read table i_makt index rs_selfield-tabindex.
SET PARAMETER ID 'MAT' FIELD i_makt-matnr.
if not i_makt-matnr is initial.
call transaction 'MM02' and skip first screen.
endif.
when '&REFRESH'.
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
CURR_REPORT = v_repid
IMPORTING
SP =
TABLES
SELECTION_TABLE = i_RSPARAMS
EXCEPTIONS
NOT_FOUND = 1
NO_REPORT = 2
OTHERS = 3
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
submit z_get_refresh with selection-table i_RSPARAMS.
rs_selfield-refresh = 'X'.
ENDCASE.
MOVE '&REFRESH' TO r_ucomm.
ENDFORM.
FORM set_pf_status *
FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
DELETE Rt_extab WHERE fcode = gc_refresh.
SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'
EXCLUDING Rt_extab.
*SET PF-STATUS 'STANDARD' EXCLUDING rt_extab.
SET TITLEBAR sy-tcode.
ENDFORM. -
How to get check box in alv grid list output
hi gurus,
can anyone inform me
how to get check box in alv output it should not be a pop up window
thank you
regards
kals.or
hi go through the fallowing code.
code*&----
*& Report YGS_ALV_BOM *
REPORT YGS_ALV_BOM .
TABLES : MAST,STKO,STPO.
TYPE-POOLS: SLIS.
TYPES : BEGIN OF TY_MAST,
CHECK_BOX,
MATNR TYPE MAST-MATNR,
WERKS TYPE MAST-WERKS,
STLAN TYPE MAST-STLAN,
STLNR TYPE MAST-STLNR,
STLAL TYPE MAST-STLAL,
END OF TY_MAST.
TYPES : BEGIN OF TY_STKO,
STLTY TYPE STKO-STLTY,
STLNR TYPE STKO-STLNR,
STLAL TYPE STKO-STLAL,
STKOZ TYPE STKO-STKOZ,
BMENG TYPE STKO-BMENG,
BMEIN TYPE STKO-BMEIN,
END OF TY_STKO.
TYPES : BEGIN OF TY_STPO,
LIGHTS,
STLTY TYPE STPO-STLTY,
STLNR TYPE STPO-STLNR,
STLKN TYPE STPO-STLKN,
STPOZ TYPE STPO-STPOZ,
IDNRK TYPE STPO-IDNRK,
MENGE TYPE STPO-MENGE,
MEINS TYPE STPO-MEINS,
END OF TY_STPO.
DATA : IT_MAST TYPE TABLE OF TY_MAST,
WA_MAST TYPE TY_MAST,
IT_STKO TYPE TABLE OF TY_STKO,
WA_STKO TYPE TY_STKO,
IT_STPO TYPE TABLE OF TY_STPO,
WA_STPO TYPE TY_STPO.
DATA : lt_fieldcat TYPE slis_t_fieldcat_alv,
ls_layout TYPE slis_layout_alv,
ls_event TYPE slis_alv_event,
lt_event TYPE slis_t_event,
it_sortinfo type slis_t_sortinfo_alv,
ls_header TYPE slis_listheader,
lt_header TYPE slis_t_listHEADER.
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
SELECT-OPTIONS : S_MATNR FOR MAST-MATNR.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM BUILD_FIELDCAT USING LT_FIELDCAT.
PERFORM BUILD_LAYOUT.
END-OF-SELECTION.
PERFORM DISPLAY_DATA.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form GET_DATA .
REFRESH : IT_MAST.
SELECT MATNR
WERKS
STLAN
STLNR
FROM MAST
INTO CORRESPONDING FIELDS OF TABLE IT_MAST
WHERE MATNR IN S_MATNR.
endform. " GET_DATA
*& Form BUILD_FIELDCAT
text
--> p1 text
<-- p2 text
form BUILD_FIELDCAT USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
REFRESH : LT_FIELDCAT.
L_FIELDCAT-COL_POS = 1.
L_FIELDCAT-FIELDNAME = 'MATNR'.
L_FIELDCAT-TABNAME = 'IT_MAST'.
L_FIELDCAT-REF_FIELDNAME = 'MATNR'.
L_FIELDCAT-REF_TABNAME = 'MAST'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 2.
L_FIELDCAT-FIELDNAME = 'WERKS'.
L_FIELDCAT-TABNAME = 'IT_MAST'.
L_FIELDCAT-REF_FIELDNAME = 'WERKS'.
L_FIELDCAT-REF_TABNAME = 'MAST'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 3.
L_FIELDCAT-FIELDNAME = 'STLNR'.
L_FIELDCAT-TABNAME = 'IT_MAST'.
L_FIELDCAT-REF_FIELDNAME = 'STLNR'.
L_FIELDCAT-REF_TABNAME = 'MAST'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
endform. " BUILD_FIELDCAT
*& Form BUILD_LAYOUT
text
--> p1 text
<-- p2 text
form BUILD_LAYOUT .
CLEAR LS_LAYOUT.
LS_LAYOUT-BOX_FIELDNAME = 'CHECK_BOX'.
LS_LAYOUT-BOX_TABNAME = 'IT_MAST'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_DATA
text
--> p1 text
<-- p2 text
form DISPLAY_DATA .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT = LS_LAYOUT
IT_FIELDCAT = LT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_MAST
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_DATA
FORM PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'YSTATUS' OF PROGRAM SY-REPID
EXCLUDING RT_EXTAB.
ENDFORM.
FORM USER_COMMAND USING RF_UCOMM TYPE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
CASE RF_UCOMM.
WHEN '&NEXT'.
PERFORM GET_DATA_BOM .
PERFORM BUILD_FIELDCAT_BOM USING LT_FIELDCAT.
PERFORM BUILD_LAYOUT_BOM.
PERFORM DISPLAY_DATA_BOM.
ENDCASE.
ENDFORM.
*& Form GET_DATA_BOM
text
--> p1 text
<-- p2 text
form GET_DATA_BOM .
CLEAR : WA_STPO,
WA_MAST.
REFRESH : IT_STPO.
DATA : IT_CHECK TYPE TABLE OF TY_MAST.
LOOP AT IT_MAST INTO WA_MAST.
IF WA_MAST-CHECK_BOX EQ 'X'.
APPEND WA_MAST TO IT_CHECK.
ENDIF.
ENDLOOP.
SELECT STLTY
STLNR
STLKN
VGKNT
IDNRK
MENGE
MEINS
FROM STPO
INTO CORRESPONDING FIELDS OF TABLE IT_STPO
FOR ALL ENTRIES IN IT_CHECK
WHERE IDNRK EQ IT_CHECK-MATNR.
CLEAR WA_STPO.
LOOP AT IT_STPO INTO WA_STPO.
SELECT SINGLE * FROM MAST WHERE MATNR EQ WA_STPO-IDNRK.
IF SY-SUBRC = 0.
WA_STPO-LIGHTS = '2'.
ELSE.
WA_STPO-LIGHTS = '1'.
ENDIF.
MODIFY IT_STPO FROM WA_STPO.
ENDLOOP.
endform. " GET_DATA_BOM
*& Form BUILD_FIELDCAT_BOM
text
--> p1 text
<-- p2 text
form BUILD_FIELDCAT_BOM USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA : L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
REFRESH : LT_FIELDCAT.
L_FIELDCAT-COL_POS = 1.
L_FIELDCAT-FIELDNAME = 'STLTY'.
L_FIELDCAT-TABNAME = 'IT_STPO'.
L_FIELDCAT-REF_FIELDNAME = 'STLTY'.
L_FIELDCAT-REF_TABNAME = 'STPO'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 2.
L_FIELDCAT-FIELDNAME = 'STLNR'.
L_FIELDCAT-TABNAME = 'IT_STPO'.
L_FIELDCAT-REF_FIELDNAME = 'STLNR'.
L_FIELDCAT-REF_TABNAME = 'STPO'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 3.
L_FIELDCAT-FIELDNAME = 'STLKN'.
L_FIELDCAT-TABNAME = 'IT_STPO'.
L_FIELDCAT-REF_FIELDNAME = 'STLKN'.
L_FIELDCAT-REF_TABNAME = 'STPO'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 4.
L_FIELDCAT-FIELDNAME = 'IDNRK'.
L_FIELDCAT-TABNAME = 'IT_STPO'.
L_FIELDCAT-REF_FIELDNAME = 'IDNRK'.
L_FIELDCAT-REF_TABNAME = 'STPO'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
L_FIELDCAT-COL_POS = 5.
L_FIELDCAT-FIELDNAME = 'MENGE'.
L_FIELDCAT-TABNAME = 'IT_STPO'.
L_FIELDCAT-REF_FIELDNAME = 'MENGE'.
L_FIELDCAT-REF_TABNAME = 'STPO'.
APPEND L_FIELDCAT TO LT_FIELDCAT.
endform. " BUILD_FIELDCAT_BOM
*& Form BUILD_LAYOUT_BOM
text
--> p1 text
*<-- p2 text
form BUILD_LAYOUT_BOM .
CLEAR : LS_LAYOUT.
LS_LAYOUT-LIGHTS_FIELDNAME = 'LIGHTS'.
LS_LAYOUT-LIGHTS_TABNAME = 'IT_STPO'.
endform. " BUILD_LAYOUT_BOM
*& Form DISPLAY_DATA_BOM
text
--> p1 text
<-- p2 text
form DISPLAY_DATA_BOM .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER_COMMAND_BOM'
I_CALLBACK_TOP_OF_PAGE = 'TOP9'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = 'ALV_BACKGROUND'
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = LS_LAYOUT
IT_FIELDCAT = LT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_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_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_STPO
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_DATA_BOM
FORM TOP9 .
CLEAR LS_HEADER.
REFRESH LT_HEADER.
LS_HEADER-TYP = 'H'.
LS_HEADER-INFO = 'BILL OF MATERIALS'.
APPEND LS_HEADER TO LT_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = LT_HEADER
I_LOGO = 'ENJOYSAP_LOGO'
I_END_OF_LIST_GRID =
ENDFORM.
FORM USER_COMMAND_BOM USING RF_UCOMM_BOM LIKE SY-UCOMM
SEL_FIELD TYPE SLIS_SELFIELD.
CASE RF_UCOMM_BOM.
WHEN '&IC1'.
SET PARAMETER ID 'MAT' FIELD WA_STPO-IDNRK.
SET PARAMETER ID 'WRK' FIELD WA_MAST-WERKS.
SET PARAMETER ID 'CSA' FIELD WA_MAST-STLAN.
CALL TRANSACTION 'CS03' AND SKIP FIRST SCREEN.
ENDCASE.[/code] -
How to create check box in ALV Reports?
how to create check box in ALV Reports?
Hi
check the report BCALV_TEST_GRID_EDITABLE
or
check this report
REPORT ZRFC346_TST.
TABLES:SFLIGHT,RL034.
TYPE-POOLS:SLIS.
INCLUDE:<ICON>,<SYMBOL>.
DATA: G_REPID LIKE SY-REPID,
G_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
G_IT_SORT TYPE SLIS_T_SORTINFO_ALV,
G_LAYOUT TYPE SLIS_LAYOUT_ALV,
G_TABNAME_HEADER TYPE SLIS_TABNAME,
G_TABNAME_ITEM TYPE SLIS_TABNAME,
G_KEYINFO TYPE SLIS_KEYINFO_ALV,
G_VARIANT LIKE DISVARIANT,
G_EXTAB TYPE SLIS_T_EXTAB,
I_SLIS_EXIT_BY_USER TYPE SLIS_EXIT_BY_USER.
DATA: XEVENT TYPE SLIS_T_EVENT,
AEVENT TYPE SLIS_ALV_EVENT,
VARIANT LIKE DISVARIANT,
LAYOUT TYPE SLIS_LAYOUT_ALV,
ASP_GROUP TYPE SLIS_SP_GROUP_ALV,
GT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV,
EXTAB TYPE SLIS_T_EXTAB WITH HEADER LINE,
XFIELD TYPE SLIS_T_FIELDCAT_ALV,
AFIELD TYPE SLIS_FIELDCAT_ALV,
G_SUCOMM LIKE SY-UCOMM,
G_SELFLD TYPE SLIS_SELFIELD.
DATA: SAV_SY_REPID LIKE SY-REPID.
CONSTANTS: CON_SFLIGHT TYPE LVC_FNAME VALUE 'SFLIGHT',
CON_DISPLAY_FULL TYPE I VALUE 3.
Data to be displayed
DATA: BEGIN OF GT_SFLIGHT OCCURS 0.
INCLUDE STRUCTURE SFLIGHT.
DATA:ACTIVATE(1).
DATA: END OF GT_SFLIGHT.
INITIALIZATION.
*........Initialisierung...............................................
PERFORM INITIALIZATION_RL034.
*........Field cata....................................................
PERFORM FIELD_CAT.
*........SPECIAL GROUP.................................................
PERFORM E07_SP_GROUP_BUILD USING GT_SP_GROUP[].
START-OF-SELECTION.
Selection
SELECT * FROM SFLIGHT INTO TABLE GT_SFLIGHT.
*........ALV CALL.......................................................
PERFORM ALV_CALL.
PERFORM USER_COMMAND_LOCAL USING G_SUCOMM G_SELFLD.
FORM USER_COMMAND_LOCAL *
--> G_UCOMM *
--> G_SELFIELD *
FORM USER_COMMAND_LOCAL USING G_UCOMM LIKE SY-UCOMM
G_SELFIELD TYPE SLIS_SELFIELD.
CASE G_UCOMM.
WHEN 'ACT'.
ENDCASE.
ENDFORM.
FORM ALV_CALL *
FORM ALV_CALL.
Call ABAP List Viewer (ALV)
G_LAYOUT-BOX_FIELDNAME = 'ACTIVATE'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BACKGROUND_ID = 'ALV_BACKGROUND'
I_BYPASSING_BUFFER = SPACE
I_BUFFER_ACTIVE = SPACE
I_CALLBACK_PROGRAM = SAV_SY_REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND_LOCAL'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = 'SFLIGHT'
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = G_LAYOUT
IT_FIELDCAT = XFIELD[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS = GT_SP_GROUP[]
IT_SORT =
IT_FILTER =
IS_SEL_HIDE = 'X'
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = XEVENT
IT_EVENT_EXIT =
IS_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 = GT_SFLIGHT
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.
FORM status *
--> EXTAB *
FORM STATUS USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STAT' EXCLUDING EXTAB.
ENDFORM. " STATUS
*& Form INITIALIZATION_RL034
text
--> p1 text
<-- p2 text
FORM INITIALIZATION_RL034.
SAV_SY_REPID = SY-REPID.
ENDFORM. " INITIALIZATION_RL034
*& Form DEFINE_EVENTS_RL034
text
--> p1 text
<-- p2 text
FORM DEFINE_EVENTS_RL034.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = XEVENT.
exceptions
list_type_wrong = 1
others = 2.
ENDFORM. " DEFINE_EVENTS_RL034
*& Form FIELD_CAT
text
--> p1 text
<-- p2 text
FORM FIELD_CAT.
DATA: LS_FCAT TYPE SLIS_FIELDCAT_ALV,
L_LIN TYPE I.
REFRESH XFIELD.
1. per Default eingeblendete Felder *
*........Ikone/Symbol..................................................
CLEAR AFIELD.
DATA: LS1_FCAT TYPE SLIS_FIELDCAT_ALV,
L_LIN1 TYPE I.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = CON_SFLIGHT
I_BYPASSING_BUFFER = SPACE
I_BUFFER_ACTIVE = SPACE
CHANGING
CT_FIELDCAT = XFIELD
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
DESCRIBE TABLE XFIELD LINES L_LIN1.
ADD 1 TO L_LIN1.
CLEAR LS_FCAT.
LS1_FCAT-FIELDNAME = 'ACTIVATE'.
LS1_FCAT-CHECKBOX = 'X'.
LS1_FCAT-KEY = 'X'.
LS1_FCAT-INPUT = 'X'.
LS1_FCAT-EDIT = 'X'.
LS1_FCAT-INTTYPE = 'C'.
LS1_FCAT-DATATYPE = 'CHAR'.
LS1_FCAT-INTLEN = 1.
LS1_FCAT-COL_POS = L_LIN1.
LS1_FCAT-SELTEXT_S = LS1_FCAT-FIELDNAME.
LS1_FCAT-SELTEXT_M = LS1_FCAT-FIELDNAME.
LS1_FCAT-SELTEXT_L = LS1_FCAT-FIELDNAME.
LS1_FCAT-SP_GROUP = 'A'.
APPEND LS1_FCAT TO XFIELD.
ADD 1 TO L_LIN.
ENDFORM. " FIELD_CAT
FORM E07_SP_GROUP_BUILD USING E07_LT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV.
DATA: LS_SP_GROUP TYPE SLIS_SP_GROUP_ALV.
CLEAR LS_SP_GROUP.
LS_SP_GROUP-SP_GROUP = 'A'.
LS_SP_GROUP-TEXT = 'SPECIAL'.
APPEND LS_SP_GROUP TO E07_LT_SP_GROUP.
ENDFORM.
Regards
Shiva -
How to print check box in ALV list display and how to pick selected ones
Hi
i am displaying one ALV list dispaly. for that im adding one check box fields by filling the fieldcat as below:
wa_fldcat-checkbox = 'X'.
wa_fldcat-edit = 'X'.
but the check box is showing disable mode only. i want to display that check box and if i select that check box i want pick that records. for ALV grid i found one FM to pick records of selectedones as below.
DATA ref_grid TYPE REF TO cl_gui_alv_grid.
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF ref_grid IS NOT INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
but how can i do for list display to pick those selected one records.
Can any one sugget regarding this.
Thanks in advance.
Rahul.Hi,
Thanks. now it's enabled. but how can we pick the records from that list whichever i selected through that check box.
i found this one for ALV grid:
DATA ref_grid TYPE REF TO cl_gui_alv_grid.
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF ref_grid IS NOT INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
but how for ALV normal list display.
Thanks.
rahul -
How to insert the new field to standard scheduling agreement script form.
Hi Gurus,
how to insert the new fields to standad sheduling agreement script form. its a need for me, i want to display the AEDAT field in scheduling agreement form ,
The below one is my requirement,
ex:- Itu2019s requested the change of Scheduling Agreement printout. Itu2019s requested for this type of document, the insertion, into the field u201CData Emissionu201D into the print, of the document last modify date instead of the document creation date. (This change will be done only for position change into the Scheduling Agreement). No change into the PO.
Change SAPSCRIPT printout. Introduction, into the Scheduling Agreement, of last modified
document date (field EKPO-AEDAT).
Thanks & Regards
chinnuopen TNAPR table and give the output type you need to modify.... get the print program name and check if some structure already have the date you wanted... if you have it already... then open the form in SE71 tr. and provide the strcuture name - feild in the position you want to have the date...
se71--->
&<str. name>-AEDAT& -
How can multiple check boxes be added at one time to a form?
How can multiple check boxes be added at one time to a form?
Thanks for your response, but copying and pasting creates a link. If the user places a check mark in one of the boxes, all the rest of the boxes will have a check mark also. I will research this some more.
Carol Deatherage
Receptionist
Novar/Honeywell
1000 SE 14th Street
Bentonville, AR 72712
Office: (800) 341-7795
Fax: (479) 271-0657
[email protected]<mailto:[email protected]>
Your feedback is important to us! Please take a moment to rate this response.
Click Here to Access the Survey<https://www.surveymonkey.com/s/NovarSurvey>!
This email and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. If you have received this email in error destroy it immediately.
Novar Confidential ***
Maybe you are looking for
-
Two-sided printing with Windows 7
After installing Windows 7 on a network computer my officejet L7680 prints the same page on both sides of a 2 sided document. I cannot get it to print the 2nd page on the back side if I want more then 1 copy. If I print just one copy the printer prin
-
My iphone 4 wont restore i have tried all day
I was using facebook and bam the screen literally faded away. I tried turning back on but it froze at the apple logo. So i plugged into laptop and it appeared in itunes in recovery mode iv tried all day to restore it but it fails with a error 14 code
-
Changing a Message type on Purchase Order
Hi guys, How can I change a standard message type on Purchase Order ? For example : On Purchase Order, when a insert a new Contract item number, occurs the Error message below : 'Contract vendor 610065 differs from vendor 610195' But, I neet to chang
-
HT1766 How to transfer a backup to an iphone.
Hi! I bought an IPhone 5 and unfortunately it wont back to my older version of itunes. Luckily I have an old Iphone 3 that's compatible with my itunes and I backed up my contacts and such about a month ago. However, the number for this iphone 3 isnt
-
How do you turn off QuickView in WebAccess? It's not set in the user's client mailbox. Thanks!