2012 Dec 14 4:43 PM
Hi All,
I am facing a weird problem with method SET_LONG_TEXT of class CL_SALV_COLUMN.
For displaying header of my ALV report, I have used this method 22 times and it is working fine for 20 columns
but it is not setting the value properly for two columns in ES language.
For these two columns the ALV takes data elements translataion and displays in header.
In debugger, I checked the values being passed to this Method and found it be correct,
the one that I wanted to display.
At the same time it is working fine all 22 columns in EN language.
Some one tackled the similar siltuation, please reply.
Thanking You All.
2012 Dec 17 5:22 AM
http://www.benx.de/benx(bD1lbiZjPTAwMQ==)/de/index.do?onInputProcessing(brai_thread)&001_thread_id=1... &001_temp=R3TR|CLAS|CL_SALV_COLUMN|SET_LONG_TEXT|WD4
Thanks,
Nikita
2012 Dec 14 8:28 PM
are ;you sure you have the column fieldname exactly correct in what you are supplying to the method to get the column name? For example, look at demo program SALV_TEST_TABLE_COLUMNS.... where you will see:
try.
lr_column ?= lr_columns->get_column( 'HYPERLINK' ). <++++++ this text has to exactly match your fieldname in upper case. If not nothing will change.
lr_column->set_long_text( 'HYPERLINK' ).
catch cx_salv_not_found. "#EC NO_HANDLER
endtry.
If there is an error because you did not supply the exact fieldname in your column retrieval, the actual column title will remain unchanged.... and since you're probably using try....endtry. and not looking to see if an exception was caught...you might not see that your fieldname is not correct and that the long text therefore remained unchanged.
2012 Dec 17 4:45 AM
Hi David,
Thanks for the help, but I have already checked these things, there is no such problem.
I have checked the internal tables inside class as well but could not find any thinng suspicious.
Thanks for the help.
2012 Dec 17 4:58 AM
Ankit,
Are 21,22 column refering standard data element or custom data element?
Have you checked proper traslation maintained from EN to ES in the translation, check in data element menu path GO to -> translation original language EN Target Language ES.
Thanks/Gagan
2012 Dec 17 5:13 AM
Hi Gagan,
Yes Gagan, the variables are correctly set, I have checked the translatation in debugger as well.
I tried with set_short_text and SET_MEDIUM_TEXT , but nothing is working.
Thanks a lot.
2012 Dec 17 5:22 AM
http://www.benx.de/benx(bD1lbiZjPTAwMQ==)/de/index.do?onInputProcessing(brai_thread)&001_thread_id=1... &001_temp=R3TR|CLAS|CL_SALV_COLUMN|SET_LONG_TEXT|WD4
Thanks,
Nikita
2012 Dec 17 5:34 AM
Thanks Nikita,
But its more cumbersome for me.
Any other idea, that colud may my code work...???
Well, thanks for the help.
2012 Dec 17 6:07 AM
Hi All,
My problem got solved.
It was taking the text with max length, among Data Element’s Translation and Language translation, since the language translation was less in size so it was displaying Data Element’s Translation.
I solved this problem by providing blank space.
Well, still its a workaround.
Probably it needs to be fixed by SAP.
Thanking You All for helping.
2023 Jul 19 12:05 PM
this problem can be solved by using 'conv #' .
DATA: lo_column TYPE REF TO cl_salv_column.
eg . lo_column->set_long_text( conv # ( text-002 ) ).
2023 Jul 19 12:38 PM
dineshkumar1302 You can see that it's a 2012 question, 7.40 didn't exist at that time, and moreover it doesn't answer the question, SET_LONG_TEXT is not sufficient. Also don't post a comment if it corresponds to an answer. Avoid answering old questions, because usually (and unfortunately), the same question has been asked and answered many times, even recently.