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 find customer number (KNA1-KUNNR) from P.O. number (EKKO-EBELN)?

former_member195355
Participant
0 Kudos

Hi,

I reallly need to find a way of getting the customer number from the purchase order number.

Does anyone have any ideas of the table paths that I could use?

Lots of juicy points up for grabs if you do : )

1 ACCEPTED SOLUTION

venkata_ramisetti
Active Contributor
0 Kudos

Hi,

Please chekc in the table EKKO. Field KUNNR refers to customer Number.

Thanks,

Ramakrishna

10 REPLIES 10

venkata_ramisetti
Active Contributor
0 Kudos

Hi,

Please chekc in the table EKKO. Field KUNNR refers to customer Number.

Thanks,

Ramakrishna

0 Kudos

Dear All,

Thank you ever so much for your replies.

Unfortuately our system does not update KUNNR in EKKO-KUNNR (the field is left blank) - hence why I'm looking for another way of doing this.

Any other ideas?

0 Kudos

HI Robert,

Try in the table EKPO-KUNNR then. I still find it inters=resting to see that how could you be able to create a PO without a Customer!!!

Ravi

former_member181962
Active Contributor
0 Kudos

EKKO-KUNNR is the customer number for the PO number- EKKO-EBELN

Former Member
0 Kudos

Check the table EKKO, field KUNNR.

To EKKO table pass purchase doc no <b>EBELN</b> and <b>KUNNR</b> field gives you the custmer number.

former_member188685
Active Contributor
0 Kudos

Hi In EKKO u have already Kunnr .

or else u are looking for some thing else.

please let me know.

regards

vijay

Former Member
0 Kudos

Robert,

<b> tables: kna1.

data: vKunnr type kna1-kunnr.</b>

U can find the Customer for every EBELN in EKKO Table.

<b> SELECT kunnr into vKUnnr from EKKO where ebeln = pEbeln.</b>

If u need more information abt Customer, u can have the following query with selected KUNNR from EKKO.

<b> select single * from kna1 where kunnr = vkunnr. </b>

Thanks

Kam

Message was edited by: Kam

Former Member
0 Kudos

Robert,

Check all EK** tables in the SAP!!!

I really agree with RAVI on this!

Thanks

Kam

Former Member
0 Kudos

HI Robert,

I have seen the interesting discussion you had in the forum. Now try this:

When we talk of a Customer for a Purchase Document, it makes sense to talk about purchase requsitions. Here is the reason why:

Generally a PO is associated with a vendor, but a sales order is associated with a customer. Take the case of a third party order/sub contract. In this case, a Purchase Requsition is created(with reference to a Sales Order), which in turn is converted to a purchase order.

This is the link of tables you can have:

1. Get the Purchase Requsition Number for the PO number (Field BANFN) of table EBAN.

2. Get the Sales Order(VBELN) for the same Purchase Requsition Number from table VBEP.

3. Once you have the Sales Order Number, you can get the customer from VBPA table.

Hope This answers.

Cheers,

Naveen.

Former Member
0 Kudos

HI There,

I believe Robert is looking for a scenario where a Purchase order is created through a Purchase requsition, which is created through a sales order(Third Party Order/Sub Contracting).

Just refer to my earlier post for the same thread and think over it.

Naveen