‎2008 Jul 10 5:23 AM
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
‎2008 Jul 10 5:26 AM
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.
‎2008 Jul 10 6:07 AM
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
‎2008 Jul 10 6:08 AM
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
‎2008 Jul 10 6:34 AM
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.
‎2008 Jul 10 6:44 AM
‎2008 Jul 10 6:51 AM
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.
‎2008 Jul 10 7:05 AM
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.
‎2008 Jul 10 7:27 AM
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.