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 in Smartforms

Former Member
0 Likes
1,704

Hi,

How can i control the output of an address in smartform?

If i give an address number the system show me the address in specific way (name1, name2, street...). My question is: how can i tell to the system that name 2 is not relevant for me OR how can i add telephone number/email?

thank for your help,

Joseph

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
999

Hi Joseph,

If you do not like the std. address element in SmartForms, you may use standard text elements to print whatever/whereever you want. Will that work for you?

Raj

Reward points if helpful

Hi Joseph,

If you do not like the std. address element in SmartForms, you may use standard text elements to print whatever/whereever you want. Will that work for you?

Raj

Reward points if helpful

4 REPLIES 4
Read only

Former Member
0 Likes
1,000

Hi Joseph,

If you do not like the std. address element in SmartForms, you may use standard text elements to print whatever/whereever you want. Will that work for you?

Raj

Reward points if helpful

Read only

i807822
Product and Topic Expert
Product and Topic Expert
0 Likes
999

Hi this is my first entry hope you like it.

Try this using se38.

Thanks Nick.

DATA:

ls_address TYPE adrs1,

lt_address_lines TYPE szadr_printform_table,

ls_address_line LIKE LINE OF lt_address_lines,

ls_dynamic_text TYPE tline.

"define iv_sending_country eg US.

"define iv_number_of_lines eg 5 or a max number .

*Manually map address fields from work area to fields *ls_address-title_text = is_customer-form.

*ls_address-name1 = wa_meter-acct_name.

*ls_address-street = wa_meter-address.

*ls_address-po_box = is_customer-postbox.

*ls_address-post_code1 = is_customer-postcode.

*ls_address-region = is_customer-region.

*ls_address-city1 = is_customer-city.

*ls_address-country = is_customer-country.

*ls_address-WHATEVER ELSE YOU NEED NECESSARY

CLEAR ls_address.

*OR move any other info according to structure and fields.

MOVE-CORRESPONDING bupa_address TO ls_address.

PERFORM convert_address USING ls_address gt_address.

FORM convert_address.

FORM convert_address USING ls_address type adrs1

new_address type TLINE_TAB.

DATA:

lt_address_lines TYPE SZADR_PRINTFORM_TABLE,

ls_address_line LIKE LINE OF lt_address_lines,

ls_dynamic_text TYPE tline.

CALL FUNCTION 'ADDRESS_INTO_PRINTFORM'

EXPORTING

address_1 = ls_address

address_type = '1' "normal/company

sender_country = gv_sending_country

"format of country

number_of_lines = gv_number_of_lines

" max lines to use.

IMPORTING

address_printform_table = lt_address_lines.

LOOP AT lt_address_lines INTO ls_address_line.

ls_dynamic_text-tdformat = '*'. "visible...

ls_dynamic_text-tdline = ls_address_line-address_line.

APPEND ls_dynamic_text TO new_address.

ENDLOOP.

ENDFORM.

Read only

Former Member
0 Likes
999

I think It could (should be) resolved with the option: PRIORITY OF LINES.

But it doesn't seems to work...

does anyone used this opton before?

thanks you,

joseph

Read only

Former Member
0 Likes
999

PRIORITY OF LINES in ADDRESS_INTO_PRINTFORM is used to format the address in the lines passed to the parameter PRIORITY OF LINES.

It is not used to format the address in a specific way. In your case you do a select on the ADRC table by passing the address number and you would be having all the details of the address like name1,name2 etc.. in seperate feilds.

By this you can display the address in the required format.