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

Data type problem

Former Member
0 Likes
563

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

4 REPLIES 4
Read only

pole_li
Active Participant
0 Likes
530

Hi,

Pls try: Parameters: pperd type SPMON Obligatory.

Regards,

Pole

Read only

Former Member
0 Likes
530

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

Read only

0 Likes
530

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

Read only

0 Likes
530

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