How to find the check box selected while using Class in ALV grid display
hi,
I am displaying the ALV report using Class
For Example: CALL METHOD MYGRID->SET_TABLE_FOR_FIRST_DISPLAY EXPORTING I_STRUCTURE_NAME = 'ACC1'
IS_VARIANT = GS_VARIANT
I_SAVE = 'A' "XSAVE
IS_LAYOUT = LOUT
CHANGING IT_FIELDCATALOG = IT_FIELD
IT_OUTTAB = ACC_NO[].
In output i am getting 10 customer with check box, how do i find that customer number is selected.
HI,
Once user selects a check box, he would CLICK on a button ( say PROCESS )inorder to do the processing for the selected records. So in the PAI, under the EVENT ( OK CODE ) of the Button ( say PROCESS ), write the following code.
CALL METHOD MYGRID->check_changed_data.
Now,
Loop at acc_no where check = `X`.
Do the processing.
endloop.
Best regards,
Prashant
Similar Messages
-
Help requested: How to pass the (check box) selected rows data to other scr
Hi friends, Here is a situation where I have to pick only those records data which i select by checking the check boxes and carry on to next screen where I have to display them and do some processing on such selected rows of data. Can any one suggest me how to code this. Thanks in advance.
Hi Subbarao,
One way is to check if the field is selected by checking if the field value = 'X'.
If it is a table control we will have to loop and find out which all records are selected..it is notable that the check box field will mostly be of single character and contain 'X' if it is checked and space if not checked
Based on the structure where the check box is held we may have to implement various logic to retrieve whether the field is checked or not....for instance we can move data to another internal table for which the checkbox is checked and can retrieve it from the next screen
Pls check,revert and reward if helpful
Regards
Byju -
How to name the Check Box as "Want Free Gift" using PARAMETERS statements
Hi all,
I am new to check boxes. I have a existing report where I have to add a check box to the selection screen.
So i said
PARAMETERS: p_cncldc AS CHECKBOX.
everythibng is fine and I get the check box on the selection screen. when i execute the report i get the name of check box as p_cncldc. but i want the name of the check box as "Want Free Gift".
How to name the check box as "Want Free Gift".
if i am saying
PARAMTERS: Want Free Gift AS CHECKBOX. it says a syntax error saying it canot be more that 8 chars.
Some one please help. I am new to Check boxes
Regards,
Jessica Sam
Edited by: jessica sam on Mar 31, 2009 10:37 PMText on the Right hand side of check box.
selection-screen begin of block b1.
selection-screen begin of line.
parameters: w_check as checkbox.
selection-screen: comment 4(30) TEST .
selection-screen end of line.
selection-screen end of block b1.
INITIALIZATION.
test = 'Want Free Gift AS CHECKBOX'.
Text on the Left hand side of check box.
selection-screen begin of block b1.
selection-screen begin of line.
selection-screen: comment 2(30) TEST .
parameters: w_check as checkbox.
selection-screen end of line.
selection-screen end of block b1.
INITIALIZATION.
test = 'Want Free Gift AS CHECKBOX'.
OR:
GOTO(Menubar)>Text Elements>Selection Texts
Regards,
Gurpreet -
How to activate the Check box in Purchase Order after Goods Receipt
Hi All,
How to activate the check box after Goods receipt of Purchase order in Item view (Goods Receipt is completed).
Where t make the settings in SPRO.
Regards,
Shailendra HadkarHi
SPRO - SAP IMG- Material management - Inventory management and physical inventory - Goods receipt - create purchase order automatically - activate auto Po creation for movement type.
Then activate the auto PO creation in Vendor master - Purchasing view
Check it out.
Regards,
raman -
Reg - how to find the purpose of methods in a class
hi everyone,
can u plz help me with how to find the purpose of methods in a class???????
a description abt the methods in a class??????
thx in advance,
regards,
balaji.sHi Balaji
Pls find some stuff.
reward pts if help.
The following statements define the structure of a class:
· A class contains components
· Each component is assigned to a visibility section
· Classes implement methods
The following sections describe the structure of classes in more detail.
Class Components
The components of a class make up its contents. All components are declared in the declaration part of the class. The components define the attributes of the objects in a class. When you define the class, each component is assigned to one of the three visibility sections, which define the external interface of the class. All of the components of a class are visible within the class. All components are in the same namespace. This means that all components of the class must have names that are unique within the class.
There are two kinds of components in a class - those that exist separately for each object in the class, and those that exist only once for the whole class, regardless of the number of instances. Instance-specific components are known as instance components. Components that are not instance-specific are called static components.
In ABAP Objects, classes can define the following components. Since all components that you can declare in classes can also be declared in interfaces, the following descriptions apply equally to interfaces.
Attributes
Attributes are internal data fields within a class that can have any ABAP data type. The state of an object is determined by the contents of its attributes. One kind of attribute is the reference variable. Reference variables allow you to create and address objects. Reference variables can be defined in classes, allowing you to access objects from within a class.
Instance Attributes
The contents of instance attributes define the instance-specific state of an object. You declare them using the DATAstatement.
Static Attributes
The contents of static attributes define the state of the class that is valid for all instances of the class. Static attributes exist once for each class. You declare them using the CLASS-DATA statement. They are accessible for the entire runtime of the class.
All of the objects in a class can access its static attributes. If you change a static attribute in an object, the change is visible in all other objects in the class.
The technical properties of instance attributes belong to the static properties of a class. It is therefore possible to refer in a LIKE addition to the visible attributes of a class through the class component selector or through reference variables, without prior creation of an object.
Methods
Methods are internal procedures in a class that define the behavior of an object. They can access all of the attributes of a class. This allows them to change the data content of an object. They also have a parameter interface, with which users can supply them with values when calling them, and receive values back from them The private attributes of a class can only be changed by methods in the same class.
The definition and parameter interface of a method is similar to that of function modules. You define a method meth in the definition part of a class and implement it in the implementation part using the following processing block:
METHOD meth.
ENDMETHOD.
You can declare local data types and objects in methods in the same way as in other ABAP procedures (subroutines and function modules). You call methods using the CALL METHOD statement.
Instance Methods
You declare instance methods using the METHODSstatement. They can access all of the attributes of a class, and can trigger all of the events of the class.
Static Methods
You declare static methods using the CLASS-METHODSstatement. They can only access static attributes and trigger static events.
Special Methods
As well as normal methods, which you call using CALL METHOD, there are two special methods called constructor and class_constructor that are automatically called when you create an object or when you first access the components of a class.
reward pts if help.
deepanker -
How to read the check box value in alv report
hi experts,
i m working on one alv report where i m using the check box for field selection in alv display.
but i don't know how to read the only selected fields.
wa_fieldcat-fieldname = 'BOX'.
wa_fieldcat-tabname = 'IT_HEADER'.
wa_fieldcat-seltext_m = 'Box'.
wa_fieldcat-checkbox = 'X'.
wa_fieldcat-input = 'X'.
wa_fieldcat-edit = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'AUFNR'.
wa_fieldcat-tabname = 'IT_HEADER'.
wa_fieldcat-seltext_m = 'Sales Doc'.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
it_fieldcat = i_fieldcat[]
i_save = 'A'
it_events = v_events
TABLES
t_outtab = it_header
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
*& Form USER_COMMAND
text
-->R_UCOMM text
-->, text
-->RS_SLEFIELDtext
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
when '&RELEAS'.
endcase
endform.
i gone through some already posted que for same problem i tried options like
loop at it_header.
endloop.
but i m getting box field empty.
is there i missed something? plz sugeest.. if u have any other solution plz post...Have this code in your user command fm:
* For capturing changed data
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = w_grid.
CALL METHOD w_grid->check_changed_data
IMPORTING
e_valid = w_valid.
IF w_valid = 'X'.
loop at itab where mark = 'X'.
endloop.
ENDIF.
Regards,
Ravi -
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 with the check box in Suppliers - Contact Directory
EBS R 12.
I am in need of finding a solution for the following:
Payables Manager -> Suppliers -> Inquiry -> Select a supplier -> Go to "Contact Directory" -> Select a contact
Under User Account section there is a check box.
When I check the check box, the following action should happen:
1. The "Username" field must contain the value of the "Email".
2. Under "Responsibilities" "Sourcing Supplier" must be checked.
I don't know where to put my hands to solve this problem.
All helps will be appreciated. Thanks.Hi
SPRO - SAP IMG- Material management - Inventory management and physical inventory - Goods receipt - create purchase order automatically - activate auto Po creation for movement type.
Then activate the auto PO creation in Vendor master - Purchasing view
Check it out.
Regards,
raman -
How to color the check boxes?
Hello
I have couple of check boxes on my form, like....... my_check_box_monthly....... my_check_box_yearly.
I have 2 scenarios, so based on scenario, i hv to select either of the check box, as below
if scenario_1
make/display my_check_box_monthly with BLUE
else if scenario_2
make/display my_check_box_yearly. with RED
endif.
For text fields..... I know how to get i, its as below,
this.ui.oneOfChild.border.fill.color.value = "224,224,224";
Pls. let me know How to write the code for COLORING the check boxes in Java Script?
Thank youKindly check this code for changing border color of check box
If scenario1
this.ui.checkButton.border.edge.color.value = "0,0,255";
else if scenario2
this.ui.checkButton.border.edge.color.value = "255,0,0";
Thanks,
Anitha -
How to pass the check box values from one view to another view
Hi Experts,
I have a selection screen view which consists of check boxes.
WBS System status.
Release Completed Closed as 3 check boxes.
Note : The above ones are check boxes.
Based on the selection made by the user, those values needs to be passed to second view which retrieves the data and
displays the data accordingly.
At the same time if the user does not make any selection, then WBS System status should contain Released, Completed and Closed values and that needs to be sent to Second view.
Kindly advise.
Regards,
Chitrasenhi ,
make a attribute of type WDY_BOOLEAN to achieve this functionality
u need to follow these steps :
1 in side ur component controller , under the ATTRIBUTES tab , make 3 attributes say attr1 , attr2 and attr3 of type WDY_BOOLEAN
2 create a context node , cn_check and 3 context attribute ca_check1 , ca_check2 and ca_check3 in ur first view for
release , complete and close check boxes
3 inside the DOINIT of ur 1st view , set the attributes attr1 , attr2 and attr3 to blank
wd_comp_controller->attr1 = ' '
wd_comp_controller->attr2 = ' '
wd_comp_controller->attr3 = ' '
4 inside the method , where u r validating , if the check boxes are checked or not , read the attributes ca_check1 , ca_check2 and
ca_check3
DATA lo_nd_cn_check TYPE REF TO if_wd_context_node.
DATA lo_el_cn_check TYPE REF TO if_wd_context_element.
DATA ls_cn_check TYPE wd_this->element_cn_check.
DATA lv_ca_check1 LIKE ls_cn_check-ca_check1.
* navigate from <CONTEXT> to <CN_CHECK> via lead selection
lo_nd_cn_check = wd_context->get_child_node( name = wd_this->wdctx_cn_check ).
* get element via lead selection
lo_el_cn_check = lo_nd_cn_check->get_element( ).
* get single attribute
lo_el_cn_check->get_attribute(
EXPORTING
name = `CA_CHECK`
IMPORTING
value = lv_ca_check1 ).
IF lv_ca_check1 EQ 'X' .
wd_comp_controller->attr1 = ' X'
wd_comp_controller->attr2 = 'X '
wd_comp_controller->attr3 = ' X' -
How to enable the check box using cl_salv_table?
Hi Experts,
what code will change for to enable the check box in the following Report program?
REPORT ZMA_ALV_OOPS2.
TABLES:MARA.
TYPES:BEGIN OF T_MARA,
SEL TYPE C,
MATNR TYPE MARA-MATNR,
WERKS TYPE MARC-WERKS,
LGORT TYPE MARD-LGORT,
LABST TYPE MARD-LABST,
END OF T_MARA.
DATA:TB_MARA TYPE STANDARD TABLE OF T_MARA,
WA_MARA TYPE T_MARA.
DATA: GR_TABLE TYPE REF TO CL_SALV_TABLE.
DATA: GR_FUNCTIONS TYPE REF TO CL_SALV_FUNCTIONS.
DATA: GR_DISPLAY TYPE REF TO CL_SALV_DISPLAY_SETTINGS.
DATA: GR_COLUMNS TYPE REF TO CL_SALV_COLUMNS_TABLE.
DATA: GR_COLUMN TYPE REF TO CL_SALV_COLUMN_TABLE.
DATA: GR_SORTS TYPE REF TO CL_SALV_SORTS.
DATA: GR_AGG TYPE REF TO CL_SALV_AGGREGATIONS.
DATA: GR_FILTER TYPE REF TO CL_SALV_FILTERS.
DATA: GR_LAYOUT TYPE REF TO CL_SALV_LAYOUT.
DATA: GR_PRINT TYPE REF TO CL_SALV_PRINT.
DATA: GR_SELE TYPE REF TO CL_SALV_SELECTIONS.
DATA: GC_TRUE TYPE SAP_BOOL VALUE 'X'.
DATA: GR_ITEM TYPE REF TO CL_SALV_ITEM.
DATA: COLUMNNAME TYPE REF TO LVC_FNAME.
top of list for CCL
DATA: GR_CONTENT_CCL TYPE REF TO CL_SALV_FORM_ELEMENT.
DATA: GR_COL TYPE REF TO CL_SALV_COLUMN.
DATA: LT_SORT TYPE SALV_T_SORT_REF,
LS_SORT TYPE SALV_S_SORT_REF,
L_SEQUENCE TYPE SALV_DE_SORT_SEQUENCE,
T_SORT TYPE REF TO SALV_T_SORT_REF.
DATA: KEY TYPE SALV_S_LAYOUT_KEY.
DATA: COLOR TYPE LVC_S_COLO.
DATA: GR_EVENTS TYPE REF TO CL_SALV_EVENTS_TABLE.
DATA: GR_SELECTIONS TYPE REF TO CL_SALV_SELECTIONS.
**--Selection screen
SELECT-OPTIONS:S_MATNR FOR MARA-MATNR.
SELECT MATNR WERKS LGORT LABST
FROM MARD
INTO CORRESPONDING FIELDS OF TABLE TB_MARA
WHERE MATNR IN S_MATNR.
TRY.
CALL METHOD CL_SALV_TABLE=>FACTORY
IMPORTING
R_SALV_TABLE = GR_TABLE
CHANGING
T_TABLE = TB_MARA.
CATCH CX_SALV_MSG.
ENDTRY.
GR_TABLE->SET_SCREEN_STATUS(
PFSTATUS = 'SALV_TABLE_STANDARD'
REPORT = SY-REPID
SET_FUNCTIONS = GR_TABLE->C_FUNCTIONS_ALL ).
GR_FUNCTIONS = GR_TABLE->GET_FUNCTIONS( ).
GR_FUNCTIONS->SET_ALL( ABAP_TRUE ).
GR_DISPLAY = GR_TABLE->GET_DISPLAY_SETTINGS( ).
GR_SELE = GR_TABLE->GET_SELECTIONS( ).
GR_SELE->SET_SELECTION_MODE( ).
GR_TABLE->SET_TOP_OF_LIST( GR_CONTENT_CCL ).
*--- To change the column headings
GR_COLUMNS = GR_TABLE->GET_COLUMNS( ).
GR_COLUMNS->SET_OPTIMIZE( GC_TRUE ).
GR_SORTS = GR_TABLE->GET_SORTS( ).
TRY.
GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( 'SEL' ) .
GR_COLUMN->SET_CELL_TYPE( IF_SALV_C_CELL_TYPE=>CHECKBOX ).
GR_COLUMN->SET_LONG_TEXT( 'CHECKBOX' ).
CATCH CX_SALV_NOT_FOUND.
ENDTRY.
GR_COLUMN->SET_CELL_TYPE( 6 ).
GR_COLUMN->SET_SHORT_TEXT( 'Check Box' ).
GR_COLUMN->SET_LONG_TEXT( 'Check Box' ).
******Check box edit
TRY.
GR_SORTS->ADD_SORT( COLUMNNAME = 'MATNR' SEQUENCE =
IF_SALV_C_SORT=>SORT_UP ).
CATCH CX_SALV_DATA_ERROR
CX_SALV_NOT_FOUND
CX_SALV_EXISTING.
ENDTRY.
GR_LAYOUT = GR_TABLE->GET_LAYOUT( ).
KEY-REPORT = SY-REPID.
GR_LAYOUT->SET_KEY( KEY ).
GR_LAYOUT->SET_SAVE_RESTRICTION( CL_SALV_LAYOUT=>RESTRICT_NONE ).
TRY.
GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( 'MATNR' ).
CATCH CX_SALV_NOT_FOUND.
ENDTRY.
COLOR-COL = '8'.
COLOR-INT = '0'.
COLOR-INV = '1'.
GR_COLUMN->SET_COLOR( COLOR ).
GR_TABLE->DISPLAY( ).
Thanks,
Mahesh.Hi,
You can use the method set_selection_mode to automatically show the checkbox for each row..and use the method get_selected_rows to get the rows selected..
Check this sample report..
TYPES: BEGIN OF type_output,
matnr TYPE matnr,
END OF type_output.
DATA:lt_output TYPE STANDARD TABLE OF type_output,
lwa_rows TYPE int4,
lwa_output TYPE type_output,
lt_rows TYPE salv_t_row.
* Local declarations.
DATA: lr_table TYPE REF TO cl_salv_table,
lr_selections TYPE REF TO cl_salv_selections.
DATA: lr_columns TYPE REF TO cl_salv_columns_table.
START-OF-SELECTION.
* Prepare data.
lwa_output-matnr = 'TEST1'.APPEND lwa_output TO lt_output.
lwa_output-matnr = 'TEST2'.APPEND lwa_output TO lt_output.
lwa_output-matnr = 'TEST3'.APPEND lwa_output TO lt_output.
* Call the factory method
TRY.
cl_salv_table=>factory(
EXPORTING
list_display = 'X'
IMPORTING
r_salv_table = lr_table
CHANGING
t_table = lt_output ).
CATCH cx_salv_msg. "#EC NO_HANDLER
ENDTRY.
* Column selection
lr_selections = lr_table->get_selections( ).
lr_selections->set_selection_mode( if_salv_c_selection_mode=>row_column ).
lr_columns = lr_table->get_columns( ).
lr_columns->set_optimize( abap_true ).
* Display
lr_table->display( ).
* Get the selected rows.
lt_rows = lr_selections->get_selected_rows( ).
* Display the selected rows.
LOOP AT lt_rows INTO lwa_rows.
READ TABLE lt_output INTO lwa_output INDEX lwa_rows.
WRITE: / lwa_output-matnr.
ENDLOOP.
Thanks
Naren -
How to get the Checked box which are clicked
for(int k=0;.....
jsp code
<input type=checkbox name=checkbox value='<%=k%>' >
how to get the particular Checkbox which are checked???String[] checkedValues = request.getParameterValues("checkbox");You'll get an array filled with the values only for the checked boxes. In other words, if no boxes are checked, checkedValues will be null or checkedValues.length == 0, not sure, going from memory.
Hope this helps!
Patrick -
How to change the check box with the push button in itrator table rows
Hi all,
I want to change the check box of the itrator table rows with push button/ some thing better as to give
the table view more good look and user friendly.
Does any one has tried any other option in table view in place of check box
Thanks
BhagatThere are various objects which you can create via iterators. Please see the application SBSPEXT_TABLE for more details.
DATA: lo_text TYPE REF TO cl_htmlb_textview,
lo_ddlb TYPE REF TO cl_htmlb_dropdownlistbox,
lo_input TYPE REF TO cl_htmlb_inputfield,
lo_button TYPE REF TO cl_htmlb_button,
lo_chk_bx TYPE REF TO cl_htmlb_checkbox.
row_ref = p_row_data_ref.
CASE p_column_key.
WHEN 'EFF_DATE'. " Input field
CREATE OBJECT lo_input.
lo_input->id = p_cell_id.
lo_input->type = 'DATE'.
lo_input->showhelp = 'TRUE'.
lo_input->width = '60'.
lo_input->invalid = 'true'.
p_class = `ao`.
lo_input->value = get_column_value( p_column_key ).
p_replacement_bee = lo_input.
WHEN 'NEW_LOC'. " Drop down list box
CREATE OBJECT lo_ddlb.
GET REFERENCE OF gt_persa INTO lo_ddlb->table.
lo_ddlb->id = p_cell_id.
lo_ddlb->nameofkeycolumn = 'NAME'.
lo_ddlb->nameofvaluecolumn = 'VALUE'.
lo_ddlb->selection = get_column_value( p_column_key ).
lo_ddlb->selection = 'DUMMY'.
p_replacement_bee = lo_ddlb.
WHEN 'MON' . " Check box
CREATE OBJECT lo_chk_bx.
lo_chk_bx->id = p_cell_id.
lo_chk_bx->checked = get_column_value( p_column_key ).
p_replacement_bee = lo_chk_bx.
WHEN 'NEW_MGR_SRCH'. " Button
CREATE OBJECT lo_button.
lo_button->id = p_cell_id.
lo_button->text = 'Search Mgr'.
lo_button->onclientclick = 'script'.
p_replacement_bee = lo_button.
WHEN OTHERS. " Text
CREATE OBJECT lo_text.
lo_text->id = p_cell_id.
lo_text->wrapping = 'FALSE'.
lo_text->text = get_column_value( p_column_key ).
lo_text->design = 'STANDARD'.
lo_text->textcolor = 'POSITIVE'.
p_replacement_bee = lo_text.
ENDCASE.
Thanks
A -
How to create the Check box and Text Area inside the Assignment block
Dear all,
I am new to web UI development. my requirement is to create the Check box and Text box in the Assignment block. Can anyone help me to do this requirement.
Thanks & Regards,
Ashok.Hi,
Please place the below code in the GET_P methods of the fields.
For Text Area
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_textarea.
ENDCASE.
For Check Box
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_checkbox.
ENDCASE.
Regards,
Lakshmi.Y -
How to change the selected row color in an alv grid display ?
Hello ,
I WANT TO CHANGE THE COLOR OF THE SELECTED RECORDS IN AN ALV GRID DISPLAY ?
ITS URGENT..
WILL BE REWARDED...hai Ssnagh Samala
EXicut This report >
Hope It Will Meet U r Requirement.
If Found Helpfull Reward.
REPORT zcuitest_alv_07.
Use of colours in ALV grid (cell, line and column) *
Table
TABLES : mara.
Type
TYPES : BEGIN OF ty_mara,
matnr LIKE mara-matnr,
matkl LIKE mara-matkl,
counter(4) TYPE n,
free_text(15) TYPE c,
color_line(4) TYPE c, " Line color
color_cell TYPE lvc_t_scol, " Cell color
END OF ty_mara.
Structures
DATA : wa_mara TYPE ty_mara,
wa_fieldcat TYPE lvc_s_fcat,
is_layout TYPE lvc_s_layo,
wa_color TYPE lvc_s_scol.
Internal table
DATA : it_mara TYPE STANDARD TABLE OF ty_mara,
it_fieldcat TYPE STANDARD TABLE OF lvc_s_fcat,
it_color TYPE TABLE OF lvc_s_scol.
Variables
DATA : okcode LIKE sy-ucomm,
w_alv_grid TYPE REF TO cl_gui_alv_grid,
w_docking_container TYPE REF TO cl_gui_docking_container.
PARAMETERS : p_column AS CHECKBOX,
p_line AS CHECKBOX,
p_cell AS CHECKBOX.
START-OF-SELECTION.
PERFORM get_data.
END-OF-SELECTION.
PERFORM fill_catalog.
PERFORM fill_layout.
CALL SCREEN 2000.
*& Module status_2000 OUTPUT
text
MODULE status_2000 OUTPUT.
SET PF-STATUS '2000'.
ENDMODULE. " status_2000 OUTPUT
*& Module user_command_2000 INPUT
text
MODULE user_command_2000 INPUT.
DATA : w_okcode LIKE sy-ucomm.
MOVE okcode TO w_okcode.
CLEAR okcode.
CASE w_okcode.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " user_command_2000 INPUT
*& Module alv_grid OUTPUT
text
MODULE alv_grid OUTPUT.
IF w_docking_container IS INITIAL.
PERFORM create_objects.
PERFORM display_alv_grid.
ENDIF.
ENDMODULE. " alv_grid OUTPUT
*& Form create_objects
text
--> p1 text
<-- p2 text
FORM create_objects.
Ratio must be included in http://5..95
CREATE OBJECT w_docking_container
EXPORTING
ratio = 95
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
CREATE OBJECT w_alv_grid
EXPORTING
i_parent = w_docking_container.
ENDFORM. " create_objects
*& Form display_alv_grid
text
--> p1 text
<-- p2 text
FORM display_alv_grid.
CALL METHOD w_alv_grid->set_table_for_first_display
EXPORTING
is_layout = is_layout
CHANGING
it_outtab = it_mara
it_fieldcatalog = it_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
ENDFORM. " display_alv_grid
*& Form get_data
text
--> p1 text
<-- p2 text
FORM get_data.
SELECT * FROM mara UP TO 5 ROWS.
CLEAR : wa_mara-color_line, wa_mara-color_cell.
MOVE-CORRESPONDING mara TO wa_mara.
ADD 1 TO wa_mara-counter.
MOVE 'Blabla' TO wa_mara-free_text.
IF wa_mara-counter = '0002'
AND p_line = 'X'.
Color line
MOVE 'C410' TO wa_mara-color_line.
ELSEIF wa_mara-counter = '0004'
AND p_cell = 'X'.
Color cell
MOVE 'FREE_TEXT' TO wa_color-fname.
MOVE '5' TO wa_color-color-col.
MOVE '1' TO wa_color-color-int.
MOVE '1' TO wa_color-color-inv.
APPEND wa_color TO it_color.
wa_mara-color_cell] = it_color[.
ENDIF.
APPEND wa_mara TO it_mara.
ENDSELECT.
ENDFORM. " get_data
*& Form fill_catalog
text
--> p1 text
<-- p2 text
FORM fill_catalog.
Colour code : *
Colour is a 4-char field where : *
- 1st char = C (color property) *
- 2nd char = color code (from 0 to 7) *
0 = background color *
1 = blue *
2 = gray *
3 = yellow *
4 = blue/gray *
5 = green *
6 = red *
7 = orange *
- 3rd char = intensified (0=off, 1=on) *
- 4th char = inverse display (0=off, 1=on) *
Colour overwriting priority : *
1. Line *
2. Cell *
3. Column *
DATA : w_position TYPE i VALUE '1'.
CLEAR wa_fieldcat.
MOVE w_position TO wa_fieldcat-col_pos.
MOVE 'MATNR' TO wa_fieldcat-fieldname.
MOVE 'MARA' TO wa_fieldcat-ref_table.
MOVE 'MATNR' TO wa_fieldcat-ref_field.
APPEND wa_fieldcat TO it_fieldcat.
ADD 1 TO w_position.
CLEAR wa_fieldcat.
MOVE w_position TO wa_fieldcat-col_pos.
MOVE 'MATKL' TO wa_fieldcat-fieldname.
MOVE 'MARA' TO wa_fieldcat-ref_table.
MOVE 'MATKL' TO wa_fieldcat-ref_field.
Color column
IF p_column = 'X'.
MOVE 'C610' TO wa_fieldcat-emphasize.
ENDIF.
APPEND wa_fieldcat TO it_fieldcat.
ADD 1 TO w_position.
CLEAR wa_fieldcat.
MOVE w_position TO wa_fieldcat-col_pos.
MOVE 'COUNTER' TO wa_fieldcat-fieldname.
MOVE 'N' TO wa_fieldcat-inttype.
MOVE '4' TO wa_fieldcat-intlen.
MOVE 'Counter' TO wa_fieldcat-coltext.
APPEND wa_fieldcat TO it_fieldcat.
ADD 1 TO w_position.
CLEAR wa_fieldcat.
MOVE w_position TO wa_fieldcat-col_pos.
MOVE 'FREE_TEXT' TO wa_fieldcat-fieldname.
MOVE 'C' TO wa_fieldcat-inttype.
MOVE '20' TO wa_fieldcat-intlen.
MOVE 'Text' TO wa_fieldcat-coltext.
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. " fill_catalog
*& Form fill_layout
text
--> p1 text
<-- p2 text
FORM fill_layout.
Field that identify color line in internal table
MOVE 'COLOR_LINE' TO is_layout-info_fname.
Field that identify cell color in inetrnal table
MOVE 'COLOR_CELL' TO is_layout-ctab_fname.
ENDFORM. " fill_layout
Regards.
Eshwar.
Maybe you are looking for
-
FRM-47023: No such parameter named REPORTSSERVER exists in form MY_FORM.
Hi, After upgrade form to Forms [32 Bit] Version 10.1.2.0.2 (Production), I have come cross this following error when I try to run the from my form from developer in Windows through OC4J: "FRM-47023: No such parameter named REPORTSSERVER exists in fo
-
Username and pwd for FileAdapter with NFS as transport protocol
Hi, we installed PI 7.1 in windows env. to access a particular target location manually from the PI windows server, the procedure is: in the Start->Run or in the explorer bar we type the ip as " 121.1.2.3\SourceFolder", then the windows asks for the
-
How to Display WBS's with Zero values in a report created by CJE2
Hi All, I have created a report using CJE1 (Report painter). When I execute the report, it only shows WBS that have values. How do I display WBS elements that do NOT have values? i.e. display items with zero values. I'm certain there is a setting eit
-
I am trying to write code that will check whether the date entered by the user is valid. The following code works but only with the first month chosen e.g. if the user selects 31 Feburary the correct Dialog box will be displayed. I would like it so t
-
Is there such a thing as a universal color laserjet driver?
Is there such a thing as a universal color laserjet driver?