Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Concatenation

Former Member
0 Likes
872

Hi,

Iam concatenating two values and populated on the description field(two values output)in the vbap table(arktx).What my requirement is the arktx should be less than 30 character.If result is more than 40 characters i want display the

error message.What have to write the code for that requirement.Please help me.

Regards,

sairam

Hi,

Iam concatenating two values and populated on the description field(two values output)in the vbap table(arktx).What my requirement is the arktx should be less than 30 character.If result is more than 40 characters i want display the

error message.What have to write the code for that requirement.Please help me.

Regards,

sairam

6 REPLIES 6
Read only

Former Member
0 Likes
843

Data: VAR type I.

VAR = STRLEN(FIELD).

if VAR > 40.

WRITE:/ 'Error message' .

ENDIF.

Read only

Former Member
0 Likes
843

concatenate val1 val2 into arbtx.

condense arbtx.

v_len = strlen( arbtx ).

if v_len > 30.

message e001(zz) with 'Text Longer than 30 chars'.

endif.

Regards,

Ravi

Read only

Former Member
0 Likes
843

data: v_len type i.

Concatenate a b into c.

v_len = strlen(c).

if v_len < 30.

Insert data********

else.

message *********

endif.

Read only

Former Member
0 Likes
843

Hi,

first check the Length of the two fields first. then only u concatenate the strings to ur variable if the length is more it will go to short dump.

try this code.

data: var1 type sy-index.

data: var2 type sy-index.

var1 = strlen(first field).

var2 = strlen(secondfield).

var1 = var1 + var2.

if var1 < 40.

use concatenate statement.

else

display the error messages.

endif.

Regards,

Sree

Read only

Former Member
0 Likes
843

Hi,

I hope following code will solve your problem.

if v_length = ( arktx ).

if v_length > 40.

MESSAGE 'Length is more than 40' TYPE 'E' .

endif.

Reward points if the answer is helpful.

Regards,

Mukul

Read only

Former Member
0 Likes
843

Hi,

Thanks for all replies.

with regards,

sairam