05-29-2013 3:07 AM
i created the following transfer routine for infoObject Zcomments. when i load the data is is give me an error.
Error:
ZCOMMENT : Data record 4 ('000060000228 '): Version 't Inspected By ' is not valid
Routine:
If TRAN_STRUCTURE-QMART = 'TP'.
if TRAN_STRUCTURE-ZZQMTXT co 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
RESULT = TRAN_STRUCTURE-ZZQMTXT.
elseif TRAN_STRUCTURE-ZZQMTXT co '123456789'.
RESULT = ' '.
else.
RESULT = TRAN_STRUCTURE-ZZQMTXT+3.
ENDIF.
Else.
RESULT = ' '.
Please help me to fix this error.
Thanks
05-29-2013 7:41 AM
i think
RESULT = TRAN_STRUCTURE-ZZQMTXT+3.
must be
RESULT = TRAN_STRUCTURE-ZZQMTXT+0(3).
05-29-2013 1:38 PM
Hi,
The Operator CO is case sensitive so may be your comparison to check the content as alphabetic is failing as entry is in small case and compare string is all capital case.
Cheers,
Arindam
05-29-2013 2:48 PM
I suppose you are converting a free input text (lowercase enabled, space allowed between letters) to an infoobject, so 't Inspected By ' is not a valid value to identify an infoobject.
Try at least, to convert to uppercase, you could also use the tool of My BW Headaches: Invalid Characters.
Regards,
Raymond
05-30-2013 12:51 AM
Hi,
Thanks for your reply,
is co allow space between letters?
if not then how do i fix this..... i'm not good in ABAP, please help me to fix this code.
Thanks
05-30-2013 1:01 AM
Hi,
You can just include space in the string value of 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. Also as convert yout input string to UPPER CASE (As also suggested by Raymond )using TRANSLATE keyword .
Cheers,
Arindam
05-30-2013 1:13 AM
thanks for your reply again.
should i use A B C D E F G H I J K L........ this is dev system, in production, it has upper case.
is this ok if i use above string value?
05-30-2013 2:59 AM
Hi,
You can use the string as
'ABCDEFGHIJKLMNOPQRSTUVWXYZ '
Notice the last space after Z.
Although it is production its upper case would advice to use TRANSLATE <var> TO UPPER CASE. This should help you get things checked in Dev and Quality before its send to production and the statement would not affect anything in production as its already UPPER CASE as per you.
Cheers,
Arindam
05-30-2013 3:39 AM
05-30-2013 6:27 AM
hi,
using 'A B C D E F G H I J K L........ ' is also correct,and using at least ' ' is also correct
05-30-2013 7:56 AM
05-30-2013 8:54 AM
Don't worry to much on space characters, read those two blogs
For more information on CO operator, read log_exp - Comparison Operators for Character-Like Data Types, only one space character is required, Abap check for each character of the first operand if it exists in the seond operand, don't bother with multiple characters.
Regards,
Raymond
05-30-2013 2:29 PM
Hi,
Thanks Arindarn,
can you please give me code and where should i put in my routine as you know i'm not good in ABAp
Thanks
05-30-2013 3:02 PM
Hi Raymond,
For String Operators like CA, CN,CO, etc. space character matters for Comparison amongst the operands. I have experienced the same during pre-validating some character like fields.
Regards,
Ankit.
05-30-2013 3:13 PM
05-30-2013 3:42 PM
Hi Pria,
Just see this code snippet,
IF lv_ekorg CN '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ' .
IF lv_msg IS INITIAL.
CONCATENATE 'Invalid Characters - Purchasing Org' space INTO lv_msg RESPECTING BLANKS.
CONDENSE lv_msg.
ELSE.
CONCATENATE lv_msg lc_comma 'Invalid Characters - Purchasing Org' space INTO lv_msg RESPECTING BLANKS.
CONDENSE lv_msg.
ENDIF.
ENDIF.
-> Here i am comparing valid characters in Purchasing Org/EKORG. Now in my case Purchasing Org can be alpha numeric so i have put digits [0-9],[lower case alphabets],[uppercase alphabets] & Space.
This code works fine and checks for all Alphanumeric characters.
Please ask if anything is still unclear.
Regards,
Ankit.
05-31-2013 12:51 AM
Hi,
You can do the following:
If TRAN_STRUCTURE-QMART = 'TP'.
if TRAN_STRUCTURE-ZZQMTXT co 'ABCDEFGHIJKLMNOPQRSTUVWXYZ '.
RESULT = TRAN_STRUCTURE-ZZQMTXT.
elseif TRAN_STRUCTURE-ZZQMTXT co '123456789'.
RESULT = ' '.
else.
RESULT = TRAN_STRUCTURE-ZZQMTXT+3.
ENDIF.
Else.
RESULT = ' '.
Check the statement if TRAN_STRUCTURE-ZZQMTXT co 'ABCDEFGHIJKLMNOPQRSTUVWXYZ '. Now it has a space after Z in the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZ ' that should solve your issue.
Cheers,
Arindam