on 04-01-2009 11:44 AM
Hi Experts,
Please tell me how to print the customer complete address in the invoice output.(please explain in detail). we have to display address in Payment information window.
SAP standard form: LB_BIL_INVOICE
Driver program: RLB_INVOICE
select all data from VBPA by passing vbeln = vbrp-vbeln.
1) for bill to party
READ TABLE IT_VBPA INTO WA_VBPA WITH KEY parvw = 'RG' .
SELECT SINGLE ADRNR FROM KNA1
INTO ADDRNUM
WHERE KUNNR EQ WA_VBPA1-KUNNR.
SELECT * FROM ADRC INTO TABLE IT_ADRC
WHERE ADDRNUMBER = ADDRNUM.
READ TABLE IT_ADRC INTO WA_ADRC INDEX 1.
2) for shift to party justchange PARVW = 'WE'.
OR ELSE
create one address node in payment info. window. and pass ADRNR .
like in my ex. &ADDRNUM&
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
CLEAR GS_HD_ADR.
get customer adress number
READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
PARTN_ROLE = 'WE'.
ADRNR = GS_HD_ADR-ADDR_NO.
THEN
DATA : IT_ADRC TYPE ADRC OCCURS 0 WITH HEADER LINE.
WA_ADRC LIKE ADRC.
SELECT * FROM ADRC INTO TABLE IT_ADRC
WHERE ADDRNUMBER = GS_HD_ADR-ADDR_NO.
READ TABLE IT_ADRC INTO WA_ADRC INDEX 1.
SAME CODE IS APPLICABLE FOR BILL TO PARTY WITH PARVW = 'RE'.
hi,
what u r printing in ur smartform.
after my code. nw data is in WA_ADRC.
print Bill To:
&wa_adrc-name1&
&wa_adrc-street&
&wa_adrc-location&
likethat whatever u want to print write here.
if then also not working then
do one thing.
u r running ur program in vf02 na...
if s. then take that billing no.
goto se16---vbpa and enter billing no
then check entries for 'WE' and 'RE' . THEREU WILL GET kunnr
then goto ADRC
enterthat kunnr and check whether ADRNR is there or not.
if it is their then just debug ur program .
hi,
as i explaned above too
create an address node in the payment window and pass the required address no to it
in initialization tab u need to do the coding
i.e for fetching address you need to fire select query on adrc table
SELECT
addrnumber
(rest of the data you need)
FROM adrc
INTO TABLE it_adrc
FOR ALL ENTRIES IN it_adrnr
WHERE addrnumber = it_adrnr-adrnr.
you need to fill it_adrnr internal table with correct value of adrnr
now in your in the payment info window
create->flow logic->program lines
add the code below:
READ TABLE it_adrc INTO wa_adrc WITH KEY
addrnumber = l_wa_adr
BINARY SEARCH.
to get l_wa_adr
the address van be ship to window address,bill to party or organization address
eg for ship to party address
READ TABLE fp_is_bil_invoice-hd_adr INTO l_wa_adr WITH KEY
bil_number = fp_is_bil_invoice-hd_gen-bil_number
partn_role = 'SH' or "RE'
append l_wa_adr TO it_adrnr
for bill to party address
READ TABLE fp_is_bil_invoice-hd_adr INTO l_wa_adr WITH KEY
bil_number = fp_is_bil_invoice-hd_gen-bil_number
partn_role = 'BP'
append l_wa_adr TO it_adrnr
for sales organization address no
CLEAR l_wa_adrnr.
IF NOT is_bil_invoice-hd_org-salesorg_adr IS INITIAL.
l_wa_adrnr = is_bil_invoice-hd_org-salesorg_adr.
APPEND l_wa_adrnr TO it_adrnr.
ENDIF.
finally in the address node created in your w window
in general attributes, give address no &WA_ADRC-ADDRNUMBER&
HI,
In the address window write this code.
CLEAR GS_HD_ADR.
get customer adress number
READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
PARTN_ROLE = 'WE'.
ADRNR = GS_HD_ADR-ADDR_NO.
THEN
Define this in ur global field.
DATA : IT_ADRC TYPE STANDARD TABLE OF ADRC.
WA_ADRC TYPE ADRC.
THEN AGAIN IN UR CODE
SELECT * FROM ADRC INTO TABLE IT_ADRC
WHERE ADDRNUMBER = GS_HD_ADR-ADDR_NO.
READ TABLE IT_ADRC INTO WA_ADRC INDEX 1.
SAME CODE IS APPLICABLE FOR BILL TO PARTY WITH PARVW = 'RE'.
THEN CREATE A TEXT NODE
AND WRITE
&WA_ADRC-NAME1&
&WA_ADRC-STREE&
.
.
.
.
LIKE THIS ADD ADDRESS FILEDS WHICHEVER U WANT.
Hi,
In the information(General Data) window, I have created one template.In that template, i created flowlogic. In the flow logic i wrote the following code. I have to print for ship to party(not in address window).
CLEAR GS_HD_ADR.
get customer adress number
READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
PARVW = 'RE'.
ADRNR = GS_HD_ADR-ADDR_NO.
DATA : IT_ADRC TYPE STANDARD TABLE OF ADRC.
WA_ADRC TYPE ADRC.
SELECT * FROM ADRC INTO TABLE IT_ADRC
WHERE ADDRNUMBER = GS_HD_ADR-ADDR_NO.
Read table IT_ADRC INTO WA_ADRC INDEX 1.
When I am checking above code , Iam getting message Field GS_HD_ADR is unknown.
After that i created one text node and inserted fields
&WA_ADRC-NAME1&
&WA_ADRC-STREEt1&
please solve the problem.
i thin u r completely new in abap.
just define GS_HD_ADR in above inout parameters and check it
then
in addtion to that
write all the fields whatever u want
goto se11
adrc
then check the fields. there are city, street1,
location,pincode .
write all fields whatever u want ?
or u can also do that like
right click and create address node
then pass &wa_adrc-ADDRNUMBER&
first check in debugging whether data is coming in wa_adrc or not?
CLEAR GS_HD_ADR.
get customer adress number
READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
parvw = 'RE'.
ADRNR = GS_HD_ADR-ADDR_NO.
DATA : IT_ADRC TYPE STANDARD TABLE OF ADRC.
WA_ADRC TYPE ADRC.
SELECT * FROM ADRC INTO TABLE IT_ADRC
WHERE ADdrnumber = GS_HD_ADR-ADDR_NO.
read table IT_ADRC INTO WA_ADRC INDEX 1.
Iam getting the message like no component exists with the name PARVW.
hi,
if u r getting values in wa_adrc , then which r that values.
can u sen details...
like
wa_adrc-ADDRNUMBER
if u r getting this then goto se16 give table name ADRC and check whether address is maintained for that number or not.
check in which fields address is maintaind and print that fields like
wa_adrc-fieldname
Hi,
I checked in SE16 and tried to print the fields which have values. but Iam not getting the data in output.
While activating the form, Iam getting the error message wa_adrc-name1 has no defined value. Tell me whether I have to maintain any declarations in form interface of Global definitions and also anything need to change in the Print program.
it_adrc type standard table of adrc
wa_adrc type adrc. when I defined this values in from interface, iam getting short tump. I declared this declarations in Global definitions. But in payment window, first i created the flow logic and then i created text node. whatever the fields iam defining in text node, Iam getting the message as &wa_adc-name1& has no defined value.
In debugging check whether wa_adrc-street , wa_adrc-name has value or not.
if there is a avalue for wa_adrc-name1 then just check where u r printing it. before ur logic or after ?
u have to print it after ur logic written.
if there is value in wa_adrc-name1 then there is no chance to give blank value.
check whether windows are overlapping or u r printin it correctly like &wa_adrc-name1& .
no chance to give error.
Hi Monika!
Sorry to bother you.
Actually even iam facing the same problem, i.e. i have declared a variable in global declarations and have written logic to store some value in it, which i have already confirmed by debugging that the variable is getting the value but in the output iam getting zero,but during check it throws warning msg that this field has no defined value, i couldn't uderstand wot to modify,
Can u help me in this regard.
Thanks and Regards,
Parwez
HI,
As you are using standard driver program u acn code it as follows -
select address no.(kna1-adrnr) from kna1 where customer no = GS_HD_GEN-kunag. (kunag = sold to party ) . if you want other one (like ship to party or bill to party ) use appropriate field from GS_HD_GEN.
now select required fields from ADRC table by passing this address no. as input.
OR
just right click on the node where u want to print address -> create address -> pass this address no.
all the filled fields from adrc table will display directly in ur window.
Edited by: Vishal Chavan on Apr 3, 2009 11:27 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
create an address node in the payment window and pass the required address no to it
i.e for fetching address you need to fire select query on adrc table
SELECT
addrnumber
(rest of the data you need)
FROM adrc
INTO TABLE it_adrc
FOR ALL ENTRIES IN it_adrnr
WHERE addrnumber = it_adrnr-adrnr.
now you need to fill it_adrnr internal table with correct value of adrnr
now in your in the payment window
READ TABLE it_adrc INTO wa_adrc WITH KEY
addrnumber = l_wa_adr
BINARY SEARCH.
to get l_wa_adr
eg for ship to party address
READ TABLE fp_is_bil_invoice-hd_adr INTO l_wa_adr WITH KEY
bil_number = fp_is_bil_invoice-hd_gen-bil_number
partn_role = 'SH'
append l_wa_adr TO it_adrnr
for bill to party address
READ TABLE fp_is_bil_invoice-hd_adr INTO l_wa_adr WITH KEY
bil_number = fp_is_bil_invoice-hd_gen-bil_number
partn_role = 'BP'
append l_wa_adr TO it_adrnr
for sales organization address no
CLEAR l_wa_adrnr.
IF NOT is_bil_invoice-hd_org-salesorg_adr IS INITIAL.
l_wa_adrnr = is_bil_invoice-hd_org-salesorg_adr.
APPEND l_wa_adrnr TO it_adrnr.
ENDIF.
finally in the address node created in youw window
in general attributes, give address no &WA_ADRC-ADDRNUMBER&
hope this helps you
Thanks
Richa
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sekhar ,
First take a copy of the layout, in that do the necessary modifications
1)create one more template in the payment information window, and add an address
in that template,
2) to get the address number copy the same program line that is there in the
address window.
creating the template to fit the window is a bit tedious job
after creation of the form, ask you functional consultant to configure the form
Regards,
Jaya rama kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.