SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, code samples and tools and downloads for ASP.Net, SQL Server, R Script, Windows, Windows Phone, AWS, SAP HANA and ABAP, like SAP UI5, Screen Personas, etc.

Install SAP Free

How to Open SAP Transaction in New Window Or in New Session using ABAP cc_call_transaction_new_task Function Module

ABAP developers can use ABAP function module CC_CALL_TRANSACTION_NEW_TASK in order to execute and display an SAP transaction in a new window or in a new session.
Using cc_call_transaction_new_task, parameters can be set for the first screen of many SAP transactions like VA02 or VA03.

In this sample ABAP report, I will execute the main ABAP program and write a message on the SAP screen.
And using the ABAP function module cc_call_transaction_new_task with required VBELN parameter is set to a valid Sales Order nnumber, I will open a new SAP GUI screen and display the Sales Order using the VA03 SAP Transaction code.

launch SAP transaction in new ABAP window

Here is the source code of the sample SAP report used for demonstrating the cc_call_transaction_new_task ABAP function.

You can realize that while using CC_CALL_TRANSACTION_NEW_TASK function, we also use STARTING NEW TASK with an identifier.
Also we are defining the DESTINATION 'NONE' for the cc_call_transaction_new_task function.
Later, you can pass required parameters like transaction code, whether to skip first screen or not and additional parameters like VBELN number using the EXPORTING and TABLES sections of the function module.

REPORT zopennewwindow .

WRITE 'This is the main ABAP program'.

  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.

    transaction = 'VA03'
    skip_first_screen = 'X'
    paramtab = l_it_params
    communication_failure = 97
    system_failure = 98
    OTHERS = 99.

IF sy-subrc = 0.
  " Success
ELSEIF sy-subrc = 97.
  " Communication Failure
ELSEIF sy-subrc = 98.
  " System Failure

I hope, as an ABAP developer you find this sample ABAP program useful for demonstrating cc_call_transaction_new_task function module to open new window and call the transaction code in the new session.
For a similar ABAP function, please refer to How to Display SAP Transaction in a New Session Or in New Window using ABAP4_Call_Transaction Function Module.

SAP Resources

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table

Meetup Sunumu 1 meetup

Copyright © 2004 - 2020 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems