Application Development and Automation 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: 
Read only

alv -change the output without modify the code

Former Member
0 Likes
623

hi...............

how can we change the alv output without modifying the code .

plz help me.

4 REPLIES 4
Read only

Former Member
0 Likes
590

Please explain your need in words

Read only

Former Member
0 Likes
590

hi satya vani ,

use this code..after execution choose the button(ctrl+f8) then you can give the position and length of the output field..

then it will automatically changed...

report .

TABLES:LFA1.

SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.

DATA:BEGIN OF ITAB OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

NAME1 LIKE LFA1-NAME1,

LAND1 LIKE LFA1-LAND1,

ORT01 LIKE LFA1-ORT01,

REGIO LIKE LFA1-REGIO,

SORTL LIKE LFA1-SORTL,

CFIELD(4) TYPE C,

END OF ITAB.

DATA:LINE TYPE I.

SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR

IN LIFNR.

DESCRIBE TABLE ITAB LINES LINE.

LOOP AT ITAB.

IF SY-TABIX = LINE.

ITAB-CFIELD = 'C410'.

MODIFY ITAB.

ENDIF.

ENDLOOP.

TYPE-POOLS:SLIS.

DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.

DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.

DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.

LAYOUT-COLWIDTH_OPTIMIZE = 'X'.

LAYOUT-WINDOW_TITLEBAR = 'VENDORS DETAILS SCREEN'.

LAYOUT-EDIT = 'X'.

LAYOUT-info_fieldname = 'CFIELD'.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'ITAB'

I_INCLNAME = SY-REPID

CHANGING

CT_FIELDCAT = FCAT.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

IS_LAYOUT = LAYOUT

IT_FIELDCAT = FCAT

TABLES

T_OUTTAB = ITAB.

regards,

venkat.

Read only

0 Likes
590

hai venkat ..

thanks for giving this

u r using list display (for list - no editable mode .)

editable mode can be worked with grid display only..

tanx

Read only

RaymondGiuseppi
Active Contributor
0 Likes
590

Just create another ALV display variant, and check it as default. (Of course it should be possible to maintain display variants, look at parameters IS_VARIANT and I_SAVE)

Regards