Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

date field

Former Member
0 Likes
570

Hi,

how can we only print month from a date field in smartforms.

e.g. 21.08.2006(Ardat) . how can we print 08 from this field.

regards

Rahul

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
544

Hi Rahul,

Make use of Offset ..

v_dat = ardat+3(2).

-Mohan.

5 REPLIES 5
Read only

Former Member
0 Likes
544

You will have to write a piece of code, to extract the date and put in a variable. Use that to print the month.

You can create a PROGRAM LINES object and write the code there.

Month = date+0(2).

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
544

Pass the data to one more variable and print in smart form.

Ex. g_month(2) type c.

g_month = date+2(2).

Read only

Former Member
0 Likes
545

Hi Rahul,

Make use of Offset ..

v_dat = ardat+3(2).

-Mohan.

Read only

Former Member
0 Likes
544

Hi Rahul

For DATS data type, you can use statement like below:

<b>write:/ sy-datum+4(2).

or as in your case:

write:/ ardat+4(2).</b>

Kind Regards

Eswar

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
544

Hi,

Just store the date value in a variable.Use program lines to do the coding.

General declaration->v1(10) type c.

v2(2).

Input :

ardat

Output :

v1

v2

Coding:

v1 = ardat.

v2 = v1+3(2).

unpack v2 to v2.

Create text element and print v2 there.

Even you can avoid using v1 by assigning ardat+3(2) directly to v2.

Kindly reward if it helps.