<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Avoiding Hard coded user names in ABAP code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641521#M1763008</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in my Z program i need to check for a specific user wise ,so i am giving as &lt;/P&gt;&lt;P&gt;if sy-uname = 'XXXXX'.&lt;/P&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so, while go for Extended program check it's giving as error message as &lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;'The use of the hard-coded user name XXXXX can acuse security problems'&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to avoid this error ....any help regarding...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suba.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Aug 2013 12:08:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-08-14T12:08:08Z</dc:date>
    <item>
      <title>Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641515#M1763002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SDN's,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am using a Hard-coded user name in my Z program while go for Extended program check it' showing as Error like 'The use of the hard-coded user name XXXXX can acuse security problems' in Security Tests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i avoid this error free from EPC .....Any one help.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suba. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 07:33:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641515#M1763002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-14T07:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641516#M1763003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess I'll not be the only one suggesting that you should take the hard coded user names out.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can explain why you think this hard coding is the right approach you may get some views on either how it could be changed or how the EPC message can be avoided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 10:40:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641516#M1763003</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-14T10:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641517#M1763004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suba , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hard Coding the User names is not a right approach , you can use set leaf instead of hardcoding ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maintain sets in Tcode : GS01 &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/261992" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/261994" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save and Coding Part is ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t_set TYPE TABLE OF rgsb4,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wa_set TYPE rgsb4.&lt;BR /&gt;&amp;nbsp; DATA: v_check TYPE C VALUE ' '.&lt;/P&gt;&lt;P&gt;&amp;nbsp; CALL FUNCTION 'G_SET_GET_ALL_VALUES'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXPORTING&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; client&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = sy-mandt&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; setnr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 'ZTEST1'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 'USR01'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = '0000'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldname&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 'BNAME'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TABLES&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_values&amp;nbsp;&amp;nbsp;&amp;nbsp; = t_set&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXCEPTIONS&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_not_found = 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OTHERS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOOP AT&amp;nbsp; T_SET INTO WA_SET.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF WA_SET-FROM = SY-UNAME .&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v_check = 'X' .&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF.&lt;BR /&gt;&amp;nbsp; ENDLOOP.&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF v_check &amp;lt;&amp;gt; 'X'.&lt;BR /&gt; YOUR CONDITION &lt;/P&gt;&lt;P&gt;&amp;nbsp; ELSE.&lt;BR /&gt; YOUR CONDITION &lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 11:07:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641517#M1763004</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-14T11:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641518#M1763005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any Particular reason for using Hard coded Breakpoints ..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 11:13:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641518#M1763005</guid>
      <dc:creator>venkatakrishna</dc:creator>
      <dc:date>2013-08-14T11:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641519#M1763006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suba Reddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let know where exactly and why you are making use of usernames so that would help in providing the correct solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;apart from that , inorder to avoid the hardcode text, u can use Text Elements. this will sort out the above error...instead if u want to pick the username dynamically , i suggest u to have a custom table with username and any other common field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;revert back if any issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Azhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 11:15:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641519#M1763006</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-14T11:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641520#M1763007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can avoid the message by removing the breakpoint. If you have the breakpoint in production, that is a security issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 11:27:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641520#M1763007</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2013-08-14T11:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641521#M1763008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in my Z program i need to check for a specific user wise ,so i am giving as &lt;/P&gt;&lt;P&gt;if sy-uname = 'XXXXX'.&lt;/P&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so, while go for Extended program check it's giving as error message as &lt;SPAN style="color: #333333; font-size: 12px; background-color: #f8f8f8;"&gt;'The use of the hard-coded user name XXXXX can acuse security problems'&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to avoid this error ....any help regarding...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suba.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 12:08:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641521#M1763008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-14T12:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641522#M1763009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suba,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You've just repeated your question again, this isn't giving us anything new to work from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key here is why you feel you need to check for a specific user name?&amp;nbsp; Is it for bebugging? Is it to limit or extend the functionality of the code?&amp;nbsp; Is it an authorisation check?&amp;nbsp; Is it for test purposes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are many ways of avoiding hard coded user names (some of them mentioned in the answers to this thread so far), but unless you explain why you think you need to do this there's no way of knowing which is the correct approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 12:41:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641522#M1763009</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-14T12:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641523#M1763010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have see so many times hard coded username in standard SAP programs &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1700/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 12:45:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641523#M1763010</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2013-08-14T12:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641524#M1763011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you only want specific user to do something. Create a specific authorization object SU20/SU21, assign this object to your transaction SU24. And in your program check for this authorization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you don't hard code something ... and the result is the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 12:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641524#M1763011</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2013-08-14T12:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641525#M1763012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes hardcoding username is an issue but many people does it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;especially smth like break sdogan...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the code goes to prod like that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;why?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Because the developer wants to debug at prod too to make life easier!!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As life gets easy secuirity is breached for sure!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do we stop using the username in your code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can you assign a auth object to that user only?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if not then &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can you seperate the code for that user only?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if not then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach:&lt;/P&gt;&lt;P&gt;Create a config table where you give 2 columns like username and role etc..&lt;/P&gt;&lt;P&gt;then enter the username in that table, via table maintenance generator&lt;/P&gt;&lt;P&gt;lets say the table name is &lt;STRONG&gt;z_special_users&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then read that config and &lt;/P&gt;&lt;P&gt;do smth like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***Here you can check the role &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class zcl_config_loader defnition.&lt;/P&gt;&lt;P&gt;public section:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-methods: class_constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-methods: get_role.&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class zcl_config_loader implementation&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;method&lt;/SPAN&gt; class_constructor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from z_special_users&lt;/P&gt;&lt;P&gt;into table gt_special_users&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method get_role.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**return the table&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in your code, main program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if zcl_config_loader=&amp;gt;get_role( ) = 'xxxRole&amp;nbsp;&amp;nbsp; '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 12:59:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641525#M1763012</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-14T12:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641526#M1763013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Solen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can't say I'm a fan of user names in config tables, think of your poor user admin team who have to keep this thing accurate and up to date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP comes with a (reasonably) useful authorisation concept, if the development needs to behave differently for different users (and let's face it what we actually mean here is different roles) then authorisation objects is the way to go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 13:09:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641526#M1763013</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-14T13:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641527#M1763014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suba,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-uname = 'XXXXX'.&lt;/P&gt;&lt;P&gt; do something.&lt;/P&gt;&lt;P&gt;end if.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above code which u said is generally used to get easier during debuugging of code, but it not recommended to move the that code with those lines to production.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or i guess u can go with building ranges for usernames and check.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-uname = r_usernames. ( r_usernames contain all the usernames)&lt;/P&gt;&lt;P&gt; do something.&lt;/P&gt;&lt;P&gt;end if.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Azhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 13:32:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641527#M1763014</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-14T13:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641528#M1763015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So have I. Especially when applying the security notes that remove that hardcoding!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you hard code a username you are creating a development cycle when that user leaves - you have to edit the program and get it to production again with the new user. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2013 05:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641528#M1763015</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2013-08-15T05:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641529#M1763016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suba reddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder why dont you use a Constant to check your IF condition as shown below.&lt;/P&gt;&lt;P&gt;CONSTANTS : C_SUBARED Type SYST-UNAME VALUE 'SUBAREDDY'.&lt;/P&gt;&lt;P&gt;IF SY-UNAME = C_SUBARED.&lt;/P&gt;&lt;P&gt;" Do some thing.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Bhargav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2013 06:32:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641529#M1763016</guid>
      <dc:creator>Venkat_Sesha</dc:creator>
      <dc:date>2013-08-15T06:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641530#M1763017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suba,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating Authorization Objects and Authority-Check is the best approach.&lt;/P&gt;&lt;P&gt;If you dont want to use it and if you are only concerned about EPC error, then replace the username with constatns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS : c_username type sy-uname value 'USERNAME'.&lt;/P&gt;&lt;P&gt;if sy-uname = C_USERNAME.&lt;/P&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this you can pass the EPC check. But still it is not the right appraoch.&lt;/P&gt;&lt;P&gt;Go for Authorization Objects and use Authority Check statement for it is the correct approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2013 06:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641530#M1763017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-15T06:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641531#M1763018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhargav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i tried what you mentioned,but still in EPC error not cleared it's showing same error...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any other solution...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suba.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 03:33:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641531#M1763018</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-16T03:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641532#M1763019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Azhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i tried what you mentioned,but still in EPC error not cleared it's showing same error...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any other solution...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suba.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 03:34:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641532#M1763019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-16T03:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641533#M1763020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Suba&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create one Authorization Object using the transaction code SU21.&lt;/P&gt;&lt;P&gt;2. Create a role using the transaction code PFCG and assign the Authorization Object to the created role.&lt;/P&gt;&lt;P&gt;3. To whom all users you wish to assign this role, assign these roles using the transaction code SU01.&lt;/P&gt;&lt;P&gt;4. Using the keyword, AUTHORITY CHECK, check whether the current user is authorized to do the particular action in your program. If the check raises sy-subrc &amp;lt;&amp;gt; 0, then raise an error, else continue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way you can check the user authorization to do a particular task, without hardcoding the username in the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Rinzy Deena Mathews&lt;/P&gt;&lt;P&gt;Applexus Technologies (P) Ltd.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 04:30:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641533#M1763020</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-08-16T04:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding Hard coded user names in ABAP code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641534#M1763021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No Suba it should not be in EPC error if you have declared in Constants and compared with Sy-Uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any how to understand the issue in more detail, it helps a lot to the forum if you can put the screen shot of the issue. so that you can get your problem solved soon. May be it is not an error in others perspective and a Warning. So please upload the screen print. Thanks..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy coding &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1700/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 06:07:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/avoiding-hard-coded-user-names-in-abap-code/m-p/9641534#M1763021</guid>
      <dc:creator>Venkat_Sesha</dc:creator>
      <dc:date>2013-08-16T06:07:40Z</dc:date>
    </item>
  </channel>
</rss>

