Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Check space in the end to display warning message.

I am currently working on validations on functional locations in the EDIT MASK. the code is already written for validations on to check for space in the beginning of the each level in the edit mask. however user requirement is that the program should produce warning messages for spaces regardless of where they appear in the Edit Mask. we have not validated to check for space at the end of each level.

I have checked with condense ,shift string right deleting trailing spaces however I am not able to check for space at the end of levels.

when i debugged the program the level8 length shows as 2 even though there is only one char in the level8. i

could you please suggest any possible solution or any keywords that would help. you can go through the below code which is already written for checking space in the begining.

here l_level1

  • Level 8 errors

l_length = STRLEN( l_level8 ).

IF ( l_level8 = space AND l_dash_count > 6 ) OR

l_dash_count > 7 OR

l_length > 4.

lt_mask_err-error = '8E'.

APPEND lt_mask_err.

l_errlvl8 = c_y.

ENDIF.

Level 8 Warning

IF rb_bdc <> c_on AND p_warn = c_on AND

( l_level8 <> space AND l_level8+0(1) = space ).

lt_mask_err-error = '8W'.

APPEND lt_mask_err.

ENDIF.

i have added this code to display warning message using shift.

l_lev8 = l_level8.

shift l_lev8 right.

l_length = STRLEN( l_lev8 ).

IF rb_bdc <> c_on AND p_warn = c_on AND

( l_lev8 <> space AND l_lev8+0(1) = space ).

lt_mask_err-error = '1W'.

APPEND lt_mask_err.

ENDIF.

Former Member
Not what you were looking for? View more on this topic or Ask a question