VA05 ADD FIELD
作者:互联网
VA05添加字段分两种情况
1、非S4系统 :这个不记录了网上资料比较多,大概是3开头的note
2、S4系统:对应note 1780163 - Report optimization: Access to further tables - SAP ONE Support Launchpad
需求:用户想要显示VBPA表中的送达方相关信息
代码编写完成后,需要注意,在查询时需要选择合作伙伴职能 SH
代码部分 ES_SDOC_WRAPPER
1 METHOD if_badi_sdoc_wrapper~adapt_result_comp. 2 DATA: 3 lt_join_metadata TYPE if_sdoc_select=>tct_join_metadata. 4 5 *display 送达方 KUNWE_ANA 6 INSERT VALUE #( table = 'VBAP' 7 field = 'KUNWE_ANA' 8 name = 'KUNWE_ANA' ) INTO TABLE ct_result_comp. 9 10 11 * join vbpa-vbeln to vbap-vbeln 12 INSERT VALUE #( target_field = 'VBELN' 13 source_table = 'VBAP' 14 source_field = 'VBELN' ) INTO TABLE lt_join_metadata. 15 * join vbpa-PARVW = 'WE' 16 INSERT VALUE #( target_field = 'PARVW' 17 constant_value = 'WE' ) INTO TABLE lt_join_metadata. 18 INSERT VALUE #( target_table = 'VBPA' 19 join_metadata = lt_join_metadata ) INTO TABLE ct_additional_table_metadata. 20 *display ADRNR_WE 21 INSERT VALUE #( table = 'VBPA' 22 field = 'ADRNR' 23 name = 'VBPA_ADRNR_WE' ) INTO TABLE ct_result_comp. 24 25 * join vbpa-ADRNR to ADRC-ADDRNUMBER 26 INSERT VALUE #( target_field = 'ADDRNUMBER' 27 source_table = 'VBPA' 28 source_field = 'ADRNR' ) INTO TABLE lt_join_metadata. 29 INSERT VALUE #( target_table = 'ADRC' 30 join_metadata = lt_join_metadata ) INTO TABLE ct_additional_table_metadata. 31 32 * Display ADRC~STREET PO_BOX TEL_NUMBER 33 INSERT VALUE #( table = 'ADRC' 34 field = 'STREET' 35 name = 'ADRC_STREET' ) INTO TABLE ct_result_comp. 36 INSERT VALUE #( table = 'ADRC' 37 field = 'PO_BOX' 38 name = 'ADRC_PO_BOX' ) INTO TABLE ct_result_comp. 39 INSERT VALUE #( table = 'ADRC' 40 field = 'TEL_NUMBER' 41 name = 'ADRC_TEL_NUMBER' ) INTO TABLE ct_result_comp. 42 ENDMETHOD.
标签:INSERT,join,VALUE,FIELD,ADD,TABLE,table,VA05,metadata 来源: https://www.cnblogs.com/springzt/p/16436738.html