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 Steps

Former Member
0 Likes
408

plz send me the ALV Steps? how to write a program?

1 ACCEPTED SOLUTION
Read only

kiran_k8
Active Contributor
0 Likes
382

Ram,

1.use type-pools slis.

2.declare a varaible of type slis_t_fieldcat-alv.

3.declare the internal table.

4.write a select query.

5.call the Fn Mod reuse_alv_fieldcatlaog_merge to create a ALV structure.

Here in this Fn Module given the repid as sy-repid,table -internal table name,

fieldcat-the varaible which you have declared of type slis_t_fieldcat_alv.

6.Call the Fn Mod reuse_alv_list_display to get the alv list output.

K.Kiran.

2 REPLIES 2
Read only

p291102
Active Contributor
0 Likes
382

Hi,

This is the sample report for alv .

REPORT YMS_ALVDEMO .

TYPE-POOLS : SLIS.

TABLES : QALS.

DATA : BEGIN OF T_OUT OCCURS 0,

MATNR LIKE QALS-MATNR, "MATERIAL

WERK LIKE QALS-WERK, "PLANT

ART LIKE QALS-ART, "Inspaction Lot Type

OBJNR LIKE QALS-OBJNR, "Object Number

END OF T_OUT.

DATA : I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,

I_LAYOUT TYPE SLIS_LAYOUT_ALV,

GS_LAYOUT TYPE LVC_S_LAYO,

G_REPID TYPE SY-REPID,

LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

SELECT-OPTIONS:S_PRFLOS FOR QALS-PRUEFLOS.

INITIALIZATION.

G_REPID = SY-REPID.

I_LAYOUT-ZEBRA = 'X'.

I_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.

START-OF-SELECTION.

PERFORM FETCH_DATA.

END-OF-SELECTION.

PERFORM FILL_FIELDCAT.

PERFORM DISPLAY_ALV.

&----


*& Form FETCH_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM FETCH_DATA .

SELECT MATNR WERK ART OBJNR

FROM QALS

INTO TABLE T_OUT

WHERE PRUEFLOS IN S_PRFLOS.

ENDFORM. " FETCH_DATA

&----


*& Form FILL_FIELDCAT

&----


  • text

----


FORM FILL_FIELDCAT .

REFRESH I_FIELDCAT[].

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = G_REPID

I_INTERNAL_TABNAME = 'T_OUT'

I_INCLNAME = G_REPID

CHANGING

CT_FIELDCAT = I_FIELDCAT[]

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

ENDFORM. " FILL_FIELDCAT

&----


*& Form display_alv

&----


  • text

----


FORM DISPLAY_ALV .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = G_REPID

IS_LAYOUT = I_LAYOUT

IT_FIELDCAT = I_FIELDCAT[]

TABLES

T_OUTTAB = T_OUT

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

ENDFORM. " display_alv

Thanks,

Sankar M

Read only

kiran_k8
Active Contributor
0 Likes
383

Ram,

1.use type-pools slis.

2.declare a varaible of type slis_t_fieldcat-alv.

3.declare the internal table.

4.write a select query.

5.call the Fn Mod reuse_alv_fieldcatlaog_merge to create a ALV structure.

Here in this Fn Module given the repid as sy-repid,table -internal table name,

fieldcat-the varaible which you have declared of type slis_t_fieldcat_alv.

6.Call the Fn Mod reuse_alv_list_display to get the alv list output.

K.Kiran.