*----------------------------------------------------------------------*
* INITIALIZATION
*----------------------------------------------------------------------*
INITIALIZATION.
PERFORM set_init.
*----------------------------------------------------------------------*
* AT SELECTION-SCREEN
*----------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
PERFORM modify_screen.
*----------------------------------------------------------------------*
* AT SELECTION-SCREEN
*----------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_month.
PERFORM f4_popup_to_select_month. <-스크린에 있는 p_month의 help를 달 예정이다.
*----------------------------------------------------------------------*
* START-OF-SELECTION
*----------------------------------------------------------------------*
START-OF-SELECTION.
PERFORM get_purchase_ledger.
PERFORM get_description.
PERFORM assign_descritpion.
*----------------------------------------------------------------------*
* END-OF-SELECTION
*----------------------------------------------------------------------*
END-OF-SELECTION.
PERFORM save_data.
저 부분의 소스는..
*&---------------------------------------------------------------------*
*& Form f4_popup_to_select_month
*&---------------------------------------------------------------------*
* Search help - Popup to choose a month
*----------------------------------------------------------------------*
FORM f4_popup_to_select_month .
DATA:
lt_dynpfields TYPE STANDARD TABLE OF dynpread,
ls_dynpfields TYPE dynpread,
l_subrc TYPE sy-subrc,
l_month TYPE isellist-month,
l_dyname TYPE sy-cprog.
FIELD-SYMBOLS:
<month> TYPE ANY.
* Value of screen reading
GET CURSOR FIELD ls_dynpfields-fieldname. <-해당 찍은 필드 이름 p_month
APPEND ls_dynpfields TO lt_dynpfields. CLEAR ls_dynpfields.
l_dyname = sy-cprog.
DO 2 TIMES.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = l_dyname
dynumb = sy-dynnr
TABLES
dynpfields = lt_dynpfields
EXCEPTIONS
invalid_abapworkarea = 01
invalid_dynprofield = 02
invalid_dynproname = 03
invalid_dynpronummer = 04
invalid_request = 05
no_fielddescription = 06
undefind_error = 07.
IF sy-subrc = 3.
* Current screen image is set of values
l_dyname = 'SAPLALDB'.
ELSE.
READ TABLE lt_dynpfields INTO ls_dynpfields INDEX 1.
* Underscores replaced with blanks
TRANSLATE ls_dynpfields-fieldvalue USING '_ '.
EXIT.
ENDIF.
ENDDO.
IF sy-subrc = 0.
* Conversion to internal format
CALL FUNCTION 'CONVERSION_EXIT_PERI_INPUT'
EXPORTING
input = ls_dynpfields-fieldvalue
IMPORTING
output = l_month.
IF l_month IS INITIAL.
* Month, initial => default value from Act. Date derived
l_month = sy-datlo+0(6).
ENDIF.
CALL FUNCTION 'POPUP_TO_SELECT_MONTH' <- 여기서 팝업을 띄워준다..
EXPORTING
actual_month = l_month
IMPORTING
selected_month = l_month
return_code = l_subrc
EXCEPTIONS
factory_calendar_not_found = 1
holiday_calendar_not_found = 2
month_not_found = 3
OTHERS = 4.
IF sy-subrc = 0 AND l_subrc = 0.
ASSIGN (ls_dynpfields-fieldname) TO <month>.
<month> = l_month.
ENDIF.
ENDIF.
ENDFORM. " f4_popup_to_select_month
'ERP-SAP > ABAP' 카테고리의 다른 글
<ABAP> Submit , import, Export 로 프로그램 호출 및 값 넘겨 주고 받기 (0) | 2011.06.24 |
---|---|
<ABAP> AT NEW, SUM, AT END, AT FIRST, AT LAST (0) | 2011.06.15 |
<ABAP> CLASS ALV 에서의 Top-of-page 만드는 소스 (0) | 2011.03.07 |
<ABAP> DEFINE의 활용. (0) | 2010.12.23 |
<ABAP> ALV - CLASS 로 만들기. ALV GRID CONTROL (0) | 2010.12.03 |