SAP Function Modules

SWY_CREATE_TASK_WS_SUBSCREEN SAP Function module







SWY_CREATE_TASK_WS_SUBSCREEN is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name SWY_CREATE_TASK_WS_SUBSCREEN into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SWY_API_TASK_FORM
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM SWY_CREATE_TASK_WS_SUBSCREEN - SWY CREATE TASK WS SUBSCREEN





CALL FUNCTION 'SWY_CREATE_TASK_WS_SUBSCREEN' "
  EXPORTING
    task =                      " swytskatrb-taskstrg  Task
*   ref_container_element_name =   " swcontdef-element
*   ref_structure_name =        " ddobjname
*   program_name =              " swyprog-prognam
*   transaction_easy_web = 'X'  " s_ewt         Easy Web Transaction
* CHANGING
*   program_dynpro_number =     " swydynp-dynpro  Screen number
*   program_dynpro_text =       " rpy_dyhead-descript
*   program_include_name =      " swyprog-prognam
*   transaction_code_name =     " tstc-tcode
*   transaction_code_text =     " tstct-ttext
*   devclass = '$TMP'           " swyprog-devclass  Package
*   corrnumber =                " e071-trkorr   Request/Task
  EXCEPTIONS
    TASK_NOT_EXISTS = 1         "
    TASK_TYPE_IS_INVALID = 2    "
    ENVIRONEMENT_NOT_CREATED = 3  "
    TRANSACTION_NOT_CREATED = 4  "
    USER_ACTION_CANCEL = 5      "               Canceled by User
    .  "  SWY_CREATE_TASK_WS_SUBSCREEN

ABAP code example for Function Module SWY_CREATE_TASK_WS_SUBSCREEN





The ABAP code below is a full code listing to execute function module SWY_CREATE_TASK_WS_SUBSCREEN including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).



DATA(ld_program_dynpro_number) = some text here

DATA(ld_program_dynpro_text) = some text here

DATA(ld_program_include_name) = some text here

SELECT single TCODE
FROM TSTC
INTO @DATA(ld_transaction_code_name).


SELECT single TTEXT
FROM TSTCT
INTO @DATA(ld_transaction_code_text).


DATA(ld_devclass) = some text here

SELECT single TRKORR
FROM E071
INTO @DATA(ld_corrnumber).


DATA(ld_task) = some text here

DATA(ld_ref_container_element_name) = some text here
DATA(ld_ref_structure_name) = 'Check type of data required'.

DATA(ld_program_name) = some text here
DATA(ld_transaction_easy_web) = 'Check type of data required'. . CALL FUNCTION 'SWY_CREATE_TASK_WS_SUBSCREEN' EXPORTING task = ld_task * ref_container_element_name = ld_ref_container_element_name * ref_structure_name = ld_ref_structure_name * program_name = ld_program_name * transaction_easy_web = ld_transaction_easy_web * CHANGING * program_dynpro_number = ld_program_dynpro_number * program_dynpro_text = ld_program_dynpro_text * program_include_name = ld_program_include_name * transaction_code_name = ld_transaction_code_name * transaction_code_text = ld_transaction_code_text * devclass = ld_devclass * corrnumber = ld_corrnumber EXCEPTIONS TASK_NOT_EXISTS = 1 TASK_TYPE_IS_INVALID = 2 ENVIRONEMENT_NOT_CREATED = 3 TRANSACTION_NOT_CREATED = 4 USER_ACTION_CANCEL = 5 . " SWY_CREATE_TASK_WS_SUBSCREEN
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_program_dynpro_number  TYPE SWYDYNP-DYNPRO ,
ld_task  TYPE SWYTSKATRB-TASKSTRG ,
ld_program_dynpro_text  TYPE RPY_DYHEAD-DESCRIPT ,
ld_ref_container_element_name  TYPE SWCONTDEF-ELEMENT ,
ld_program_include_name  TYPE SWYPROG-PROGNAM ,
ld_ref_structure_name  TYPE DDOBJNAME ,
ld_transaction_code_name  TYPE TSTC-TCODE ,
ld_program_name  TYPE SWYPROG-PROGNAM ,
ld_transaction_code_text  TYPE TSTCT-TTEXT ,
ld_transaction_easy_web  TYPE S_EWT ,
ld_devclass  TYPE SWYPROG-DEVCLASS ,
ld_corrnumber  TYPE E071-TRKORR .


ld_program_dynpro_number = some text here

ld_task = some text here

ld_program_dynpro_text = some text here

ld_ref_container_element_name = some text here

ld_program_include_name = some text here
ld_ref_structure_name = 'Check type of data required'.

SELECT single TCODE
FROM TSTC
INTO ld_transaction_code_name.


ld_program_name = some text here

SELECT single TTEXT
FROM TSTCT
INTO ld_transaction_code_text.

ld_transaction_easy_web = 'Check type of data required'.

ld_devclass = some text here

SELECT single TRKORR
FROM E071
INTO ld_corrnumber.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name SWY_CREATE_TASK_WS_SUBSCREEN or its description.