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: 

Partner Function Address

Former Member
0 Kudos

Hi All,

The name and address that is to print on each label will be pulled from the partner function ZP.How to fetch based on partner function.

If possible sample query.

Thanks in advance.

Regards,

Sujatha

8 REPLIES 8

former_member156446
Active Contributor
0 Kudos

Hi check the table VBPA, PARVW is the partner funciton which will be ZP in ur case.. get the ADrNR from this table and hit ADRC table for address details..


select vbeln posnr adrnr 
       from vbpa 
     into table it_adrnr
     where parvw = 'ZP'.

select <adress1> <adress2>
      into...
     from adrc 
for all entries in it_adrnr
where adrnr in it_adrnr.

Former Member
0 Kudos

Hi sudha ,

partner function table is vbpa from here u fetch kunnr where parvw is ZP.

take that kunnr and goto kna1 table from kna1 pick adrnr . and then goto adrc table and pick name1 name2 whatever u want for the address where ADDRNUMBER = adrnr.

Reward if helpful.

Regards

AMit Pratap SIngh

Former Member
0 Kudos

Hi sudha,

the VBPA- table will have the partnerfunction(parvw) and adrnr field.

so you can get the value for adrnr where parvw = 'zp'.

depend on that get values from adrc which will hold the address details.

this will work fine.

reward me if it is useful

thanks

AM

Former Member
0 Kudos

get the details of the partner like partner number ie kunnr from vbpa. get the address number for that partner from kna1.

get the address details from adrc table.

try this

select vbeln posnr kunnr

into table it_vbpa

from vbpa

where PARVW eq 'ZP'.

if sy-subrc eq 0.

it_vbpatemp[] = it_vbpa[].

sort it_vbpatemp by kunnr.

delete adjacent duplicates from it_vbpatemp

comparing kunnr.

select kunnr adrc

from kna1

into table it_kna1

for all entries in it_vbpatemp

where kunnr eq it_vbpatemp-kunnr.

if sy-subrc eq 0.

it_kna1temp[] = it_kunnr[].

sort it_kna1temp by adrc.

delete adjacent duplicates from it_kna1temp

comparing adrc.

select <address details > from adrc

into table it_adrc

for all entries in it_kna1temp

where adrc eq it_kna1temp-adrc.

endif.

endif.

Former Member
0 Kudos

Hello

Try to use FM SD_PARTNER_READ

0 Kudos

Hi,

VBPA is the table having partner function and partner address stored in ADRC table. as you said partner function = ZP.

have a look.

select adrnr into table i_vbpa from vbpa

where parvw = 'ZP'.

if not i_vbpa[] is initial.

select addrnumber title name1 city into table i_adrc

from adrc for all entries in i_vbpa

where adrnr = i_vbpa-adrnr.

endif.

regards.

sriram.

0 Kudos

Hi Sriram,

I don't have address number and all to get from ADRC.

This is the selection screen:

Selection screen fields:

u2022 Sales Organization

u2022 Distribution Channel

u2022 Division

u2022 Sales Person (partner type ZE, Z1, Z2)

u2022 City

u2022 Region

u2022 Customer Group (Channel/Market)

u2022 Customer Group 2 (Sub Channel/Market)

The name and address that is to print on each label will be pulled from the partner function ZP.

This is the req.

Thank you

Sudha.

0 Kudos

Hi,

have a look in brief.

select-options: s_vkorg like vbak-vkorg,

s_vtweg like vbak-vtweg,

s_spart like vbak-spart.

data itab like vbak occurs 0 with header line.

data jtab like vbpa occurs 0 with header line.

data ktab like adrc occurs 0 with header line.

start-of-selection.

select vbeln from vbak

into table itab where vkorg in s_vkorg and vtweg in s_vtweg spart in s_spart

loop at itab.

select adrnr from vbpa

into table jtab where vbeln = itab-vbeln and parvw = 'ZE' AND PARVW = 'Z1' AND PARVW = 'Z2'.

append jtab.

endloop.

if not jtab[] is initial.

select addrnumber name1 city1 from adrs

into table ktab for all entries in jtab where addrnumber = jtab-adrnr.

endif.

LOOP AT KTAB.

WRITE:/ KTAB----

ENDLOOP.