Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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 .
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.
Same error after applying your as with load statement
you can link VBAK-VBELN and VBPA-VBELN . this will gives you all partner function details related to sales order.
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