cancel
Showing results for 
Search instead for 
Did you mean: 

Bill to party address printing in standard invoice smartform

Former Member
0 Kudos

Hi Experts,

I am trying to modify the standard invoice smartform as per client requirement.In the payment window, i deleted the fields which are not necessary and I have to print bIll to party address in payment information window. I wrote the code like this in program lines.

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

ADRNR = GS_HD_ADR-ADDR_NO.

DATA : IT_ADRC TYPE STANDARD TABLE OF ADRC with header line

,

WA_ADRC like line of it_ADRC.

*

SELECT * FROM ADRC INTO TABLE IT_ADRC

WHERE ADdrnumber = GS_HD_ADR-ADDR_NO.

read table IT_ADRC INTO WA_ADRC index 1.

Next I Created one text node and I inserted fields like

&wa_adrc-name1&

&wa_adrc-street&.

In SE16 , data is there for name1 and street fields of ADRC table. when I am trying to activate the form , iam getting warning message as field&wa_adrc-name1& has no defined value. In the output, data is not displayed for bill to party address. Please tell me the solution.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi sekhar,

i already told u that there is no any problem with code.

just check the width of bill to party window.

then try to print it in another window..and check what is happen?

or else.

just check one more time,

se16 vbpaenter vbeln ---u will get adrnr against RE .

take that adrnr aand goto adrc and check there name1 is there .

if it is coming in wa_adrc then just increase the size of window. and check it once

Former Member
0 Kudos

Hi Monika,

Problem Solved. Problem not with the windows overlapping. There is some change in coding and in declarations part. Thanks for your support.

Former Member
0 Kudos

ya..always welcome.

Former Member
0 Kudos

Hi Sekhar!

Sorry to bother you, actually iam also facing the same problem the value is not displaying, can you tell me wot is the change you made in the coding.

Regards,

Parwez

Former Member
0 Kudos

Hi Parwez,

Declare the types declaration in global definitions-->types tab and first check in debugging wheter you are getting values or not.

Former Member
0 Kudos

Hi Sekhar!

Could you please eloborate your statement, i mean at types tab wot exactly i have to do?

Actually i've already checked by debugging that the filed is getting the value , but don't know why at the output iam getting zero value.

I've gone thru sap site and got to know that the global definitions presume some defined value and would give warning message sying " field has no defined value" but exactly wot to be done to resolve i culdn't make it.

Thanks in advance......

Regards,

Parwez

Former Member
0 Kudos

Hi Parwez,

Sorry Iam very busy from morning.So,Iam unable to reply .You can ignore the warning messages.

In global definitions, types tab write the following code.

types:begin of ty_adrc,

addrnumber type AD_ADDRNUM,

name1 type AD_NAME1,

street type AD_STREET,

city1 type AD_CITY1,

city_code type AD_CITYNUM,

end of ty_adrc.

types:wa_adrc type table of ty_adrc.

In global data,

it_adrc type table of ty_adrc

wa_adrc type ty_adrc

In the program lines of 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 = 'RE'.

adrnr = gs_hd_adr-addr_no.

SELECT name1 street city1 city_code FROM adrc INTO corresponding fields of TABLE it_adrc

WHERE addrnumber = gs_hd_adr-addr_no.

loop at it_adrc into wa_adrc.

READ TABLE it_adrc INTO wa_adrc with key addrnumber = gs_hd_adr-addr_no.

endloop.

try with this code

Former Member
0 Kudos

HI Sekhar!

Thanks a lot for your kind concern.

Regards,

Parwez

Answers (7)

Answers (7)

Former Member
0 Kudos

hi ,

now try this code.

global definitions -

it_vbpa like vbpa.

it_adrc like adrc.

select single * from vbpa into it_vbpa where vbeln = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER

and parvw = 'RE'.

select single * from adrc into it_adrc where ADDRNUMBER = it_vbpa-adrnr.

in text node - write &it_adrc-name1& and so on.

first check table vbpa for entries with input vbeln = your invoice no . and parvw = 'RE'.

if entry exist in table vbpa then above code should work .

regards,

Former Member
0 Kudos

Hi Sekhar,

you can ignore this warning message & you can avoid this warning message by providing some default value to &wa_adrc-name1& .

Regards,

Sravanthi

Former Member
0 Kudos

Hi Sravanthi,

I am not bothered about the warning message. But in the print preview, bill to party address values are not displayed.

Former Member
0 Kudos

Hi,

What code u have written is correct.

Still u try following.

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

ADRNR = GS_HD_ADR-ADDR_NO.

declare adrnr like CADNR in global definitions.

data: it_adrc like adrc . ( no table as there is only one address for bill to party)

select single * from adrc into it_adrc where addrnumber = ADRNR.

Create one text node and I inserted fields like

write : &it_adrc-name1&

&it_adrc-street&

etc.....

regards

Former Member
0 Kudos

adrnr like cadnr is not accepting. its giving error message.

Former Member
0 Kudos

No.The problem is not solved. Still Iam getting the same message and the output is not displayed.

Former Member
0 Kudos

Hi,

It is better to use function module 'ADDR_GET' by providing Address number as input and use that output as address.

Example :

CALL FUNCTION 'ADDR_GET'

EXPORTING

address_selection = sel---->Provide Address number

IMPORTING

sadr = sadr---->Output will be in this structure.

EXCEPTIONS

parameter_error = 1

address_not_exist = 2

version_not_exist = 3

internal_error = 4

OTHERS = 5.

Former Member
0 Kudos

Hi sekhar,

you need to declare variable in the form interface and if it is structure declare it .

then activate.

Regards,

Vijay

Former Member
0 Kudos

hi

you need to declare the field name1 and its type in form interface - import parameter and then activate the form.

Former Member
0 Kudos

Hi Sekhar,

You can ignore the warning message and regarding the display of the fields....just put a break-point in the program lines and check in debugging whether the values are getting populated into those fields.

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 = 'RE'.
ADRNR = GS_HD_ADR-ADDR_NO.

DATA : IT_ADRC TYPE STANDARD TABLE OF ADRC with header line
,
WA_ADRC like line of it_ADRC.
*
SELECT * FROM ADRC INTO TABLE IT_ADRC
WHERE ADdrnumber = GS_HD_ADR-ADDR_NO.

read table IT_ADRC INTO WA_ADRC index 1.

break-point. 

Now when you execute this smart form, the cursor stops at the statement BREAK-POINT. Here you check the work area WA_ADRC whether it is getting populated with values or not.

Regards,

Swapna.

Former Member
0 Kudos

Hi,

Already I checked in debugging, values are getting for work area fields. But when Iam activating iam getting the warning message field&wa_adrc-name1& has no defined value.