2006 Jul 10 12:59 PM
Hi all,
I have a issue which is like this need to create a check box on the selection screen , when the user check this ..the out of alv grid should show 5 required fields and when he doent it should show 8 required fields in alv grid .. at the moment it is displaying all the fields of tables vbak and kna1...is there any way we restrict or delete the fields with FM 'REUSE_ALV_FIELDCATALOG_MERGE'..
thxs,
vin.
2006 Jul 10 1:12 PM
Hi vind,
1. simple.
2. fieldcat-no_out = 'X'.
3. For those 3 fields, which u don't, want to display,
just
Loop at the field catalogue,
and make
NO_OUT = 'X'
(for those 3 fields)
regards,
amit m.
Hi vind,
1. simple.
2. fieldcat-no_out = 'X'.
3. For those 3 fields, which u don't, want to display,
just
Loop at the field catalogue,
and make
NO_OUT = 'X'
(for those 3 fields)
regards,
amit m.
2006 Jul 10 1:01 PM
Hello Vin,
When building the field catalog,
If P_CHECK = 'X'.
field-key = 'X'.
ENDIF.
If useful reward points.
Regards,
Vasanth
2006 Jul 10 1:07 PM
Hi,
after you get the fieldcat from the FM 'REUSE_ALV_FIELDCATALOG_MERGE'
you need to delete the entries from fieldcat which you don't want to show when check box is checked or you can do this also make them as TECH fields.
if p_check = 'X'.
loop at it_fieldcat into x_fieldcat.
if x_fieldcat-fieldname = 'ABC'. "this is the field i don't want to show..
x_fieldcat-tech = 'X'.
modify it_feildcat from x_fieldcat index sy-tabix transporting tech.
endif.
endloop.
endif.like this you add the other fields .
when you make tech = 'X' those fields will not be visible in Output display.
Regards
vijay
2006 Jul 10 1:09 PM
U MAY USE THE IF CONDITION FOR THAT PASS THE FUNCTION CODE OF THE CHECK BOX IN YOUR PROGRAM AND USE IF CONDITION RATHER THEN MODIFYING YOUR FUNCTION MODULE.
2006 Jul 10 1:12 PM
Hi vind,
1. simple.
2. fieldcat-no_out = 'X'.
3. For those 3 fields, which u don't, want to display,
just
Loop at the field catalogue,
and make
NO_OUT = 'X'
(for those 3 fields)
regards,
amit m.
2006 Jul 10 1:40 PM
hi,
or work simply with a predefined layout
x_save = 'X'.
gs_variant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = c_tabname
IS_VARIANT = gs_variant
IS_layout = lay
I_SAVE = x_save
TABLES
T_OUTTAB = gridtab
EXCEPTIONS
OTHERS = 1.A.
2006 Jul 10 1:49 PM
Hi,
Check this code , this is exactly what you are looking...
REPORT ZTEST_ALV_CHECK MESSAGE-ID ZZ .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR like vbap-matnr,
END OF ITAB.
parameters: p_check as checkbox.
SELECT VBELN
POSNR
MATNR
FROM VBAP
UP TO 20 ROWS
INTO TABLE ITAB.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = sy-repid
CHANGING
CT_FIELDCAT = it_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.
<b>if p_check = 'X'.
loop at it_fieldcat into x_fieldcat.
if x_fieldcat-fieldname = 'MATNR'.
x_fieldcat-tech = 'X'.
modify it_fieldcat from x_fieldcat index sy-tabix transporting tech.
endif.
endloop.
endif.</b>
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
TABLES
T_OUTTAB = ITAB
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.Regards
vijay
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |