cancel
Showing results for 
Search instead for 
Did you mean: 

Call TCode MM02 from ALV

former_member226419
Contributor
0 Kudos

Hello Gurus,

I have a requirement in which I have displayed ALV having Material number details and my requirement is once a user clicks on MATNR it will go to tcode MM02.

The same way we used to do in normal ALV.

I have make it as hot spot and also make it interactive but dont know how to call tcode MM02.

Can anybody share some good document with screenshots how to achieve the same?

I think it has to be done through web services.

Please help.

BR

Sumeet

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Using ITS you can achieve this: Call the url like this in external window/ modal window.

" http://<url>:portno/sap/bc/gui/sap/its/webgui?~TRANSACTION=MM02 " 

Check this doc for reference: http://scn.sap.com/community/web-dynpro-abap/blog/2013/05/02/wd-application-to-call-a-transaction-co...

Hope this helps u,

Regards,

Kiran

former_member226419
Contributor
0 Kudos

Hi,

I tried this but got below error.

The webserver for http://ersbxdb0.gene.com reported that an error occurred while trying to access the website. Please click here to return to the previous page.

BR

Sumeet

former_member184578
Active Contributor
0 Kudos

Hi,

Check the ITS service is activated or not. Go to transaction SICF and click on Execute, then navigate to default_host -> sap -> bc -> gui -> sap -> its -> webgui.

Right click on webgui and click on Activate service ( if it is not activated ). Then right click on webgui and click on Test Service. Then you should be able to see SAP GUI for HTML open in browser.

Regards,

Kiran

former_member226419
Contributor
0 Kudos

Hi,

I have given the service path as '/sap/bc/gui/sap/its/webgui' as when i try to activate the same , tab 'Activate Service' is in disabled mode. And when I click test path it open Netweaver GUI but I want to open Tcode MM02 and also can you please me with the code what needs to be done?

BR

Sumeet

former_member226419
Contributor
0 Kudos

Below is the code I have written.

  DATA lo_window_manager TYPE REF TO if_wd_window_manager.

  DATA lo_api_component  TYPE REF TO if_wd_component.

  DATA lo_window         TYPE REF TO if_wd_window.

  lo_api_component  = wd_comp_controller->wd_get_api( ).

  lo_window_manager = lo_api_component->get_window_manager( ).

  lo_window         = lo_window_manager->create_external_window(

                     url = 'http://ersbxdb0.gene.com:8040/sap/bc/gui/sap/its/webgui?~transaction=*mm02'

                     ).

  lo_window->open( ).

And when I run the dynpro app, it says 'DNS lookup failed'.

Former Member
0 Kudos

Hi Sumeet

DNS lookup fail means that the given URL is not correct and more specific that the host is either unrichable or incorrect.

former_member184578
Active Contributor
0 Kudos

Hi,

And when I run the dynpro app, it says 'DNS lookup failed'.

When you test the Web Dynpro application are you getting this error initially or When you click on Material number in ALV, you are getting this?

As you said, you are able to test the SAP GUI in HTML, you could simply add this parameter (~TRANSACTION=MM02) in the URL to test.

I guess you have problem in Web Dynpro. Check whether FQDN is maintained.

Also check whether you have maintained the host entries.

Regards,

Kiran

former_member226419
Contributor
0 Kudos

Hi Kiran,

I am new to dynpro and Web services so please excuse me if I ask any stupid question..

Problem is like this.

In tcode when I run SICF i enterd service path as '/sap/bc/gui/sap/its/webgui' and test it manually it opens SAP GUI screen but i am not able add service for Tcode MM02.

2.) But at code level what URL I have to give,,, I didnt got that.....Instead of SAP GUI I want to open MM02. So I need two things from You.

a.) How to add service in SFIC .

b.) How to access the same in the dynpro application via code ( as I have passed the wrong URL it gives me DNS error..)

I hope you got my problem.

BR

Sumeet

Former Member
0 Kudos

The last part of the url given the parameter transaction code is probaly right.

What you need now is the FQN (Full Qualified Name) of the backend running your service sicf and the port it uses : check that FQN really is ersbxdb0.gene.com and port 8040.

If it doesn't work it could be a problem of domains also

former_member184578
Active Contributor
0 Kudos

Hi,

First you didn't answer my question! " Are you getting the DNS error when you run the WDA application or when you call ITS from WDA? "

In tcode when I run SICF i enterd service path as '/sap/bc/gui/sap/its/webgui' and test it manually it opens SAP GUI screen but i am not able add service for Tcode MM02

You don't have to add the service for Tcode MM02. What I meant was, when you test the ITS( by right click on webgui and Test Service) , SAP GUI will open in browser, there in the address bar you could see the URL ( say in your case ' http://xxxxxxxx:ppp/sap/bc/gui/sap/its/webgui?sap-client=004' ) now just append the parameter " ~TRANSACTION=MM02 "  so it will be like " http://xxxxxxxx:ppp/sap/bc/gui/sap/its/webgui?sap-client=004&~transaction=MM02 "

And as you said, you are able to see SAP GUI in browser, I guess you are facing the issue when you Test your WDA application.

So, follow the steps provided in my earlier reply to maintain FQDN and maintain host entries.

Regards,

Kiran

former_member226419
Contributor
0 Kudos

Hi,

Thanks .. I was giving wrong URL...now I am able to open MM02  on clicking button.. But I have requirement once I click MATNR ( which is hotspot) it will open MM02 for that particular MATNR.

So my question is how to populate MATNR on MM02 screen with code.

Code:

Below I am getting the value of MATNR.

  lo_nd_item = wd_context->get_child_node( name = 'ND_MARA' ).

  ASSIGN r_param->value->* TO <fs_lv_matnr>.

Below is the code to Call MM02:


Below code I have written to call MM02 on clicking custom button on screen...

But my requirement is to open MM02 on clicking MATNR.

DATA lo_window_manager TYPE REF TO if_wd_window_manager.

  DATA lo_api_component  TYPE REF TO if_wd_component.

  DATA lo_window         TYPE REF TO if_wd_window.

  lo_api_component  = wd_comp_controller->wd_get_api( ).

  lo_window_manager = lo_api_component->get_window_manager( ).

  lo_window         = lo_window_manager->create_external_window(

                     url = 'http://hvctla03.ct002.tss.loc:8000/sap/bc/gui/sap/its/webgui/se61_disptxt?sap-client=650&~transactio...'

                     ).

  lo_window->open( ).

BR

Sumeet

former_member226419
Contributor
0 Kudos

With above code I am able to open MM02  but  my requirement is to skip 1st screen of MM02 and open next screen with MATNR clicked.

former_member184578
Active Contributor
0 Kudos

Hi,

Now just concatenate ' '(space) 'RMMG1-MATNR=' lv_material_num '&~OKCODE=ENTR' to your URL.

So it looks like: 'https://XXXXXXX:PPPP/sap/bc/gui/sap/its/webgui?sap-client=004&~transaction=MM02%20RMMG1-MATNR=12345&...

Hope this helps u.,

Regards,

Kiran

ramakrishnappa
Active Contributor
0 Kudos

Hi Sumeet,


sumeet durgia wrote:

my requirement is to skip 1st screen of MM02 and open next screen with MATNR clicked.

To skip the first screen, you need to pass url parameter RMMG1-MATNR  and OK CODE in your url string.


Solution:

your url:

lv_url = 'http://hvctla03.ct002.tss.loc:8000/sap/bc/gui/sap/its/webgui/se61_disptxt?sap-client=650&~transactio...'.

concatenate

lv_url

'&RMMG1-MATNR= '  lv_matnr

'&~OKCODE= ENTR'.


* lv_matnr - material number to be passed


Hope this helps you.


Regards,

Rama



Answers (0)