


@AbapCatalog.sqlViewAppendName: 'ZC_POFS_EXT'
@EndUserText.label: 'Extension for C_PurchaseOrderFs'
extend view C_PurchaseOrderFs with ZC_PurchaseOrderFs_Ext
association[0..1] to ZMM_PO_WF_CUST_FIELD as CustFields
on CustFields.ebeln = purchaseorder
{
@EndUserText: {label: 'Project Id'}
@UI.identification: [{
position: 30,
label: 'Project Id',
importance: #HIGH }]
CustFields.ProjectId as ProjectId,
@EndUserText: {label: 'Project Description'}
@UI.identification: [{
position: 30,
label: 'Project Description',
importance: #HIGH }]
CustFields.ProjectDescription as ProjectDescription,
@EndUserText: {label: 'Header Note'}
@ObjectModel.readOnly: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:ZCL_MM_PO_HEADER_NOTE'
@UI.identification: [{
position: 40,
label: 'Header Note',
importance: #HIGH }]
cast('' as abap.char(1333)) as HeaderNote
} METHOD if_sadl_exit_calc_element_read~calculate.
DATA: lv_ebeln TYPE ebeln,
lv_name TYPE tdobname,
lt_lines TYPE STANDARD TABLE OF tline,
lt_lines1 TYPE STANDARD TABLE OF tdline.
LOOP AT it_original_data ASSIGNING FIELD-SYMBOL(<lfs_org_data>).
DATA(lv_index) = sy-tabix.
ASSIGN COMPONENT 'PURCHASEORDER' OF STRUCTURE <lfs_org_data> TO FIELD-SYMBOL(<lfs_ebeln>).
IF <lfs_ebeln> IS ASSIGNED.
lv_name = <lfs_ebeln>.
**--Read Header Note from
CLEAR: lt_lines,lt_lines1.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = 'F02'
language = 'E'
name = lv_name
object = 'EKKO'
TABLES
lines = lt_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF NOT lt_lines IS INITIAL.
lt_lines1 = VALUE #( FOR ls_lines IN lt_lines
( ls_lines-tdline ) ).
DATA(lv_string) = concat_lines_of( table = lt_lines1 sep = CL_ABAP_CHAR_UTILITIES=>newline ).
READ TABLE ct_calculated_data ASSIGNING FIELD-SYMBOL(<lfs_cal_data>) INDEX lv_index.
IF sy-subrc = 0.
<lfs_cal_data> = lv_string.
ENDIF.
ENDIF. "IF NOT lt_lines IS INITIAL.
ENDIF. "IF <lfs_ebeln> IS ASSIGNED.
ENDLOOP. "LOOP AT IT_ORIGINAL_DATA ASSIGNING FIELD-SYMBOL(<lfs_org_data>).
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 3175 | |
| 2865 | |
| 2074 | |
| 1509 | |
| 1407 | |
| 1225 | |
| 1170 | |
| 1138 | |
| 1112 | |
| 904 |