cancel
Showing results for 
Search instead for 
Did you mean: 

(URGENT)! Address lines priority setting in SMARTFORM

Former Member
0 Kudos

Hello,

Can you please tell me how can I control address node printing in SMARTFORM.

Actually my address node is printing address with name1 And name2 only and I want that it should also print name3.

So please explain how can I play with the priority settings of address node.

AND Is there any way to debug the SMARTFOPRM on productive system in display mode only, Without hardcoded 'BREAK-POINT'.

thank you in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The priority string you specify in the smartform defines which address lines SAP chucks out if the number of lines in the address exceeds the "Number of Lines to be Used" specified. Each address line is assigned a character as follows:

  • A Title (A nrede)

  • P Mandatory blank line (P flichtleerzeile)

  • F Functional title

  • 4 Name 4

  • 3 Name 3

  • H Home City

  • R Region

  • T District ( 006 and 015 only)

  • 7 Street - supplementary line 2

  • I Location

  • 8 Street - supplementary line 3

  • 6 Street - supplementary line 1

  • L Country name (L andesbezeichnung)

  • C Postal Code

  • 2 Name 2

  • B P.O. Box

  • S Street

  • 5 c/o-Name

  • N Name(+title) of the natural person

  • D Department

  • O City (O rtszeile)

e.g. if you put A2 in the priority string SAP will remove the title line and then name2 to try to make the address fit into number of lines specified. You'll notice that there's no character for name1 (internally it's 1, but if you try to specify name1 to be removed it gets filtered out at the top of function ADDRESS_INTO_PRINTFORM).

I had a similar problem to you in that I don't want title and name1 printed. I got around the problem by:

1) Defining a customer address format 900 in table T005A

2) Change the address layout key for my country (GB) from 006 to 900 (Do this in SPRO in the country code setup)

3) Creating a CMOD project for enhancement SZAD0001. I put the following code in EXIT_SAPLSADR_001:

data:
  lv_num_times             type i,
  lv_postn                 type i,
  lv_next_postn            type i.

* Do standard address formatting for GB
perform address_layout_006 in program saplsadr
            using adrs1_name_fields
                  adrs2_name_fields
                  adrs3_name_fields
                  adrs_post_fields
                  street_has_priority
         changing data_carrier_line.

* Remove address lines that are specified twice in the priority string.
lv_num_times = strlen( line_priority ).
clear lv_postn.
lv_next_postn = 1.

* SAP filters out 1 (name1) chars from the priority
translate line_priority using 'N1'.

do lv_num_times times.
  if line_priority+lv_postn(1) = line_priority+lv_next_postn(1).
* Double character found - remove related address lines.
    delete address_lines where line_type = line_priority+lv_postn(1).
  endif.
  add 1 to: lv_postn, lv_next_postn.
enddo.

This code calls the normal GB address formatting first. It then removes from the address output any lines that are specified twice in the priority string. e.g. to completely remove the title line and name2 line, even if the total number of lines is less then that maximum specified in the smartform, I put:

<b>AA22</b> in the "Priority of Lines" in the smartform.

There is a slight trick because SAP won't let you specify name1 in the "Priority of Lines" string. I used an N instead, which is translated to the "1" for name1 in the customer function.

This function should only affect addresses that have an explicit "Priority of Lines" specifed with double chars (.e.g AANN ) in a smartform, all other printing shouldn't be affected.

Hope this helps,

Anthony.