cancel
Showing results for 
Search instead for 
Did you mean: 

0calweek with only number of the week

former_member254358
Participant

Hi,

is there any infoobject similar to 0calweek but only with the number of the week?

For example, 07.2015 but to get only the 07.

or if not, how could I to achieve this?

Thanks in advance.

Regards.

Accepted Solutions (1)

Accepted Solutions (1)

anshu_lilhori
Active Contributor
0 Kudos

I do not think it is available for week.I know its there in case of month like 0calmonth2.

My suggestion to achieve this would be to create a zinfoobject of type NUMC and length 2.

Map you source date field with it--Rule type routine.

Make use of function module DATE_GET_WEEK

Pass your date it will give you year and week number.Out of that you can get week number.

This is the idea to achieve it.

Regards,

AL

Answers (3)

Answers (3)

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

For example, 07.2015 but to get only the 07.

if ask only 07. that is not make sense.

it should be 07.2015  - week. year.

Thanks,

Phani.

Former Member
0 Kudos

Hi,

Where do you want to use it.... you can use transformation to meet your requirement.

Regards,

AR

former_member254358
Participant
0 Kudos

Thanks Amit,

for your reply.

RamanKorrapati
Active Contributor
0 Kudos

Hi,

About standard time char am not sure.

if not exist then you can create a custom info object which is type of number with 2 length.

at transformations you can write small routine and read first 2 digits(0(2)) from source.

You can map source field to target object(month number) and writ a routine.

Result = <source date field>+0(2).

Source field assuming in MMYYYY.

do syntax check and activate transformations.

Please check with your abaper if you get any error about code.

Thanks

RafkeMagic
Active Contributor
0 Kudos

it's actually YYYYWW, so the code should be changed to

result = <source date field>+4(2).

RamanKorrapati
Active Contributor
0 Kudos

Yes Raf. i mentioned month. its my mistake.

Thank you for the note.

@ David

if source is WWYYYY then my result statement is fine.

if source is YYYYWW then follow reply.