https://exercism.org/tracks/abap/exercises/reverse-string
Reverse String in ABAP on Exercism
Can you solve Reverse String in ABAP? Improve your ABAP skills with support from our world-class team of mentors.
exercism.org
알고보니 엄청 쉬운 방법이 있었다..ㅎ
내가 쓴 답변
CLASS zcl_reverse_string DEFINITION PUBLIC.
PUBLIC SECTION.
DATA : GV_LEN TYPE I.
METHODS reverse_string
IMPORTING
input TYPE string
RETURNING
VALUE(result) TYPE string.
ENDCLASS.
CLASS zcl_reverse_string IMPLEMENTATION.
METHOD reverse_string.
" Please complete the implementation of the reverse_string method
GV_LEN = STRLEN( INPUT ) - 1.
CLEAR RESULT.
DO GV_LEN + 1 TIMES.
result = result && input+GV_LEN(1).
GV_LEN = GV_LEN - 1.
ENDDO.
ENDMETHOD.
ENDCLASS.
다른 사람의 모범답변
METHOD reverse_string.
result = reverse( input ).
ENDMETHOD.
SAP BAdI 추가 (0) | 2024.09.13 |
---|---|
CLASS TEST #2 : Scrabble Score (0) | 2024.01.12 |
CLASS TEST #1 : Hello, World! (0) | 2024.01.09 |
ABAP - 다른 SAP끼리 데이터 송수신하는 RFC 펑션 프로그램 (0) | 2023.08.23 |
ABAP - BDC 실습(자재 마스터 변경) (0) | 2023.03.17 |