Chinaunix首页 | 论坛 | 博客
  • 博客访问: 586712
  • 博文数量: 154
  • 博客积分: 10208
  • 博客等级: 上将
  • 技术积分: 2225
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-16 14:02
文章分类

全部博文(154)

文章存档

2012年(4)

2011年(44)

2010年(50)

2009年(4)

2008年(52)

我的朋友

分类:

2010-07-05 10:27:57

function zconversion_user_date_format .
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     REFERENCE(IMP_DATE) TYPE  CHAR8
*"  CHANGING
*"     REFERENCE(CHG_DATE) TYPE  CHAR10
*"----------------------------------------------------------------------
  data: datfm like usr01-datfm.
  select single datfm into datfm from usr01
     where bname = sy-uname.
  if sy-subrc = 0.
    perform frm_formatdate using datfm imp_date
                                                    chg_date.
  endif.
endfunction.

*----------------------------------------------------------------------*
***INCLUDE LZFG_DATEF01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Form  FRM_FORMATDATE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form frm_formatdate using f_strtype type c
                                            f_stridate type any
                                            f_strcdate type any
                         .
  data: dtdate type d.
  data: stryear(4) type c.
  data: strmonth(2) type c.
  data: strday(2) type c.
  data: strspeareted type c.
  dtdate    = f_stridate.
  stryear   = dtdate(4).
  strmonth  = dtdate+4(2).
  strday    = dtdate+6(2).
*  clear: dtdate,stryear,strmonth,strday.
  perform getdateseperated using f_strtype
                        changing strspeareted.
  case f_strtype.
    when '1'.
      concatenate strday strmonth stryear
          into f_strcdate separated by strspeareted.
    when '2' or '3'.
      concatenate strmonth strday stryear
          into f_strcdate separated by strspeareted.
    when '4' or '5' or '6' or 'A' or 'B' or 'C'.
      concatenate stryear strmonth strday
          into f_strcdate separated by strspeareted.
  endcase.
endform.                    "frm_FormatDate
*&---------------------------------------------------------------------*
*&      Form  GETDATESEPERATED
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form getdateseperated using f_strdatetype type c
                     changing f_strseperated type c.
  case f_strdatetype.
    when '1' or '4' or '7'.
      f_strseperated = '.'.
    when '2' or '5' or '8' or 'A' or 'B' or 'C'.
      f_strseperated = '/'.
    when '3' or '6' or '9'.
      f_strseperated = '-'.
  endcase.
endform.                    "GetDateSeperated
阅读(586) | 评论(0) | 转发(0) |
0

上一篇:submit使用

下一篇:CASH_FLOW_CONSTRUCT_LOAN

给主人留下些什么吧!~~