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

Abap code 'concatenate' with 0calday

Former Member
0 Likes
668

Hi Friends

I read the field zfiscper 8 (AAAAMMM) and I need convert this to the first day of this period (AAAAMM01)

The problem is that zfiscper has 7 digits (AAAAMMM) and I need only 6 (AAAAMM) +'01'

IE: The period value is 2010003

I try with CONCATENATE VPERIO0(4) VPERIO6(2) '01' INTO RESULT.

and give the error: 20103001 is not valid

after I try with CONCATENATE VPERIO0(4) VPERIO5(2) '01' INTO RESULT.

and give me the error: 20100030 is not valid

seems to be problem to capture the month

How can I get it?

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
608

The second should be ok. Try this one then


result = vperio(4).  "year
result+4(2) = vperio+5(2). "month
result+6(2) = '01'. "first day

Regards

Marcin

The second should be ok. Try this one then


result = vperio(4).  "year
result+4(2) = vperio+5(2). "month
result+6(2) = '01'. "first day

Regards

Marcin

3 REPLIES 3
Read only

MarcinPciak
Active Contributor
0 Likes
609

The second should be ok. Try this one then


result = vperio(4).  "year
result+4(2) = vperio+5(2). "month
result+6(2) = '01'. "first day

Regards

Marcin

Read only

0 Likes
608

the same error..

"Value '20100030 ' of characteristic 0DATE is not plausible BRAIN 27 @3R@"

pls, take in account that zperi is char(7) and 0calday is DATS (8)

What can we do?

Read only

0 Likes
608

as we can clearly see, the ABAP is correct and you should get 20100301. So either you don't give the right info (input format is not 2010003 for example, or you get another format), or the error doesn't come from the abap but from BI (20100301 would be transformed to something else...)

First of all, debug your code. If you still don't solve, explain the context when the code is executed...