Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

alv

Former Member
0 Kudos

hi

please advise how you display the medium text in ALV note i am using the REUSE_ALV_HIERSEQ_LIST_DISPLAY

and how to not display a field on the ALV output even though if the field is found on the field catalog merge structure

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Use field catalog

To force header to medium text, use field DDICTXT = 'M'. (If column width changes the program will search the best header, so remove other texts if you don't want that behavior)

To not display a field use field NO_OUT = 'X', to insure that user wont display it use field TECH = 'X'.

Regards

4 REPLIES 4

Former Member
0 Kudos

U can avoid the fields using the option NO_OUT

Narendra

Former Member
0 Kudos

Hey do 1 thing,don't assign any column postion to that filed catalog,whom you don't want to display in ALV output.

hope its works.

regds

raymond_giuseppi
Active Contributor
0 Kudos

Use field catalog

To force header to medium text, use field DDICTXT = 'M'. (If column width changes the program will search the best header, so remove other texts if you don't want that behavior)

To not display a field use field NO_OUT = 'X', to insure that user wont display it use field TECH = 'X'.

Regards

Former Member
0 Kudos

Hi,

below code may help u.

REPORT ZGRO_TEST1.

*

TABLES: USR02. "Logon-Daten

*

TYPE-POOLS: SLIS.

*

DATA: BEGIN OF USERTAB OCCURS 0,

CLASS like USR02-CLASS,

CNT TYPE P DECIMALS 0,

END OF USERTAB.

*

Daten und Tabellen für ABAP Listviewer

DATA: PROGNAME LIKE SY-REPID,

FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

SORT TYPE SLIS_T_SORTINFO_ALV.

************************************************************************

START-OF-SELECTION.

*

PERFORM EINLESEN.

*

PERFORM AUSGABE.

*

************************************************************************

FORM EINLESEN.

*

SELECT * FROM USR02. " where bname = sy-uname.

*

MOVE USR02-CLASS TO USERTAB-CLASS.

*

MOVE 1 TO USERTAB-CNT.

*

APPEND USERTAB.

*

ENDSELECT.

*

ENDFORM.

************************************************************************

FORM AUSGABE.

*

PROGNAME = SY-REPID.

*

Feldkatatalog vorbereiten auf Basis der ITAB-Definitionen

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = PROGNAME

I_INTERNAL_TABNAME = 'USERTAB'

I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = PROGNAME

CHANGING

CT_FIELDCAT = FIELDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

*

Feldkatalog etwas abändern (Titel, Spaltenbreite)

PERFORM SPALTENEIGENSCHAFTEN USING FIELDCAT.

Sortierung und Summenbildung festlegen

PERFORM SORT_DEFINIEREN USING SORT.

*

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = PROGNAME

IT_FIELDCAT = FIELDCAT

IT_SORT = SORT

TABLES

T_OUTTAB = USERTAB

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

ENDFORM.

************************************************************************

FORM SPALTENEIGENSCHAFTEN USING P_FIELDCAT

TYPE SLIS_T_FIELDCAT_ALV.

*

DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

*

LOOP AT P_FIELDCAT INTO WA_FIELDCAT.

Spaltenüberschriften

CASE WA_FIELDCAT-FIELDNAME.

WHEN 'CNT'.

MOVE 8 TO WA_FIELDCAT-OUTPUTLEN.

MOVE 'X' TO WA_FIELDCAT-DO_SUM.

MOVE 'Anzahl' TO WA_FIELDCAT-SELTEXT_M.

ENDCASE.

*

MODIFY P_FIELDCAT INDEX SY-TABIX FROM WA_FIELDCAT .

*

ENDLOOP.

*

ENDFORM.

************************************************************************

FORM SORT_DEFINIEREN USING SORT TYPE SLIS_T_SORTINFO_ALV.

*

DATA: WA_SORT TYPE SLIS_SORTINFO_ALV.

*

WA_SORT-SPOS = 1.

WA_SORT-FIELDNAME = 'CLASS'.

WA_SORT-UP = ' '.

WA_SORT-DOWN = 'X'.

WA_SORT-GROUP = 'UL'.

WA_SORT-SUBTOT = 'X'.

APPEND WA_SORT TO SORT.

*

ENDFORM.

************************************************************************

regards,

vasavi.

kindly reward if helpful.