SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

ALV



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Maxim080789
Участник
Участник



Joined: 04 May 2012
Posts: 7

PostPosted: Fri May 04, 2012 3:25 pm    Post subject: ALV Reply with quote

Ребята выручайте!что в моем коде не так.Программа не работает.Перечитал эту тему вдоль и поперек.ABAP только начал изучать!


(2).txt
 Description:

Download
 Filename:   (2).txt
 Filesize:  2.64 KB
 Downloaded:  1122 Time(s)

Back to top
View user's profile Send private message
Maxim080789
Участник
Участник



Joined: 04 May 2012
Posts: 7

PostPosted: Fri May 04, 2012 3:45 pm    Post subject: Re: ALV Reply with quote

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.



FORM build_fcat_1.

CLEAR gt_fieldcat.
GT_FIELDCAT-FIELDNAME = 'DELOV'.
GT_FIELDCAT-COLTEXT = TEXT-006.
GT_FIELDCAT-TOOLTIP = TEXT-006.
GT_FIELDCAT-SELTEXT = TEXT-006.
GT_FIELDCAT-DATATYPE = 'CHAR'.
GT_FIELDCAT-OUTPUTLEN = 10.
APPEND gt_fieldcat.
CLEAR gt_fieldcat.
GT_FIELDCAT-FIELDNAME = 'CONTSCH'.
GT_FIELDCAT-COLTEXT = TEXT-008.
GT_FIELDCAT-TOOLTIP = TEXT-008.
GT_FIELDCAT-SELTEXT = TEXT-008.
GT_FIELDCAT-DATATYPE = 'CHAR'.
GT_FIELDCAT-OUTPUTLEN = 12.
APPEND gt_fieldcat.
CLEAR gt_fieldcat.
GT_FIELDCAT-FIELDNAME = 'FAM'.
GT_FIELDCAT-COLTEXT = TEXT-009.
GT_FIELDCAT-TOOLTIP = TEXT-009.
GT_FIELDCAT-SELTEXT = TEXT-009.
GT_FIELDCAT-DATATYPE = 'CHAR'.
GT_FIELDCAT-OUTPUTLEN = 40.
APPEND gt_fieldcat.
ENDFORM.










это код если кому то удобнее!
Back to top
View user's profile Send private message
Удав
Гуру
Гуру


Age: 48
Joined: 25 Jan 2008
Posts: 580
Location: Москва

PostPosted: Fri May 04, 2012 3:54 pm    Post subject: Reply with quote

Посмторите программу BCALV_TEST_GRID. Она работает.
_________________
С уважением,
Удав.
Back to top
View user's profile Send private message
Maxim080789
Участник
Участник



Joined: 04 May 2012
Posts: 7

PostPosted: Fri May 04, 2012 4:00 pm    Post subject: Reply with quote

Удав wrote:
Посмторите программу BCALV_TEST_GRID. Она работает.







Спасибо,нашел решение.Все помогло!Поля во временной таблице в начале кода должны соответствовать присваиваемым в FORM build_fcat_1.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.