cancel
Showing results for 
Search instead for 
Did you mean: 

Loading data with overlapping time intervals using generic datasource

marval
Explorer
0 Kudos

Dear gurus,

I've an issue/question with loading time-dependent master data from HCM-Infotype to ZEMPLOYEE via generic datasource based directly on Infotype table.

HCM Infotype-Data

PERNR; VALID_TO; VALID_FROM; SUBTYPE; VALUE
88888888; 99991231; 20140502; 9001; ABC
88888888; 99991231; 20230101; 9002; 123

Requirement:

  • When Subtype 9001, I need VALUE (= ABC) in Attribute X in InfoObject ZEMPLOYEE
  • When Subtype 9002, I need VALUE (= 123) in Attribute Y in InfoObject ZEMPLOYEE

Problem/Issue

As InfoObject only has PERNR and VALID_TO as keys, VALID_FROM information is lost when loading to InfoObject. Therefore time intervals overlap (both records with VALID_TO: 99991231) and are not created/inserted correctly with DTP-setting "handling duplicate data records".

Expected result

MasterData Table of ZEMPLOYEE should look like this after load:

/BIC/ZEMPLOYEE; DATETO; DATEFROM; /BIC/ZATTRBT_X; /BIC/ZATTRBT_Y

88888888; 01.05.2014; 01.01.1000; ;

88888888; 31.12.2022; 02.05.2014; ABC;

88888888; 31.12.9999; 01.01.2023; ABC; 123

Any ideas or best practise for this scenario?

Thanks!

View Entire Topic
ranganath_korata
Contributor
0 Kudos

Hi Martin,

Will 9001 and 9002 be the only two Subtypes for every employee? So will there be only two records for every employee? Can you share some more sample data, please?

Thanks.

marval
Explorer
0 Kudos

Hello,

there are also several other Subtypes (and records) available in InfoType for every employee.

HCM-InfoType (sample data):

RECORD; PERNR; VALID_TO; VALID_FROM; SUBTYPE; VALUE
1; 10000001; 99991231; 20230101; 0001; AAA
2; 10000001; 99991231; 20230101; 9000; BBB
3; 10000001; 99991231; 20230601; 9001; ABC
4; 10000001; 99991231; 20230801; 9002; 123
5; 10000001; 99991231; 20230101; 9003; 111
6; 10000002; 99991231; 20230101; 9001; XYZ
7; 10000002; 20230331; 20230101; 9002; 123
8; 10000002; 20231231; 20230401; 9002; 456
9; 10000002; 99991231; 20240101; 9002; 789

However, currently only subtypes 9001 and 9002 are needed in BW. Therefore record 3, 4 and 6-9 are relevant:

RECORD; PERNR; VALID_TO; VALID_FROM; SUBTYPE; VALUE
1; 10000001; 99991231; 20230101; 0001; AAA
2; 10000001; 99991231; 20230101; 9000; BBB
3; 10000001; 99991231; 20230601; 9001; ABC
4; 10000001; 99991231; 20230801; 9002; 123
5; 10000001; 99991231; 20230101; 9003; 111
6; 10000002; 99991231; 20230101; 9001; XYZ
7; 10000002; 20230331; 20230101; 9002; 123
8; 10000002; 20231231; 20230401; 9002; 456
9; 10000002; 99991231; 20240101; 9002; 789

Depending on subtype (9001 & 9002), we need either content of Field VALUE in attribute ZATTRBT_X for Subtype 9001 or ZATTRBT_Y for Subtype 9002. Time intervalls should be created accordingly:

Expected result (InfoObject master table)

/BIC/ZEMPLOYEE;DATETO;DATEFROM; /BIC/ZATTRBT_X; /BIC/ZATTRBT_Y
10000001; 20230731; 20230601; 9001; ABC;
10000001; 99991231; 20230801; 9001; ABC; 123
10000002; 20230331; 20230101; 9001; XYZ; 123
10000002; 20231231; 20230401; 9002; XYZ; 456
10000002; 99991231; 20240101; 9002; XYZ; 789

Thank you and kind regards.