2008 Oct 23 2:35 PM
Hi experts!
When I create a material with MM01 Transaction If I write in material description (short text) "camión" or "CAMIÓN" I have different records in MAKT-MAKTG sap table and then I have a problem for to do a SELECT. The question is a combination of capital letters with mark accent.
System saves diferents records. It's curious. I think that it's a problem function module "AIPC_CONVERT_TO_UPPERCASE"
Example:
MM01 Transaction | Field MAKT-MAKTG (system save automatically)
-
-
"camión" | "CAMION" (without accent mark!!!)
"CAMIÓN" | "CAMIÓN" (respect accent mark)
OK, my problem is now I want to do a select:
SELECT * INTO CORRESPONDING FIELDS OF TABLE smara
FROM makt
WHERE makt-maktg LIKE ¿¿¿"camión" OR "CAMIÓN" ????
I need two records. How I can do this?
In spanish language we have "á" "à" "é" "è" "í" "ó" "ú" and it's not a good solution TRANSLATE "camión" for "c_m__n". I tried it.
A lot of thanks in advance.
Hi experts!
When I create a material with MM01 Transaction If I write in material description (short text) "camión" or "CAMIÓN" I have different records in MAKT-MAKTG sap table and then I have a problem for to do a SELECT. The question is a combination of capital letters with mark accent.
System saves diferents records. It's curious. I think that it's a problem function module "AIPC_CONVERT_TO_UPPERCASE"
Example:
MM01 Transaction | Field MAKT-MAKTG (system save automatically)
-
-
"camión" | "CAMION" (without accent mark!!!)
"CAMIÓN" | "CAMIÓN" (respect accent mark)
OK, my problem is now I want to do a select:
SELECT * INTO CORRESPONDING FIELDS OF TABLE smara
FROM makt
WHERE makt-maktg LIKE ¿¿¿"camión" OR "CAMIÓN" ????
I need two records. How I can do this?
In spanish language we have "á" "à" "é" "è" "í" "ó" "ú" and it's not a good solution TRANSLATE "camión" for "c_m__n". I tried it.
A lot of thanks in advance.
2008 Oct 23 2:40 PM
you can select all the entries from makt in a internal table and loop through that with the function regex to check whether special chararcters are used. or otherwise find is also possibilty
kind regards
arthur de smidt
2008 Oct 23 3:15 PM
Thank your for you rquick answer arthur but, what word put in select sentence??
because makt have different records (with and without accent mark) and if user wants to find a material and I store material in a variable and then I want to do a select.
Example:
User writes in my search dynpro:
Material: camión
And I want show two records:
ID | name
-
-
1 | camión
2 | CAMION
Edited by: djlu on Oct 23, 2008 4:15 PM
2008 Oct 27 8:07 AM
sorry I thought you wanted to make a query so you could select all the records with special characters with the intention to change them all to no special character names. as said you have a problem in searching when a user doesn't know the special character. I don't believe there is a nice sollution to this besides to as you do right now create 2 records..
but what's the point from a user perspective to see both descriptions ??
kind regards
arthur
2008 Oct 27 8:31 AM
Because sometimes user saved word with or without accent mark in material description and then If user wants to find don't remember what did he do. I think that SAP have a big problem with this and with AIPC_CONVERT_TO_UPPERCASE function module because this function module convert word to uppercase but delete accent mark. But now I have a table with different records and I need to find everything.
A lot of thanks in advance.
Regards.
2008 Oct 27 9:00 AM
hi
I checked the FM AIPC_CONVERT_TO_UPPERCASE in single run with the same sample set given by you and it is working fine. That is
"camión" comes as "CAMIÓN".
So i don't think there is problem in FM.
2008 Oct 27 9:06 AM
Rajeev I believe that is not his problem, the problem is that the user can also enter camion on his search and will not find camión
perhaps an option is to replace all possible occurenences of special characters with a wild card
so search for cami+n instead. so you can instruct you're users not to use special characters in search and or instruct them that if they know a special character is in place that they use + or you can replace the o and e and a and or other letters always by +
you can do a find and replace before you pass on the search values.
and the field maktg has always got the uppercase value (at least in my system) so why convert ?
And on the other hand when I read you're start post again it is fine what SAP is doing. it creates 2 records
1 with special characters and 1 without in the maktg. so that it doesn't matter if the user searches with or without special characters. it will find the material record anyway !! when you want to print or use the material then the user can see perhaps the special character from the material but he doesn't need to get confused about the existence of 2 material records with different names while it is actuallu 1 material
kind regards
arthur
Edited by: A. de Smidt on Oct 27, 2008 10:07 AM
Edited by: A. de Smidt on Oct 27, 2008 10:17 AM
Edited by: A. de Smidt on Oct 27, 2008 10:20 AM
2008 Oct 27 10:05 AM
Hi Rajeev Kumar,
First of all thank you for your answer.
I checked the FM AIPC_CONVERT_TO_UPPERCASE in single run a lot of times and it is not working fine.
That is "camión" comes as "CAMION" .
But "CAMIÓN" comes as "CAMIÓN".
But anyway please, do this example:
go to MM01 transaction and creates a material (for example TRUCK0001)
and in short description write "camión" and save material.
go to SE11 transaction and go to MAKT table and view record (Filter MATNR: "TRUCK0001"). I see this:
MANDT: 100
MATNR: TRUCK0001
SPRAS: S
MAKTX: "camión" --> respect . ok
MAKTG: "CAMION" --> convert to uppercase and ELIMINATES accent mark
go to MM01 transaction and creates a material (for example TRUCK0002)
and in short description write "BIG CAMIÓN" and save material.
go to SE11 transaction and go to MAKT table and view record (Filter MATNR: "TRUCK0002"). I see this:
MANDT: 100
MATNR: TRUCK0002
SPRAS: S
MAKTX: "BIG CAMIÓN" --> respect. ok
MAKTG: "BIG CAMIÓN" --> respect!!
2 different criterias, same word! and 2 records saved.
Ok now I want to so a select in MAKT for finding a material .
Ok this is my custom code:
CALL FUNCTION 'AIPC_CONVERT_TO_UPPERCASE'
EXPORTING
I_INPUT = description
I_LANGU = SY-LANGU
IMPORTING
E_OUTPUT = up_description
.
CONCATENATE '%' up_description '%' INTO up_description.
SELECT * INTO CORRESPONDING FIELDS OF TABLE zmakt
FROM makt
WHERE maktg LIKE up_description.
And zmakt have ONLY one record! Obviusly TRUCK0001. But no TRUCK0002 and I need it. "Select" find exact word.
Lot of thanks in advance.
2008 Oct 27 10:35 AM
hi djlu,
i don't know what is the problem in your server as that FM is working fine.
Secondly i m showing u the output of MAKT table which is also fine:
MANDT MATNR SPRAS MAKTX MAKTG
800 000000000000001618 E camión CAMIÓN
I have tried this in SPRAS = E.
2008 Oct 27 10:44 AM
Hi Djlu,
Following the Rajeev Answer, I think you can look for the relevant OSS Note also......
2008 Oct 27 10:48 AM
Ok, I find it, the problem is SPRAS.
Try this:
SE37 transaction
AIPC_CONVERT_TO_UPPERCASE
RUN
I_INPUT -> "camión"
I_LANGU -> "ES"
Look at E_OUTPUT.
2008 Oct 27 11:13 AM
hi djlu
in this case also, our system is working fine
Here i have provided "camión" this as input.
after F8 it also changes to "CAMIÓN", .. so no need to confuse regarding input.
Import parameters Value
I_INPUT "CAMIÓN"
I_LANGU ES
Export parameters Value
E_OUTPUT "CAMIÓN"
I think some patch is needed there. try for some OSS notes
2008 Oct 27 11:33 AM
Ok. We know problem but not solution.
Maybe OSS note can fix this for new records in future.
But now I have more than 400 records with and without accent mark in my MAKT table and I need a "SELECT" sentence for find it.
Regards.
2008 Oct 27 12:09 PM
You may use replace all occurance of 'accent' by %. and store it in a variable lets say v_maktx
and then in the where condition for select provide maktx like v_maktx.
2008 Oct 27 12:10 PM
You may use replace all occurance of 'accent' by %. and store it in a variable lets say v_maktx
and then in the where condition for select provide maktx like v_maktx.
2008 Oct 27 2:38 PM
Yes Rajeev, I said this in my first post. But It's not a good solution replacing % for each character, many results.
regards
2009 Jan 14 3:07 PM
To replace accent characters by non-accent characters :
Check function SCP_REPLACE_STRANGE_CHARS with INTEXT as input text ( no type )
Result is the input text without any accent !
A great solution by Eurotechnos.
Edited by: Xavier Jardin on Jan 14, 2009 4:30 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |