cancel
Showing results for 
Search instead for 
Did you mean: 

Date in SAPScript.

Former Member
0 Kudos

Hi Experts,

and how would you solve this?

Now I have

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

/    &DATE&

and would like to have for US "YYYY/MM/DD" and for others 'DD.MM.YYYY'

Please advice. I am beginner.

Thank you very much.

Kasia

Accepted Solutions (1)

Accepted Solutions (1)

naresh_bammidi
Contributor
0 Kudos

Hi,

1) First get the data of vendor into internal table (itab)

2)  loop the internal table  and in between the loop call the write_form with element

3) Under that element(in script) write the if condition based on country

     eg: if itab-country eq 'US'.

           /:   SET DATE MASK = YYYY/MM/DD

          else if

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

          endif.

Thanks

Naresh

Answers (2)

Answers (2)

Former Member
0 Kudos

Create a routine in your print program and call it in your smartform and in in program put the condition that for us

/: perform <form_name> in program <program_name>

   /: using <var1>

   /: using <var2>

   .

   .

   /: changing <return1>

   /: changing <return2>

   /: endperform

In program

FORM <form> TABLES fp_it_intab STRUCTURE itcsy     

                                        fp_it_outtab STRUCTURE itcsy.

.....

.....

Endform.

Former Member
0 Kudos

sorry, it should depends of country in vendor master data. Thx.

Former Member
0 Kudos

Hi,

did u get the answer.

try to use routines. in routines u give the condition.

regards,

Ramya R

Former Member
0 Kudos

Hi

You can do it based on IF conditions either in your script or in a subroutine in another program as already suggested.

Regards,

Shravan