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

SAP Script : Date is Boxes ??

Former Member
0 Likes
867

Dear All,

I wanted to print date in boxes. i,e MM DD YY in boxes.

I am doing like this.

/: SET DATE MASK = 'MM.DD.YY'

and then playing with Box Command, to draw vertical lines in between DD, MM and YY... with

BOX HEIGHT '0.5' CM FRAME 10 TW

BOX XPOS '.48' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW

BOX XPOS '.78' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW

Is this a right method ?? or Else

Should there be a Standard method to print Date in Boxes ..

Please let me know ...

Thanks

Regards

venkat.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
802

HI venkat, If you just want a separator '|' between mm|dd|yy then you can build a variable like this

concatenate '|' mm dd yy '|' into v_new_date separated by '|'.

Use this v_new_date to be printed on the sap script.

But it will not be like boxes.

Other wise, your approach is correct.

Regards,

Ravi

6 REPLIES 6
Read only

Former Member
0 Likes
803

HI venkat, If you just want a separator '|' between mm|dd|yy then you can build a variable like this

concatenate '|' mm dd yy '|' into v_new_date separated by '|'.

Use this v_new_date to be printed on the sap script.

But it will not be like boxes.

Other wise, your approach is correct.

Regards,

Ravi

Read only

vinod_gunaware2
Active Contributor
0 Likes
802

Hi

I think it is correct approach.

here is some more details

To define the formatting of date fields, use the SET DATE MASK control command. Executing this command causes all subsequent date fields to be printed using the specified format.

Syntax:

/: SET DATE MASK = 'date_mask'

In the date mask, you can use the following codes:

· DD: day (two digits)

· DDD: day name - abbreviated

· DDDD: day name - written out in full

· MM: month (two digits)

· MMM: month name - abbreviated

· MMMM: month name - written out in full

· YY: year (two digits)

· YYYY: year (four digits)

· LD: day (formatted as for the L option)

· LM: month (formatted as for the L option)

· LY: year (formatted as for the L option)

All other characters found in a date mask are interpreted as simple text and are copied straight into the output.

Assuming the current system date is March 1st, 1997.

/: SET DATE MASK = 'Foster City, MM/DD/YY'

&DATE& -> Foster City, 03/01/97

/: SET DATE MASK = 'MMMM DD, YYYY'

&DATE& -> March 01, 1997

The date mask may be reset to the default setting by using an empty string:

/: SET DATE MASK = ' '

The abbreviated and full forms of the names of the days and months are stored in the language dependent TTDTG table under the following keys:

· %%SAPSCRIPT_DDD_dd: abbreviated day name

· %%SAPSCRIPT_DDDD_dd: full form of day name

· %%SAPSCRIPT_MMM_mm: abbreviated month name

· %%SAPSCRIPT_MMMM_mm: full form of month name

dd: day number 01 = Monday,..., 07 = Sunday

mm: month number 01 = January,..., 12 = December

regards

vinod

Read only

Former Member
0 Likes
802

Yes..your approach is rite. One box, two vertical lines in it, will create three boxes.Then you place the date

in it.

Thanks,

Vamshi Tallada

Read only

0 Likes
802

Thank you Vamshi, Vinod & Ravi.

But I am still wondering that there could be a better way than just playing with Vertical lines. Anyway job is completed.

I am keeping this thread open, may be we will get some other opinions...

Anyway, I will allot some points to your efforts ..

Thanks & Regards

Venkat

Read only

0 Likes
802

Dear Senior SAP Guys,

Please look at this question and Solution and Give your advice.

Read only

Former Member
0 Likes
802

Hai Venkat

BOX HEIGHT '0.5' CM FRAME 10 TW

BOX XPOS '.48' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW

BOX XPOS '.78' CM WIDTH 0 TW HEIGHT '0.5' CM FRAME 10 TW

using POSITION XORIGIN 10ch YORIGIN 22 LN command in between the abobe statements

Thanks & Regards

Sreenivasulu P