- Include programs allow us to manage complex programs in an orderly way.
- These are sub-programs which contains a set of re-usable statements .
- These programs can not be executed directly.
- These include programs must be embedded inside a main program for execution.
- These programs does not contain parameter interface, that is no importing and exporting parameters.
- Syntax :
INCLUDE Z or Y<Include name>.
Ex:
Steps
- Enter the Title and Select the Attribute type as INCLUDE program and Click on save.
- Save it in either Local package or Package.
- Source Code
TYPES : BEGIN OF TY_VBRK,
VBELN TYPE VBRK-VBELN,
VKORG TYPE VBRK-VKORG,
NETWR TYPE VBRK-NETWR,
END OF TY_VBRK.
DATA : WA_VBRK TYPE TY_VBRK,
IT_VBRK TYPE TABLE OF TY_VBRK.
SELECT-OPTIONS : S_VBELN FOR WA_VBRK-VBELN.
VBELN TYPE VBRK-VBELN,
VKORG TYPE VBRK-VKORG,
NETWR TYPE VBRK-NETWR,
END OF TY_VBRK.
DATA : WA_VBRK TYPE TY_VBRK,
IT_VBRK TYPE TABLE OF TY_VBRK.
SELECT-OPTIONS : S_VBELN FOR WA_VBRK-VBELN.
- Save -> Check -> Activate.
- Click on Execute.
Note : Include programs can not be executed directly. Include programs must be embedded inside a main program for execution.
- To create executable program . Go to Transaction code SE38.
- Enter the Title and select Attribute type as Executable program and click on save.
Note : Nested include's are possible.
- Double click on ZTSD_INCLUDE1.
- Source Code
SELECT VBELN VKORG NETWR FROM VBRK INTO TABLE IT_VBRK WHERE VBELN IN
S_VBELN.
- Source Code
LOOP AT IT_VBRK INTO WA_VBRK.
WRITE : / WA_VBRK-VBELN , WA_VBRK-VKORG , WA_VBRK-NETWR.
ENDLOOP.
WRITE : / WA_VBRK-VBELN , WA_VBRK-VKORG , WA_VBRK-NETWR.
ENDLOOP.
- Execute.
No comments:
Post a Comment