Skip to Content
0

Invert Routine For FiscalPeriod Split

Mar 02, 2017 at 11:26 AM

79

avatar image

Hello All,

Need your help for the scenario mentioned below.

We are trying to populate data using virtual provider , below the virtual provider we have a transformation. In the target fields 0FISCPER (Fiscal Period) of transformation filed routine is written to concatenate SOURCE_FIELDS-GJAHR(Year) and SOURCE_FIELDS-MONAT(Period) coming from source and assign it to 0FISCPER (Fiscal Period).

Now we need to write a INVERT routine to separate GJAHR and MONAT from 0FISCPER into their respective fields.

I wrote the code but When i try to assign back both GJAHR and MONAT it's not working however if i assign back any one field it's working perfectly.

Code is show below. Please let me know if you have any ideas/methods to assign back both the fields to their respective fields. Method c_r_selset_inbound->unite is working perfectly once but second time it's changing the object type which is causing trouble .

Code:-

***Fill Period Dimension Set

IF me->lo_set_mont IS INITIAL. CALL METHOD i_r_universe_inbound->get_dimension_by_name EXPORTING i_dimname = 'MONAT' RECEIVING r_r_dimension = lr_dimension_pe. CALL METHOD lr_dimension_pe->create_set_from_ranges EXPORTING i_t_ranges = lt_inb_mont[] RECEIVING r_r_set = me->lo_set_mont. ENDIF.

similarly fiscal year is also filled.

*****Inbound selection Data

c_r_selset_inbound = cl_rsmds_set=>get_empty_set( ).

* c_r_selset_inbound = c_r_selset_inbound->unite( me->lo_set_fscy ).

c_r_selset_inbound = c_r_selset_inbound->unite( me->lo_set_mont ).

c_exact = rs_c_true.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Koen Hesters Mar 20, 2017 at 10:48 AM
0

HI

check out doc:

https://archive.sap.com/kmuuid2/f05d0b81-076a-2c10-44ab-f00b0b90ce38/Writing%20Inverse%20Routine%20with%20Expert%20Routine.pdf

READ TABLE i_thx_selection_cs INTO l_sx_selection_cs

WITH KEY chanm = '0FISCYPER'.

l_s_selection-fieldnm = 'GJAHR'. "Source fields name Year

l_s_selection-sign = 'I'.

l_s_selection-option = 'EQ'.

Loop at l_sx_selection_cs-rt_chavl into wa

l_s_selection-low = wa-low(4)

endloop.

APPEND l_s_selection TO c_t_selection.

l_s_selection-fieldnm = 'MONAT'. "Source fields name Year

l_s_selection-sign = 'I'.

l_s_selection-option = 'EQ'.

Loop at l_sx_selection_cs-rt_chavl into wa

l_s_selection-low = wa-low+4(2)

endloop.

APPEND l_s_selection TO c_t_selection.

Share
10 |10000 characters needed characters left characters exceeded