cancel
Showing results for 
Search instead for 
Did you mean: 

How to open Project Master form for a specific project from right click menu

rajesh_khater
Active Participant
0 Kudos
54

Hi,

I have added a new menu item in the Right Click menu when the user clicks on the Project column in an AR Invoice.

In the menu event, how can I open the Project Master form for the specific Project on which the user has right clicked? We have created a UDT and Form for Project due to some customizations required for this client. SO I need to open the UDO Form for the Project Master (UDT) which we have created, and load the Project on which the user has right clicked.

Some sample code or pseudocode steps would be appreciated.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

rajesh_khater
Active Participant
0 Kudos

Dear experts, waiting for replies!

edy_simon
Active Contributor
0 Kudos

Hi Rajesh,

To start with, there is no project master form for a specific project.

Project Form is a form that list all the projects, not individual.

Regards
Edy

rajesh_khater
Active Participant
0 Kudos

Hi Edy, You are right. I think I did not explain properly in the question.

For my requirements, the standard Project Master has some shortcomings, as I needed multiple attachments in Project Master. So I created 2 UDTs of Master type, and registered UDO and generated form for that.

When the user creates a Project in my form, I push the required fields like Code, Name, Active, etc. to the standard Project of SAP, using my addon.

Now I want to provide a feature to the user to navigate to my Project Master Form (not SAP standard Project) when they right click on the Project column in the AR Invoice.

In the right click event, how can I read the current row? Once I know that, I already know the column id, so I will be able to read the Project in the current row. Then next question is how can I display my Form for the specific project?

Please advise.

Thanks.

edy_simon
Active Contributor
0 Kudos

Hi Rajesh,

You will need a work around for this:

1. Create a Global Variable to keep track of the 'Right Click Row'

2. On the before Right Click Event :

     - Store the pVal.Row (Better Yet, store the Project Code in your Global Variable)

     - Check if your User Menu already exists

     - If not Exists, create your User Menu under one of the Parent Menu (You can try under Menu '768')

3. On After Menu Pressed Event, Check if this pVal.MenuUID is your menu, if it is Get the Project Code from your Global Variable. And use your own logic to draw your UDO form.


Sorry, there is no automatic and easy way of doing this.


Regards

Edy



rajesh_khater
Active Participant
0 Kudos

Hi Edy,

I got the first part of reading the row or the Project Code.

Regarding the 2nd part, what should be the logic. I can open my custom form for Project Master, but how do I load the record for the specific project? Just tell me the logic or high level steps.

Thanks.

edy_simon
Active Contributor
0 Kudos

Hi Rajesh,

Depends on how you draw your UDO form.

If your UDO form is registered in SBO, you can use SBO_Application.OpenForm method to open your form.

If you draw your own UDO form using srf/xml :

1. Draw your UDO Form.

2. Put the form in Find Mode.

3. Using UI API, Place your Cursor to the Code field.

4. Using UI API, Place the Project Code in this Field

5. Finally invoke a Click on the Find Button of your form.

or -

1. Draw your UDO Form.

2. Put the form in OK Mode.

3. Create as SAPbouiCOM.Conditions Object to select your Project Code

4. Use the DBDataSource.Query(oCons)

Regards

Edy

rajesh_khater
Active Participant
0 Kudos

Great Edy! This is helpful.

During UDO registration, I have generated a form also for the UDO, so I guess I can use OpenForm.

I guess I can use either of the 2 approaches for a UDO registered form also, am I right?

One more thing: How to put the form in OK mode?

Thanks.

edy_simon
Active Contributor
0 Kudos

Hi Rajesh

oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE

Regards

Edy

Answers (0)