cancel
Showing results for 
Search instead for 
Did you mean: 

need to pull vendor address information from PO

Former Member
0 Kudos

Hi Friends..

I am creating a shipper instructions smartform and need to display shippers address in the form.. For that purpose i need to pull the vendor address information from the PO...

Can some one tell me the data extraction logic involved here like what tables i need to access to get the required vendor address and flow of it...

Here the client is creating the PO and also sending the shippers instruction form when PO is created as far as i my understanding...

Thanks,

Kanthi..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kanthi

You can take 'LIFNR' field (vendor A/c number) from table EKKO (Purchasing Document Header table). I mean you can select LIFNR field using select statement.

after selecting LIFNR field, you can pick the address details of vendor from LFA1 table using select statement

Select ...... from LFA1 into .........

where LIFNR = <your selected LIFNR>.

So, briefly: LIFNR is a foreign key field in EKKO for vendor and LFA1 is the check table for it.

So, see table EKKO to have a closer look.

Regards

Ashish

Former Member
0 Kudos

Thanks for the reply..

So when a purchase order is created.. what field value can we expect in the form subroutine of the print program.. ( Do i get any shipper instruction number or any other field..)

based on that field value only i should proceed further right to pull the vendor address details...

Tell me if iam in the right path...

Thanks,

Kanthi..

Former Member
0 Kudos

Hi Kanthi,

Print program will get PO number which populated as Object Key of the NAST structure. Using PO number you can get Vendor Number from EKKO and then vendor details from LFA1.

Regards,

Arun.

Former Member
0 Kudos

Hi Kanthi,

Based on the PO number you can select LIFNR from EKKO. Then using this LIFNR get ADRNR(address number) of this vendor from LFA1(table). Then create an address node in your Smart From and pass the above obtained ADRNR to this address node. This node will automatically print the entire addres of the vendor.

Thanks and Regards,

Bharat Kumar Reddy.V

Former Member
0 Kudos

THanks for all your valuable replies..

making a good progress on my form development.. In the same form i have another requirement to populate the shipper number which is a sequential number starting from 0001 to 9999 range. Each time the program is ran to create a new output document, a the next number in the range should be assigned to shipper number..

Any comments on how to accomplish this would be great..

Right rewards for great responses..

Thanks,

Kanthi.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kanthi

Whether you are interested in creating your own number range??

If yes, you can do it using transaction SNRO.

I will try to give more details soon.

Regards

Ashish

Former Member
0 Kudos

Hi

When a PO is created, at that time you need to enter vendor number (LIFNR).

The details of different vendors are maintained in table LFA1.

The tables for PO are EKKO (header table) and EKPO (line item table).

But, if you want to capture the vendor address for printing, you only need to know the PO number (EBELN field). And, then you can proceed like:

Select LIFNR from EKKO into <yourDefinedVAR> where EBELN = XYZ.

Select <requiredAddressFields> from LFA1 into (....) where LIFNR = <yourDefinedVAR>.

So, finally, if you know the PO number, you can find rest of the things.

Regards

Ashish

Former Member
0 Kudos

PO number = Object Key of the NAST structure. pass this PO number to EKKO to get the Vendor Number and then address from from LFA1....