F How to find all Plants in SAP using Function Module | CodeTheta

How to find all Plants in SAP using Function Module

June 04, 2024

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.
DATAitab 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=>displayitab ).

IDE Used To Test This Code : SAP ABAP Editor.

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