Run User Compare with ERPConnect (Theobald)

585 Views Asked by At

I would like to know if anyone knows if it is possible to run a SAP User Compare from c# using ERPConnect 4 from Theobald? If so, how?

I can open a connection to SAP and run functions - just don't know how to do User Compare.

EDIT: It seems like we have to run the report PFCG_TIME_DEPENDENCY.

If anyone knows how to run a report with ERPConnect, or if there exists a functional module in SAP that can run a report, that will also help.

1

There are 1 best solutions below

1
On

I am not exactly sure what your comparison has to include, but I assume, that you want to compare attributes of the users. If that is the case, you could download the users data from the SAP tables. Here is a starting point for what tables you probably need: http://www.tcodesearch.com/sap-tables/detail?id=USR01

USER01 is the user master record, containing all user with it's main attributes. You can find other interesting related user table through the link above.

To read a table using Erpconnect, look at this link: https://my.theobald-software.com/index.php?/Knowledgebase/Article/View/21/23/reading-sap-tables-directly

You need to create an instance of the ReadTable class. Then you add the fields you are interested in using the AddField method (e.g. MANDT and BNAME for the USR01 table). You could but don't have to enter filter criteria using the AddCriteria method. If you do add multiple creteria, be sure to add boolean operators like "and" or "or":

table.AddCriteria("LANGU = 'D'"); 
table.AddCriteria("AND MANDT = '007'"); 

Finally set the table name of the table you want to download and execute the Run-Method. After that you can loop through the results stored in <your RunTable-Instance>.Result.Rows

Sascha