cancel
Showing results for 
Search instead for 
Did you mean: 

Regd: Customer address printing in invoice from

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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&

Former Member
0 Kudos

Hi Monika,

Please make use of the same variable names and internal table names, and send the code .

Former Member
0 Kudos

Hi Monika,

Please send the code with the same variable names which are used in the standard form and send the code back.

Former Member
0 Kudos

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'.

Former Member
0 Kudos

Hi monika,

I used the code what u sent now. but the address is not displayed. No change in the output, even after the addition of the code.

Former Member
0 Kudos

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 .

Former Member
0 Kudos

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&

Former Member
0 Kudos

where r u using this code?

Former Member
0 Kudos

in the adress window.

Former Member
0 Kudos

do coding for selection from table adrc into it_adrc in initialization

in your address window read data from it_adrc for correct value of addrress no explained above

just create an address node in ur address window and pass the desired address no to it

&wa_adrc-addrnumber&

Thanks

Former Member
0 Kudos

do coding for selection from table adrc into it_adrc in initialization

in your address window read data from it_adrc for correct value of addrress no explained above

just create an address node in ur address window and pass the desired address no to it

&wa_adrc-addrnumber&

Thanks

Former Member
0 Kudos

HI,

U WRITE MY CODE IN ADDRESS WINDOW NA.

THEN DO THIS.

GIVE BREAK POINT.

AND check ADRNR is comming or not.

if it is coming then check is there is a value in wa_adrc ?

if s then instead ofaddress node

create a text node.

and print the fields as a shownalready.

Former Member
0 Kudos

Hi monika,

Regd. customer address printing in payment information window. please tell me the step by step procedure with standard variable names.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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?

Former Member
0 Kudos

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.

Former Member
0 Kudos

USE PARTN_ROLE INSTEAD OF PARVW

Former Member
0 Kudos

I am getting the output wa_adrc-addrnumbers has no defined value.

Former Member
0 Kudos

what u want to sya ?

output or warning msg?

just debug ur code.

put break-point just before ur code and checkit once .

is there any value in wa_adrc . if s then it is correct.

Former Member
0 Kudos

In debugging , I am getting values in wa_adrc . But in print preview, Values are not showing. and when activating iam getting error message as wa_adrc-addrnumber has no defined value.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

hi,

define this is global data

it_adrc type standard table of adrc

wa_adrc type adrc

Former Member
0 Kudos

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.

Former Member
0 Kudos

IS THIS ERROR MSE (RED COLOR ) OR WARNING MSG (YELLOW COLOR) ?

ABOUT SHORT DUMP.

R U DEFINED THAT IT_ADRC AND WA_ADRC IN INPUT PARAMETERS OR OUPUT PARAMETERS .

TRY TO SOLVE IT .

Former Member
0 Kudos

Now no short dump.But only the thing is data is not printing in the invoice form. Is there any changes to be done in the print program or any suggestion.

Former Member
0 Kudos

NOW CHECK,

which value u r printing .

for ex. if u r printing &wa_adrc-street&, &wa_adrc-name1&,&wa_adrc-postal_code&

goto se16 adrcenter thar address number and check whether data is maintain for the corresponding fields like name1, street,postal_code etc.

Former Member
0 Kudos

Already I checked in SE16 and i tried to print the fields which have values, but in the output data is not printing.its empty.for the address number.values are there for name1, street.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi mirza,

I am facing similar issue with SAP Script in check printing, If you resolved it, can you please guide me how to do it

Thanks,

Amar

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

.

Former Member
0 Kudos

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