Smartform, how use command SET DATE MASK like in SAPSCRIPT

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Chris96
Posts: 3
Joined: Mon May 12, 2003 9:06 am

Smartform, how use command SET DATE MASK like in SAPSCRIPT

Post by Chris96 » Mon May 12, 2003 9:35 am

Hi,

I want to use the command SET DATE MASK in SMARTFORM.
Like with SAPSCRIPT :
/: SET DATE MASK 'MMM DD, YYYY'
&DATE&

for the result : May 12, 2003

Chaps
Posts: 32
Joined: Mon Oct 21, 2002 11:01 am
Location: Boston, USA

Post by Chaps » Tue May 13, 2003 6:01 pm

Hi Chris,

This is possible by adding a Programming code before this text element.
In the code, you have to handle this via ABAP -

Code: Select all

  data: l_month like t247-mnr,
        l_month_descr like t247-ltx.

  l_month = sy-datum+4(2).

  select single ltx
  into l_month_descr
  from t247
  where spras = zzsf_billdoch-printlanguage and
        mnr = l_month.

  if not l_month_descr is initial.
    concatenate l_month_descr sy-datum+6(2)
    into v_faxdate separated by space.

    concatenate v_faxdate ',' into v_faxdate.
    concatenate v_faxdate sy-datum(4) into v_faxdate separated by space.

  endif. " L_Month_Descr.
Thanks,
Chaps.
"Skill is fine, and genius is splendid, but right contacts are more valuable than either. "
--Archibald McIndoe

Guest

Post by Guest » Tue May 13, 2003 10:46 pm

referring to Chaps code u can use FM HR_IN_GET_DATE_COMPONENTS to get month description. this FM also uses T247 table.

Cheers :)
DSC

MikeM

Post by MikeM » Wed May 14, 2003 1:58 pm

Unfortunately these are the only ways around the issue. Here's what SAP once said to me:
Hello Michael,

I am sorry, but the SET DATE MASK command doesn't exist in the
Smart Forms. The reason is this: In Sapscript you have a print
program and a layout set, which are seperated. So you need two
possibilities to set the date mask: In the print program e.g. via
the ABAP command SET COUNTRY and in the layout set via the
SET DATE MASK command. Unfortunately this often resulted in
some confusion.

Now in the Smart Forms you have the possibility to use
ABAP coding directly. So there was no need for a 'special Sapscript'
solution any more. You can set the date format directly by adding
a 'program lines' node into the Smart forms and setting the date
format e.g. via the SET COUNTRY command. The ABAP SET COUNTRY command
only sets the date format and the display of the decimal point.
If you need a more complicated date format, you may also create
a function module for the conversion and call that function module
in the Smart forms.

Yours sincerely
Holger Eichmann
SAP Support Center Europe

Post Reply