728x90
자주 사용되는 재사용 라이브러리 입니다.
현재일 및 시간
1
2
3
4
5
6
7
8
9
10
11
|
import ABSL;
import AP.CRM.Global;
var result : DataType::DateTime;
var DateTime = Context.GetCurrentGlobalDateTime().ConvertToLocalDateTime("UTC+9");
result.content = DateTime .content;
result.daylightSavingTimeIndicator = DateTime .daylightSavingTimeIndicator;
result.timeZoneCode = DateTime .timeZoneCode;
return result;
|
Context 함수는 시스템정보를 기반으로 데이터를 가져오는데 사용됩니다.
현재일
1
2
3
4
5
6
7
8
9
|
import ABSL;
import AP.Common.GDT;
var result : DataType::Date;
result = Context.GetCurrentGlobalDateTime().ConvertToLocalDateTime("UTC+9").ConvertToGlobalDateTime().GetDate();
return result;
|
현재시간
1
2
3
4
5
6
7
8
|
import ABSL;
import AP.Common.GDT;
var result : DataType::Time;
result = Context.GetCurrentGlobalDateTime().ConvertToLocalDateTime("UTC+9").ConvertToGlobalDateTime().GetTime();
return result;
|
현재년도
1
2
3
|
var result : DataType::Date;
result = Context.GetCurrentGlobalDateTime().ConvertToLocalDateTime("UTC+9").ConvertToGlobalDateTime().GetDate().EndOfYear();
return result;
|
현재월
1
2
3
4
5
6
|
import ABSL;
import AP.Common.GDT;
var result : DataType::Date;
result = Context.GetCurrentGlobalDateTime().ConvertToLocalDateTime("UTC+9").ConvertToGlobalDateTime().GetDate().EndOfMonth();
return result;
|
접속자의 EmployeeID 반환
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import ABSL;
import AP.Common.GDT;
var result : DataType::EmployeeID;
var IdentityUUID = Context.GetCurrentIdentityUUID();
var IdentityItem = Identity.Retrieve(IdentityUUID);
var EmployeeItem = Employee.Retrieve(IdentityItem.BusinessPartnerUUID);
result = EmployeeItem.IdentificationEmployeeID.EmployeeID;
return result;
|
접속자의 Employee Name 반환
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import ABSL;
import AP.Common.GDT;
var result : DataType::LANGUAGEINDEPENDENT_ENCRYPTED_LONG_Name;
var IdentityUUID = Context.GetCurrentIdentityUUID();
var IdentityItem = Identity.Retrieve(IdentityUUID);
var EmployeeItem = Employee.Retrieve(IdentityItem.BusinessPartnerUUID);
result = EmployeeItem.CurrentCommon.BusinessPartnerFormattedName;
return result;
|
접속자 Group ID 반환
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import ABSL;
import AP.Common.GDT;
var result : DataType::OrganisationalCentreID;
var IdentityUUID = Context.GetCurrentIdentityUUID();
var IdentityItem = Identity.Retrieve(IdentityUUID);
var EmployeeItem = Employee.Retrieve(IdentityItem.BusinessPartnerUUID);
var OrgGroup = EmployeeItem.CurrentOrganisationalUnitAssignment.Where(n => n.RoleCode == "219").GetFirst().ToParent;
{
result = OrgGroup.ID;
}
return result;
|
접속자 Group Name 반환
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import ABSL;
import AP.Common.GDT;
var result : DataType::LANGUAGEINDEPENDENT_MEDIUM_Name;
var IdentityUUID = Context.GetCurrentIdentityUUID();
var IdentityItem = Identity.Retrieve(IdentityUUID);
var EmployeeItem = Employee.Retrieve(IdentityItem.BusinessPartnerUUID);
var OrgGroup = EmployeeItem.CurrentOrganisationalUnitAssignment.Where(n => n.RoleCode == "219").GetFirst().ToParent;
{
result = OrgGroup.CurrentNameAndAddress.Name;
}
return result;
|
728x90
'IT > SAP C4 HANA' 카테고리의 다른 글
[SAP] Cloud Application Studio의 TI Screen 안에 QC 생성 (0) | 2020.01.06 |
---|---|
[SAP] Cloud Application Studio의 CSV File Upload (0) | 2020.01.06 |
[SAP] Cloud Application Studio의 ReuseFunction 1 (0) | 2020.01.03 |
[SAP] Cloud Application Studio의 Debugging (0) | 2020.01.02 |
[SAP] Cloud Application Studio의 메시지 추가 (0) | 2019.12.24 |
댓글