头图

Directory of zero-based ABAP learning tutorial series articles

ABAP Basics

ALV Development Topics

This step is the follow-up of this tutorial article ABAP Standard Training Course BC400 Study Notes: Variables, Constants and Literals of the ABAP Programming Language, and Text Symbols .

ABAP variables of type string, which seem easy to use.

The following code defines a variable of type string, assigns it to Jerry, and prints it.

 REPORT z.

DATA: lv_string TYPE string.

lv_string = 'Jerry'.

WRITE:/ lv_string.

Can you tell me the output of the following two lines of print statements? Here strlen is the ABAP standard function used to calculate the length of the input string, that is, the number of characters.

 DATA: lv_string1 TYPE string,
      lv_string2 type string.

lv_string1 = ' a '.
lv_string2 = ` a `.

WRITE:/ strlen( lv_string1 ), strlen( lv_string2 ).

The answers are 2 and 3.

Refer to this link for a detailed explanation.


注销
1k 声望1.6k 粉丝

invalid