2007 Jan 30 1:08 PM
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
2007 Jan 30 1:10 PM
Data: VAR type I.
VAR = STRLEN(FIELD).
if VAR > 40.
WRITE:/ 'Error message' .
ENDIF.
2007 Jan 30 1:10 PM
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
2007 Jan 30 1:12 PM
data: v_len type i.
Concatenate a b into c.
v_len = strlen(c).
if v_len < 30.
Insert data********
else.
message *********
endif.
2007 Jan 30 1:18 PM
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
2007 Jan 30 1:20 PM
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
2007 Jan 31 3:59 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |