New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

SAP C_ABAPD_2507 Exam - Topic 5 Question 9 Discussion

Actual exam question for SAP's C_ABAPD_2507 exam
Question #: 9
Topic #: 5
[All C_ABAPD_2507 Questions]

You select a field flight_date with type DATS in the field list of a CDS view.

Which of the following expressions returns the 2-digit month from the field?

(Select 2 correct answers)

Show Suggested Answer Hide Answer
Suggested Answer: A, B

A DATS field is stored as YYYYMMDD.

Option A: substring( flight_date, 5, 2 ) Extracts characters 5--6 correct month.

Option B: right( left( flight_date, 6 ), 2 ) Takes first 6 chars YYYYMM, then last 2 correct month.

Option C: Wrong, extracts last 2 chars of MMDD, results in day not month.

Option D: Wrong, starts at 4 gives YM instead of MM.

Study Guide Reference: ABAP CDS Development Guide -- String Functions in CDS.


Contribute your Thoughts:

0/2000 characters
Christoper
2 months ago
Wait, how does D return the month? Seems off.
upvoted 0 times
...
Eura
2 months ago
Definitely A and D, no doubt about it!
upvoted 0 times
...
Doug
3 months ago
I think B might work too, but not sure.
upvoted 0 times
...
Rolf
3 months ago
A and D are correct!
upvoted 0 times
...
Ming
3 months ago
I agree, A and D are the way to go!
upvoted 0 times
...
Yvonne
3 months ago
I’m confused about the positions in these functions. I thought the month was always at the same place, but I can't recall if it’s 4 or 5 for the substring.
upvoted 0 times
...
Becky
3 months ago
I practiced a similar question last week, and I feel like B could be a valid way to extract the month too.
upvoted 0 times
...
Latrice
4 months ago
I'm not entirely sure, but I remember something about using substring for date fields. Maybe D is also a good choice?
upvoted 0 times
...
Marilynn
4 months ago
I think option A might be correct since it looks like it starts at the right position for the month.
upvoted 0 times
...
Precious
4 months ago
I'm not too sure about this. I think I'll try options B and C just to see if they work as well. Better to cover all the bases in the exam.
upvoted 0 times
...
Vannessa
4 months ago
I'm pretty confident about this one. The 2-digit month is the 5th and 6th characters of the date string, so option A and D should work.
upvoted 0 times
...
Kindra
4 months ago
Okay, I've got this. The DATS field type means it's a date field, so I can use the substring() function to extract the month part. I'll go with option A and D.
upvoted 0 times
...
Gearldine
5 months ago
Hmm, I'm a bit confused. I'm not sure if I should be using substring(), left(), or right() functions here. I'll have to think this through carefully.
upvoted 0 times
...
Glory
5 months ago
I think I'll try option A and D. The question is asking for the 2-digit month, so I'm guessing I need to extract the middle part of the date string.
upvoted 0 times
...
Jess
5 months ago
A and D are the correct answers. The month is always in the 5th and 6th positions of a DATS field.
upvoted 0 times
...
Tuyet
5 months ago
I think A and D might be correct.
upvoted 0 times
...

Save Cancel