2 weeks ago - last edited 2 weeks ago
I have below multiple IF statements which I want to see combined,
I tried using ELSEIF and CASE but its not applicable here because the comparison operator is <> instead of =
Below is the code:
IF <ls_load>-atnam <> 'AA'.
IF VALUE #( lt_num[ charact = 'AA' ]-value_from OPTIONAL ) IS INITIAL.
DELETE lt_num WHERE charact = 'AA'.
ENDIF.
ENDIF.
IF <ls_load>-atnam <> 'BB'.
IF VALUE #( lt_num[ charact = 'BB' ]-value_from OPTIONAL ) IS INITIAL.
DELETE lt_num WHERE charact = 'BB'.
ENDIF.
ENDIF.
IF <ls_load>-atnam <> 'CC'.
IF VALUE #( lt_num[ charact = 'CC' ]-value_from OPTIONAL ) IS INITIAL.
DELETE lt_num WHERE charact = 'CC'.
ENDIF.
ENDIF.
Hello, consider creating a method in this case. All three conditions looks same, just parameter 'AA'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.