SAP S/4HANA에서 T-Code별로 사용하고 있는 CDS View 목록을 출력하는 ABAP 코드를 만들어줘.
- User
SAP S/4HANA에서 T-Code별로 사용하고 있는 CDS View 목록을 출력하는 ABAP 코드를 만들어줘.
Assistant
Sure, I can help you with that. Here's an ABAP code snippet that retrieves the list of CDS views used by each T-Code in SAP S/4HANA. This code uses the function module 'SVT_READ_CDS_VIEW_USAGE' to get the CDS view usage information. Please note that this function module is only available in SAP S/4HANA systems.
abapREPORT zcds_view_usage. DATA: lt_tcode_cds_views TYPE TABLE OF svt_cds_view_usage, ls_tcode_cds_views TYPE svt_cds_view_usage, lt_tcodes TYPE TABLE OF sy-tcode, ls_tcode TYPE sy-tcode. * Replace the following line with your own list of T-Codes lt_tcodes = VALUE #( ( 'VA01' ) ( 'VA02' ) ( 'VA03' ) ). LOOP AT lt_tcodes INTO ls_tcode. CALL FUNCTION 'SVT_READ_CDS_VIEW_USAGE' EXPORTING iv_tcode = ls_tcode TABLES tt_cds_view_usage = lt_tcode_cds_views. LOOP AT lt_tcode_cds_views INTO ls_tcode_cds_views. WRITE: / ls_tcode, ls_tcode_cds_views-cds_view_name. ENDLOOP. CLEAR lt_tcode_cds_views. ENDLOOP.Replace the T-Codes in the
lt_tcodestable with the ones you want to analyze. The code will then loop through each T-Code and print the corresponding CDS views used by that T-Code.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.