on 2025 Apr 10 8:17 AM
Hello Team,
could anybody guide me to convert the below abap code to new syntax as per 750/740
Below the prepopulated (having 2 record line) internal table CT_ITEM has 40+ fields and we wanted to modify 1 field acctasscat.
LOOP AT ct_item ASSIGNING FIELD-SYMBOL(<ls_ctitem>).
IF line_exists( lt_ctitem-ariba_extension[ field_name = gc_asmtcat_name ] ).
<ls_ctitem>-acctasscat = lt_ctitem-ariba_extension[ field_name = gc_asmtcat_name ]-field_value.
ENDIF.
ENDLOOP.
I have tried doing it myself but no luck as its creates new record and that new records contain only one column filled. below is tried query
ct_item_tmp = VALUE #( FOR <ls_item_old> IN ct_item
LET lt_item = is_input-purchasing_contract_erpcreate-purchasing_contract-item[ ariba_item_id = <ls_item>-ariba_itemno ]
( acctasscat = COND knttp(
WHEN line_exists( is_input-purchasing_contract_erpcreate-purchasing_contract-item[ ariba_item_id = <ls_item_old>-ariba_itemno ]-ariba_extension[ field_name = gc_asmtcat_name ] )
THEN is_input-purchasing_contract_erpcreate-purchasing_contract-item[ ariba_item_id = <ls_item_old>-ariba_itemno ]-ariba_extension[ field_name = gc_asmtcat_name ]-field_value
ELSE space ) )
( <ls_item_old> ) ).
Request clarification before answering.
| User | Count |
|---|---|
| 18 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.