Application Development and Automation 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: 
Read only

Address printing in Sapscript

Former Member
0 Likes
2,991

This is the link I found for address/endaddress: http://help.sap.com/erp_fao_addon10/helpdata/en/4e/34fd9363de02c2e10000000a15822b/content.htm

I need to print the complete address of the customer including the entry in street4 in the customer master. At present, the sapscript uses the address/endaddress as below. But when I debugged, the structure DKADR does not have the value for street4 anywhere. And following the link above, it looks like only one street field can be printed, is that correct? Therefore, how can I be able to print the address inlcuding that field?

Note: I tried to create a subroutine called in the sapscript but it didn't work as nothing got printed on the form. Probably I did it incorrectly. However, during debug, I've seen the fields of ADRS_PRINT and it was not picking up the street4 value too. So maybe even if it worked, I still would not have what I needed.

Has anyone encountered this to advise on a sound approach to handle the issue? Thanks in advance!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,488

Hi,

what modul are u using?

never seen a field "Street 4"

do you mean name4 or addressline 4?

In the documentation also FM ADDRESS_INTO_PRINTFORM is mentioned. though it is kinda complex this fm can change the layout of the address. U can customize addresstypes for every single formular. this fm returns adress-lines and you can customize the amount of lines and set prio what Information should be included. but as mentioned this FM takes time to understand.

Though i would suggest u to copy the address conversion out of a similar standard programm.

if this aint possible, do it manually. at least you have to find the db-table where the field is stored you want to print.

if you using a standard programm for printing and just want to change the layout, set a breakpoint in ur print programm and look up the structures that are available.

regards

Stefan Seeburger

This is the link I found for address/endaddress: http://help.sap.com/erp_fao_addon10/helpdata/en/4e/34fd9363de02c2e10000000a15822b/content.htm

I need to print the complete address of the customer including the entry in street4 in the customer master. At present, the sapscript uses the address/endaddress as below. But when I debugged, the structure DKADR does not have the value for street4 anywhere. And following the link above, it looks like only one street field can be printed, is that correct? Therefore, how can I be able to print the address inlcuding that field?

Note: I tried to create a subroutine called in the sapscript but it didn't work as nothing got printed on the form. Probably I did it incorrectly. However, during debug, I've seen the fields of ADRS_PRINT and it was not picking up the street4 value too. So maybe even if it worked, I still would not have what I needed.

Has anyone encountered this to advise on a sound approach to handle the issue? Thanks in advance!

9 REPLIES 9
Read only

Former Member
0 Likes
2,489

Hi,

what modul are u using?

never seen a field "Street 4"

do you mean name4 or addressline 4?

In the documentation also FM ADDRESS_INTO_PRINTFORM is mentioned. though it is kinda complex this fm can change the layout of the address. U can customize addresstypes for every single formular. this fm returns adress-lines and you can customize the amount of lines and set prio what Information should be included. but as mentioned this FM takes time to understand.

Though i would suggest u to copy the address conversion out of a similar standard programm.

if this aint possible, do it manually. at least you have to find the db-table where the field is stored you want to print.

if you using a standard programm for printing and just want to change the layout, set a breakpoint in ur print programm and look up the structures that are available.

regards

Stefan Seeburger

Read only

0 Likes
2,488

Hi Stefan,

It's from ADDR1_DATA structure field STR_SUPPL3. On the customer master XD02, it is the field named Street 4. I actually tried using the FM ADDRESS_INTO_PRINTFORM already but the information was not in the ADRS_PRINT lines as well.

As an interim solution, what I did was to add code to the print program:

select single str_suppl3 from ardc

  into location_street4

  where addrnumber = dkadr-adrnr.

Then in the sapscript, I added /: LOCATION &LOCATION_STREET4& in between street and city.So far it works.

Read only

0 Likes
2,488

Hi Cholen,

call perform statement in sap script. Use FM ADDRESS_INTO_PRINTFORM in that perform. Use variable ADDRESS_PRINTFORM to display the address lines.

Thanks,

Santosh

Read only

0 Likes
2,488

Is it possible to call FM directly in sapscript? It should be in a subroutine pool, isn't it? I did that but the address line I wanted still did not show. 😕 PERFORM ADDRESS_INTO_PRINTFORM IN PROGRAM SUBROUTINE POOL... :/ENDPERFORM

Read only

Pavithra_madhu
Participant
0 Likes
2,488

Hi,

I think you have to include addressline4 to standard program of address u are using in SAP script using SO10

Cheers,

Pavithra

Read only

0 Likes
2,488

Can you provide more details on this? I know how to do include SO10 text in SAP script but I do not understand exactly how the addressline4 will be stored in SO10.

Read only

0 Likes
2,488

Hi,

You can refer standard script also.. check MEDRUCK in SE71 ....

Cheers,

Pavithra

Read only

Former Member
0 Likes
2,488

Hi Cholen,

are you still searching for a better solution?

as you wrote, you selecting street 4 at the moment and its working.

i would not do

😕 PERFORM ADDRESS_INTO_PRINTFORM IN PROGRAM SUBROUTINE POOL... :/ENDPERFORM

as you wrote.

better add a subroutine in your sap-script driver programm and use

Addressline 1-9 for output in sap script - if possible.

first of all, you have to get the FM ADDRESS_INTO_PRINTFORM to return the adress in the form you want it (Addressline 1- 9).

regards

Stefan Seeburger

Read only

0 Likes
2,488

As my interim solution is working, I will close this thread. I will try your recommendations later if I find necessary. Thanks, everyone for e valuable inputs.