- Syntax :
- Defining Subroutines.
<statements>
ENDFORM.
- Calling Subroutines.
- Internal subroutines have the source code in the calling ABAP/4 program:
PERFORM <subroutine> .
Steps:
- Go to transaction code SE38.
- Enter the Title.
- Select Attribute Type as Executable Program.
- Click on save button.
- Either save it in Package or Local Package.
- Write the code,
- 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. " TO FETCH DATA
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. " TO FETCH DATA
- Double click on Subroutine name i.e FETCH_DATA .
- Create one more subroutine to display output.
No comments:
Post a Comment