cancel
Showing results for 
Search instead for 
Did you mean: 

How to change STARTMODE of a SAP Transaction

Former Member
0 Kudos

Hi,

I have created a transaction for a Web Dynpro ABAP application. I want to change the start mode of the transaction dynamically. Please let me if it is possible and how.

Thanks,

Isha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All,

Thanks for your inputs. My scenario is as follows:

When the transaction is called, I need to check the value of a field in the table and based on its value I need to open the application in a browser or in the SAP GUI. Please let me know where should I put the code or if any enhancement can be done for the same?

Thanks,

Isha Varshney

Former Member
0 Kudos

Hi Isha,

I would suggest you to create a program in SE38 and assign a Tcode to it.

Inside your program,check the value of the field which you require and then use FM 'WDY_EXECUTE_IN_PLACE' to open the application either in browser or in GUI.

You can use the code given by above.

Answers (3)

Answers (3)

ramakrishnappa
Active Contributor
0 Kudos

Hi Isha,

I agree with Mr. Jozef, that transaction code WDYID uses FM: WDY_EXECUTE_IN_PLACE.

Please check the below code :


data lt_parameters type  TIHTTPNVP.

data lv_internal_mode type char01.

data lv_gen_url type string.

"prepare start mode

     IF start_mode = 'BROWSER'.

       lv_internal_mode = abap_false.    

     ELSE.

       lv_internal_mode = abap_true. "GUI

     ENDIF.

CALL FUNCTION 'WDY_EXECUTE_IN_PLACE'

     EXPORTING

       protocol     = 'HTTPS'

       internalmode = lv_internal_mode

       application  = 'ZWDA_TEST_MY_APP'

       parameters   = lt_parameters

     IMPORTING

       out_url      = lv_gen_url

     EXCEPTIONS

       INVALID_APPLICATION    = 1

       BROWSER_NOT_STARTED    = 2

       OTHERS                 = 3.

Hope this helps you.

Regards,

Rama

former_member184578
Active Contributor
0 Kudos

Hi,

You could create a BDC Recording for WDYID transaction and populate the STARTMODE dynamically and call the BDC Transaction. Or create 2 separate transaction with STARTMODE as GUI and BROWSER and then call the corresponding transaction based on condition.

hope this helps,

Regards,

Kiran

Former Member
0 Kudos

what is the start mode?

Former Member
0 Kudos

STARTMODE is a parameter that we need to supply when we create a transaction.

I wish to change the startmode of the transaction to GUI & Browser dynamically based on certain values.

Former Member
0 Kudos

can you provide a screenshot where you define the startmode for a transaction?

Former Member
0 Kudos
Former Member
0 Kudos

It is one of the parameters in a parameter transaction

Former Member
0 Kudos

I see 2 solutions:

- As you will not have many startmodes (probably 2-3 at maximum), you can create separated transactions each with it's own startmode. Then you can wrap it by the one starting transaction which can in turn do anything - it can be a program that evaluates your dynamic condition and runs the corresponding one.

- If you debugg WDYID transaction a little, you will find, that it runs FM WDY_EXECUTE_IN_PLACE. So you should be able to create any transaction, which would use a suppressed dynpro without any different logic only running this FM.