Wednesday, July 13, 2016

User Roles, Security, Profiles Etc


Roles : They are used to administer security features for various users in SAP.

Composite Roles : They are roles which have individual roles with in. Parent role is a composite roles and there are individual roles inside each composite role.

Standard Programs
IAM_API_TESTFRAME’ for dealing with user and corresponding roles
RSUSR002 : Gives details of users and roles

T-Code
SU01 : User Information
SUIM - User Information System

Tables
USH02            - Change history for logon data
AGR_AGRS   - Roles in Composite Roles
AGR_USERS - Assignment of roles to users

BAPIs
BAPI_USER_CREATE1
BAPI_USER_ACTGROUPS_ASSIGN



Reference Notes
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/668e6629-0701-0010-7ca0-994cb7dec5a3?overridelayout=true



Creating Users in SAP
BAPI_USER_CREATE1
The BAPI needs the following mandatory parameters.
*& Passing the mandatory parameters
*& LogON Data
CLEARlw_logondata.
lw_logondata-gltgv sy-datum.    " User Valid From
lw_logondata-gltgb '99991231'.  " User Valid To

*& Password
CLEARlw_password.
lw_password-bapipwd 'Welcome123'.

*& Address Table
CLEARlw_address.
lw_address-lastname = <user lastname>.

REFRESH lt_param[]lt_return[].

 CALL FUNCTION 'BAPI_USER_CREATE1'
   EXPORTING
     USERNAME     = <userid>
     LOGONDATA    lw_logondata
     PASSWORD     lw_password
     ADDRESS      lw_address
  TABLES
    PARAMETER     lt_param
    RETURN        lt_return

Assign Roles
BAPI_USER_ACTGROUPS_ASSIGN
  CALL FUNCTION 'BAPI_USER_ACTGROUPS_ASSIGN'
    EXPORTING
      USERNAME             <userid>
    TABLES
      ACTIVITYGROUPS       lt_roles
      RETURN               lt_return
            .

Delete Users
 CALL FUNCTION 'BAPI_USER_DELETE'
  EXPORTING
    USERNAME       <userid>
  TABLES
    RETURN         lt_return
          .

           .

IDocs and TRfc

Idocs  and TRfc


IDoc
Intermadiate Document
An IDoc (intermediate document) is a standard data structure for electronic data interchange (EDI).
IDocs are used for the data interchange between SAP systems as well as between an SAP system
and an external system. IDocs serve as the vehicle for data transfer in SAP’s Application Link
Enabling (ALE) system. The contents, structure, sender, receiver, and current status of the IDoc are
defined in the IDoc header.

Data extraction from an SAP R/3 source system to BW begins when BW sends a request in the form of a request IDoc.
The source system then extracts the data and sends it to the BW system.

REFER LINK

Transactional RFC (tRFC)
For each transaction running in the system, there will be LUWs generated. These can be seen in SM58.


Scenarios
Data not coming to BW - Request is in Yellow status
This might happen, when the TRfc are struck in the source system .

Take the IDoc number and go to Tcode - WE02 and display the Idoc to see if there are any errors.

Also, go to SM58 and run the tcode. It will give you list of TRfc present in the system. They can either be due to some errors or just hanging there as there are no processors to process them. You can execute these from here , so that they reach the destination.

Maintaining Languages
Tcode : WE03
In the infopackage, we can see the incoming and outgoing idoc numbers and if we run WE03, we can see the logs of the request.
In language infopackages, even though we cannot see the SPRAS selection, if we check the iDoc, we can see the languages being used in the filter


Language setting in BW

Master T-code for Language settings
I18N

TCodes : I18N ; SMLT ; RZ10 ; RZ11

Table : TCPOI


Report Program : RSCPINST

This is the ‘NLS Setting Maintainance’ program, where we can add new languages to the system.



Click on ‘Add’ and add the languages.
Sometimes, the F4 help would not give the language you intend to add. In that case, the language list needs to be extended using ‘Extend Language List’ where it takes to a new screen and new language can be added.







 SMLT Tcode

Once that step is done, you can see the new language in the F4 help and add it. Save and activate it, and the system would update all the database table entries with the new language setting. Then the paramtere ‘zca/installed_languages’ needs to be maintained manually.

RZ10
This is where profiles for the system are maintained. Each profile has number of parameters to be maintained.
For adding language the parameter would be ‘zca/installed_languages’. System needs to be restarted once the change is done.




Corresponding SAP Notes

112065 - Using customer language 'Z1'
42305 - RSCPINST (I18N configuration tool)
2185213 - Configuration of logon languages and profile parameter zcsa/installed_languages
1345121 - Profile Parameters which should not be set in Unicode
529789 - BW extraction/extractor checker differences ( Point 10)
73606 - Supported Languages and Code Pages


Billing

Datasources
  • 2LIS_13_VDHDR
  • 2LIS_13_VDITM
  • 2LIS_13_VDKON
TCode
VF01 / VF02  / VF03

Base Tables 
VBRK ( Billing Document: Header Data )
VBRP ( Billing Document: Item Data)
VBUK 
VBUP
KOMV / KONV [ KOMV is only a strucutre ]

Bill Plan Header  : FPLA
Bill Plan Item      : FPLT 


Set up tables
OLI9BW / RMCVNEUF
Can be run open with out any selection. Has Billing document on the selection screen

Related SAP Notes
SIS/BW: Statistics update for value items, quantities HERE

Creating Billing Document / Change to Bill Plan
Here you can create billing documents for a sales order ( I am doing this for bill plan related stuff )
Go to VF04 - Enter sales document and billing date.
check order type check box in the end.
it will display an entry
save it
this will create a billing document.



2LIS_13_VDITM

Billing Item
Base tables : SAP Link

FKIMG and ZFKIMG / OLIME / NETWR and ZZNETWR
My Notes* ( not sure if below is the right explanation )
In VBRP, we can see FKIMG populated irrespective of POSAR, but in 2LIS_13_VDITM, FKIMG does not get populated for Value Items. SAP Note 368011 will solve the issue.

Basically, for value item OLIME is the field which is populated. This field is not from any table, but a structure which gets populated internally ( not sure where ).
So if you implement Note - solution 2  values from OLIME or FKIMG are moved to ZFKIMG which can be used in BW.

Check code in below function module to see the assignment
EXIT_SAPLMCS6_002
ZXMCVU06




2LIS_13_VDKON

Base table : VBRK
                    VBRP
                    KONV ( In LBWE structure it is KOMV, but KOMV is only a structure)

This datasource works as Item change date as pointer. It will get all new/changed records at item level.

Only Active conditions are considered. KONV-KINAK should be blank.
If Note 1062462 is implemented, Inactive conditions can be extracted, but there are some other other side effects as mentioned in the note - Not sure how they would effect.
Personal experience : In the user exit for the extractor, I added code to add Inactive records to the standard extractor.




BW House Keeping


  • Delete entries from PSA regularly
  • Delete entries from change log regularly
  • Use RSREQREDUCE tcode to monitor the growth of infoproviders