Application Development 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: 

How to get the information corresponding to the words transfer from RFC

former_member209770
Participant
0 Kudos

Dear Gurus,

I have a problem... I have to select all the customer information corresponding to the data from external system user key in.

For example:

These information exist in SAP table KNA1 u2192Samsung TW、Samsung KR、Samsung CN、APPLE、IBM、GOOGLE

When user key in "Samsung" on Web, SAP will export "Samsung TW、Samsung KR、Samsung CN" through RFC, and show the three customer data on Web screen.

But I don't know what SELECT syntax I can use?

My code as below....



*"  IMPORTING
*"     VALUE(IN_CUSTOMERNO) TYPE  CHAR30

...

SELECT A~KUNNR A~LAND1 B~NAME1 B~CITY1 B~POST_CODE1 B~STREET B~HOUSE_NUM1
FROM KNA1 AS A
INNER JOIN ADRC AS B ON A~ADRNR = B~ADDRNUMBER
INTO CORRESPONDING FIELDS OF TABLE iPARTNER
WHERE B~NAME1 IN IN_CUSTOMERNO.

It will show the error msg like that "The IN operator with "IN_CUSTOMERNO" is followed neither by an internal table nor by a value list".

Is any suggestion?

Thanks in advance.

2 REPLIES 2

uwe_schieferstein
Active Contributor
0 Kudos

Hello Ya-Chung

If you want to select for multiple customer names then your IMPORTING parameter needs to be a range table, e.g.:


DATA: lt_rng_name1   TYPE RANGE OF name1_gp.  " data element of KNA1-NAME1
DATA: ls_rng               LIKE LINE OF lt_rng_name1.

"... Fill range itab, e.g.
ls_rng-sign    = 'I'.  " include
ls_rng-option = 'CS'.  " contains string
ls_rng-low    = 'SAMSUNG'.
APPEND ls_rng TO lt_rng_name1.

" Select all customers which contain string 'SAMSUNG' in their name.
SELECT A~KUNNR A~LAND1 B~NAME1 B~CITY1 B~POST_CODE1 B~STREET B~HOUSE_NUM1
FROM KNA1 AS A
INNER JOIN ADRC AS B ON A~ADRNR = B~ADDRNUMBER
INTO CORRESPONDING FIELDS OF TABLE iPARTNER
WHERE B~NAME1 IN lt_rng_name1.

You need to check out which option parameters (CS, CP, EQ, etc.) are accepted in the WHERE condition of the SELECT statement.

Regards

Uwe

0 Kudos

Dear Uwe,

But I won't know what data user will key in.

So I have to use an variant to get the data.

Does the data type "range of" be available for RFC-enabled function modules on IMPORT tab?

Thanks a lot.