Authorizations required for extracting your custom code

The SAP user performing the custom code extraction should be assigned with the SAP_ALL or a similar strong BASIS user authorizations.
If for any reason the SAP_ALL role cannot be assigned to the user, use the following authorizations - 

Authorizations Required for Online Run
S_RFC_ADM 
S_DEVELOP 

Authorizations Required for Background Execution 
S_DEVELOP 
S_PROGNAM 
S_RFC_ADM 
S_TABU_DIS 
S_TABU_CLI 
S_XMB_MONI 
S_DATASET 
S_SPO_DEV 
S_BTCH_ADM 
S_BTCH_JOB