Age: 48 Joined: 06 Aug 2010 Posts: 79 Location: Ukraine
Posted: Tue Sep 21, 2010 11:12 am Post subject: Не выводится ALV GRID
Народ, подскажите, уже даже не знаю на что грешить все таблицы заполняются данные есть, структура для вывода создана, все менюшки выводятся, а сама сетка не выводится что бы я не делал. Вот текст программы:
*&---------------------------------------------------------------------*
*& Module STATUS_1001 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_1001 OUTPUT.
SET PF-STATUS 'STANDARD'.
SET TITLEBAR '1001'.
ENDMODULE. " STATUS_1001 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_1001 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_1001 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_1001 INPUT
TYPES: BEGIN OF doc_type,
bal_str LIKE zmm_rsb-bal_str,
gr_name LIKE zmm_rsb-gr_name,
str_name LIKE zmm_rsb-str_name,
bklas LIKE mbew-bklas,
schetz LIKE skat-saknr,
scheto LIKE skat-saknr,
kolvo LIKE mseg-menge,
sumz LIKE mbew-stprs,
sumo LIKE mbew-stprs,
END OF doc_type.
DATA: BEGIN OF fcat_stru OCCURS 0,
bal_str LIKE zmm_rsb-bal_str,
gr_name LIKE zmm_rsb-gr_name,
str_name LIKE zmm_rsb-str_name,
bklas LIKE mbew-bklas,
schetz LIKE skat-saknr,
scheto LIKE skat-saknr,
kolvo LIKE mseg-menge,
sumz LIKE mbew-stprs,
sumo LIKE mbew-stprs.
DATA: END OF fcat_stru.
DATA: BEGIN OF it_alv OCCURS 0.
INCLUDE STRUCTURE zrsb_out.
DATA: END OF it_alv.
TYPES: BEGIN OF schet_type,
schet LIKE skat-saknr,
sumz LIKE mbew-stprs,
END OF schet_type.
DATA: BEGIN OF st_zmmrsb OCCURS 0.
INCLUDE STRUCTURE zmm_rsb.
DATA: END OF st_zmmrsb.
DATA: r_bklas TYPE RANGE OF mbew-bklas,
l_bklas LIKE LINE OF r_bklas,
idx LIKE sy-tabix.
DATA: l_zmmrsb LIKE LINE OF st_zmmrsb.
DATA: schet LIKE zsh_saldo_nit OCCURS 0 WITH HEADER LINE,
saldo LIKE zshsum_saldo_nit OCCURS 0 WITH HEADER LINE,
l_schet LIKE LINE OF schet.
DATA: t_doc TYPE doc_type OCCURS 0 WITH HEADER LINE,
it_doc TYPE doc_type OCCURS 0 WITH HEADER LINE.
DATA: ok_code LIKE sy-ucomm,
g_container TYPE scrfname VALUE 'CONT',
g_grid TYPE REF TO cl_gui_alv_grid,
g_custom_cont TYPE REF TO cl_gui_custom_container,
fcat_lvc TYPE lvc_t_fcat,
gt_fcat_lvc LIKE LINE OF fcat_lvc,
gt_fcat LIKE lvc_s_fcat,
it_fcat TYPE lvc_s_fcat OCCURS 0,
fcat_slis TYPE slis_t_fieldcat_alv,
gs_alvlayout TYPE lvc_s_layo.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_god LIKE mseg-mjahr OBLIGATORY DEFAULT sy-datum(4),
p_month(2) TYPE n DEFAULT sy-datum+4(2) OBLIGATORY.
"p_bklas LIKE mbew-bklas.
SELECTION-SCREEN: END OF BLOCK b1.
*&---------------------------------------------------------------------*
*& Form data_selection
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM data_selection.
SELECT * INTO TABLE st_zmmrsb FROM zmm_rsb.
LOOP AT st_zmmrsb INTO l_zmmrsb.
l_bklas-low = l_zmmrsb-bklas.
l_bklas-sign = 'I'.
l_bklas-option = 'EQ'.
APPEND l_bklas TO r_bklas.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM r_bklas.
SELECT t4~bal_str t4~gr_name t4~str_name t1~bklas t4~schetz t4~scheto
t3~lbkum AS kolvo
INTO CORRESPONDING FIELDS OF TABLE t_doc
FROM zmm_rsb AS t4
JOIN mbew AS t1 ON t1~bklas = t4~bklas
JOIN ckmlhd AS t2 ON t2~matnr = t1~matnr AND t2~bwkey = t1~bwkey
JOIN ckmlpp AS t3 ON t3~kalnr = t2~kalnr
WHERE
t1~bklas IN r_bklas AND
t3~bdatj = p_god AND
t3~poper = p_month.
"t1~bklas = p_bklas.
"GROUP BY t4~bal_str t4~gr_name t4~str_name t1~bklas t3~lbkum.
SORT t_doc BY bal_str gr_name str_name.
LOOP AT t_doc.
COLLECT t_doc INTO it_doc.
ENDLOOP.
LOOP AT it_doc.
CLEAR l_schet.
l_schet-hkont = it_doc-scheto.
APPEND l_schet TO schet.
CLEAR l_schet.
l_schet-hkont = it_doc-schetz.
APPEND l_schet TO schet.
ENDLOOP.
CALL FUNCTION 'ZSALDO_NIT'
EXPORTING
p_god = p_god "- год
p_be = '1000' "- 1000
p_nmes = p_month "- период
TABLES
sh = schet[] "- счета, которе передам в ФМ
shsum = saldo[]. "– выходная таблица
LOOP AT saldo.
READ TABLE it_doc WITH KEY schetz = saldo-hkont.
IF saldo-waers NE 'UAH'.
CONTINUE.
ENDIF.
idx = sy-tabix.
IF sy-subrc EQ 0.
it_doc-sumz = saldo-sum_uah.
MODIFY it_doc INDEX idx.
CLEAR: idx.
CONTINUE.
ELSE.
READ TABLE it_doc WITH KEY scheto = saldo-hkont.
IF saldo-waers NE 'UAH'.
CONTINUE.
ENDIF.
idx = sy-tabix.
IF sy-subrc EQ 0.
it_doc-sumo = saldo-sum_uah.
MODIFY it_doc INDEX idx.
CLEAR: idx.
CONTINUE.
ENDIF.
ENDIF.
ENDLOOP.
CLEAR: it_alv.
LOOP AT it_doc.
MOVE-CORRESPONDING it_doc TO it_alv.
it_alv-summa = it_doc-sumz + it_doc-sumo.
APPEND it_alv.
ENDLOOP.
ENDFORM. "data_selection
Age: 37 Joined: 18 Jan 2008 Posts: 71 Location: Tashkent-Astana-Moscow
Posted: Tue Sep 21, 2010 11:32 am Post subject:
формирование и вывод alv грида надо вынести в PBO 1001 экрана _________________ Пользователь не знает, чего он хочет, пока не увидит то, что он получил. (Э. Йодан)
Age: 37 Joined: 18 Jan 2008 Posts: 71 Location: Tashkent-Astana-Moscow
Posted: Tue Sep 21, 2010 11:46 am Post subject:
klkuznetsov wrote:
вызов формы alv_display поместил в модуль status_1001 который и является PBO экрана 1001, результат тот же что и раньше, а проще говоря не помогло
1) call screen 1001 выносим из alv_display
2) точно ли имя контейнера в 1001 экране = CONT
2) проверяем создаются ли нормально объекты контейнера и грида в дебагере если все объекты нормально создаются то по сути должно работать _________________ Пользователь не знает, чего он хочет, пока не увидит то, что он получил. (Э. Йодан)
Age: 170 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Tue Sep 21, 2010 12:28 pm Post subject:
klkuznetsov wrote:
Мдя... теперь вопрос как в атрибуты экрана добавить имя контейнера?
Заходите в Screen Painter.
Давите на кнопке слева Custom Contol.
На экране рисуете область нужного размера.
Называете ее CUST _________________ Молитва - это запрос разработчику на изменение кода программы.
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.