cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid printing the Country name in the SAP Script

Former Member
0 Kudos

Hi All,

I am printing the address of the ship to customer in SAP script using ADDRESS and ENDADDRESS. The address is formatting based on the country code that I am passing in the COUNTRY parameter. Everything looks fine. But here my requirement is It has to display the address according to COUNTRY parameter and it should display all the part of the address except country name.

I am using the following syntax

/: ADDRESS PARAGRAPH AD LINES 7

/: NAME &IT_SOLDTO_ADDRS-NAME1&, &IT_SOLDTO_ADDRS-NAME2&

/: STREET &IT_SOLDTO_ADDRS-STRAS&

/: POBOX &IT_SOLDTO_ADDRS-PFACH& CODE &IT_SOLDTO_ADDRS-PSTL2&

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

/: POSTCODE &IT_SOLDTO_ADDRS-PSTLZ&

/: COUNTRY &IT_SOLDTO_ADDRS-LAND1&

/: REGION &IT_SOLDTO_ADDRS-REGIO&

/: ENDADDRESS

for example if I pass COUNTRY = 'DE', it is printing country name as 'GERMANY'.

Please advise me how to avoid the country name alone from printing in the address.

It is very urgent requirement. Points will be awarded for helpful answers.

Regards,

Yellappa.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

please check if any field print country name between ADDRESS and ENDADDRESS.if exist, comment this field. have a try!

best regards,

Frank

Former Member
0 Kudos

Hi,

I couldn't find any option in ADDRESS ENDADDRESS to stop country name from printing. I have debugged the functionality of ADDRESS ENDADDRESS to see how it is formatting the address. I have a found a FM 'ADDRESS_INTO_PRINTFORM' where formatting is happening. I have used this FM in driver program and got the address format in internal table ADDRESS_PRINTFORM_TABLE[] there for country line type = 'L', hence based on this I have removed the country name, I have taken remaining address lines in variables and used the same for printing. Hence resolved..

Regards,

yellappa.

valter_oliveira
Active Contributor
0 Kudos

Hello.

With Exit SZAD0001 (SMOD), FM EXIT_SAPLSADR_001, you can edit the patern of the address printing in your system. But before that you have to configure the key of the edition routine to address print (transaction OY01).

For example, at STANDARD, Portugal uses key 001. This key must be changed to a key between 900 and 999 to activate the exit. (For more info consult sap note 38922.)

You can copy 001 to a 900 and then restrict to some layouts (I don't know if you want on a specific one or in all of your system).

Best regards.

Valter Oliveira.

Former Member
0 Kudos

Hi Valter,

Thanks for your quick response. I believe I would like to add some more information to my question. This address format is only for this script alone. For other scripts it should display the full address format(along with country name). Is there anything we can restrict this through some parameters passing to ADDRESS and ENDADDRESS.

Regards,

Yellappa.

valter_oliveira
Active Contributor
0 Kudos

Hello.

Please follow this link:

http://help.sap.com/saphelp_nw70/helpdata/EN/d2/cb3d46455611d189710000e8322d00/frameset.htm and choose SAPscript Control Statement ADDRESS.

I think you can use STXADDRESS-LANG_COUNT and remove COUNTRY and REGION for it.

Best regards.

Valter Oliveira.

Former Member
0 Kudos

Hi,

I believe this value STXADDRESS-LANG_COUNT is equivalent to the value we are passing in COUNTRY parameter. I have tried once removing the country code ( commented ). This time it is not displaying the country name, but formatting is not proper. Please suggest what else we can do on this.

Regards,

Yellappa.

valter_oliveira
Active Contributor
0 Kudos

Hi again.

Please, as a try, comment COUNTRY and REGION and insert

/: LANG_COUNT 'DE'

Best regards.

Valter Oliveira.

Former Member
0 Kudos

Hi Valter,

Sorry for the late reply. I have tried your last suggestion, but it didn't work. Please help me what are the other ways we can do.

Regards,

Yellappa.

valter_oliveira
Active Contributor
0 Kudos

Hello.

Since it's only one script, you can always do it without command address, like this:


* &IT_SOLDTO_ADDRS-NAME1& &IT_SOLDTO_ADDRS-NAME2&
* &IT_SOLDTO_ADDRS-STRAS&
* &IT_SOLDTO_ADDRS-ORT01& &IT_SOLDTO_ADDRS-ORT02&
* &IT_SOLDTO_ADDRS-PSTLZ&

If a field is not formatted as your needs, you can always convert it yourself, it's not that hard (in driver program or create a PERFORM in script).

Hope this solves your problem.

Best regards.

Valter Oliveira.

Former Member
0 Kudos

Hi Valter,

We thought of implementing the same idea what you have given. But here the problem is, if it is for only one country we can write the address format manually without using ADDRESS ENDADDRESS. Since we have many countries, I believe we may need to repeat the code for all the countries format, if we are not using ADDRESS command, which is very tedious work.

Regards,

Yellappa.