‎2007 Apr 09 12:54 PM
Hi Group,
Here i am trying an ALV, could you just help me out??
In my list/grid display i want to leave one field in which user can enter data.
So i can work out some update functions.
Do you have any idea how to achieve this???
Thanks.
‎2007 Apr 09 12:56 PM
You should fill the field catalog for that field with the property INPUT = 'X'.
WA_FIELDCAT-SELTEXT_L = 'Field for input.
WA_FIELDCAT-FIELDNAME = 'JOBCARD'.
WA_FIELDCAT-TABNAME = 'IT_FINAL'.
WA_FIELDCAT-COL_POS = LV_POS.
WA_FIELDCAT-INPUT = 'X'.
WA_FIELDCAT-OUTPUTLEN = 10.
Regards,
Ravi
‎2007 Apr 09 12:56 PM
You should fill the field catalog for that field with the property INPUT = 'X'.
WA_FIELDCAT-SELTEXT_L = 'Field for input.
WA_FIELDCAT-FIELDNAME = 'JOBCARD'.
WA_FIELDCAT-TABNAME = 'IT_FINAL'.
WA_FIELDCAT-COL_POS = LV_POS.
WA_FIELDCAT-INPUT = 'X'.
WA_FIELDCAT-OUTPUTLEN = 10.
Regards,
Ravi
‎2007 Apr 09 12:57 PM
Hi,
While preparing field catalog you have to set edit field as in this code.
ls_fcat-fieldname = 'VBELN'.
ls_fcat-ref_table = 'VBAK'.
ls_fcat-ref_field = 'VBELN'.
ls_fcat-coltext = 'Sales order'.
<b>ls_fcat-edit = 'X'.</b>
APPEND ls_fcat TO gt_fieldcat_edit.
you can use check_changed_data method on alv object to fetch the changed data
Hope this helps
Cheers,
Simha.
Award forum points to helpful answers
‎2007 Apr 09 12:58 PM
Hi,
CLEAR wa_fldcat.
wa_fldcat-Col_pos = 3.
wa_fldcat-fieldname = 'FLAG'.
wa_fldcat-coltext = 'CHECK'.
wa_fldcat-outputlen = 3.
wa_fldcat-checkbox = 'X'.
wa_fldcat-edit = 'X'.
APPEND wa_fldcat TO FLDCAT.
regards,
bharat.
‎2007 Apr 09 12:58 PM
‎2007 Apr 09 1:05 PM
Hi Samir,
Hope this code will help u.
FORM f002_edit_field USING w_field TYPE any
w_col TYPE any
w_edit TYPE any.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = w_field.
wa_fieldcat-seltext_l = w_col.
wa_fieldcat-outputlen = 15.
wa_fieldcat-edit = w_edit.
wa_fieldcat-input = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
Regards,
Thasneem
‎2007 Apr 09 1:37 PM
Hi Samir,
Delare an Internal table to capture the data which user can enter the data.
In the field catalog of ALV just pass the EDIT = 'X' to the filed which user wants to enter the data.
&----
*& Form BUILD_FIELDCATLOG
&----
FORM build_fieldcatlog .
wa_fieldcat-col_pos = 1.
wa_fieldcat-tabname = 'TB_ZMJBR_DET'.
wa_fieldcat-fieldname = 'SPG'.
wa_fieldcat-seltext_l = 'MATERIAL PRICING GROUP'.
wa_fieldcat-datatype = 'CHAR'.
<b> wa_fieldcat-edit = 'X'.</b>
wa_fieldcat-outputlen = 22.
APPEND wa_fieldcat TO tb_fieldcat.
CLEAR wa_fieldcat.
after this in the grid dispaly pass the layout.
&----
*& Form DISPLAY_ALV_REPORT
&----
This perform is used to display Records in the output Layout
----
FORM display_alv_report .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = tb_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
<b>is_layout = wa_layout
it_fieldcat = tb_fieldcat</b>
it_events = tb_event
TABLES
t_outtab = tb_zmjbr_det
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.
CLEAR tb_header.
ENDFORM. " DISPLAY_ALV_REPORT
after that delare a perform for layout like this.
&----
*& Form layout
&----
This perform is used to display the output Layout
----
FORM layout USING tb_layout TYPE slis_layout_alv.
tb_layout-detail_popup = 'X'.
<b> tb_layout-edit = 'X'.</b>
ENDFORM. " layout
execute the ALV .
Here that perticular filed can be editable and user can enter the data.
after entering the data u should confirm it by pressing any buttion, so for this u crete a Push Button at Application toolbar .
User after entering the data to that perticualr filed and press on Push Button, here u capture the ok-code (name of push button in se41) and in code write the logic in User command like this.
&----
*& Form USER_COMMAND
&----
This perform is used for User-command
----
FORM user_command USING r_ucomm LIKE sy-ucomm
tb_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'PUSHBUTTON'.
PERFORM UPDATE_DATA .
ENDCASE.
ENDFORM. " USER_COMMAND
In PERFORM UPDATE_DATA copy the captured data to internal table and from there update it to Table.
If u didn't understand plese give where u are not getting.
Give the reward if helpfull.
Thanks & Regards,
Anil.