*----------------------------------------------------------------------*
* PARAMETERS * PARAMETERS宣言
*----------------------------------------------------------------------*
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(10) text-t07 USER-COMMAND jtdp.
SELECTION-SCREEN PUSHBUTTON 13(10) text-t08 USER-COMMAND brdp.
SELECTION-SCREEN: END OF LINE.
SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-t01. "選択条件
SELECTION-SCREEN: BEGIN OF BLOCK blk3 WITH FRAME TITLE text-t03. "受注伝票情報
SELECT-OPTIONS: so_jtdpy FOR c_denp_bg, "受注伝票番号
so_brdpy FOR c_denp_bg, "伝票番号(物流画面)
so_ksdpy FOR c_denp_bg, "検収伝票番号
so_kydpy FOR c_denp_bg, "解約伝票番号
so_shdno FOR c_sh_no, "商談№
SELECTION-SCREEN: END OF BLOCK blk3.
SELECTION-SCREEN: BEGIN OF BLOCK blk4 WITH FRAME TITLE text-t04. "物流現調伝票情報
SELECT-OPTIONS: so_brdpb FOR c_br_denp_bg, "物流現調伝票番号
so_custm FOR c_cust, "顧客
so_tteig FOR c_sal_in, "担当営業
so_soddt FOR d_sod_hk_dt, "主オーダ発行日
so_lstdm FOR d_lst_olndt_km, "最終オンライン操作日(解約前)
so_lstdg FOR c_lst_olndt_kg, "最終オンライン操作日(解約後)
so_onldt FOR d_kt_ol_ko_dt. "最終オンライン操作日
* 最終変更日時(FROM)
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: POSITION 31.
PARAMETERS: pa_fromd TYPE d.
SELECTION-SCREEN: POSITION 43.
PARAMETERS: pa_fromt TYPE t.
SELECTION-SCREEN: COMMENT 1(20) text-t05 FOR FIELD pa_fromd. "最終変更日時(FROM)
SELECTION-SCREEN: END OF LINE.
* 最終変更日時(TO)
SELECTION-SCREEN: BEGIN OF LINE.
SELECTION-SCREEN: POSITION 31.
PARAMETERS: pa_tod TYPE d.
SELECTION-SCREEN: POSITION 43.
PARAMETERS: pa_tot TYPE t.
SELECTION-SCREEN: COMMENT 1(16) text-t06 FOR FIELD pa_tod. "最終変更日時(TO)
SELECTION-SCREEN: END OF LINE.
PARAMETERS: pa_koumk TYPE as4text. "項目名
SELECTION-SCREEN: END OF BLOCK blk4.
SELECTION-SCREEN: END OF BLOCK blk1.
SELECTION-SCREEN: BEGIN OF BLOCK blk2 WITH FRAME TITLE text-t02. "出力条件
PARAMETERS: pa_kensu(15) TYPE n DEFAULT 100 OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK blk2.
* 選択条件変換用パラメータ(最終変更日時)
SELECT-OPTIONS: so_date FOR d_date NO-DISPLAY,
so_time FOR t_time NO-DISPLAY.
PARAMETERS: pa_code(4) TYPE c NO-DISPLAY.
*----------------------------------------------------------------------*
* INITIALIZATION 初期処理
*----------------------------------------------------------------------*
INITIALIZATION.
GET PARAMETER ID cc_memory_id FIELD c_memory.
IF c_memory IS INITIAL.
SET TITLEBAR cc_titlebar_100.
* 受注伝票選択画面を設定する
PERFORM fm_set_dynpro_jtdp.
pa_code = cc_ok_code_jtdp.
ELSE.
pa_code = c_memory.
SET PARAMETER ID cc_memory_id FIELD cc_ok_code_jtdp.
ENDIF.
*----------------------------------------------------------------------*
* AT SELECTION-SCREEN 画面制御処理
*----------------------------------------------------------------------*
AT SELECTION-SCREEN.
IF sy-ucomm = cc_ok_code_jtdp
OR sy-ucomm = cc_ok_code_brdp
OR sy-ucomm = cc_ok_code_ksdp
OR sy-ucomm = cc_ok_code_kydp.
pa_code = sy-ucomm.
ENDIF.
* 実行の場合のみ、画面チェックする
IF sy-ucomm = cc_ok_code_exct.
* 画面チェック
PERFORM fm_check_select.
ENDIF.
*----------------------------------------------------------------------*
* AT SELECTION-SCREEN OUTPUT 画面制御処理
*----------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
CASE pa_code.
* 受注伝票の場合
WHEN cc_ok_code_jtdp.
SET TITLEBAR cc_titlebar_100.
* 受注伝票選択画面を設定する
PERFORM fm_set_dynpro_jtdp.
c_ok_code_sav = pa_code.
* 物流伝票の場合
WHEN cc_ok_code_brdp.
SET TITLEBAR cc_titlebar_200.
* 物流伝票選択画面を設定する
PERFORM fm_set_dynpro_brdp.
c_ok_code_sav = pa_code.
* 検収伝票の場合
WHEN cc_ok_code_ksdp.
SET TITLEBAR cc_titlebar_300.
* 検収伝票選択画面を設定する
PERFORM fm_set_dynpro_ksdp.
c_ok_code_sav = pa_code.
* 解約伝票の場合
WHEN cc_ok_code_kydp.
SET TITLEBAR cc_titlebar_400.
* 解約伝票選択画面を設定する
PERFORM fm_set_dynpro_kydp.
c_ok_code_sav = pa_code.
WHEN OTHERS.
CASE c_ok_code_sav.
* 受注伝票の場合
WHEN cc_ok_code_jtdp.
SET TITLEBAR cc_titlebar_100.
* 受注伝票選択画面を設定する
PERFORM fm_set_dynpro_jtdp.
* 物流伝票の場合
WHEN cc_ok_code_brdp.
SET TITLEBAR cc_titlebar_200.
* 物流伝票選択画面を設定する
PERFORM fm_set_dynpro_brdp.
* 検収伝票の場合
WHEN cc_ok_code_ksdp.
SET TITLEBAR cc_titlebar_300.
* 検収伝票選択画面を設定する
PERFORM fm_set_dynpro_ksdp.
* 解約伝票の場合
WHEN cc_ok_code_kydp.
SET TITLEBAR cc_titlebar_400.
* 解約伝票選択画面を設定する
PERFORM fm_set_dynpro_kydp.
ENDCASE.
ENDCASE.
*----------------------------------------------------------------------*
* START-OF-SELECTION 処理実行
*----------------------------------------------------------------------*
START-OF-SELECTION.
* 選択画面に選択条件【最終変更日時】の編集
PERFORM fm_edit_so_date_time.
CASE c_ok_code_sav.
* 受注伝票の場合
WHEN cc_ok_code_jtdp.
* 受注伝票情報取得する
PERFORM fm_get_data_jtdp.
* ALV一覧項目編集(受注伝票)
PERFORM fm_edit_alv_jtdp.
* ALV一覧出力(受注伝票)
PERFORM fm_output_alv TABLES itab_jtdp.
* 物流伝票の場合
WHEN cc_ok_code_brdp.
* 物流伝票情報取得する
PERFORM fm_get_data_brdp.
* ALV一覧項目編集(物流伝票)
PERFORM fm_edit_alv_brdp.
* ALV一覧出力(物流伝票)
PERFORM fm_output_alv TABLES itab_brdp.
* 検収伝票の場合
WHEN cc_ok_code_ksdp.
* 検収伝票情報取得する
PERFORM fm_get_data_ksdp.
* ALV一覧項目編集(検収伝票)
PERFORM fm_edit_alv_ksdp.
* ALV一覧出力(検収伝票)
PERFORM fm_output_alv TABLES itab_ksdp.
* 解約伝票の場合
WHEN cc_ok_code_kydp.
* 解約伝票情報取得する
PERFORM fm_get_data_kydp.
* ALV一覧項目編集(解約伝票)
PERFORM fm_edit_alv_kydp.
* ALV一覧出力(解約伝票)
PERFORM fm_output_alv TABLES itab_kydp.
ENDCASE.
* 伝票種類メモリへ設定
c_memory = c_ok_code_sav.
SET PARAMETER ID cc_memory_id FIELD c_memory.
*&---------------------------------------------------------------------*
*& Form FM_CHECK_SELECT
*&---------------------------------------------------------------------*
* 画面チェック
*----------------------------------------------------------------------*
FORM fm_check_select .
* 伝票種類より、画面入力項目チェック
CASE: c_ok_code_sav.
* 受注伝票の場合
WHEN cc_ok_code_jtdp.
IF so_jtdpy IS INITIAL "受注伝票
AND so_shdno IS INITIAL "商談№
AND pa_tod IS INITIAL "最終変更日(TO)
AND pa_tot IS INITIAL. "最終変更時(TO)
* エラーメッセージ:検索条件を入力してください
MESSAGE e128(zbusa_0000).
ENDIF.
* 物流伝票の場合
WHEN cc_ok_code_brdp.
IF so_brdpy IS INITIAL "伝票番号(物流伝票画面)
AND so_shdno IS INITIAL "商談№
* エラーメッセージ:検索条件を入力してください
MESSAGE e128(zbusa_0000).
ENDIF.
* 検収伝票の場合
WHEN cc_ok_code_ksdp.
IF so_ksdpy IS INITIAL "検収伝票
AND so_shdno IS INITIAL "商談№
AND pa_tot IS INITIAL. "最終変更時(TO)
* エラーメッセージ:検索条件を入力してください
MESSAGE e128(zbusa_0000).
ENDIF.
* 解約伝票の場合
WHEN cc_ok_code_kydp.
IF so_kydpy IS INITIAL "解約伝票
AND so_shdno IS INITIAL "商談№
AND so_chmno IS INITIAL "注文№
AND so_kykno IS INITIAL "契約管理№
AND so_kysno IS INITIAL "契約先
AND so_custm IS INITIAL "顧客
AND so_tteig IS INITIAL "担当営業
AND so_ebscd IS INITIAL "営業部署コード
AND so_egpcd IS INITIAL "営業グループコード
AND so_insed IS INITIAL "インサイドセールス
AND so_kykdt IS INITIAL "解約日
AND so_odano IS INITIAL "オーダ№
AND so_soddt IS INITIAL "主オーダ発行日
AND so_lstdg IS INITIAL "最終オンライン操作日(解約後)
AND so_lstdm IS INITIAL "最終オンライン操作日(解約前)
AND pa_fromd IS INITIAL "最終変更日(FROM)
AND pa_fromt IS INITIAL "最終変更時(FROM)
AND pa_tod IS INITIAL "最終変更日(TO)
AND pa_tot IS INITIAL. "最終変更時(TO)
* エラーメッセージ:検索条件を入力してください
MESSAGE e128(zbusa_0000).
ENDIF.
ENDCASE.
ENDFORM. " FM_CHECK_SELECT
*&---------------------------------------------------------------------*
*& Form FM_SET_DYNPRO_JTDP
*&---------------------------------------------------------------------*
* 受注伝票選択画面を設定する
*----------------------------------------------------------------------*
FORM fm_set_dynpro_jtdp .
LOOP AT SCREEN.
IF screen-name CS cc_scr_name_block3 "BLOCK3(受注伝票情報)
OR screen-name CS cc_scr_name_block4 "BLOCK4(物流現調伝票情報)
OR screen-name CS cc_scr_name_brdpy "物流伝票
OR screen-name CS cc_scr_name_ksdpy "検収伝票
OR screen-name CS cc_scr_name_kydpy "解約伝票
OR screen-name CS cc_scr_name_brdpb "物流現調伝票
OR screen-name CS cc_scr_name_duedt "希望納期
OR screen-name CS cc_scr_name_setpl "設置場所
OR screen-name CS cc_scr_name_delpl "一次搬入先
OR screen-name CS cc_scr_name_kshdt "検収日
OR screen-name CS cc_scr_name_sksdy "使用開始日
OR screen-name CS cc_scr_name_sksdn "使用開始日(無償)
OR screen-name CS cc_scr_name_kykdt "解約日
OR screen-name CS cc_scr_name_lstdm "最終オンライン操作日(解約前)
OR screen-name CS cc_scr_name_lstdg. "最終オンライン操作日(解約後)
screen-active = 0.
ENDIF.
IF screen-name CS cc_scr_name_pt1.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDFORM. " FM_SET_DYNPRO_JTDP
*&---------------------------------------------------------------------*
*& Form FM_SET_DYNPRO_BRDP
*&---------------------------------------------------------------------*
* 物流伝票選択画面を設定する
*----------------------------------------------------------------------*
FORM fm_set_dynpro_brdp .
LOOP AT SCREEN.
IF screen-name CS cc_scr_name_jtdpy "受注伝票
OR screen-name CS cc_scr_name_ksdpy "検収伝票
OR screen-name CS cc_scr_name_kydpy "解約伝票
OR screen-name CS cc_scr_name_kssno "決裁№
OR screen-name CS cc_scr_name_kshdt "検収日
OR screen-name CS cc_scr_name_sksdy "使用開始日
OR screen-name CS cc_scr_name_sksdn "使用開始日(無償)
OR screen-name CS cc_scr_name_kykdt "解約日
OR screen-name CS cc_scr_name_lstdm "最終オンライン操作日(解約前)
OR screen-name CS cc_scr_name_lstdg. "最終オンライン操作日(解約後)
screen-active = 0.
ENDIF.
IF screen-name CS cc_scr_name_pt2.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDFORM. " FM_SET_DYNPRO_BRDP
*&---------------------------------------------------------------------*
*& Form FM_SET_DYNPRO_KSDP
*&---------------------------------------------------------------------*
* 検収伝票選択画面を設定する
*----------------------------------------------------------------------*
FORM fm_set_dynpro_ksdp .
LOOP AT SCREEN.
IF screen-name CS cc_scr_name_block3 "BLOCK3(受注伝票情報)
OR screen-name CS cc_scr_name_block4 "BLOCK4(物流現調伝票情報)
OR screen-name CS cc_scr_name_jtdpy "受注伝票
OR screen-name CS cc_scr_name_brdpy "受注伝票(物流伝票画面)
OR screen-name CS cc_scr_name_kydpy "解約伝票
OR screen-name CS cc_scr_name_kssno "決裁№
OR screen-name CS cc_scr_name_brdpb "物流現調伝票
OR screen-name CS cc_scr_name_duedt "希望納期
OR screen-name CS cc_scr_name_setpl "設置場所
OR screen-name CS cc_scr_name_delpl "一次搬入先
OR screen-name CS cc_scr_name_kykdt "解約日
OR screen-name CS cc_scr_name_lstdm "最終オンライン操作日(解約前)
OR screen-name CS cc_scr_name_lstdg. "最終オンライン操作日(解約後)
screen-active = 0.
ENDIF.
IF screen-name CS cc_scr_name_pt3.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDFORM. " FM_SET_DYNPRO_KSDP
*&---------------------------------------------------------------------*
*& Form FM_SET_DYNPRO_KYDP
*&---------------------------------------------------------------------*
* 解約伝票選択画面を設定する
*----------------------------------------------------------------------*
FORM fm_set_dynpro_kydp .
LOOP AT SCREEN.
IF screen-name CS cc_scr_name_block3 "BLOCK3(受注伝票情報)
OR screen-name CS cc_scr_name_block4 "BLOCK4(物流現調伝票情報)
OR screen-name CS cc_scr_name_jtdpy "受注伝票
OR screen-name CS cc_scr_name_brdpy "物流伝票
OR screen-name CS cc_scr_name_ksdpy "検収伝票
OR screen-name CS cc_scr_name_kssno "決裁№
OR screen-name CS cc_scr_name_brdpb "物流現調伝票
OR screen-name CS cc_scr_name_duedt "希望納期
OR screen-name CS cc_scr_name_setpl "設置場所
OR screen-name CS cc_scr_name_delpl "一次搬入先
OR screen-name CS cc_scr_name_kshdt "検収日
OR screen-name CS cc_scr_name_sksdy "使用開始日
OR screen-name CS cc_scr_name_sksdn "使用開始日(無償)
OR screen-name CS cc_scr_name_onldt. "最終オンライン操作日
screen-active = 0.
ENDIF.
IF screen-name CS cc_scr_name_pt4.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDFORM. " FM_SET_DYNPRO_KYDP
*&---------------------------------------------------------------------*
*& Form FM_EDIT_SO_DATE_TIME
*&---------------------------------------------------------------------*
* 選択画面に選択条件【最終変更日時】の編集
*----------------------------------------------------------------------*
FORM fm_edit_so_date_time .
REFRESH: so_date, "最終変更日
so_time. "最終変更時
CLEAR: so_date, "最終変更日
so_time. "最終変更時
so_date-sign = cc_so_i.
so_date-option = cc_so_bt.
so_time-sign = cc_so_i.
so_time-option = cc_so_bt.
* 最終変更日(FROM)= INITIAL
IF pa_fromd IS INITIAL.
so_date-low = cc_date_begin.
ELSE.
so_date-low = pa_fromd.
ENDIF.
* 最終変更日(TO)= INITIAL
IF pa_tod IS INITIAL.
so_date-high = cc_date_end.
ELSE.
so_date-high = pa_tod.
ENDIF.
* 最終変更時(FROM)= INITIAL
IF pa_fromt IS INITIAL
OR pa_fromt = space.
so_time-low = cc_time_begin.
ELSE.
so_time-low = pa_fromt.
ENDIF.
* 最終変更時(TO)= INITIAL
IF pa_tot IS INITIAL
OR pa_tot = space.
so_time-high = cc_time_end.
ELSE.
so_time-high = pa_tot.
ENDIF.
APPEND so_date TO so_date.
APPEND so_time TO so_time.
ENDFORM. " FM_EDIT_SO_DATE_TIME