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

Выбор месяца и года на Selection-Screen



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Search Help, Match Code
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Fri Oct 05, 2007 2:07 pm    Post subject: Выбор месяца и года на Selection-Screen Reply with quote

Code:
PARAMETER p_per type spmon default sy-datum.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_per.
  PERFORM MONAT_F4 .

************************************************************************
*                         search help period values                    *
FORM  MONAT_F4. "#EC CALLED
  DATA: BEGIN OF MF_DYNPFIELDS OCCURS 1.
          INCLUDE STRUCTURE DYNPREAD.
  DATA: END   OF MF_DYNPFIELDS.
  DATA: MF_RETURNCODE   LIKE SY-SUBRC,
        MF_MONAT        LIKE ISELLIST-MONTH,
        MF_HLP_REPID    LIKE SY-REPID.
*  FIELD-SYMBOLS: <MF_FELD>.

* Wert von Dynpro lesen
  GET CURSOR FIELD MF_DYNPFIELDS-FIELDNAME.
  APPEND MF_DYNPFIELDS.
  MF_HLP_REPID = SY-REPID.
  DO 2 TIMES.
    CALL FUNCTION 'DYNP_VALUES_READ'
         EXPORTING
              DYNAME               = MF_HLP_REPID
              DYNUMB               = SY-DYNNR
         TABLES
              DYNPFIELDS           = MF_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.
*     Aktuelles Dynpro ist Wertemengenbild
      MF_HLP_REPID = 'SAPLALDB'.
    ELSE.
      READ TABLE MF_DYNPFIELDS INDEX 1.
*     Unterstriche durch Blanks ersetzen
      TRANSLATE MF_DYNPFIELDS-FIELDVALUE USING '_ '.
      EXIT.
    ENDIF.
  ENDDO.
  IF SY-SUBRC = 0.
*   Konvertierung ins interne Format
    CALL FUNCTION 'CONVERSION_EXIT_PERI_INPUT'
         EXPORTING
              INPUT  = MF_DYNPFIELDS-FIELDVALUE
         IMPORTING
              OUTPUT = MF_MONAT
         EXCEPTIONS
              OTHERS = 0.
    if sy-subrc <> 0. " SLIN
    endif.
    IF MF_MONAT IS INITIAL.
*     Monat ist initial => Vorschlagswert aus akt. Datum ableiten
      MF_MONAT = SY-DATLO(6).
    ENDIF.
    CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
         EXPORTING
              ACTUAL_MONTH               = MF_MONAT
         IMPORTING
              SELECTED_MONTH             = MF_MONAT
              RETURN_CODE                = MF_RETURNCODE
         EXCEPTIONS
              FACTORY_CALENDAR_NOT_FOUND = 01
              HOLIDAY_CALENDAR_NOT_FOUND = 02
              MONTH_NOT_FOUND            = 03.
    IF SY-SUBRC = 0 AND MF_RETURNCODE = 0.
*     ASSIGN (MF_DYNPFIELDS-FIELDNAME) TO <MF_FELD>. " ==>> note 148804
*     <MF_FELD> = MF_MONAT.
      CALL FUNCTION 'CONVERSION_EXIT_PERI_OUTPUT'
           EXPORTING
                INPUT  =  MF_MONAT
           IMPORTING
                OUTPUT =  MF_DYNPFIELDS-FIELDVALUE.
      COLLECT MF_DYNPFIELDS.
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
           EXPORTING
                DYNAME               = MF_HLP_REPID
                DYNUMB               = SY-DYNNR
         TABLES
                DYNPFIELDS           = MF_DYNPFIELDS
           EXCEPTIONS
                INVALID_ABAPWORKAREA = 01
                INVALID_DYNPROFIELD  = 02
                INVALID_DYNPRONAME   = 03
                INVALID_DYNPRONUMMER = 04
                INVALID_REQUEST      = 05
                NO_FIELDDESCRIPTION  = 06
                UNDEFIND_ERROR       = 07.           "<<== note 148804
      check sy-subrc <> 0.
    ENDIF.
  ENDIF.
ENDFORM.                               "MONAT_F4
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 -> Search Help, Match Code 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.