Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

SAP Exam C_ABAPD_2507 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:

Latrice
2 days 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
8 days 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
13 days 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
18 days 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
23 days 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
28 days 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
1 month 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
1 month 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
1 month ago
I think A and D might be correct.
upvoted 0 times
...

Save Cancel