cancel
Showing results for 
Search instead for 
Did you mean: 

Pool/Crew Management custom development in Work Manager 6.0

Former Member
0 Kudos

Hi All;

I'm new in the Agentry space, please bear with me. I'm working on a development of bringing in a crew/pool management screen into work manager 6.0. So this functionality should work in the such a way that the user clicks on the screen/tab "Pool Management" and within this screen would be a list of employees within a particular work centre. The user would then be able to tick, which employees he/she would be taking out for an inspection. I've been trying to get a feel or sense of direction of how I would go about with this development within Work Manager 6.0, with no success. Please kindly assist in terms of how I would go about with such a development or maybe if there is a resource that I could refer to, to guide me in bringing the employees onto this screen per work centre and enable the user to tick the relevant employees from the list, individually.

I see that Work Manager already has a table "ctPersonResp" which contains all the employees, But I would like to enable the app user to select/filter employees to select from based on different work centres. How would I display all employees in a given work centre? Also how would I bring about a functionality of being able to choose/select/tick individual users within that work centre? I would greatly appreciate any help/direction in terms of getting this development started.

I'm using SMP 2.3 SP03 with Agentry 6.1.4.179 and am using Agentry WPF client as the testing client.

Thanks in advance!

Regards;

Sizo Ndlovu

Accepted Solutions (1)

Accepted Solutions (1)

jason_latko
Advisor
Advisor
0 Kudos

Sizo,

Lots of ways you could do this.  Here are some ideas to get you started:

Add a new field to ctPersonResp for WorkCentre.  Add some new indexes to the table also.  There is already a unique index on PersonnelNumber.  Add another index on the WorkCentre field with no parent, making this a top level index.  Add a new index called PersonByWOrkCentre pointing to the Persno field.  Assign PersonByWOrkCentre to have a parent of WorkCentre.  Now you have the ability to filter by WorkCentre on your screens.

Now at a higher level:  On your selection screen, add a complex table list on the left.  This will display the users for either a hard-coded work centre, or you can let the user select the work centre by adding a complex table drop down or a free text field for them to choose from.  This selection will then drive the filter on the complex table list of personnel by adding the field as the parent to use on the CT List itself.  Add a List Tile View or List View on the right.  This will display the personnel that the user has selected from the main list on the left.  Add a screen button called "Add" that will trigger this adding.  Double-click on the left list can also trigger this adding.  The add action will identify the current CT row that is selected on the left and add the relevant data to an object collection where we will store the selected users.  You should start by blanking out this collection which you could store in the Main Object and maybe call it TempPersonnel.  Assign this the Personnel Object to this collection.  This is a new object you need to create to hold the personnel info.  You can add the same fields contained in the complex table, plus maybe one more that displays the full first + last name called FullName.  Now point the List View control on screen to this collection, and use the new FullName field to display.  The Add trigger action should run a transaction followed by an Apply to save the data.  You will add a new record to the TempPersonnel collection using the current CT record selected on the left list.  You will probably need to check to make sure that person has not already been added to the list previously by adding an execute rule on the Action itself.  You will probably also want to add a "Remove" or "Delete" button next to the list on the right to remove an added name.  Tie this button to an Action that deletes the selected row from the TempPersonnel collection.

Once the TempPersonnel collection is populated, you can loop over that collection to process the users and do whatever you need to do from there.

The above is one way could go to achieve your requirement.  You will probably be confused and find it quite challenging at first since your are new to Agentry.  Just ask if you need clarification or additional help on any points.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Hi Jason;

You're right, it is a bit confusing when u're getting started, lets hope I get there soon. I think I have pretty much tried to follow as per your guideline of creating the WorkCentre field and the related indexes. I have also gone to create the screen that gets called within the Pool Management screen tab, but somehow, I am not seeing any selection dropdown when I test on the device. Please see the below screenshots for what I have done and kindly guide me as to where I could be going wrong.

Thanks in advance!

Sizo Ndlovu

jason_latko
Advisor
Advisor
0 Kudos

Sizo,

What object is your screen displaying?  Are you trying to populate the work center drop down with the value from the current work order?  Need some more info on what the screenset definition looks like.

The WorkCentre drop down does not work?  The screen shots look correct there.  Is the complex table work centre field getting populated correctly with data?  You can check this using the ATE (Agentry Test Environment) by inspecting the complex table after the initial transmit.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Hi Jason;

Thanks again for taking your time to assist! My screen is currently not displaying anything, I was trying to geth the workcentre field populated using the workorder object, but this does not seem to work. The "ctpersonresp" table does not seem to have the WorkCentre field populating when I check via ATE, it is blank after the initial transmit!

Does it mean, if it were to populate, I would see the drop-down on the device? How could I possibly go on to have it populate?

One more wierd thing though is my Pool Management screen is not even showing the field label that I have next to where I would like the dropdown to appear.

Thanks and Regards;

Sizo Ndlovu

jason_latko
Advisor
Advisor
0 Kudos

Sizo,

You need to populate the WorkCentre field in your complex table by adding code to the java or database script that populates this table.  Just adding the field and index wont accomplish anything if you don't populate the field from code.  Seems like you are kind of flying blind here on some basic concepts.  I would suggest starting on the Agentry landing page here:

http://scn.sap.com/docs/DOC-47882

There are tutorials here that explain how to do things from scratch.  You could also take a class on Agentry development.  Get familiar with how things work, then come back with specific questions.  At this point, it seems you are somewhat lost on the basics.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Hi Jason;

I could be missing some basics, thank you for pointing it out, but it would be very helpful if you could give me some guidance. Where do I find this java code/database script that populates this table?

Thank you for the links, but it would be very helpful as well if you could direct me to a link that speaks specifically to populating complex tables via Java/database script as you have mentioned!

Regards;

Sizo Ndlovu

jason_latko
Advisor
Advisor
0 Kudos

Sizo,

You need to load the Java source into your Eclipse editor environment.  Use the config panel web interface to look at the parameters for the WM 6.0 application.  Look for the CT_SAPOBJECT entry for ctpersonresp.  It points to: com.syclo.sap.workmanager.object.PersonResponsible.  That is the Java class you need to add your new WorkCentre field to and populate it with the appropriate field from the BAPI: /SMERP/HR_CTEMPLOYEE_LIST_GET.  You will need to run or examine the BAPI in SE37 transaction to see the field list available for that CT in SAP.  You may also need to turn on the appropriate field in the config panel for that complex table if it is not on by default.  I don't know that procedure, but others around here do.  Make sure the field name you add to your class matches the field name you added to the CT in the Editor.  Once you get the CT populated correctly, we can move on to your screen.

Jason Latko - Senior Product Developer at SAP

jason_latko
Advisor
Advisor
0 Kudos

Sizo,

In config panel, choose mobile data object configuration, then open up the CT node on the left tree.  Scroll down to HR_CTEMPLOYEE_LIST_GET for SWM60 app.  Choose that record and scroll back up.  Choose resultset field selection tab on right pane.  Open handler method and table nodes.  Now you will see the list of fields that this CT returns from the backend.  They should all be on by default.  I don't see work center here, so that will cause you a problem.  Maybe one of those other fields will work for you?  If not, then this will require someone to modify your BAPI to return work center.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Hi Jason;

Thanks a lot for your guidance.

I have implemented the relevant ABAP GET Class that fetches the data from the SAP backend, I have also gone to create the relevant Java classes: object, bapi, steplet and stephandler on the agentry editor side. I have also done the relevant config on the config panel to create the MDO, BAPI_WRAPPER, and add application parameters for the new object. I have done this in a way that the new object brings in a totally new object, that carries all the fields that I require, which are WorkCentre, PersonnelNo and PersonName. I have not used complex tables or data tables, but rather an object that extends SAPObject. Please assist as to how I would carry on to fix this problem.

Much appreciated!

Sizo

Former Member
0 Kudos

I finally had this resolved, I had to debug to pick up the issue on the Java side. Now I can see the data on the device.

Thanks Jason!

Answers (1)

Answers (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Sizo,

You may also want to take a look at some of the new functionality coming in Work Manager 6.1 due out later this month as that will include a Crew Management component that may address some of your needs.

--Bill