‎2008 Jul 02 2:36 AM
Well now i have to create a program that would get two parameters.
Posting period as well as the Company Code.
Posting period's format should always be (YYYYMM), I started by declaring
Parameters: pperd(6) type I Obligatory.
But then I noticed, that when I run it, the length of posting period reaches more than 6. I also noticed that there is a data type of ACCP. whose format is YYYYMM. Unfortunately when I try to declare it, it doesn't work.
I'm tyring to find the simplest solution possible, since I also have to implement error checking i.e Month should not be greater that 12 etc. can anyone help
‎2008 Jul 02 2:45 AM
Hi,
Pls try: Parameters: pperd type SPMON Obligatory.
Regards,
Pole
‎2008 Jul 02 2:52 AM
hI there
I'm afraid I tried your solution and its format is MM YYYY when i execute it.
I'm trying for YYYYMM.
also there was no error when I entered the month 20.
Thanks though I appreciate the effort
‎2008 Jul 02 3:13 AM
HI ,
use the table s031-spmon . it will take it in yyyymm. check it in the table table s031.ok . even if u want to declare as parameter declare like.
Parameters: pperd type N Obligatory.
or
Parameters: pperd like s031-spmon Obligatory.
it will consider only 6 .
nothing to get afraid . what ever the format it may be like MMYYYY or YYYYMM.
u can easily concatenate by your won way look at this example
CONCATENATE lt_output-ausbs6(2) '/' lt_output-ausbs4(2) '/'
lt_output-ausbs(4) INTO lt_file-ausbs.
or goto the TCODE : ABAPDOCU . type keyword as concatenate.
it will work .
reward if its really useful .
bye
vinoth
‎2008 Jul 02 3:48 AM
Hi Katrina ,
The format depends on your date format setting in your user master. And you should check the month value in your own program.
Regards,
Pole