SAP S/4
ABAP Programming
for non-Technical Users
Process Character Strings
in a Program
Copy Source Code
ZABAP_007 to
ZABAP_008
Activate the new Program
REPS (Source Code)
REPT (Text Elements)
copied from the Source Program are to be activated for the NEW Target Program ZABAP_008
Source codes and Text Elements for the NEW Program are now Activated
split z_name into
z_first_name & z_last_name
assuming user will always enter a first name then only the last name. (no validation in the program to check if last or first name)
split z_name into
z_first_name & z_last_name
assuming user will always enter a first name then only the last name. (no validation in the program to check if last or first name):
Step 1: create 2 variables to store the first and last name.
note the common and full stop
DATA: z_rldcy TYPE i,
z_tlany TYPE i,
z_first_name TYPE string,
z_last_name TYPE string.
split z_name into
z_first_name & z_last_name
assuming user will always enter a first name then only the last name. (no validation in the program to check if last or first name):
Step 1: create 2 variables to store the first and last name.
Step 2: use SPLIT syntax to split z_name into 2 variables z_first_name and z_last_name
AT ‘ ‘ syntax means
eg: if the name entered as
Jamie Lee Bourne
since there is space after Jamie,
Jamie = z_first name
Lee Bourne = last name
Before syntax and activation, let’s change the Program Title
Syntax check
Activate the Source Code
Test RUN
Notice any characters after the “space” of the first word is considered split to z_last _name