How to Edit in ALV?
Hi Experts,
I am working on a BAPI for creating Requsition where i am taking one ref PR and then modifying required details and then creating a new PR.
Everything is working fine but before creating the new PR i want to display that data in the form of alv grid and where i can edit the values and save then a new PR will be created as per modification on alv.
check the sample code wht i hv done....
SELECT * FROM EBAN INTO CORRESPONDING FIELDS OF TABLE IT_EBAN WHERE
BANFN EQ S_BANFN.
LOOP AT IT_EBAN.
ENDLOOP.
LOOP AT IT_EBAN.
T_REQUISITION_ITEMS-DOC_TYPE = 'ZSD'.
MOVE IT_EBAN-BNFPO TO T_REQUISITION_ITEMS-PREQ_ITEM.
MOVE IT_EBAN-ERNAM TO T_REQUISITION_ITEMS-CREATED_BY.
MOVE IT_EBAN-AFNAM TO T_REQUISITION_ITEMS-PREQ_NAME.
MOVE IT_EBAN-BADAT TO T_REQUISITION_ITEMS-PREQ_DATE.
MOVE IT_EBAN-TXZ01 TO T_REQUISITION_ITEMS-SHORT_TEXT.
MOVE IT_EBAN-MATNR TO T_REQUISITION_ITEMS-MATERIAL.
MOVE IT_EBAN-EMATN TO T_REQUISITION_ITEMS-PUR_MAT.
T_REQUISITION_ITEMS-PLANT = '4000'.
T_REQUISITION_ITEMS-STORE_LOC = 'YRD1'.
T_REQUISITION_ITEMS-PUR_GROUP = 'JSD'.
MOVE IT_EBAN-MATKL TO T_REQUISITION_ITEMS-MAT_GRP.
MOVE IT_EBAN-MENGE TO T_REQUISITION_ITEMS-QUANTITY.
MOVE IT_EBAN-MEINS TO T_REQUISITION_ITEMS-UNIT.
T_REQUISITION_ITEMS-DELIV_DATE = '20080618'.
APPEND T_REQUISITION_ITEMS.
CALL FUNCTION 'BAPI_REQUISITION_CREATE'
EXPORTING
SKIP_ITEMS_WITH_ERROR =
IMPORTING
NUMBER = E_NUMBER
TABLES
REQUISITION_ITEMS = T_REQUISITION_ITEMS
*REQUISITION_ACCOUNT_ASSIGNMENT = T_REQ_ACCOUNT_ASSIGNMENT
REQUISITION_ITEM_TEXT =
REQUISITION_LIMITS =
REQUISITION_CONTRACT_LIMITS =
REQUISITION_SERVICES =
REQUISITION_SRV_ACCASS_VALUES =
RETURN = T_RETURN
REQUISITION_SERVICES_TEXT =
EXTENSIONIN =
REQUISITION_ADDRDELIVERY =
ENDLOOP.
IF NOT E_NUMBER IS INITIAL .
WRITE:/ 'REQ NO:' , E_NUMBER , 'CREATED'.
ELSE.
LOOP AT T_RETURN.
WRITE T_RETURN-MESSAGE.
ENDLOOP.
ENDIF.
what i want is before calling BAPI_REQUISITION_CREATE i need to display it_eban as alv and then where i can edit the values and save and that values will move to T_REQUISITION_ITEMS table. no need of hard cording Plant and purch. grop and storage location details. I know how to display the ALV grid just tell me how to edit in ALV and when i cllick save it shold move to BAPI_REQUISITION_CREATE.
its an urgent...
<b>points will be rewarded for useful answers</b>
Regards,
sunil kairam.
Check this editable alv report...
REPORT zjay_edit_alv.
* TYPE-POOLS *
TYPE-POOLS: slis.
* INTERNAL TABLES/WORK AREAS/VARIABLES
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
w_field TYPE slis_fieldcat_alv,
p_table LIKE dd02l-tabname,
dy_table TYPE REF TO data,
dy_tab TYPE REF TO data,
dy_line TYPE REF TO data.
* FIELD-SYMBOLS *
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa> TYPE ANY,
<dyn_field> TYPE ANY,
<dyn_tab_temp> TYPE STANDARD TABLE.
* SELECTION SCREEN *
PARAMETERS: tabname(30) TYPE c DEFAULT 'MARA',
lines(5) TYPE n DEFAULT 7.
* START-OF-SELECTION *
START-OF-SELECTION.
* Storing table name
p_table = tabname.
* Create internal table dynamically with the stucture of table name
* entered in the selection screen
CREATE DATA dy_table TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_table->* TO <dyn_table>.
IF sy-subrc <> 0.
MESSAGE i000(z_zzz_ca_messages) WITH ' No table found'.
LEAVE TO LIST-PROCESSING.
ENDIF.
* Create workarea for the table
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
* Create another temp. table
CREATE DATA dy_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_tab->* TO <dyn_tab_temp>.
SORT i_fieldcat BY col_pos.
* Select data from table
SELECT * FROM (p_table)
INTO TABLE <dyn_table>
UP TO lines ROWS.
REFRESH <dyn_tab_temp>.
* Display report
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_PF_STATUS'
TABLES
t_outtab = <dyn_table>
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
*& Form SET_PF_STATUS
* Setting custom PF-Status
* -->RT_EXTAB Excluding table
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTANDARD'. "copy it from SALV func group standard
ENDFORM. "SET_PF_STATUS
*& Form user_command
* Handling custom function codes
* -->R_UCOMM Function code value
* -->RS_SELFIELD Info. of cursor position in ALV
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
* Local data declaration
DATA: li_tab TYPE REF TO data,
l_line TYPE REF TO data.
* Local field-symbols
FIELD-SYMBOLS:<l_tab> TYPE table,
<l_wa> TYPE ANY.
* Create table
CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN li_tab->* TO <l_tab>.
* Create workarea
CREATE DATA l_line LIKE LINE OF <l_tab>.
ASSIGN l_line->* TO <l_wa>.
CASE r_ucomm.
* When a record is selected
WHEN '&IC1'.
* Read the selected record
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
rs_selfield-tabindex.
IF sy-subrc = 0.
* Store the record in an internal table
APPEND <dyn_wa> TO <l_tab>.
* Fetch the field catalog info
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = p_table
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 0.
* Make all the fields input enabled except key fields
w_field-input = 'X'.
MODIFY i_fieldcat FROM w_field TRANSPORTING input
WHERE key IS INITIAL.
ENDIF.
* Display the record for editing purpose
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
it_fieldcat = i_fieldcat
i_screen_start_column = 10
i_screen_start_line = 15
i_screen_end_column = 200
i_screen_end_line = 20
TABLES
t_outtab = <l_tab>
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
* Read the modified data
READ TABLE <l_tab> INDEX 1 INTO <l_wa>.
* If the record is changed then track its index no.
* and populate it in an internal table for future
* action
IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
<dyn_wa> = <l_wa>.
i_index = rs_selfield-tabindex.
APPEND i_index.
ENDIF.
ENDIF.
ENDIF.
* When save button is pressed
WHEN 'SAVE'.
* Sort the index table
SORT i_index.
* Delete all duplicate records
DELETE ADJACENT DUPLICATES FROM i_index.
LOOP AT i_index.
* Find out the changes in the internal table
* and populate these changes in another internal table
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
IF sy-subrc = 0.
APPEND <dyn_wa> TO <dyn_tab_temp>.
ENDIF.
ENDLOOP.
* Lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc = 0.
* Modify the database table with these changes
MODIFY (p_table) FROM TABLE <dyn_tab_temp>.
REFRESH <dyn_tab_temp>.
* Unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table.
ENDIF.
ENDCASE.
rs_selfield-refresh = 'X'.
ENDFORM. "user_command
Similar Messages
-
Hi all,
I have created an ALV Grid display using container.
My question is : How to edit an AlV.
Initially some of column are in Display Mode, That i had set as non editable.
But i want that when i create new/insert new record using the Insert button of alv , the only new column should apper as editable (all columns) as it is new record. So i can insert it into batabase.
Any one an help me with this .
Thanks
AmarHi Amar,
I have added one Sample program pls check it and Let me know
INCLUDE .
TABLES: lfa1, lfb1, ekko, ekpo.
TYPE-POOLS: slis.
DATA: ok_code LIKE sy-ucomm,
g_container TYPE scrfname VALUE 'CONTAINER',
grid1 TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container.
DATA: repname LIKE sy-repid.
DATA: t_disvariant TYPE TABLE OF disvariant WITH HEADER LINE.
DATA: t_fieldtab TYPE lvc_t_fcat.
DATA: t_layout TYPE lvc_s_layo.
DATA: gs_toolbar TYPE stb_button.
DATA: t_rows TYPE lvc_t_row WITH HEADER LINE.
TABLA DE DATOS
DATA: BEGIN OF ti_acred OCCURS 0,
bukrs LIKE lfb1-bukrs,
lifnr LIKE lfa1-lifnr,
land1 LIKE lfa1-land1,
name1 LIKE lfa1-name1,
ort01 LIKE lfa1-ort01,
pstlz LIKE lfa1-pstlz,
regio LIKE lfa1-regio,
sortl LIKE lfa1-sortl,
stras LIKE lfa1-stras,
adrnr LIKE lfa1-adrnr,
END OF ti_acred.
DATA i_salida LIKE ti_acred OCCURS 0.
DATA: d_bukrs LIKE t001-bukrs.
DATA container.
DATA save VALUE 'X'.
Pantalla de Selección -
SELECTION-SCREEN BEGIN OF BLOCK bloq1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : lifnr FOR lfa1-lifnr,
bukrs FOR lfb1-bukrs.
SELECTION-SCREEN END OF BLOCK bloq1.
SELECTION-SCREEN BEGIN OF BLOCK bloq3 WITH FRAME TITLE text-003.
PARAMETERS: p_alvasg TYPE slis_vari. " Disposición ALV
SELECTION-SCREEN END OF BLOCK bloq3.
LOCAL CLASSES: Definition
*===============================================================
class lcl_event_receiver: local class to
define and handle own functions.
Definition:
~~~~~~~~~~~
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
handle_menu_button
FOR EVENT menu_button OF cl_gui_alv_grid
IMPORTING e_object e_ucomm,
handle_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
PRIVATE SECTION.
ENDCLASS.
lcl_event_receiver (Definition)
*===============================================================
LOCAL CLASSES: Implementation
*===============================================================
class lcl_event_receiver (Implementation)
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar.
§ 2.At event TOOLBAR define a toolbar element of type 1 by using
event paramenter E_OBJECT. Remember its function code.
Part I: Define a menu button including a function code that
is evaluated in 'handle_MENU_BUTTON
append a menu with default button (Type 1)
The function code of the default button is the same as
the one for the menu.
If the user klicks on the default button ALV raises
directly event BEFORE_USER_COMMAND
(then USER_COMMAND, AFTER_USER_COMMAND).
If the user klicks on the menu button ALV raises event MENU_BUTTON.
CLEAR gs_toolbar.
MOVE 'MODIFY' TO gs_toolbar-function.
--> This function code is evaluated in 'handle_menu_button'
MOVE icon_change TO gs_toolbar-icon.
MOVE 'Modificar' TO gs_toolbar-quickinfo.
MOVE 0 TO gs_toolbar-butn_type.
MOVE space TO gs_toolbar-disabled.
APPEND gs_toolbar TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_menu_button.
§ 3.At event MENU_BUTTON query your function code and define a
menu in the same way as a context menu.
Part II: Evaluate 'e_ucomm' to see which menu button of the toolbar
has been clicked on.
Define then the corresponding menu.
The menu contains function codes that are evaluated
in 'handle_user_command'.
query e_ucomm to find out which menu button has been clicked on
IF e_ucomm = 'MODIFY'.
CALL METHOD e_object->add_function
EXPORTING fcode = 'MODIFY'
text = 'Modificar'. "modificar
§ 3a.) choose a default function and define the same function code
as used for the menu.
CALL METHOD e_object->add_function
EXPORTING fcode = 'DECISION'
text = 'Decisión de empleo'. "Decisión
"de empleo
ENDIF.
ENDMETHOD.
METHOD handle_user_command.
§ 4.At event USER_COMMAND query the function code of each function
defined in step 3.
Part III : Evaluate user command to invoke the corresponding
function.
DATA: lt_rows TYPE lvc_t_row.
get selected row
CALL METHOD grid1->get_selected_rows
IMPORTING et_index_rows = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
add your handling, for example
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = repname
txt2 = sy-subrc
txt1 = 'Error in Flush'(500).
ENDIF.
go to other table
CASE e_ucomm.
WHEN 'DECISION'.
REFRESH T_ROWS.
PERFORM SELECCION_LINEAS_DECISION TABLES lt_rows.
WHEN 'MODIFY'.
REFRESH t_rows.
PERFORM SELECCION_LINEAS_modify TABLES lt_rows.
CALL SCREEN 200.
ENDCASE.
ENDMETHOD. "handle_user_command
ENDCLASS.
lcl_event_receiver (Implementation)
*===================================================================
INITIALIZATION -
INITIALIZATION.
repname = sy-repid.
PERFORM initialize_fieldcat.
PERFORM initializa_layout.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_alv -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_alvasg.
PERFORM alvl_value_request USING p_alvasg ' '.
START-OF-SELECTION -
START-OF-SELECTION.
PERFORM obtener_datos.
END-OF-SELECTION -
END-OF-SELECTION.
CALL SCREEN 9010.
Subrutinas -
Form obtener_datos
FORM obtener_datos.
REFRESH ti_acred.
CLEAR ti_acred.
SELECT * INTO CORRESPONDING FIELDS OF TABLE ti_acred
FROM lfa1
WHERE lifnr IN lifnr.
LOOP AT ti_acred.
SELECT SINGLE bukrs INTO ti_acred-bukrs FROM lfb1
WHERE lifnr = ti_acred-lifnr.
MODIFY ti_acred.
ENDLOOP.
i_salida[] = ti_acred[].
ENDFORM.
MODULE PBO OUTPUT *
MODULE status_9010 OUTPUT.
DATA it_toolbar_excluding TYPE ui_func.
SET PF-STATUS 'EMPRESA'.
CLEAR g_custom_container.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
CREATE OBJECT grid1
EXPORTING i_parent = g_custom_container.
CALL METHOD grid1->set_table_for_first_display
EXPORTING i_structure_name = 'I_SALIDA'
is_variant = t_disvariant
i_save = save
I_DEFAULT = ' '
is_layout = t_layout
CHANGING it_outtab = i_salida
it_fieldcatalog = t_fieldtab.
SET HANDLER lcl_event_receiver=>handle_user_command
lcl_event_receiver=>handle_menu_button
lcl_event_receiver=>handle_toolbar FOR ALL INSTANCES.
CALL METHOD grid1->set_toolbar_interactive.
ELSE.
CALL METHOD grid1->refresh_table_display.
ENDIF.
ENDMODULE.
Module EXIT INPUT
MODULE exit INPUT.
REFRESH i_salida.
CLEAR i_salida.
SET SCREEN 0.
LEAVE SCREEN.
ENDMODULE. " EXIT INPUT
Form initialize_fieldcat
FORM initialize_fieldcat.
DATA: l_fieldcat TYPE lvc_t_fcat WITH HEADER LINE.
REFRESH t_fieldtab.
Catálogo de Campos
CLEAR l_fieldcat.
l_fieldcat-tabname = 'I_SALIDA'.
l_fieldcat-fix_column = 'X'.
l_fieldcat-no_out = 'O'.
l_fieldcat-key = 'X'.
l_fieldcat-ref_field = 'BUKRS'.
l_fieldcat-ref_table = 'LFB1'.
l_fieldcat-fieldname = 'BUKRS'.
APPEND l_fieldcat TO t_fieldtab.
CLEAR l_fieldcat.
l_fieldcat-tabname = 'I_SALIDA'.
l_fieldcat-fix_column = 'X'.
l_fieldcat-no_out = 'O'.
l_fieldcat-key = 'X'.
l_fieldcat-ref_field = 'LIFNR'.
l_fieldcat-ref_table = 'LFA1'.
l_fieldcat-fieldname = 'LIFNR'.
APPEND l_fieldcat TO t_fieldtab.
CLEAR l_fieldcat.
l_fieldcat-tabname = 'I_SALIDA'.
l_fieldcat-fix_column = 'X'.
l_fieldcat-no_out = 'O'.
l_fieldcat-edit = 'X'.
l_fieldcat-ref_field = 'NAME1'.
l_fieldcat-ref_table = 'LFA1'.
l_fieldcat-fieldname = 'NAME1'.
APPEND l_fieldcat TO t_fieldtab.
CLEAR l_fieldcat.
l_fieldcat-tabname = 'I_SALIDA'.
l_fieldcat-fix_column = 'X'.
l_fieldcat-no_out = 'O'.
l_fieldcat-edit = 'X'.
l_fieldcat-ref_field = 'LAND1'.
l_fieldcat-ref_table = 'LFA1'.
l_fieldcat-fieldname = 'LAND1'.
APPEND l_fieldcat TO t_fieldtab.
CLEAR l_fieldcat.
l_fieldcat-tabname = 'I_SALIDA'.
l_fieldcat-fix_column = 'X'.
l_fieldcat-no_out = 'O'.
l_fieldcat-edit = 'X'.
l_fieldcat-ref_field = 'ORT01'.
l_fieldcat-ref_table = 'LFA1'.
l_fieldcat-fieldname = 'ORT01'.
APPEND l_fieldcat TO t_fieldtab.
CLEAR l_fieldcat.
l_fieldcat-tabname = 'I_SALIDA'.
l_fieldcat-fix_column = 'X'.
l_fieldcat-no_out = 'O'.
l_fieldcat-edit = 'X'.
l_fieldcat-ref_field = 'PSTLZ'.
l_fieldcat-ref_table = 'LFA1'.
l_fieldcat-fieldname = 'PSTLZ'.
APPEND l_fieldcat TO t_fieldtab.
CLEAR l_fieldcat.
l_fieldcat-tabname = 'I_SALIDA'.
l_fieldcat-fix_column = 'X'.
l_fieldcat-no_out = 'O'.
l_fieldcat-edit = 'X'.
l_fieldcat-ref_field = 'REGIO'.
l_fieldcat-ref_table = 'LFA1'.
l_fieldcat-fieldname = 'REGIO'.
APPEND l_fieldcat TO t_fieldtab.
CLEAR l_fieldcat.
l_fieldcat-tabname = 'I_SALIDA'.
l_fieldcat-fix_column = 'X'.
l_fieldcat-no_out = 'O'.
l_fieldcat-edit = 'X'.
l_fieldcat-ref_field = 'SORTL'.
l_fieldcat-ref_table = 'LFA1'.
l_fieldcat-fieldname = 'SORTL'.
APPEND l_fieldcat TO t_fieldtab.
CLEAR l_fieldcat.
l_fieldcat-tabname = 'I_SALIDA'.
l_fieldcat-fix_column = 'X'.
l_fieldcat-no_out = 'O'.
l_fieldcat-edit = 'X'.
l_fieldcat-ref_field = 'STRAS'.
l_fieldcat-ref_table = 'LFA1'.
l_fieldcat-fieldname = 'STRAS'.
APPEND l_fieldcat TO t_fieldtab.
CLEAR l_fieldcat.
l_fieldcat-tabname = 'I_SALIDA'.
l_fieldcat-fix_column = 'X'.
l_fieldcat-no_out = 'O'.
l_fieldcat-key = 'X'.
l_fieldcat-ref_field = 'ADRNR'.
l_fieldcat-ref_table = 'LFA1'.
l_fieldcat-fieldname = 'ADRNR'.
APPEND l_fieldcat TO t_fieldtab.
ENDFORM. " initialize_fieldcat
Form initializa_layout
FORM initializa_layout.
t_layout-zebra = 'X'.
t_layout-cwidth_opt = 'X'.
t_layout-no_toolbar = 'X'.
T_LAYOUT-EDIT = 'X'.
T_LAYOUT-DETAILINIT = 'X'.
T_LAYOUT-CWIDTH_OPT = 'X'.
T_LAYOUT-TOTALS_BEF = 'X'.
T_LAYOUT-NUMC_TOTAL = 'X'.
ENDFORM. " initializa_layout
Module USER_COMMAND_9010 INPUT
MODULE user_command_9010 INPUT.
CASE sy-ucomm.
WHEN 'SAVE'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = ' '
DIAGNOSE_OBJECT = ' '
text_question = 'Pulsaste SAVE'
TEXT_BUTTON_1 = 'Ja'(001)
ICON_BUTTON_1 = ' '
TEXT_BUTTON_2 = 'Nein'(002)
ICON_BUTTON_2 = ' '
DEFAULT_BUTTON = '1'
DISPLAY_CANCEL_BUTTON = 'X'
USERDEFINED_F1_HELP = ' '
START_COLUMN = 25
START_ROW = 6
POPUP_TYPE =
IMPORTING
ANSWER =
TABLES
PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_9010 INPUT
Form alvl_value_request
FORM alvl_value_request USING pi_alv
value(p_0158).
DATA: l_disvariant TYPE disvariant.
Wertehilfe
l_disvariant-report = sy-cprog.
l_disvariant-report(1) = 'A'.
l_disvariant-variant = pi_alv.
l_disvariant-log_group = p_0158.
CALL FUNCTION 'LVC_VARIANT_SAVE_LOAD'
EXPORTING
i_save_load = 'F'
i_tabname = '1'
CHANGING
cs_variant = l_disvariant
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
pi_alv = l_disvariant-variant.
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " ALVL_VALUE_REQUEST
Kanagaraja L -
How to save data in ztable after editing in alv report
how to save data in ztable after editing in alv report?
Hi,
Please find the attachment below.This may be usefull to you.
[http://wiki.sdn.sap.com/wiki/display/Snippets/ALV-Editingandsavingtheeditedvaluesin+Database%28OOPS%29]
Regards,
Ramakrishna Yella. -
How to Edit the CheckBox in Classic ALV GRID Display
Hi,
I want to Edit the checkbox in Grid Display.
I have one checkbox field in my internal Table,
Code Of the Program,
Data :
Begin of itab occurs 0,
CHK type C,
MATNR like MARA-MATNR,
end of itab.
Iam building the fieldcatelog using Merge Funcion module.
After that I am chaning the properties of the field
catelog like below,
loop at I_FCAT assigning <FCAT>.
Case <FCAT>-Fieldname
When 'CHK'.
<FCAT>-Checkbox = 'X'.
<FCAT>-INPUT = 'X'.
I dont have edit option in fieldcatelog.
modify I_FCAT from <FCAT>.
endcase.
endloop.
In the Layout,
I_LAYOUT-box_fieldname = 'CHK'.
I_LAYOUT-box_tabname = 'ITAB'.
It is displaying the Checkbox field.but I couldnt edit the checkBox.
I can able to edit in REUSE_ALV_LIST_DISPLAY.
But I have to use REUSE_ALV_GRID_DISPLAY.How to edit the checkbox.
Thanks in Advance,
SumithraHi vasu,
The below procedure explains you to create a checkbox cloumn in the grid and allows you to edit i hope this will helps u.
The ALV Grid Control displays the cells of a column as checkboxes if the column is marked as a checkbox column in the field catalog.
Add another field to the output table in which you want to display checkboxes
OR
Define an existing field as a checkbox.
Procedure
1. Add a field to your output table:
Data: gt_fieldcat type lvc_t_fcat.
Types: begin of gs_outtab.
Types: checkbox type c. "field for checkbox
Include structure <ABAP Dictionary structure> .
Types: end of gs_outtab.
Data: gt_outtab type gs_outtab occurs 0 with header line.
2 * Add an entry for the checkbox to the field catalog
clear ls_fcat.
ls_fcat-fieldname = 'CHECKBOX'.
* Essential: declare field as checkbox and
* mark it as editable field:
ls_fcat-checkbox = 'X'.
ls_fcat-edit = 'X'.
* do not forget to provide texts for this extra field
ls_fcat-coltext = text-f01.
ls_fcat-tooltip = text-f02.
ls_fcat-seltext = text-f03.
append ls_fcat to gt_fieldcat.
regards,
venu. -
Hi gurus in ALV how to edit the fields on out put list
hi gurus in ALV how to edit the fields on out put list
hi
REPORT ZSB_ALV_EDITABLE_SAMPLE.
TABLES: SFLIGHT.
DATA: gc_container TYPE scrfname VALUE 'LIST_AREA',
gc_custom_container TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
gc_grid TYPE REF TO CL_GUI_ALV_GRID,
gs_layout TYPE LVC_S_LAYO,
gt_fieldcat TYPE LVC_T_FCAT.
DATA: ok_code TYPE SY-UCOMM.
DATA: gt_outtab TYPE TABLE OF SFLIGHT.
*DYNPRO
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '100'.
CREATE OBJECT gc_custom_container
EXPORTING
container_name = gc_container
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_custom_container
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5 .
PERFORM prepare_field_catalog CHANGING gt_fieldcat .
PERFORM prepare_layout CHANGING gs_layout .
PERFORM get_alv_display.
ENDMODULE.
*& Module USER_COMMAND_0100 INPUT
MODULE USER_COMMAND_0100 INPUT.
OK_CODE = SY-UCOMM.
IF OK_CODE = 'BACK'.
SET SCREEN 0.
LEAVE SCREEN.
CLEAR OK_CODE.
ENDIF.
ENDMODULE.
FORM prepare_field_catalog CHANGING gt_fieldcat TYPE LVC_T_FCAT.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
I_STRUCTURE_NAME = 'SFLIGHT'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = gt_fieldcat[].
ENDFORM.
FORM prepare_layout changing p_gs_layout TYPE lvc_s_layo.
p_gs_layout-zebra = 'X'.
p_gs_layout-edit = 'X'.
ENDFORM. " prepare_layout
FORM get_alv_display .
SELECT * FROM sflight INTO TABLE gt_outtab UP TO 10 ROWS.
CALL METHOD gc_grid->set_table_for_first_display
EXPORTING
I_STRUCTURE_NAME = 'SFLIGHT'
IS_LAYOUT = gs_layout
CHANGING
it_outtab = gt_outtab
IT_FIELDCATALOG = gt_fieldcat
ENDFORM. " get_alv_display -
How to Edit selected row in ALV
Hi Experts,
I new to webdynpro ABAP. How to Edit the entire selected row in ALV. Please suggest?
Thanks in advance.Hi,
I guess you have created the node as dynamic and also set this to the ALV..
1. Have you created READ_ONLY attribute of type wdy_boolean inside the node to which the ALV is bound..If not create it first and set the default value for this readonly as abap_true...ie X.
2. Got the contents in the internal table.
bind the table to the node..
3.Instantiate the ALV.
4. Now get teh column refrences of this ALV using the cl_salv_wd_config_table..and for columns
use the cell editor type as cl_salv_wd_uie_input_field...
loop through the column references and for all refrences create an object of type Input field and inside this class
use the method set_read_only_field_name ( 'READ_ONLY' ).
For the table settings if_salv_wd_table_settings of cl_salv_wd-config_table.. set the read only mode as abap_false..
5 create the custom button in the ALV using the cl_salv_wd_fe_button..
6 In this go for the events ON_FUCNTION and inside this method..do the coding
7 .Initially the table will be set to non editable..
In the button handler....
Get the refernece of this node to which the ALV is bound.....
lr_node = wd_context->get_child_node( 'VBAK' ). "dynamic node name
lv_index = lr_node->get_lead_selection_index ( ).
loop at it_table into ls_table.
if sy-tabix eq lv_index.
ls_table-read_only = abap_false. "editable
else.
ls_table-read_only = abap_true. "non editable
endif.
modify table
endloop.
lr_node->bind_table( lt_table ).
If you have any doutbs just refer the previous thread posted on the same..
You can follow the above steps to acheive thjs..
Regards,
Lekha.
Edited by: Lekha on Dec 17, 2009 6:10 PM -
sir,
explain me how to edit row in alv report in particular column.put in the fieldcatalog;;
wa_fieldcat-edit = 'X'.
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-scrtext_m = 'Net Price'.
wa_fieldcat-edit = 'X'. "sets whole column to be editable
wa_fieldcat-col_pos = 7.
wa_fieldcat-outputlen = 15.
wa_fieldcat-datatype = 'CURR'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat. -
How to make field is editable in ALV CL_SALV_TABLE only)
Hi,
How to make field is editable in ALV CL_SALV_TABLE only)
Any one has tried to make field si editable by using CL_SALV_TABLE class.
*I know how to do it in REUSEALV function module and CL_GUI_ALV class.*_
Please reply only if you riedin CL_SALV_TABLE class method.
Regards
Rajesh V
Moderator message: not supported, please read class documentation and search for previous discussions.
Edited by: Thomas Zloch on Mar 17, 2011 2:07 PMHi Chad,
Please refer the link,
Edit field in alv
Regards,
Hema.
Reward points if it is useful. -
How to make fields/columns un-editable in ALV
Hi,
How can I make a field/column un-editable in ALV.
I tried writing: ls_fc_po-edit = ' '. (inside loop for the selected column/field), but it doesnot work for me.
Any suggestions please.
Thanks,
RavishThe code for the field catalogue is below:
LOOP AT lt_fc_po INTO ls_fc_po.
IF ls_fc_po-fieldname EQ 'PO_ID'.
ls_fc_po-no_out = 'X'.
ELSEIF ls_fc_po-fieldname EQ 'UNIT_OF_MEASURE'.
ls_fc_po-outputlen = '10'.
ls_fc_po-tooltip = 'Unit of Measure'.
ELSEIF ls_fc_po-fieldname EQ 'ITEM_ID'.
ls_fc_po-outputlen = '10'.
ls_fc_po-tooltip = 'Purchase Order Items'.
ELSEIF ls_fc_po-fieldname EQ 'QUANTITY'.
ls_fc_po-outputlen = '10'.
ELSEIF ls_fc_po-fieldname EQ 'CURRENCY'.
ls_fc_po-edit = ' '.
ls_fc_po-outputlen = '10'.
ls_fc_po-tooltip = 'Currency'.
ELSEIF ls_fc_po-fieldname EQ 'DATE_OF_DELIVERY'.
ls_fc_po-outputlen = '18'.
ls_fc_po-coltext = 'Delivery Date'.
ls_fc_po-tooltip = 'Requested Delivery date'.
ELSEIF ls_fc_po-fieldname EQ 'PLANT_ID'.
ls_fc_po-outputlen = '15'.
ls_fc_po-coltext = 'Plant'.
ls_fc_po-tooltip = 'Plant Identifier'.
ELSEIF ls_fc_po-fieldname EQ 'MATERIAL_DESC'.
ls_fc_po-outputlen = '18'.
ELSEIF ls_fc_po-fieldname EQ 'MATERIAL_ID'.
ls_fc_po-outputlen = '15'.
ls_fc_po-coltext = 'Material'.
ls_fc_po-tooltip = 'Material Identifier'.
IF GL_PO_EVENT_ALV = 0.
GL_PO_EVENT_ALV = 1.
data: l_field type lvc_fname.
data: lt_f4 type lvc_t_f4.
data: ls_f4 type lvc_s_f4.
l_field = ls_fc_po-fieldname.
ls_f4-fieldname = l_field.
ls_f4-register = 'X'.
ls_f4-getbefore = 'X'.
ls_f4-chngeafter = 'X'.
append ls_f4 to lt_f4.
CALL METHOD po_itm_trn_alvgrid->register_f4_for_fields
EXPORTING
it_f4 = lt_f4.
ENDIF.
ENDIF.
MODIFY lt_fc_po FROM ls_fc_po.
ENDLOOP. -
Hi experts..
i got one requirement like i need to edit some rows particularly in alv....
Edit in alv output....is it possible to get that .....using normal function module with out using oops concept...
could any one pls help me...Hi Pendurti ,
If you want a particular field to be editable , simply define the fieldcatalog as
wa_fieldcatalog-edit = 'X'.
wa_fieldcatalog-input = 'X'.
for that field.
and
Now when you use FM ' Reuse alv grid display '
define USER_COMMAND
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'
it_fieldcat = int_fieldcatalog
is_layout = wa_layout
TABLES
t_outtab = t_disp.
and now in form USER_COMMAND ; code as per following
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref1.
CALL METHOD ref1->check_changed_data.
endform.
Regards,
Yogendra Bhaskar -
How to make a particular row and column field editable in ALV
Hi Experts,
I have a requirement to make a particular row and column field editable in ALV output. Like i need to make 2nd row - 4th column editable of ALV output.
Kindly help me out to solve this.
Any help would be appreciated.
Thanks,
AshutoshHi Ashutosh,
please check below, explained by some experts.
In the below link editing two columns MOD_RANK and TECH_RANK.
These two columns will be in edit mode once after selecting the required record
Editing single cell in a row of ALV table
And also look for more info
http://scn.sap.com/thread/884976 -
Make rows as non editable in ALV
Hi Experts,
I have a standard ALV table where records are fetched from backend table. Here I have a field Approved as check box.
My requirement is I need to make all the rows as non editable, if the Approved checkbox is checked. How can I achieve this.
I went through the below discussion, but still am not clear of how to achieve it.
How to set some rows in ALV to be editable or some non editable.
I know to set a field as non editable in WD, but don't know how to set some specific rows as non editable in alv.
Please help me.
With Regards,
Ramakrishnan MHi,
Create an Attribute in the Context say READ_ONLY of type wdy_boolean and bind the read only of cell editor to that attribute using set_read_only_fieldname( ) method. Then set the value of attribute READ_ONLY to abap_true/abap_false based on check box value.
check this wiki for reference: How to edit conditionally row of a ALV table in Web Dynpro for ABAP - Web Dynpro ABAP - SCN Wiki
Hope this helps u,
Regards,
Kiran -
Editable WD ALV - Cell Read Only
Hi,
Is there any way for making an individual cell read only for a column-row combination.
My scenario is :
I have an editable WD ALV with data. Now , in row(e.g Index 4) entry of the table, I want to make column2 and Column3 read only for that particular entry(row no.- Index) !! Please guide me through if there is any way to do the same.
Best Regards
SidYou will have to create an extra attribute for each of your column, of type boolean under the same node. Now bind these attributes to the read only property of your column's cell editors.
Then pass abap_true/abap_false to make the field editable/reaonly.
Check this wiki for your reference,
check this Wiki [https://wiki.sdn.sap.com/wiki/display/WDABAP/How%20to%20edit%20conditionally%20row%20of%20a%20ALV%20table%20in%20Web%20Dynpro%20for%20ABAP]
Regards,
Radhika. -
How can we modify alv output list
Hi
this is fazil.
Please tell me any body How can we modify alv output list.
Thanks & Regards
Fazil
[email protected]Fazil,
check the program,
You can find the code in this program 'BCALV_FIELDCAT_TEST'
*& Report BCALV_FIELDCAT_TEST *
This report allows to modify the fieldcatalog of a corresponding
output table and to view the effects of your changes directly.
Note that for some changes you need to newly display the whole
ALV Grid Control, e.g., DDIC-Fields are read only the first time
you call SET_READY_FOR_FIRST_DISPLAY.
Note also that not all scenarios can be tested since the output
table does not comprise all fields to test available features
of the fieldcatalog. Copy this program and extend the output
table accordingly if you want to test such a special feature.
(The field CARRNAME in 'gt_sflight' was added to test field REF_FIELD
and TXT_FIELD of the fieldcatalog - see what happens if you
calculate subtotals by carrier-id).
report bcalvt_fieldcatalog .
data: ok_code type sy-ucomm,
save_ok_code type sy-ucomm,
fieldcatalog for output table
gt_fieldcat type lvc_t_fcat,
fieldcatalog for fieldcatalog itself:
gt_fcatfcat type lvc_t_fcat,
gs_fcatlayo type lvc_s_layo.
Output table
data: begin of gt_sflight occurs 0.
data: carrname type s_carrname.
include structure sflight.
data: end of gt_sflight.
data: g_max type i value 100.
data: g_all type c value SPACE.
Controls to display gt_sflight and corresponding fieldcatalog
data: g_docking type ref to cl_gui_docking_container,
g_alv type ref to cl_gui_alv_grid.
data: g_custom_container type ref to cl_gui_custom_container,
g_editable_alv type ref to cl_gui_alv_grid.
LOCAL CLASS Definition
class lcl_event_receiver definition.
public section.
methods handle_data_changed
for event data_changed of cl_gui_alv_grid
importing er_data_changed.
endclass.
class lcl_event_receiver implementation.
method handle_data_changed.
at the time being, no checks are made...
endmethod.
endclass.
data: event_receiver type ref to lcl_event_receiver.
end-of-selection.
set screen 100.
*& Module STATUS_0100 OUTPUT
text
module status_0100 output.
set pf-status 'BASIC'.
set titlebar 'BASICTITLE'.
create ALV Grid Control in the first run
if g_docking is initial.
perform create_and_init_controls.
endif.
endmodule. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
module user_command_0100 input.
save_ok_code = ok_code.
clear ok_code.
case save_ok_code.
when 'SUBMIT'.
set the frontend fieldcatalog
ATTENTION: DDIC-Fields are not updated using this method!
(see 'RESTART')
call method g_alv->set_frontend_fieldcatalog
exporting
it_fieldcatalog = gt_fieldcat.
call method g_alv->refresh_table_display.
call method cl_gui_cfw=>flush.
when 'RESTART'.
Destroy the control currently visible and display it again
using the changed fieldcatalog.
perform restart_sflight.
when '&ALL'.
perform switch_visibility.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
*& Form CREATE_AND_INIT_CONTROLS
text
--> p1 text
<-- p2 text
form create_and_init_controls.
create object g_docking
exporting
dynnr = '100'
extension = 150
side = cl_gui_docking_container=>dock_at_bottom.
create object g_alv
exporting
i_parent = g_docking.
create object g_custom_container
exporting
container_name = 'CC_0100_FIELDCAT'.
create object g_editable_alv
exporting
i_parent = g_custom_container.
register events
create object event_receiver.
set handler event_receiver->handle_data_changed for g_editable_alv.
call method g_editable_alv->register_edit_event
exporting
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
perform build_fieldcatalogs changing gt_fieldcat gt_fcatfcat.
perform modify_fieldcatalog changing gt_fcatfcat.
perform select_data. "CHANGING gt_sflight
call method g_alv->set_table_for_first_display
changing
it_outtab = gt_sflight[]
it_fieldcatalog = gt_fieldcat[].
optimize column width of grid displaying fieldcatalog
gs_fcatlayo-cwidth_opt = 'X'.
Get fieldcatalog of table sflight - alv might have
modified it after passing.
call method g_alv->get_frontend_fieldcatalog
importing et_fieldcatalog = gt_fieldcat[].
call method cl_gui_cfw=>flush.
Display fieldcatalog of table sflight:
call method g_editable_alv->set_table_for_first_display
exporting
is_layout = gs_fcatlayo
changing
it_outtab = gt_fieldcat[]
it_fieldcatalog = gt_fcatfcat[].
register events
create object event_receiver.
set handler event_receiver->handle_data_changed for g_editable_alv.
endform. " CREATE_AND_INIT_CONTROLS
*& Form restart_sflight
text
--> p1 text
<-- p2 text
form restart_sflight.
data: ls_fieldcat type lvc_s_fcat.
free g_docking and thus g_alv
call method g_docking->free.
clear g_docking.
clear g_alv.
create new instances
create object g_docking
exporting
dynnr = '100'
extension = 150
side = cl_gui_docking_container=>dock_at_bottom.
create object g_alv
exporting
i_parent = g_docking.
This is an internal method to invalidate all fields in the fieldcat
loop at gt_fieldcat into ls_fieldcat.
clear ls_fieldcat-tech_comp.
modify gt_fieldcat from ls_fieldcat.
endloop.
Newly display the list with current fieldcatalog.
call method g_alv->set_table_for_first_display
changing
it_outtab = gt_sflight[]
it_fieldcatalog = gt_fieldcat.
Get fieldcatalog - it might be changed by ALV in the last call
call method g_alv->get_frontend_fieldcatalog
importing
et_fieldcatalog = gt_fieldcat[].
call method g_editable_alv->refresh_table_display.
call method cl_gui_cfw=>flush.
endform. " restart_sflight
*& Form select_data
text
--> p1 text
<-- p2 text
form select_data.
data: lt_sflight type table of sflight with header line,
ls_scarr type scarr.
select data of sflight
select * from sflight into table lt_sflight up to g_max rows.
copy data to gt_sflight and update CARRNAME
loop at lt_sflight.
move-corresponding lt_sflight to gt_sflight.
select single * from scarr into ls_scarr
where carrid = gt_sflight-carrid.
gt_sflight-carrname = ls_scarr-carrname.
append gt_sflight.
endloop.
endform. " select_data
*& Form BUILD_FIELDCATALOGS
text
<--P_GT_FIELDCAT text
<--P_GT_FCATFCAT text
form build_fieldcatalogs changing p_fieldcat type lvc_t_fcat
p_fcatfcat type lvc_t_fcat.
data: ls_fcat type lvc_s_fcat.
Fieldcatalog for table SFLIGHT: p_fieldcat
generate fieldcatalog automatically
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'SFLIGHT'
I_CLIENT_NEVER_DISPLAY = 'X'
changing
ct_fieldcat = p_fieldcat[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 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.
shift all column positions to the right except for MANDT
loop at p_fieldcat into ls_fcat.
if ls_fcat-fieldname ne 'MANDT'.
add 1 to ls_fcat-col_pos.
if ls_fcat-fieldname = 'CARRID'.
ls_fcat-txt_field = 'CARRNAME'."link CARRNAME to CARRID
endif.
modify p_fieldcat from ls_fcat.
endif.
endloop.
create a new line for CARRNAME in p_fieldcat
clear ls_fcat.
ls_fcat-fieldname = 'CARRNAME'.
ls_fcat-ref_table = 'SCARR'.
ls_fcat-col_pos = 1.
insert new line before CARRID (do not forget MANDT!).
insert ls_fcat into p_fieldcat index 1.
Fieldcatalog for table LVC_T_FCAT:p_fcatfcat
Generate fieldcatalog of fieldcatalog structure.
This fieldcatalog is used to display fieldcatalog 'p_fieldcat'
on the top of the screen.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'LVC_S_FCAT'
I_CLIENT_NEVER_DISPLAY = 'X'
changing
ct_fieldcat = p_fcatfcat[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 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.
Hide all fields that are not documented (valid for release 4.6A)
perform hide_fields changing p_fcatfcat.
endform. " BUILD_FIELDCATALOGS
*& Module EXIT_PROGRAM INPUT
text
module exit_program input.
leave program.
endmodule. " EXIT_PROGRAM INPUT
*& Form MODIFY_FIELDCATALOG
text
<--P_GT_FCATFCAT text
form modify_fieldcatalog changing p_fcatfcat type lvc_t_fcat.
data ls_fcat type lvc_s_fcat.
loop at p_fcatfcat into ls_fcat.
ls_fcat-coltext = ls_fcat-fieldname.
ls_fcat-edit = 'X'.
if ls_fcat-fieldname = 'COL_POS' or ls_fcat-fieldname = 'FIELDNAME'.
ls_fcat-key = 'X'.
endif.
modify p_fcatfcat from ls_fcat.
endloop.
endform. " MODIFY_FIELDCATALOG
form hide_fields changing p_fieldcat type lvc_t_fcat.
data: ls_fcat type lvc_s_fcat.
Only show documented fields of fieldcatalog.
For a documentation choose "Help->Application Help" in the menu.
loop at p_fieldcat into ls_fcat.
if not (
ls_fcat-fieldname eq 'CFIELDNAME'
or ls_fcat-fieldname eq 'COL_POS'
or ls_fcat-fieldname eq 'COLDDICTXT'
or ls_fcat-fieldname eq 'COLTEXT'
or ls_fcat-fieldname eq 'CURRENCY'
or ls_fcat-fieldname eq 'DD_OUTLEN'
or ls_fcat-fieldname eq 'DECIMALS_O'
or ls_fcat-fieldname eq 'DECMLFIELD'
or ls_fcat-fieldname eq 'DO_SUM'
or ls_fcat-fieldname eq 'DRAGDROPID'
or ls_fcat-fieldname eq 'EDIT_MASK'
or ls_fcat-fieldname eq 'EMPHASIZE'
or ls_fcat-fieldname eq 'EXPONENT'
or ls_fcat-fieldname eq 'FIELDNAME'
or ls_fcat-fieldname eq 'HOTSPOT'
or ls_fcat-fieldname eq 'ICON'
or ls_fcat-fieldname eq 'INTLEN'
or ls_fcat-fieldname eq 'INTTYPE'
or ls_fcat-fieldname eq 'JUST'
or ls_fcat-fieldname eq 'KEY'
or ls_fcat-fieldname eq 'LOWERCASE'
or ls_fcat-fieldname eq 'LZERO'
or ls_fcat-fieldname eq 'NO_OUT'
or ls_fcat-fieldname eq 'NO_SIGN'
or ls_fcat-fieldname eq 'NO_SUM'
or ls_fcat-fieldname eq 'NO_ZERO'
or ls_fcat-fieldname eq 'OUTPUTLEN'
or ls_fcat-fieldname eq 'QFIELDNAME'
or ls_fcat-fieldname eq 'QUANTITY'
or ls_fcat-fieldname eq 'REF_FIELD'
or ls_fcat-fieldname eq 'REF_TABLE'
or ls_fcat-fieldname eq 'REPREP'
or ls_fcat-fieldname eq 'REPTEXT'
or ls_fcat-fieldname eq 'ROLLNAME'
or ls_fcat-fieldname eq 'ROUND'
or ls_fcat-fieldname eq 'ROUNDFIELD'
or ls_fcat-fieldname eq 'SCRTEXT_L'
or ls_fcat-fieldname eq 'SCRTEXT_M'
or ls_fcat-fieldname eq 'SCRTEXT_S'
or ls_fcat-fieldname eq 'SELDDICTXT'
or ls_fcat-fieldname eq 'SELTEXT'
or ls_fcat-fieldname eq 'SP_GROUP'
or ls_fcat-fieldname eq 'SYMBOL'
or ls_fcat-fieldname eq 'TECH'
or ls_fcat-fieldname eq 'TIPDDICTXT'
or ls_fcat-fieldname eq 'TOOLTIP'
or ls_fcat-fieldname eq 'TXT_FIELD' ).
ls_fcat-tech = 'X'.
endif.
modify p_fieldcat from ls_fcat.
endloop.
endform.
form switch_visibility.
data: lt_fcatfcat type lvc_t_fcat,
ls_fcat type lvc_s_fcat.
call method g_editable_alv->get_frontend_fieldcatalog
importing ET_FIELDCATALOG = lt_fcatfcat.
if not g_all is initial.
perform hide_fields changing lt_fcatfcat.
g_all = SPACE.
else.
loop at lt_fcatfcat into ls_fcat.
if ls_fcat-tech eq 'X'.
ls_fcat-tech = SPACE.
ls_fcat-no_out = 'X'.
modify lt_fcatfcat from ls_fcat.
endif.
endloop.
g_all = 'X'.
endif.
call method g_editable_alv->set_frontend_fieldcatalog
exporting it_fieldcatalog = lt_fcatfcat.
call method g_editable_alv->refresh_table_display.
endform.
Don't forget to rewaard if useful.. -
How to edit a PDF in Photoshop CS4
Hi there,
I'm having some real trouble trying to figure out how to edit a PDF in photoshop cs4. So i need to edit/change text, move things around, that type of thing.
I work in Windows.
Could someone give me a bit a low down on how this is done?
Much appreciated,
VictoriaYou can open them but you will totally rasterize everything.
PDFs are not intended to be edited. They are a final format but as
mentioned you can use Acrobat for some minor text edits or use it to
extract the images to Photoshop for further editing.
Bob
Maybe you are looking for
-
ITunes 10.5 Freezing on Windows 7 - Cannot sync or update phone
I have an iPhone 4 and I wanted to update to the iOS5 but I have to update my iTunes to the newest version. Now my iTunes freezes any time my phone is connected. I cannot sync my phone and I decided to just try to do the update but after it was done
-
Not getting Stock on hand in May Month,while getting in April(Urgent Please
Hi, In my BW, there are countable records, those have posting date as 31.01.2008. and it has stock of 96.4 kg. Since "Stock On hand" is calculated on fly and it gives snap shot. I can see the same value 96.4 kg, for next all days till April 2008. But
-
Looking for HP Photo template print v 1.12
I know HP updated this program, but I want the templates back that were in the 1.12 version! Will somebody share, please?!
-
Email in Photoshop Lightroom 4
The new email feature in LR4.0 is nice, however it does not recognize my Outlook email contacts. When I send an email I have to type in the recipients email addresses every time, or create a separate address book just for Lightroom. This is kind of a
-
Firefox 29.1 won't download to my Macbook Pro running 10.6.8.
Trying to download 29.0.1 to MBP on 10.6.8 and the progress bar says that it is trying to connect to the server. This goes on for as long as I let it (hours) so is clearly not happy. I then cancel the download and continue with v28 and all is well. I