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 SAP Scripts

Former Member
0 Likes
1,579

Hi,

I am using SAP Scripts to print the purchase orders. I have problem in printing the address for Puerto Rico. All other addresses print well except for PR. In this case, it prints the postal code prior to the city. Is it because it is a province. We are using the Standard print program which uses the NAST table. Please advice.

Thanks.

Raj

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,353

This is configuration. It will apply to all of your layout sets, not just the purchase order.

The address layout format is set up for each country. I think the transaction code is OY01. It is in the IMG with the label SET COUNTRIES.

PR is probably set for 010.

Hi,

I am using SAP Scripts to print the purchase orders. I have problem in printing the address for Puerto Rico. All other addresses print well except for PR. In this case, it prints the postal code prior to the city. Is it because it is a province. We are using the Standard print program which uses the NAST table. Please advice.

Thanks.

Raj

8 REPLIES 8
Read only

former_member480923
Active Contributor
0 Likes
1,353

Hi

See the Address Maintenance as done in database, because address is printed as per the preview avialabel in the SAP database. If you wanna modify change it there it will be reflected in SAPSCript don't have to write any extra code for that.

Hope This Helps

Anirban

Read only

Former Member
0 Likes
1,353

hi Raj,

Change alignment to display format for City and PO Code display

chk this one..

/:ADDRESS PARAGRAPH AS

/: TITLE &VBLKK-ANRED&

/: NAME &VBLKK-NAME1&, &VBLKK-NAME2&, &VBLKK-NAME3&, &VBLKK-NAME4&/: Street ‘115’

/: POBOX &VBLKK-PFACH& CODE &VBLKK-PSTL2& CITY &VBLKK-PFORT&

/: POSTCODE &VBLKK-PSTLZ&

/: CITY &VBLKK-ORT01&, &VBLKK-ORT02&

/: COUNTRY &VBLKK-LAND1&

/: REGION &VBLKK-REGIO&

/: FROMCOUNTRY &TVST-ALAND&

/: End Address

hope this helps

Revert back for more help

Regards

Naresh

Read only

0 Likes
1,353

Hi Naresh,

The address is printing correctly for all other states and cities in proper format. Only in case of Puerto Rico ( province)it is printing the postal code prior to the city. Do you think it should stil;l help for this case.

Also, can you please let me know if I can do this change in the same Script or if I need to copy the script and then modify.

Thanks,

Raj

Read only

Former Member
0 Likes
1,353

Hi Raj,

you can make the change to SAP-Script form in transaction code SE71.

make a copy and make changes in original language for layout design.

SAPscript calls the function module <b>ADDRESS_INTO_PRINTFORM</b> for formatting the address. If the display is not in the required form, please check the settings valid for this function module (see the documentation on the function module).

This FM will print the address according to the Standard address format of the sender_country. So the address format will change depends upon the sender country.

CALL FUNCTION 'ADDRESS_INTO_PRINTFORM'

EXPORTING

address_type = '1'

address_number = adrnr

sender_country = sender_country

number_of_lines = 10

street_has_priority = 'X'

IMPORTING

address_printform = wa_address.

If the problem is with only PR i suggest you to use an if condition.

else modify the address format by using the user exit:

"EXIT_SAPLSADR_001" .

Guess this helps

Reward points if helpful

Regards

Naresh

Read only

Former Member
0 Likes
1,354

This is configuration. It will apply to all of your layout sets, not just the purchase order.

The address layout format is set up for each country. I think the transaction code is OY01. It is in the IMG with the label SET COUNTRIES.

PR is probably set for 010.

Read only

0 Likes
1,353

Norman,

Can you suggest me as to what PR can be set to instead of 010.

Thanks,

Raj

Read only

0 Likes
1,353

Raj,

It depends how you want it formatted. The address, currency, and dates are usually formatted for the destination country. All of these settings are in txn OY01.

If you want it to look like US formatting, it would be 004.

Read only

0 Likes
1,353

Thanks Norman. That solved the problem.

I have awarded points to you.

Raj.