Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

string functions in function module

sanjeev_mishra_15aug
Active Participant
0 Likes
4,057

Hi guys,

I am directly coming to the point that I am facing....

In fact I created a table in ddic where one field having its own domain I selected the lower case option too...

means now the input in that table in case sensitive. If the entry in that table is like 'Mumbai' then it will generate error if we send import parameter as 'MUMBAI'.

Now coming to the point:

I created a Function module too where the select statement was written based on that particular field (case sensitive).

Now whenever I run the F.M. the input value i.e. 'Mumbai' is automatically converted into uppercase string like 'MUMBAI' resulting no output.

Please help to overcome this situation.

Which string function I should use to prevent the F.M. from converting the import parameter into uppercase string.

Thanks in advance.

14 REPLIES 14
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
3,232

Hello Sanjeev,

Translate the import parameter in FM to lower case .

translate lv_var to lowercase.

Thanks

Read only

0 Likes
3,232

hello friend....

if i translate the lv_var into lower then the input parameter like 'Mumbai' will be converted into 'mumbai'. so again no output will be shown.

By the way thanks for your reply.

Please suggest an effective way to overcome it.

Read only

0 Likes
3,232

Hi Sanjeev,

Can you paste your code here.

Thanks

Read only

Arun_Prabhu_K
Active Contributor
0 Likes
3,232

Hello Sanjeev.

     Have you created that import parameter with reference to that table-field?

Regards.

Read only

0 Likes
3,232

Yeah Arun,

I have created the import parameter of type of that table field.

Read only

0 Likes
3,232

How are you getting that input from user? PARAMETERS?

Read only

VenkatRamesh_V
Active Contributor
0 Likes
3,232

Hi Sanjeev,

Hope it help full.

data: lv_value TYPE string,
       lv_temp TYPE string,
       lv_cnt  TYPE i,
       lv_diff TYPE  i.
PARAMETERS: so_get(10) TYPE c DEFAULT 'Mumbai'.


START-OF-SELECTION.

lv_cnt = strlen( so_get ).

lv_diff = lv_cnt - 1.


lv_value  = so_get+0(1).
lv_temp   = so_get+1(lv_diff).

TRANSLATE lv_temp to LOWER CASE.

CONCATENATE lv_value lv_temp INTO lv_value.

WRITE: lv_value.


Regards,

Venkat.

Read only

0 Likes
3,232

Did you try

parameter so_get(10) type c LOWER CASE.

Read only

0 Likes
3,232

Sir,

Thank you.

Regards,

Venkat. 

Read only

former_member1716
Active Contributor
0 Likes
3,232

Hi Sanjeev,

What data element are you using for the import parameter that holds the country name.

Regards,

Satish

Read only

former_member1716
Active Contributor
0 Likes
3,232

Hi Sanjeev,

If you are running your FM in se37 then there will be check box at top of the FM as Uppercase/Lowercase as marked below in red, you have check the box and input values and then run the FM.

However if you are using it in the program it should work normally, it will just take the input as it is. This kind of scenario is very common in FMs dealing with user name abd password. Get back if you have further issues.

regards,

Satish

Read only

former_member1716
Active Contributor
0 Likes
3,232

Also check whether the data element that you are using for the field has a domain in which the lowercase checkbox is checked as shown below for another domain in Red.

If Not then i would request you to use another suitable domain or create a Custom domain and data element.

Hope you are clear with the steps to be taken. Please get back for further queries.

Regards,

Satish

Read only

0 Likes
3,232

Thank you Satish,

In fact in the domain the lower case is checked...

Because of this only the input is being taken as case sensitive....

Read only

0 Likes
3,232

Then if you are using it in program it should not affect, please check from your end. It should work fine, if you are executing from SE37 tcode please follow above procedure i suggested.

Did you try executing in SE37, what is the output there? is that fine?

regards,

Satish