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

re : authorization

Former Member
0 Likes
396

Hi

how to give authorization for a plant in program.

with regards

mani

4 REPLIES 4
Read only

Former Member
0 Likes
372

Hi,

refer this----


PARAMETERS carr TYPE spfli-carrid.

AT SELECTION-SCREEN.

AUTHORITY-CHECK OBJECT 'S_CARRID'

ID 'CARRID' FIELD carr

ID 'ACTVT' FIELD '03'.

IF sy-subrc <> 0.

MESSAGE 'No authorization' TYPE 'E'.

ENDIF.

Reward if helpful.

Thanks.

Read only

Former Member
0 Likes
372

In the table maintenance by specifying the authorization group

u can give authorizations.

Or for user dialogs.

&----


*& Module USER_COMMAND_0100 INPUT

&----


MODULE USER_COMMAND_0100 INPUT.

CASE OK_CODE.

WHEN 'SHOW'.

AUTHORITY-CHECK OBJECT 'S_CARRID'

ID 'CARRID' FIELD '*'

ID 'ACTVT' FIELD '03'.

IF SY-SUBRC NE 0. MESSAGE E009. ENDIF.

MODE = CON_SHOW.

SELECT SINGLE * FROM SPFLI

WHERE CARRID = SPFLI-CARRID

AND CONNID = SPFLI-CONNID.

IF SY-SUBRC NE 0.

MESSAGE E005 WITH SPFLI-CARRID SPFLI-CONNID.

ENDIF.

CLEAR OK_CODE.

SET SCREEN 200.

WHEN 'CHNG'.

AUTHORITY-CHECK OBJECT 'S_CARRID'

ID 'CARRID' FIELD '*'

ID 'ACTVT' FIELD '02'.

IF SY-SUBRC NE 0. MESSAGE E010. ENDIF.

MODE = CON_CHANGE.

SELECT SINGLE * FROM SPFLI

WHERE CARRID = SPFLI-CARRID

AND CONNID = SPFLI-CONNID.

IF SY-SUBRC NE 0.

MESSAGE E005 WITH SPFLI-CARRID SPFLI-CONNID.

ENDIF.

OLD_SPFLI = SPFLI.

CLEAR OK_CODE.

SET SCREEN 200.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

Refer this link,

http://help.sap.com/saphelp_webas620/helpdata/en/9f/dbaccb35c111d1829f0000e829fbfe/content.htm

Regards,

Jagadish

Read only

Former Member
0 Likes
372

Hi

You can do the following way

at selection-screen.

authority-check object 'M_BEST_WRK'

id 'WERKS' field p_werks

id 'ACTVT' field '01'.

if sy-subrc ne 0.

message e000(zwm) with 'You are not having Authorization'..

endif.

Reward points, if it is helpful.

Regards

Raja.

Read only

Former Member
0 Likes
372

Hi Mani,

You can use AUTHORITY CHECK statement to do that.

Use the respective authorization object in the statement and check for sy-subrc = 0 after the statement execution.

if its not equal to 0, then throw error.

Hope this helps you.

Thanks,

Arun