Refactor below code DATA lvagreementnumber TYPE evrtn. DATA lvinforecordnetprice TYPE…
- User
Refactor below code
DATA lv_agreement_number TYPE evrtn. DATA lv_info_record_net_price TYPE netpr. DATA lo_purchase_price TYPE REF TO lcl_purchase_price.
codeFIELD-SYMBOLS: <ls_mbew> TYPE mbew. FIELD-SYMBOLS: <fs_t001w> TYPE gty_t001w . CREATE OBJECT lo_purchase_price EXPORTING iv_material = iv_matnr iv_plant = iv_werks it_product_locations = gt_aps_pl it_local_currencies = ct_local_currencies it_info_record_prices = gt_info_rec_price it_purchase_prices = gt_purch_price it_plants_branches = ct_t001w. lv_agreement_number = lo_purchase_price->get_agreement_number( ). IF lv_agreement_number IS INITIAL. lv_info_record_net_price = lo_purchase_price->calculate_info_rec_net_price( ). IF lv_info_record_net_price IS INITIAL. rv_price = calculate_last_order_price. " last_order_price ELSE. rv_price = lv_info_record_net_price. ENDIF. ELSE. rv_price = lo_purchase_price->calculate_agreement_price( ). ENDIF. Assistant
- User
ok, but please do not use inline declaration or abap keywords >=7.4
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.