cancel
Showing results for 
Search instead for 
Did you mean: 

Derive 0CALMONTH from 0DATE in RSANWB Routine

Former Member
0 Kudos

Hi all,

I want to derive 0CALMONTH from an 0DATE InfoObject in a RSANWB process, with a routine.

Can anyone help me with the code?

Thanks in advance. I will assign points if helpfull!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

you can just do a assignment. As the internal format of date is YYYYMMDD and the internal format for the calmonth is YYYYMM, just move the date to the month.

kind regards

Siggi

Former Member
0 Kudos

Hi Siegfried,

Thanks for your reply. I know I can assign the fields, but I need to do it with a routine, because I must also do a group by and aggregation in the RSANWB process.

1. Derive 0CALMONTH from 0DATE in a routine

2. Group by characteristic and time and Aggregate this on keyfigure

3. Load result in DSO (with key on date)...

Former Member
0 Kudos

Derived as follows:

*TYPES: ...

DATA: ls_source TYPE y_source_fields,

ls_target TYPE y_target_fields.

LOOP AT it_source INTO ls_source.

MOVE-CORRESPONDING ls_source TO ls_target.

ls_target-calmonth = ls_source-calday.

APPEND ls_target TO et_target.

endloop.