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

RFC_READ_TABLE with Excel VB

Former Member
0 Likes
4,061

I want to pass the value to field BEDNR . but I do not have exact value, so I want to pass like *TEST* . means I want to add "*" front and back. when I enter code shown in screen shot, RFC gives no result. How to use '*' to get the related entries from SAP.
1 ACCEPTED SOLUTION
Read only

Stefan-Schnell
Active Contributor
0 Likes
3,706

Hello Duraisamy,

as far as I can see is your SQL statement correct.

I check it with this statement on the table SFLIGHT:

CARRID = 'AA' AND (PLANETYPE LIKE '%-%' AND PLANETYPE NOT LIKE '%300%')

Plantypes are 747-400 and A310-300. With this statement I expect only the flights with 747-400 planetype, and that is what I get.

Cheers
Stefan

8 REPLIES 8
Read only

Stefan-Schnell
Active Contributor
3,706

Hello Duraisamey,

try

oRow.Value(1) = "WERKS = '5000' AND BEDNR LIKE '%TEST%'"

Let us know your result.

Cheers
Stefan

Read only

0 Likes
3,706

Hello Stefan....

Thank you so mush for your reply.. Its working correctly.

If you do not mind , I have one more questions.

If I want to exclude some Item , how should I write ? . I want to include Which has TA17 and Want to exclude which has BADTA17

Read only

Stefan-Schnell
Active Contributor
0 Likes
3,707

Hello Duraisamy,

as far as I can see is your SQL statement correct.

I check it with this statement on the table SFLIGHT:

CARRID = 'AA' AND (PLANETYPE LIKE '%-%' AND PLANETYPE NOT LIKE '%300%')

Plantypes are 747-400 and A310-300. With this statement I expect only the flights with 747-400 planetype, and that is what I get.

Cheers
Stefan

Read only

Former Member
0 Likes
3,706

Hi Stefan,

Thanks for your reply.. Sorry its not working. I am using Visual basic (VB) to download data from SAP table. First statement is working correctly. second is not working.

Read only

3,706

Hello Duraisamy,

sure it is not working because the length of your line is to long.

This line is okay, because it is < 72 characters:

WERKS = '5000' AND LOEKZ <> 'X' AND BEDNR LIKE '%TA17%'

But this line is not okay, it is > 72 characters:

WERKS = '5000' AND LOEKZ <> 'X' AND (BEDNR LIKE '%TA17%' AND BEDNR NOT LIKE '%TG%')

OPTIONS is from type SO_TEXT072 (CHAR with a length of 72).

Add a new line.

Cheers
Stefan

Read only

Former Member
0 Likes
3,706

Hello Stefan, I am getting syntax error. when split it to two lines

Read only

3,706

Hello Duraisamy,

try

Set oRow = oTOPT.Rows.Add
oRow.Value(1) = "WERKS = '5000' AND LOEKZ <> 'X' AND "
Set oRow = oTOPT.Rows.Add
oRow.Value(1) = "(BEDNR LIKE '%TA17%' AND BEDNR NOT LIKE '%TG%')"

Cheers
Stefan

Read only

Former Member
0 Likes
3,706

hello Stefan.. Thank you so much.. Its working Correctly.