Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Funciton module needs to be called in a new window.

Former Member
0 Kudos

Hi All,

I have a requirement as below.

I am executing an ALV report based on OOPS. After executing that report it displays few contract number. When we click on a contract number it calls a standard function module. Within this function it populates data and calls a screen to display the output which is once again an another standard tcode.

But when the 2nd tocde is displaying in the screen, it overrides the 1st ALV display. We want to create one more screen/session for the 2nd display so that we can see both the display simultaneously.

I have tried with CALL FUNCTION func ...STARTING NEW TASK task name DESTINATION none but it is not working.

I have also tried with the function module 'TH_CREATE_MODE' but here we can pass the transaction not the function module. If we only pass the transaction there, the transaction will open but there is no data available as the data population in done within the function module.

We are also unable to change the function module since it is a standard one and it is used by several programs. I am assuming that we have to apply some tricks while we are calling that function module.

Please advice.

Thanks and regards.

1 REPLY 1

Former Member
0 Kudos

Hi Satyajit,

Did you try this FM 'ABAP4_CALL_TRANSACTION' in the new task. This works for my case.

Here is the sample code which I used:

CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'TEST'

EXPORTING

tcode = 'VA03'

skip_screen = 'X'

TABLES

spagpa_tab = it_order.

Else this is the sample report program which will be helpful for you.

REPORT zopennewwindow .


WRITE 'This is the main ABAP program'.


DATA :

  lv_skip(1) TYPE c VALUE 'X',

  lv_vbeln LIKE vbak-vbeln VALUE '1500000015',

  l_st_param TYPE tpara,

  l_it_params TYPE TABLE OF tpara.


CLEAR l_st_param.

CLEAR l_it_params[].


l_st_param-paramid = 'AUN'.

l_st_param-partext = lv_vbeln.

APPEND l_st_param TO l_it_params.


CALL FUNCTION 'CC_CALL_TRANSACTION_NEW_TASK'

  STARTING NEW TASK 'VA03'

  DESTINATION 'NONE'

  EXPORTING

    transaction = 'VA03'

    skip_first_screen = 'X'

  TABLES

    paramtab = l_it_params

  EXCEPTIONS

    communication_failure = 97

    system_failure = 98

    OTHERS = 99.


IF sy-subrc = 0.

  " Success

ELSEIF sy-subrc = 97.

  " Communication Failure

  EXIT.

ELSEIF sy-subrc = 98.

  " System Failure

  EXIT.

ELSE.

  EXIT.

ENDIF.

This will helps.

Regards,

Rahul Gupta