Posted: Fri May 04, 2012 3:45 pm Post subject: Re: ALV
REPORT Z_ALV_FORM.
data: BEGIN OF t_partn OCCURS 0,
a LIKE dfkkop-gpart,
b LIKE dfkkop-VKONT,
c LIKE but000-NAME_LAST,
* d like DFKKOP-BETRW,
END OF T_PARTN.
data: gt_fieldcat type lvc_t_fcat with header line.
data: tabs like table of t_partn.
data: r_container type REF TO CL_GUI_CUSTOM_CONTAINER,
r_grid type REF TO CL_GUI_ALV_GRID.
START-OF-SELECTION.
SELECT dfkkop~gpart
dfkkop~VKONT
but000~NAME_LAST
* sum( DFKKOP~BETRW )
from but000
INNER JOIN dfkkop on but000~partner = dfkkop~gpart
APPENDING CORRESPONDING FIELDS OF TABLE tabs
WHERE dfkkop~AUGST <> '9'
GROUP BY dfkkop~gpart dfkkop~VKONT but000~NAME_LAST.
CALL SCREEN 1000.
data: ok_code like sy-ucomm.
MODULE LIST OUTPUT.
SET PF-STATUS 'Z_GUI_STAT'.
SET TITLEBAR 'TITLE_100'.
clear ok_code.
****************************************
CREATE OBJECT r_container
EXPORTING
CONTAINER_NAME = 'CONTANER'. " IF SY-SUBRC NE 0
************************************
CREATE OBJECT r_grid
EXPORTING
I_PARENT = r_container. " IF SY-SUBRC NE 0
PERFORM build_fcat_1.
****************************
CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
CHANGING
it_fieldcatalog = gt_fieldcat[]
IT_OUTTAB = tabs[].
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE.
*************Параметры на выход********************************
MODULE Z_PAI INPUT.
case ok_code.
when 'BACK' or 'EXIT'.
leave PROGRAM.
when 'OK'.
endcase.
ENDMODULE.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.