2014 Sep 03 2:05 PM
Hi All,
I am writing a select statement as shown below.Even though I maintained text element for 009 as 'A' but when I double click on below line it shows me as 009 not found.Why? How can I rectify it.Thanks in Advance.
Best Regards,
Chakradhar.
2014 Sep 03 5:06 PM
Hi All,
Thanks for all for your replies.I already worked with constants but my tech lead asked it to change it for text element.I too do not know why exactly he asked to change.So, I changed it from constants to text elements but it is not working fine.
Regards,
Chakradhar.
2014 Sep 03 2:10 PM
2014 Sep 04 7:38 AM
Wrong
data: some_text type c length 80.
some_text = 'This is my text'(001).
Perfectly valid, and certainly better than
data: some_text type c length 80.
some_text = text-001.
2014 Sep 03 2:29 PM
Hi chakri ,
i think text-symbols are not activated .
goto->text_elements->text-symbols and activate .
if still doesnt work ,use se32 t-code to analyze and adjust the test_symbols .
and it is not advisable to use text-symbols in select query .
regards,
krishna.
2014 Sep 03 4:11 PM
Hi Krishna,
Thanks for you reply.I checked it whether it is in active mode or not.But it is not working yet.
2014 Sep 04 5:53 AM
Hi chakri,
go through the link http://scn.sap.com/thread/200183 .
if a text-symbol is maintained then after double-click ,it would navigate you to the text-symbols screen.
Activate your code and goto text-symbols and click on compare text symbols .this will take you to se32 .and how to maintain the text-symbols is specified in the attached link .ELSE simply remove (009) and write TEXT-009 and double click on it and provide description .
Regards,
krishna
2014 Sep 03 2:29 PM
Hi,
Why are you trying to use text elements for where conditions in your code? If you want to tidy you the code you might be better using constants.
I really wouldn't advise to use text-elements in your select statements like this.
Cheers,
G.
2014 Sep 03 2:36 PM
Hi ,
If you use text elements... The following will be the problem you will face,
The report created by you in EN language and user executes this it in other than EN language.
If you miss to maintain that corresponding text in that text element.
Your select statement will go wrong.
Please correct it.
Regards,
Ravi Shankar.L
2014 Sep 03 2:41 PM
hi
Select kschl
kozgf
from t685
into table i_t685
where kvewe eq text-009
and kappl eq 'v'
2014 Sep 03 2:42 PM
Remove the space between text litteral and text number 'A' (009) -> 'A'(009). I suppose the editor interpret it as a variable containing a list of fields...
Also define and activate this text if required. Usually, for such fields use text elements when translation required, here define a CONSTANT in your code declaratives.
Regards,
Raymond
2014 Sep 03 4:51 PM
Two very knowledgeable SCN members have already suggested to use a constant (and I couldn't agree more). Is there any specific reason to stick with a text element? As already pointed out, it doesn't make sense to use a text element in such context yet here we go again. It's starting to look borderline masochistic...
2014 Sep 03 5:06 PM
Hi All,
Thanks for all for your replies.I already worked with constants but my tech lead asked it to change it for text element.I too do not know why exactly he asked to change.So, I changed it from constants to text elements but it is not working fine.
Regards,
Chakradhar.
2014 Sep 03 5:59 PM
I'm really confused what a tech lead would be basing their decision on... If it was something relevant to the translation then yes, I get it. But if you drill down to the domain for KVEWE field, I really don't see how could there be language-specific entries in the T681V table. Honestly, even replacing 'A' with a constant seems like a "tomato - tomahto" situation.
Anyway, it seems to work fine for me - double-click is working and no errors displayed.
SELECT single kschl into var1
from t685 where kvewe EQ 'A'(009).
Other than chosing a different language and not activating the texts, as already mentioned, not sure what else could possibly go wrong...
2014 Sep 03 6:39 PM
In that case, the best advice I can give you is to challenge your tech lead why they want you to use text elements for single character values that are being passed into the Where condition of an SQL statement. At worst, I'd agree using constants would make some sense although as has already said, creating a constant of value "A" is (IMHO) a waste of time but that is a discussion for elsewhere...
Seriously, if you think constants are correct (and no-one here can think of any reason why text-elements make sense in this situation) you should really push back on your tech lead. You'd get my vote, as in over 15 years of ABAP meddling I've never seen, used or had the desire to use text-elements in my SQL statements as you describe here.
From a wider perspective, I am seeing a worrying trend with ABAP teams of late where a "lead" of some description makes a blanket decision that makes no sense but they don't/won't/can't explain and justify how they stand by that decision. It leads to bad practice, bad code, poor supportability and generally dilutes the skills and abilities of the developers being "led".
Just my thoughts
2014 Sep 03 7:03 PM
I am seeing a worrying trend with ABAP teams of late where a "lead" of some description makes a blanket decision that makes no sense but they don't/won't/can't explain and justify how they stand by that decision.
My fav topic - tech leads, QA reviewers.
Once a QA reviewer wanted me to change AUTHORITY-CHECK OBJECT 'F_BKPF_BUK' to AUTHORITY-CHECK OBJECT con_bkpf_buk As per his definition anything inside single quotes (') is a text, and hence to be declared as a constant.
I would not make such a stupid change & the QA reviewer would not release my code. The matter was escalated to higher level & the reviewer finally had to give in. My K.O. punch was if 'F_BKPF_BUK' is to be declared as constant, then 'REUSE_ALV_GRID_DISPLAY' should as well
2014 Sep 04 7:16 AM
Hi Jelena,
Thanks for your reply.If I write the select statement in START-OF-SELECTION event it is working fine but when I write the same select statement in the AT SELECTION-SCREEN ON VALUE-REQUEST in order to provide f4 help for the selection field(KSCHL) it is not working fine.Anyway I convinced my lead that I use constants in my program but I want to know that before the use of start-of-selection the text-elements will work or not.
Regards,
Chakradhar.
2014 Sep 04 7:41 AM
Of course, who uses quotes nowadays.
AUTHORITY-CHECK OBJECT |F_BKPF_BUK|.
2014 Sep 03 5:38 PM
Hi Chakri,
Even my advise is also use constants instead of Text elements in where condition .
Thanks
Raju C D
2014 Sep 04 6:17 AM
Hi Chakri,
the advantage of text elements is, that they are translatable.
But for table access this is not useful. You don't want to access T685 table entries with KVEWE = 'A' if logon language is English and with KVEWE = 'B' if logon language is French.
Sorry, text elements for table access with key is no good idea.
Regards,
Klaus
2014 Sep 04 7:19 AM
Hi All,
Thanks for your replies.At last I convinced my lead that I go with constants not with the text elements.
BR,
Chakradhar.
2014 Sep 04 7:42 AM
To prevent further answers, repeating the same information, I'm locking the thread now.