06-24-2008 3:11 AM
hi friends^^
how to create required field in alv?
i don't find required option in fieldcatalog and others.
is it possible?
06-24-2008 5:12 AM
Hi,
Try the field key_sel in field catalog if you are using in ALV Grid using FM. it should be work for column level.
regards,
SB
06-26-2008 1:25 AM
thanks for you answer.
but key_sel does't.
key_sel = 'X'. -> does not required field.
i want to make required field(obligatory field) in editable alv.
please answer me..
06-26-2008 1:33 AM
Hi,
In the field catlog KEY_SEL = 'X' which enables your required field.
do reward points also do send the code..
06-26-2008 1:35 AM
Hi
While saving check if the required field is not marked with 'X'.
then show the message "Reqd field to be entered'.
do reward points
06-26-2008 11:37 AM
Source code..
PLANETYPE is key_sel = 'X'.
But does't required field...
REPORT zs32editable1 .
TYPE-POOLS : slis.
DATA : gt_sflight TYPE TABLE OF sflight.
DATA : gt_fieldcat TYPE slis_t_fieldcat_alv,
gs_fieldcat LIKE LINE OF gt_fieldcat,
gs_layout TYPE slis_layout_alv.
START-OF-SELECTION.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE gt_sflight
FROM sflight.
gs_layout-colwidth_optimize = 'X'.
gs_layout-edit = 'X'.
gs_fieldcat-fieldname = 'PLANETYPE'.
gs_fieldcat-key_sel = 'X'.
append gs_fieldcat to gt_fieldcat.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = 'SFLIGHT'
is_layout = gs_layout
IT_FIELDCAT = gt_fieldcat
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.
06-24-2008 5:21 AM
Hi,
if u don't want to display i.e. Hide the field.
U declare the fieldcatlog -NO_OUT = 'X'.
Now this field hide but if u want display u can click the layout in the alv display screen. Then u move to display list.
Thanks,
Durai.V