In today’s tutorial I want to teach you how to open new SAP transaction using ABAP Function called “CC_CALL_TRANSACTION_NEW_TASK”.
Program Description:
We will be creating a start up program that will call this function and open a new transaction for VL03N, and it will skip the first screen while supplying the delivery order number and display the delivery order screen.
We will be creating a start up program that will call this function and open a new transaction for VL03N, and it will skip the first screen while supplying the delivery order number and display the delivery order screen.
Here’s the ABAP sample source code.
Z_CALL_NEW_TASK.
WRITE:/ ‘This is your main Program ‘.
WRITE:/ ‘You will see a new session program’.
WRITE:/ ‘Opened after this program is active’.
WRITE:/ ‘You will see a new session program’.
WRITE:/ ‘Opened after this program is active’.
DATA :
lv_skscr(1) TYPE c VALUE ‘X’,
lv_vbeln LIKE LIKP-VBELN VALUE ‘5572000119′,
l_st_prscr TYPE tpara,
l_it_scrprm TYPE TABLE OF tpara.
lv_skscr(1) TYPE c VALUE ‘X’,
lv_vbeln LIKE LIKP-VBELN VALUE ‘5572000119′,
l_st_prscr TYPE tpara,
l_it_scrprm TYPE TABLE OF tpara.
CLEAR l_st_prscr.
CLEAR l_it_scrprm[].
CLEAR l_it_scrprm[].
l_st_prscr-paramid = ‘VL’.
l_st_prscr-partext = lv_vbeln.
APPEND l_st_prscr TO l_it_scrprm.
l_st_prscr-partext = lv_vbeln.
APPEND l_st_prscr TO l_it_scrprm.
CALL FUNCTION ‘CC_CALL_TRANSACTION_NEW_TASK’
STARTING NEW TASK ‘VL03N’
DESTINATION ‘NONE’
EXPORTING
STARTING NEW TASK ‘VL03N’
DESTINATION ‘NONE’
EXPORTING
transaction = ‘VL03N’
skip_first_screen = ‘X’
TABLES
paramtab = l_it_scrprm
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.
” Success
ELSEIF sy-subrc = 97.
” Communication Failure
EXIT.
ELSEIF sy-subrc = 98.
” System Failure
EXIT.
ELSE.
EXIT.
ENDIF.
1. Now Run the program (F8)
2. Below you will see there are 2 programs active, the first one is the ABAP program that is calling the VL03 transaction.
2. Below you will see there are 2 programs active, the first one is the ABAP program that is calling the VL03 transaction.
Post a Comment