Steps
- Go to Transaction Code SE38.
- Enter the program name which start's with Y or Z < program name > and click on CREATE button.
- Enter the Title.
- Select the Attribute Type as Executable Program.
- Click on SAVE button.
Source Code
TYPES : BEGIN OF TY_MAKT,
MATNR TYPE MAKT-MATNR,
SPRAS TYPE MAKT-SPRAS,
MAKTX TYPE MAKT-MAKTX,
END OF TY_MAKT.
DATA : WA_MAKT TYPE TY_MAKT,
IT_MAKT TYPE HASHED TABLE OF TY_MAKT WITH UNIQUE KEY MATNR.
WA_MAKT-MATNR = 122.
WA_MAKT-SPRAS = 'EN'.
WA_MAKT-MAKTX = 'LENOVO'.
INSERT WA_MAKT INTO TABLE IT_MAKT.
CLEAR WA_MAKT.
WA_MAKT-MATNR = 123.
WA_MAKT-SPRAS = 'EN'.
WA_MAKT-MAKTX = 'DELL'.
INSERT WA_MAKT INTO TABLE IT_MAKT.
CLEAR WA_MAKT.
WA_MAKT-MATNR = 124.
WA_MAKT-SPRAS = 'EN'.
WA_MAKT-MAKTX = 'HP'.
INSERT WA_MAKT INTO TABLE IT_MAKT.
CLEAR WA_MAKT.
WA_MAKT-MATNR = 122.
WA_MAKT-SPRAS = 'DE'.
WA_MAKT-MAKTX = 'MICROSOFT'.
INSERT WA_MAKT INTO TABLE IT_MAKT.
CLEAR WA_MAKT.
WA_MAKT-MATNR = 124.
WA_MAKT-SPRAS = 'EN'.
WA_MAKT-MAKTX = 'LENOVO'.
INSERT WA_MAKT INTO TABLE IT_MAKT.
CLEAR WA_MAKT.
LOOP AT IT_MAKT INTO WA_MAKT.
WRITE : / WA_MAKT-MATNR,
WA_MAKT-SPRAS,
WA_MAKT-MAKTX.
ENDLOOP.
MATNR TYPE MAKT-MATNR,
SPRAS TYPE MAKT-SPRAS,
MAKTX TYPE MAKT-MAKTX,
END OF TY_MAKT.
DATA : WA_MAKT TYPE TY_MAKT,
IT_MAKT TYPE HASHED TABLE OF TY_MAKT WITH UNIQUE KEY MATNR.
WA_MAKT-MATNR = 122.
WA_MAKT-SPRAS = 'EN'.
WA_MAKT-MAKTX = 'LENOVO'.
INSERT WA_MAKT INTO TABLE IT_MAKT.
CLEAR WA_MAKT.
WA_MAKT-MATNR = 123.
WA_MAKT-SPRAS = 'EN'.
WA_MAKT-MAKTX = 'DELL'.
INSERT WA_MAKT INTO TABLE IT_MAKT.
CLEAR WA_MAKT.
WA_MAKT-MATNR = 124.
WA_MAKT-SPRAS = 'EN'.
WA_MAKT-MAKTX = 'HP'.
INSERT WA_MAKT INTO TABLE IT_MAKT.
CLEAR WA_MAKT.
WA_MAKT-MATNR = 122.
WA_MAKT-SPRAS = 'DE'.
WA_MAKT-MAKTX = 'MICROSOFT'.
INSERT WA_MAKT INTO TABLE IT_MAKT.
CLEAR WA_MAKT.
WA_MAKT-MATNR = 124.
WA_MAKT-SPRAS = 'EN'.
WA_MAKT-MAKTX = 'LENOVO'.
INSERT WA_MAKT INTO TABLE IT_MAKT.
CLEAR WA_MAKT.
LOOP AT IT_MAKT INTO WA_MAKT.
WRITE : / WA_MAKT-MATNR,
WA_MAKT-SPRAS,
WA_MAKT-MAKTX.
ENDLOOP.
No comments:
Post a Comment