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 comparison in select clause and RFC import parameter

Former Member
0 Likes
568

Hello All,

I am developing one RFC which will retrieve some data from SAP HR module depending on First name. I have declared VALUE as a import parameter.

when i write below query is works properly.

SELECT pernr cname gbdat FROM PA0002 INTO CORRESPONDING FIELDS OF TABLE wa_PA0002

WHERE VORNA LIKE 'Prashant'.

My requirement is to accept the name from user.

But when I write query like this

SELECT pernr cname gbdat FROM PA0002 INTO CORRESPONDING FIELDS OF TABLE wa_PA0002

WHERE VORNA LIKE VALUE.

It does not work.

Please help me if anybody have any clue about the same. I have also tried with u2018=u2019 sigh, but no success.

Thanks in advance,

Prashant

1 ACCEPTED SOLUTION
Read only

former_member217544
Active Contributor
0 Likes
522

Hi Prashant,

We too faced similar type of issues while we are developing RFCs.

When you are executing the RFC standalone ( without calling from portal), then all the inputs that are given to the Function Module will be changed to UPPER CASE( standard working procedure of FM)

Here in the value paramter if the input value is "Prashant",

it will change to "PRASHANT" and will search for records with that particlar format, but not the records with "Prashant"

Note: But generally in tables there is some another field which stores the name in UPPER CASE whatever the format user enters

Example:

If user is saving the record with name Prashant, then

VORNA contains the value "Prashant"

and another field wil be there in the same table which stores the vlaue as "PRASHANT".

So if you get teh field, then change the select query as follows :

SELECT pernr cname gbdat FROM PA0002 INTO CORRESPONDING FIELDS OF TABLE wa_PA0002

WHERE < use the field which stores the name in UPPER CASE> LIKE VALUE.

Try checking with this field (VNAMC in PA0002 table). Iam not sure but i think it will save the first name in UPPSER CASE and try to use this filed name in the where clause.

Hope this will help.

Regards,

Swarna Munukoti

Edited by: Swarna Munukoti on Aug 12, 2008 8:07 AM

Hello All,

I am developing one RFC which will retrieve some data from SAP HR module depending on First name. I have declared VALUE as a import parameter.

when i write below query is works properly.

SELECT pernr cname gbdat FROM PA0002 INTO CORRESPONDING FIELDS OF TABLE wa_PA0002

WHERE VORNA LIKE 'Prashant'.

My requirement is to accept the name from user.

But when I write query like this

SELECT pernr cname gbdat FROM PA0002 INTO CORRESPONDING FIELDS OF TABLE wa_PA0002

WHERE VORNA LIKE VALUE.

It does not work.

Please help me if anybody have any clue about the same. I have also tried with u2018=u2019 sigh, but no success.

Thanks in advance,

Prashant

3 REPLIES 3
Read only

Former Member
0 Likes
522

i think the value inside VALUE field may be in captial letter.

plz check it.

Regards

Anbu

Read only

former_member217544
Active Contributor
0 Likes
523

Hi Prashant,

We too faced similar type of issues while we are developing RFCs.

When you are executing the RFC standalone ( without calling from portal), then all the inputs that are given to the Function Module will be changed to UPPER CASE( standard working procedure of FM)

Here in the value paramter if the input value is "Prashant",

it will change to "PRASHANT" and will search for records with that particlar format, but not the records with "Prashant"

Note: But generally in tables there is some another field which stores the name in UPPER CASE whatever the format user enters

Example:

If user is saving the record with name Prashant, then

VORNA contains the value "Prashant"

and another field wil be there in the same table which stores the vlaue as "PRASHANT".

So if you get teh field, then change the select query as follows :

SELECT pernr cname gbdat FROM PA0002 INTO CORRESPONDING FIELDS OF TABLE wa_PA0002

WHERE < use the field which stores the name in UPPER CASE> LIKE VALUE.

Try checking with this field (VNAMC in PA0002 table). Iam not sure but i think it will save the first name in UPPSER CASE and try to use this filed name in the where clause.

Hope this will help.

Regards,

Swarna Munukoti

Edited by: Swarna Munukoti on Aug 12, 2008 8:07 AM

Read only

0 Likes
522

Thanks Swarna,

I have checked the condition with the VAMC.

Points are awarded.