Application Development 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: 

Displaying Dynamic Address in smartform in so10

former_member219737
Participant
0 Kudos

Hi Team,

I need to display the address in smartform via so10 format in a dynamic way .

I have attached the screen shot for reference. But i want to delete the first line which apprears in this dynamic address.

Can anyone suggest an idea on it.

Regards,

Karthik S

5 REPLIES 5

Sandra_Rossi
Active Contributor
0 Kudos

See the documentation at http://help.sap.com/saphelp_nw70/helpdata/en/d2/69a151cd8b11d3b563006094192fe3/frameset.htm

It explains the function module ADDRESS_INTO_PRINTFORM.

0 Kudos

Hi Sandra,

Thanks for your reply .

I have checked it and i have listed sample code in driver program .

Can i know what to be done in smartform End and sample screen shot of it .

    CALL FUNCTION 'ADDR_GET'

      EXPORTING

        address_selection = lw_addr_sel

      IMPORTING

        sadr              = lt_sadr.

    IF sy-subrc EQ 0.

      lw_adrs1-name1      = lt_sadr-name1.

      lw_adrs1-name2      = lt_sadr-name2.

      lw_adrs1-name3      = lt_sadr-name3.

      lw_adrs1-name4      = lt_sadr-name4.

      lw_adrs1-post_code1 = lt_sadr-pstlz.

      lw_adrs1-city1      = lt_sadr-ort01.

      lw_adrs1-city2      = lt_sadr-ort02.

      lw_adrs1-street     = lt_sadr-stras.

      lw_adrs1-country    = c_de.

      CALL FUNCTION 'ADDRESS_INTO_PRINTFORM'

        EXPORTING

          address_1         = lw_adrs1

          address_type      = '1'

          number_of_lines   = 10

        IMPORTING

          address_printform = lw_adrs_print.

      WRITE lw_adrs_print-line0 TO w_line0.

      WRITE lw_adrs_print-line1 TO w_line1.

      WRITE lw_adrs_print-line2 TO w_line2.

      WRITE lw_adrs_print-line3 TO w_line3.

      WRITE lw_adrs_print-line4 TO w_line4.

      WRITE lw_adrs_print-line5 TO w_line5.

      WRITE lw_adrs_print-line6 TO w_line6.

      WRITE lw_adrs_print-line7 TO w_line7.

    ENDIF.

  ENDIF.

Regards,

KArthik S

0 Kudos

Hi Team,

Can i know , wat i need to do in Smartform End inorder to display the address .

Can suggest an idea on this ?

Regards,

KArthik S

0 Kudos

Why did you use 'number_of_lines   = 10' if you only map to 8 fields, and what are you asking for, the FM provide you 8 lines of texts, and I suppose you are able to use table, loop and templates in Smartforms?

In online documentation or your course notes on  Smart Forms, Using SAP Smart Forms, Basic Elements of a Form, look for Inserting Addresses and Printing Data in a Table.

Of course you could also play with Customer-Specific Settings to change the address format (removing the first line ?) but I won’t…

Regards,

Raymond

satyabrata_sahoo3
Contributor
0 Kudos

For this you need to use "Priority of Lines" string to exclude the line you do not want to print..(in general attribute tab of the Address)

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               
  • P   Mandatory blank line
  • F   Functional title
  • 4   Name 4
  • 3   Name 3
  • H   Home City
  • R   Region
  • T   District                                
  • 7   Street - supplementary line 2
  • I   Location
  • 8   Street - supplementary line 3
  • 6   Street - supplementary line 1
  • L   Country name        
  • 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       

Ex- 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.

Remember to use suitable 'Number of Lines to be Used' with 'Priority of Lines'..


-Satya