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

regarding alv

Former Member
0 Likes
737

hi ,

i have created a ALV report but i am not understanding the somefunction that have been used in below program.plz tell me about the ? marked functions or whatever used in below report.

TYPE-POOLS: slis. ?????

DATA:

t_fieldcat TYPE slis_t_fieldcat_alv, ??????

l_fieldcat TYPE slis_fieldcat_alv, ?????

t_layout TYPE slis_layout_alv. ?????

DATA : BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARD-MATNR,

LGORT1 LIKE MARD-LGORT,

WERKS1 LIKE MARD-WERKS,

LGPBE LIKE MARD-LGPBE,

MAKTX LIKE MAKT-MAKTX,

MBWBEST LIKE S032-MBWBEST,

LGORT LIKE S032-LGORT,

WERKS LIKE S032-WERKS,

BASME LIKE S032-BASME,

END OF ITAB.

SELECTION-SCREEN : BEGIN OF BLOCK AMIT WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : MAT FOR MARD-MATNR.

SELECT-OPTIONS : BIN FOR MARD-LGPBE.

SELECT-OPTIONS : LOC FOR S032-LGORT DEFAULT 'MAIN'.

SELECT-OPTIONS : SITE FOR S032-WERKS DEFAULT '1901'.

SELECTION-SCREEN : END OF BLOCK AMIT.

FORMAT COLOR 4 INTENSIFIED ON.

WRITE: /1(20) 'MATERIAL' ,

30(70) 'DESCRIPTION',

75(15) 'BIN NO.',

111(15)'QUANTITY' ,

121(4) 'UOM'.

START-OF-SELECTION.

REFRESH : ITAB.

CLEAR : ITAB.

SELECT AMATNR ALGPBE BMAKTX CMBWBEST C~BASME INTO CORRESPONDING FIELDS OF TABLE ITAB

FROM

MARD AS A INNER JOIN MAKT AS B ON AMATNR = BMATNR INNER JOIN S032 AS C ON A~MATNR =

C~MATNR

WHERE A~LGORT IN LOC

AND A~WERKS IN SITE

AND C~LGORT IN LOC

AND C~WERKS IN SITE

AND A~MATNR IN MAT

AND A~LGPBE IN BIN

GROUP BY AMATNR ALGPBE BMAKTX CMBWBEST CBASME ORDER BY AMATNR.

PERFORM t_fieldcat.

PERFORM reuse_alv.

FORM t_fieldcat .

PERFORM fill_field USING 'MATNR' 'MATERIAL'. ???

PERFORM fill_field USING 'LGPBE' 'BIN NO'.

PERFORM fill_field USING 'MAKTX' 'MATERIAL DESCRIPTION'.

PERFORM fill_field USING 'MBWBEST' 'QUANTITY'.

PERFORM fill_field USING 'BASME' 'UOM'.

ENDFORM. "T_FIELDCAT

FORM fill_field USING p_fieldname ???

p_seltext. ????

l_fieldcat-fieldname = p_fieldname. ???

l_fieldcat-tabname = 'ITAB'. ???

l_fieldcat-seltext_m = p_seltext. ????

APPEND l_fieldcat TO t_fieldcat. ????

CLEAR l_fieldcat.

ENDFORM.

FORM reuse_alv . ??????

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' ?????

EXPORTING

is_layout = t_layout

it_fieldcat = t_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.

ENDFORM.

plz tell me about the above ???? marked things .means to say what is the purpose and need to use them in alv.

thanx/regards,

vaneet thakur

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
705

hI vaneet,

1.TYPE-POOLS: slis ITS USED FOR ALV REPORT command u should give this command for all ALV report.

2. l_fieldcat TYPE slis_fieldcat_alv - this is declaration for fieldcat for output dispaly in alv grid or list.

3. PERFORM fill_field USING 'MAKTX' 'MATERIAL DESCRIP - this command for performing display output individual field in alv grid display.

4. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' - this is the funtion module for alv report.

two type of alv output display.

1.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

2.CALL FUNCTION 'REUSE_ALV_list_DISPLAY'

with in this fm u give internal table name for display outputs in req display.

regards

G.vendhan

hi ,

i have created a ALV report but i am not understanding the somefunction that have been used in below program.plz tell me about the ? marked functions or whatever used in below report.

TYPE-POOLS: slis. ?????

DATA:

t_fieldcat TYPE slis_t_fieldcat_alv, ??????

l_fieldcat TYPE slis_fieldcat_alv, ?????

t_layout TYPE slis_layout_alv. ?????

DATA : BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARD-MATNR,

LGORT1 LIKE MARD-LGORT,

WERKS1 LIKE MARD-WERKS,

LGPBE LIKE MARD-LGPBE,

MAKTX LIKE MAKT-MAKTX,

MBWBEST LIKE S032-MBWBEST,

LGORT LIKE S032-LGORT,

WERKS LIKE S032-WERKS,

BASME LIKE S032-BASME,

END OF ITAB.

SELECTION-SCREEN : BEGIN OF BLOCK AMIT WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : MAT FOR MARD-MATNR.

SELECT-OPTIONS : BIN FOR MARD-LGPBE.

SELECT-OPTIONS : LOC FOR S032-LGORT DEFAULT 'MAIN'.

SELECT-OPTIONS : SITE FOR S032-WERKS DEFAULT '1901'.

SELECTION-SCREEN : END OF BLOCK AMIT.

FORMAT COLOR 4 INTENSIFIED ON.

WRITE: /1(20) 'MATERIAL' ,

30(70) 'DESCRIPTION',

75(15) 'BIN NO.',

111(15)'QUANTITY' ,

121(4) 'UOM'.

START-OF-SELECTION.

REFRESH : ITAB.

CLEAR : ITAB.

SELECT AMATNR ALGPBE BMAKTX CMBWBEST C~BASME INTO CORRESPONDING FIELDS OF TABLE ITAB

FROM

MARD AS A INNER JOIN MAKT AS B ON AMATNR = BMATNR INNER JOIN S032 AS C ON A~MATNR =

C~MATNR

WHERE A~LGORT IN LOC

AND A~WERKS IN SITE

AND C~LGORT IN LOC

AND C~WERKS IN SITE

AND A~MATNR IN MAT

AND A~LGPBE IN BIN

GROUP BY AMATNR ALGPBE BMAKTX CMBWBEST CBASME ORDER BY AMATNR.

PERFORM t_fieldcat.

PERFORM reuse_alv.

FORM t_fieldcat .

PERFORM fill_field USING 'MATNR' 'MATERIAL'. ???

PERFORM fill_field USING 'LGPBE' 'BIN NO'.

PERFORM fill_field USING 'MAKTX' 'MATERIAL DESCRIPTION'.

PERFORM fill_field USING 'MBWBEST' 'QUANTITY'.

PERFORM fill_field USING 'BASME' 'UOM'.

ENDFORM. "T_FIELDCAT

FORM fill_field USING p_fieldname ???

p_seltext. ????

l_fieldcat-fieldname = p_fieldname. ???

l_fieldcat-tabname = 'ITAB'. ???

l_fieldcat-seltext_m = p_seltext. ????

APPEND l_fieldcat TO t_fieldcat. ????

CLEAR l_fieldcat.

ENDFORM.

FORM reuse_alv . ??????

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' ?????

EXPORTING

is_layout = t_layout

it_fieldcat = t_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.

ENDFORM.

plz tell me about the above ???? marked things .means to say what is the purpose and need to use them in alv.

thanx/regards,

vaneet thakur

5 REPLIES 5
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
705

TYPE-POOLS: slis. ????? DATA: t_fieldcat TYPE slis_t_fieldcat_alv, ?????? l_fieldcat TYPE slis_fieldcat_alv, ????? t_layout TYPE slis_layout_alv. ????? DATA : BEGIN OF ITAB OCCURS 0, MATNR LIKE MARD-MATNR, LGORT1 LIKE MARD-LGORT, WERKS1 LIKE MARD-WERKS, LGPBE LIKE MARD-LGPBE, MAKTX LIKE MAKT-MAKTX, MBWBEST LIKE S032-MBWBEST, LGORT LIKE S032-LGORT, WERKS LIKE S032-WERKS, BASME LIKE S032-BASME, END OF ITAB. SELECTION-SCREEN : BEGIN OF BLOCK AMIT WITH FRAME TITLE TEXT-001. SELECT-OPTIONS : MAT FOR MARD-MATNR. SELECT-OPTIONS : BIN FOR MARD-LGPBE. SELECT-OPTIONS : LOC FOR S032-LGORT DEFAULT 'MAIN'. SELECT-OPTIONS : SITE FOR S032-WERKS DEFAULT '1901'. SELECTION-SCREEN : END OF BLOCK AMIT. FORMAT COLOR 4 INTENSIFIED ON. WRITE: /1(20) 'MATERIAL' , 30(70) 'DESCRIPTION', 75(15) 'BIN NO.', 111(15)'QUANTITY' , 121(4) 'UOM'. START-OF-SELECTION. REFRESH : ITAB. CLEAR : ITAB. SELECT A~MATNR A~LGPBE B~MAKTX C~MBWBEST C~BASME INTO CORRESPONDING FIELDS OF TABLE ITAB FROM MARD AS A INNER JOIN MAKT AS B ON A~MATNR = B~MATNR INNER JOIN S032 AS C ON A~MATNR = C~MATNR WHERE A~LGORT IN LOC AND A~WERKS IN SITE AND C~LGORT IN LOC AND C~WERKS IN SITE AND A~MATNR IN MAT AND A~LGPBE IN BIN GROUP BY A~MATNR A~LGPBE B~MAKTX C~MBWBEST C~BASME ORDER BY A~MATNR. PERFORM t_fieldcat. PERFORM reuse_alv. FORM t_fieldcat . PERFORM fill_field USING 'MATNR' 'MATERIAL'. ??? PERFORM fill_field USING 'LGPBE' 'BIN NO'. PERFORM fill_field USING 'MAKTX' 'MATERIAL DESCRIPTION'. PERFORM fill_field USING 'MBWBEST' 'QUANTITY'. PERFORM fill_field USING 'BASME' 'UOM'. ENDFORM. "T_FIELDCAT FORM fill_field USING p_fieldname ??? p_seltext. ???? l_fieldcat-fieldname = p_fieldname. ??? l_fieldcat-tabname = 'ITAB'. ??? l_fieldcat-seltext_m = p_seltext. ???? APPEND l_fieldcat TO t_fieldcat. ???? CLEAR l_fieldcat. ENDFORM. FORM reuse_alv . ?????? CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' ????? EXPORTING is_layout = t_layout it_fieldcat = t_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. ENDFORM.
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
705

Oh !!! Sorry ...

Dear friend check the dicumentation of each Function Modules ..

Read only

Former Member
0 Likes
706

hI vaneet,

1.TYPE-POOLS: slis ITS USED FOR ALV REPORT command u should give this command for all ALV report.

2. l_fieldcat TYPE slis_fieldcat_alv - this is declaration for fieldcat for output dispaly in alv grid or list.

3. PERFORM fill_field USING 'MAKTX' 'MATERIAL DESCRIP - this command for performing display output individual field in alv grid display.

4. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' - this is the funtion module for alv report.

two type of alv output display.

1.CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

2.CALL FUNCTION 'REUSE_ALV_list_DISPLAY'

with in this fm u give internal table name for display outputs in req display.

regards

G.vendhan

Read only

0 Likes
705

hi,

thanx for reply, i have created report successfully but tell me how to increase the size of columns in alv.

thanx/regards,

vaneet thakur

Read only

Former Member
0 Likes
705

Hi,

check in sdn lot of threads available regarding alv report

check the below link for progam

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/abapInteractiveALV+Program

Regards,

Madhu