Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SU20 use of data type (DATS) is restricted for authorization fields

Sandra_Rossi
Active Contributor
0 Likes
1,391

Hello,

I had this question and could solve it (I'm posting the answer), please don't look at my question/answer unless you want to complete.

In SU20 in ABAP 7.52 and 7.57, I see the message "Use of data type DATS is restricted for authorization fields" (UE321).

What does it mean?

I couldn't find anything in the forum or in the SAP notes about it.

This message did not appear in older version 7.40.

Thanks for reading me.

Sandra

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,347

I guess this warning message can be ignored.

In my case, I wanted a DATS field: I create a new domain with conversion exit SDATE, if I create an authorization (PFCG) and type the date in user format (e.g. DD.MM.YYYY), it will save the authorizations internally in YYYYMMDD format, and I could verify that the authority check works fine in the case of an authorization defined with a date interval. SDATE displays with month with 3 characters abbreviation (e.g. 20231231 -> 31.DEC.2023). I couldn't find an existing standard Basis conversion exit which displays in user format (e.g. DD.MM.YYYY / 31.12.2023).

In PFCG, type the date in user's date format, after save 051023 will be displayed as 05.OCT.2023:

You can see in the table AGR_1251 that it stores the dates in YYYYMMDD format as expected:

The code which validates the data type in SU20 is in the method CHECK_SGL_CURR_DDIC_SETTINGS of the class CL_SU20_CONSI:

  • No warning if it's type CHAR or NUMC.
  • Error UE320 if it's type STRING or SSTRING. UE 320 Data type &1 cannot be used for authorization fields.
  • Warning UE321 otherwise (DATS, etc.) UE 321 Use of data type &1 is restricted for authorization fields.

1 REPLY 1
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,348

I guess this warning message can be ignored.

In my case, I wanted a DATS field: I create a new domain with conversion exit SDATE, if I create an authorization (PFCG) and type the date in user format (e.g. DD.MM.YYYY), it will save the authorizations internally in YYYYMMDD format, and I could verify that the authority check works fine in the case of an authorization defined with a date interval. SDATE displays with month with 3 characters abbreviation (e.g. 20231231 -> 31.DEC.2023). I couldn't find an existing standard Basis conversion exit which displays in user format (e.g. DD.MM.YYYY / 31.12.2023).

In PFCG, type the date in user's date format, after save 051023 will be displayed as 05.OCT.2023:

You can see in the table AGR_1251 that it stores the dates in YYYYMMDD format as expected:

The code which validates the data type in SU20 is in the method CHECK_SGL_CURR_DDIC_SETTINGS of the class CL_SU20_CONSI:

  • No warning if it's type CHAR or NUMC.
  • Error UE320 if it's type STRING or SSTRING. UE 320 Data type &1 cannot be used for authorization fields.
  • Warning UE321 otherwise (DATS, etc.) UE 321 Use of data type &1 is restricted for authorization fields.