VF01 Kalem Bazında Custom Tab Eklenmesi
Billing Item bazında VF01/VF02/VF03 yeni tab ekleme. Buton ekleme yapılıyor. Gerekirse VBRP-ZZ*** alanlar da eklenebilir.
1) SE38`den bir program oluşturulur.
ZSD_093_P_VF01_CUSTOM_TAB
2) Oluşturulan program için SE51`den ekran oluşturulur. Ekrana BTTN1 ismine &CURR fonksiyon isimli buton eklenir.
PROCESS BEFORE OUTPUT.
MODULE status_9999.
PROCESS AFTER INPUT.
MODULE user_command_9999.
PROCESS BEFORE OUTPUT.
MODULE status_9999.
PROCESS AFTER INPUT.
MODULE user_command_9999.
3) Oluşturulan program için SE51`den ekran oluşturulur. Ekrana BTTN1 ismine &CURR fonksiyon isimli buton eklenir.
4)SAPMV60A programının 6002 numaralı ekranına gidilir. Include MV60AF0C_CUST_ITEM_ACTIVATE içinde FORM CUST_ITEM_ACTIVATE `in hemen başlangıcına ehnancement eklenir.
*----------------------------------------------------------------------*
FORM CUST_ITEM_ACTIVATE .
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$SE:(1) Form CUST_ITEM_ACTIVATE, Start A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZSD_093_ENH_VF01_ADD_TAB. "active version
LOOP AT SCREEN.
IF screen-name EQ `TABSTRIP_TAB07`.
gs_cust_tab-item_caption = `Additional`.
gs_cust_tab-item_program = `ZSD_093_P_VF01_CUSTOM_TAB`.
gs_cust_tab-item_dynpro = `9999`.
IF NOT gs_cust_tab-item_dynpro IS INITIAL.
screen-active = 1.
screen-invisible = 0.
MODIFY SCREEN.
tabstrip_tab07 = gs_cust_tab-item_caption.
ENDIF.
ENDIF.
ENDLOOP.
ENDENHANCEMENT.
*----------------------------------------------------------------------*
FORM CUST_ITEM_ACTIVATE .
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$SE:(1) Form CUST_ITEM_ACTIVATE, Start A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZSD_093_ENH_VF01_ADD_TAB. "active version
LOOP AT SCREEN.
IF screen-name EQ `TABSTRIP_TAB07`.
gs_cust_tab-item_caption = `Additional`.
gs_cust_tab-item_program = `ZSD_093_P_VF01_CUSTOM_TAB`.
gs_cust_tab-item_dynpro = `9999`.
IF NOT gs_cust_tab-item_dynpro IS INITIAL.
screen-active = 1.
screen-invisible = 0.
MODIFY SCREEN.
tabstrip_tab07 = gs_cust_tab-item_caption.
ENDIF.
ENDIF.
ENDLOOP.
ENDENHANCEMENT.
5)ZZ`li bir alan eklendiğinde gerekmez, fakat buton eklenecekse MV60AI0G_GET_FCODE include`unun içinde MODULE GET_FCODE INPUT.`un sonunda bir yerde enhancement ile sy-ucomm`u `PFCU` olarak ezmek gerekir.
ENHANCEMENT 1 ZSD_093_ENH_VF01_ADD_TAB2. "active version
IF sy-tcode EQ `VF01` AND fcode EQ `&CURR`.
fcode = `PFCU`.
ENDIF.
ENDENHANCEMENT.
IF sy-tcode EQ `VF01` AND fcode EQ `&CURR`.
fcode = `PFCU`.
ENDIF.
ENDENHANCEMENT.
4)ZSD_093_P_VF01_CUSTOM_TAB programı içinde TAB`ın ve tab içinde ekrana eklenen alanların VF01-VF02-VF03` de nasıl gözükeceği yada gaözüküp gözükmeyeceği ayarlanır.
*&---------------------------------------------------------------------*
*& Report ZSD_093_P_VF01_CUSTOM_TAB
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zsd_093_p_vf01_custom_tab.
*&---------------------------------------------------------------------*
*& Module STATUS_9999 OUTPUT
*&---------------------------------------------------------------------*
MODULE status_9999 OUTPUT.
IF sy-tcode NE `VF01`.
LOOP AT SCREEN.
IF screen-name EQ `BTTN01`.
screen-active = 0.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9999 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_9999 INPUT.
DATA(lv_save_code) = sy-ucomm.
CLEAR: sy-ucomm.
CASE lv_save_code.
WHEN `&CURR`.
PERFORM f_get_rate.
ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Form F_GET_RATE
*&---------------------------------------------------------------------*
FORM f_get_rate.
DATA: lt_fields TYPE TABLE OF sval,
ls_fields TYPE sval,
lv_kkurs TYPE kkurs,
lv_rcode TYPE char1.
APPEND VALUE #( tabname = `PRCD_ELEMENTS`
fieldname = `KKURS` ) TO lt_fields.
CALL FUNCTION `POPUP_GET_VALUES`
EXPORTING
no_value_check = ` `
popup_title = `Enter CURR Rate`
start_column = `5`
start_row = `5`
IMPORTING
returncode = lv_rcode
TABLES
fields = lt_fields
EXCEPTIONS
error_in_fields = 1
others = 2.
IF sy-subrc EQ 0.
LOOP AT lt_fields INTO ls_fields WHERE tabname EQ `PRCD_ELEMENTS`
AND fieldname EQ `KKURS`.
lv_kkurs = ls_fields-value.
EXIT.
ENDLOOP.
ENDIF.
"IMPORT RV60AFZZ(userexit_pricing_prepare_tkomk) içinde.
EXPORT lv_kkurs FROM lv_kkurs TO MEMORY ID `ZSD_093_VF01_KKURS`.
ENDFORM.
*&---------------------------------------------------------------------*
*& Report ZSD_093_P_VF01_CUSTOM_TAB
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zsd_093_p_vf01_custom_tab.
*&---------------------------------------------------------------------*
*& Module STATUS_9999 OUTPUT
*&---------------------------------------------------------------------*
MODULE status_9999 OUTPUT.
IF sy-tcode NE `VF01`.
LOOP AT SCREEN.
IF screen-name EQ `BTTN01`.
screen-active = 0.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9999 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_9999 INPUT.
DATA(lv_save_code) = sy-ucomm.
CLEAR: sy-ucomm.
CASE lv_save_code.
WHEN `&CURR`.
PERFORM f_get_rate.
ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Form F_GET_RATE
*&---------------------------------------------------------------------*
FORM f_get_rate.
DATA: lt_fields TYPE TABLE OF sval,
ls_fields TYPE sval,
lv_kkurs TYPE kkurs,
lv_rcode TYPE char1.
APPEND VALUE #( tabname = `PRCD_ELEMENTS`
fieldname = `KKURS` ) TO lt_fields.
CALL FUNCTION `POPUP_GET_VALUES`
EXPORTING
no_value_check = ` `
popup_title = `Enter CURR Rate`
start_column = `5`
start_row = `5`
IMPORTING
returncode = lv_rcode
TABLES
fields = lt_fields
EXCEPTIONS
error_in_fields = 1
others = 2.
IF sy-subrc EQ 0.
LOOP AT lt_fields INTO ls_fields WHERE tabname EQ `PRCD_ELEMENTS`
AND fieldname EQ `KKURS`.
lv_kkurs = ls_fields-value.
EXIT.
ENDLOOP.
ENDIF.
"IMPORT RV60AFZZ(userexit_pricing_prepare_tkomk) içinde.
EXPORT lv_kkurs FROM lv_kkurs TO MEMORY ID `ZSD_093_VF01_KKURS`.
ENDFORM.