10-06-2008 6:54 AM
PERFORM build_fieldcat USING gt_fieldcat[] pos 'KUNNR' 'Customer No' 'X' ' '.
Please explain me this. I am new to abap
10-06-2008 6:56 AM
Hi,
Please double click on the perform statement it will take you to the form statement and that will explain to you what is going on.
But the best way to understand is go to FM
REUSE_ALV_LIST_DISPLAY and read the documentation on the right hand corner.
Regards,
Pramod
10-06-2008 6:56 AM
Hi,
Please double click on the perform statement it will take you to the form statement and that will explain to you what is going on.
But the best way to understand is go to FM
REUSE_ALV_LIST_DISPLAY and read the documentation on the right hand corner.
Regards,
Pramod
10-06-2008 8:44 AM
Thanks for ur information
Could u give me an idea about A L V r e l a t e d d e c l a r a t i o n s.
and the related naming conventions
10-06-2008 7:11 AM
Hi
To display an ALV list , a fieldcat has to built in order to specify the list of fields and their data types that has to be displayed in the ALV list.
once the fieldcat is built , the data table is built and both are passed to the FM
REUSE_ALV_LIST_DISplay to display the alv list.
Please find the code below which is in order .
1 . PERFORM display_alv.
FORM display_alv .
PERFORM build_alv.
PERFORM alv_display.
ENDFORM. PERFORM build_alv.
ORM build_alv .
PERFORM build_fcat USING
'BUKRS'
'gt_data'
'12'
text-t02.
PERFORM build_fcat USING
'HKONT'
'gt_data'
'11'
text-t03.
PERFORM build_fcat USING
'PRCTR'
'gt_data'
'13'
text-t04.
PERFORM build_fcat USING
'VBUND'
'gt_data'
'15'
text-t05.
PERFORM build_fcat USING
'SHKZG'
'gt_data'
'12'
text-t06.
PERFORM build_fcat USING
'SIGN'
'gt_data'
'4'
text-t08.
PERFORM build_fcat USING
'DMBTR'
'gt_data'
'15'
text-t07.
ENDFORM. " build_alv
FORM build_fcat USING value(p_0072)
value(p_0073)
value(p_0074)
p_text_t02.
gv_pos = gv_pos + 1.
wa_fcat-col_pos = gv_pos.
wa_fcat-fieldname = p_0072.
wa_fcat-tabname = p_0073.
wa_fcat-outputlen = p_0074.
wa_fcat-reptext_ddic = p_text_t02.
APPEND wa_fcat TO gt_fcat.
CLEAR wa_fcat.
ENDFORM. " build_fcat
&----
*& Form alv_display
&----
ALV display
----
--> p1 text
<-- p2 text
----
FORM alv_display .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = gt_fcat
i_save = 'A'
TABLES
t_outtab = gt_data[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM. " alv_display
regards,
Ramya
10-06-2008 8:43 AM
Thanks for ur information
Could u give me an idea about A L V r e l a t e d d e c l a r a t i o n s.
and the related naming conventions