Wednesday, 29 June 2016

External Subroutines without passing parameters


  • Syntax to call external subroutine.

                  Perform <subroutine name > (program name).
                                       or

                 Perform < subroutine name > in program <program name>.

Ex:



Steps :

  • Go to transaction code SE38.


  • Enter the program name start's with Y or Z<program name > and click on create button.

  • Enter the Title.
  • Select Attribute Type as Executable Program.
  • Click on save button.


  • Either save it in Package or Local Package.

Source code


TYPES BEGIN OF TY_VBRP,
        VBELN TYPE VBRP-VBELN,
        POSNR TYPE VBRP-POSNR,
        MATNR TYPE VBRP-MATNR,
        ARKTX TYPE VBRP-ARKTX,
       END OF TY_VBRP.

DATA WA_VBRP TYPE TY_VBRP,
       IT_VBRP TYPE TABLE OF TY_VBRP.

SELECT-OPTIONS S_VBELN FOR WA_VBRP-VBELN.

PERFORM FETCH_DATA IN PROGRAM ZINTER_SUB_WITHOUT_PAR" TO FETCH DATA
PERFORM DISPLAY(ZINTER_SUB_WITHOUT_PAR).





  • Save ->Check ->Activate.

  • Click on Execute.



Input


Output



No comments:

Post a Comment