24 Kasım 2011 Perşembe

SAP/ABAP: ISP_GET_WEEKDAY_NAME FM

METHOD IF_EX_MRM_PAYMENT_TERMS~PAYMENT_TERMS_SET.

*   {ADD Mert Zeki Başcıl 19.10.2012 11:24:17

  BREAK MZBASCIL.

  IF I_RBKPV-ZTERM EQ 'Z011'.

    DATA: LV_ENDDA    TYPE SY-DATUM,
          LV_DATUM    TYPE SY-DATUM,
          LV_LAST_DAY TYPE SY-DATUM,
          LV_OK       TYPE C,
          LV_TEXT(2)  TYPE C.

    E_ZFBDT  = I_RBKPV-BLDAT + 21.

    LV_DATUM = E_ZFBDT.

    CLEAR LV_OK.

    WHILE LV_OK IS INITIAL .

      CALL FUNCTION 'LAST_DAY_OF_MONTHS'
        EXPORTING
          DAY_IN            = LV_DATUM
        IMPORTING
          LAST_DAY_OF_MONTH = LV_ENDDA.

      LV_LAST_DAY = LV_ENDDA.

      WHILE LV_OK IS INITIAL AND LV_DATUM <= LV_LAST_DAY .

        CALL FUNCTION 'ISP_GET_WEEKDAY_NAME'
          EXPORTING
            DATE      = LV_LAST_DAY
            LANGUAGE  = 'E'
          IMPORTING
            SHORTTEXT = LV_TEXT.

        IF LV_TEXT = 'TU'.
          LV_OK = 'X'.
        ELSE.
          LV_LAST_DAY = LV_LAST_DAY - 1.
        ENDIF.

      ENDWHILE.

      IF LV_OK <> 'X'.
        LV_DATUM = LV_ENDDA + 1.
      ENDIF.

    ENDWHILE.

    E_ZFBDT = LV_LAST_DAY.

  ELSE.

    E_ZFBDT = I_RBKPV-ZFBDT.
    E_ZBD1T = I_RBKPV-ZBD1T.

  ENDIF.

*    } ADD Mert Zeki Başcıl 19.10.2012 11:24:17

ENDMETHOD.

Hiç yorum yok:

Yorum Gönder

İnsdroid

Sabahtan beri çatada çutada çatada çutada… Bitmedi yine de… Neyse, yolumuz uzun, toparlıyorum çantamı, adaptörü falan tıkıştırıyorum bir şe...