Below I have used K_WERKS_OF_BUKRS_FIND function module to fetch all the plants in particular company code.
Code:
REPORT zfind_all_plants.
DATA: itab TYPE STANDARD TABLE OF t001w.
CALL FUNCTION 'K_WERKS_OF_BUKRS_FIND'
EXPORTING
bukrs = '1000'
TABLES
* ITAB_001K =
itab_001w = itab
EXCEPTIONS
no_entry_in_t001k = 1
no_entry_in_t001w = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
cl_demo_output=>display( itab ).
DATA: itab TYPE STANDARD TABLE OF t001w.
CALL FUNCTION 'K_WERKS_OF_BUKRS_FIND'
EXPORTING
bukrs = '1000'
TABLES
* ITAB_001K =
itab_001w = itab
EXCEPTIONS
no_entry_in_t001k = 1
no_entry_in_t001w = 2
OTHERS = 3.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
cl_demo_output=>display( itab ).
Try this code in your computer for better understanding. Enjoy the code. If you have any Question you can contact us or mail us. We will reply you as soon as possible.
Post a Comment