Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

fetching two field having same name from SAP

I want to fetch customer from 2 table from SAP , one is sold to party , and another one is ship to party , both is identified by a field KUNNR and i am joining both tables. when load script then a error: Fields with same name .

How to rename it while fetching from SAP

6 Replies
guytzumer
Partner - Contributor III
Partner - Contributor III

hello

1. First of all, what tables are you referring to.. ?

2. If you'r working with SapConnector, try to read the tables with medium description.

3. Do Load on the Select and you will able to change a field names.

hope it helps..

Guy tzumer

Not applicable
Author

My Code is:

Load *;

sql select

VAPMA~KUNNR

VBPA~KUNNR

FROM VAPMA INNER JOIN ON (VAPMA~VBELN = VBPA~VBELN) ;

-----------------------------------------------------------------------------------------------------------------------------------

ERROR : KUNNR is already declared.

while I am fetching data from sap.

I require both KUNNR fields .

Not applicable
Author

Hi.

You can declare the different names after the Load statement:

Load

VAPMA~KUNNR as SoldToCustomerNo,

VBPA~KUNNR as ShipToCustomerNo;

SQL SELECT ... ;

Just remember that later you'll have to connect the lookup tables (Customer addresses, names etc.) according to the same names.

BTW: I'm not familiar with SAP DB so maybe the VAPMA is the ship to and not the sold to... Don't know.

Regards,

Montal.

Not applicable
Author

Same error after applying your as with load statement

suniljain
Master
Master

you can link VBAK-VBELN and VBPA-VBELN . this will gives you all partner function details related to sales order.

googel84
Partner - Creator III
Partner - Creator III

Hi rajnigupta, since you are performing an inner join on VAPMA-KUNNR = VBPA-KUNNR, these two fields (both named KUNNR in your query) will have the same content. So my suggestion is to use just one of them.

SQL SELECT
VAPMA-KUNNR
FROM VAPMA INNER JOIN VBPA ON VAPMA-KUNNR = VBPA-KUNNR

Note that I worked on the SQL statement and not on the LOAD statement (which, I think, you can discard) as suggested by Montal