cancel
Showing results for 
Search instead for 
Did you mean: 

Address with Type 'Define Dynamically' using Global Data

former_member727980
Discoverer
0 Kudos

Hello,

in a new created Adobe form Program Lines are no longer available. How can a global variable be set?

The global variable is used in an Address as Dynamic Address Type.

Thank you very much for your help.

Kind regards, Marion Hergert

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In the context , you can create an address node, which needs the input address number, address type , number of lines , language and sending country as parameters.

The functionality similar to the SMARTform addressnode.

The above parameters can be send to the form from program dynamically.

My solution is useful if you are designing the form from SFP transaction

Pavan meda

former_member727980
Discoverer
0 Kudos

Hi,

thank you very much for your answer. I have already used the address node. The point is that for the Address Type a global variable is used. I dont know how I can set this variable before the address is evaluated. The address type is not imported but it is calculated.

Do you know a solution for calculating global parameters?

Kind regards,

Marion

Former Member
0 Kudos

hi,

generally the global parameters will be declared and do some logic in the intrface. in the address node,for dynamic address type parameter should be 3rd one ( am not sure), drag the global parameter into that field and you can proceed further.

The following logic I have used when I developed the forms when there is no address number.

I think you can use the similar logic in your case.

If your application makes no use of the Business Address Services but you still want to have country-specific addresses, you must use ABAP coding to achieve this. It is possible to do this in the application program or in the initialization coding of the interface. The example here describes the latter option. You need to call the function module ADDRESS_INTO_PRINTFORM. Among its parameters, you will find address_1. This structure contains all relevant address fields, like name, street, city, or country. These fields must be filled with the address data from your application. In other words, you must take care to create a correct mapping of the address fields from your application and the individual address fields of structure address_1.

You should determine the value of parameter number_of_lines. It equals the maximum number of lines that will be created from the address data. Function module ADDRESS_INTO_PRINTFORM returns an internal table address_printform_table, which has only one column. Every line contains one line of the address that has been assembled according to the addressee's country. These lines need to be converted into a two-column internal table of type tline that can be used as the source of a dynamic text in a PDF form. Its two columns are:

TDFORMAT - contains the paragraph format of the line (e.g. an asterisk for the default format)

TDLINE contains the text itself.

Addresses Without Business Address Services - Coding

TYPE-POOLS: szadr.

DATA:

ls_address TYPE adrs1,

lt_address_lines TYPE szadr_printform_table,

ls_address_line LIKE LINE OF lt_address_lines.

*map address fields from work area to fields from function module

ls_address-title_text = is_customer-form.

ls_address-name1 = is_customer-name.

ls_address-street = is_customer-street.

ls_address-post_code1 = is_customer-postcode.

ls_address-city1 = is_customer-city.

ls_address-country = is_customer-country.

CALL FUNCTION 'ADDRESS_INTO_PRINTFORM'

EXPORTING

address_1 = ls_address

address_type = '1' "normal/company

sender_country = iv_sending_country

number_of_lines = 6

IMPORTING

address_printform_table = lt_address_lines.

DATA: ls_dynamic_text TYPE tline.

  • LT_DYNAMIC_TEXT would be defined as a global field

  • of the interface as follows:

  • lt_dynamic_text TYPE TABLE OF tline

LOOP AT lt_address_lines

INTO ls_address_line.

ls_dynamic_text-tdformat = '*'.

ls_dynamic_text-tdline = ls_address_line-address_line.

APPEND ls_dynamic_text TO lt_dynamic_text.

ENDLOOP.

pass this internaltable to the context. drag that table in the layout.

former_member727980
Discoverer
0 Kudos

Hi,

I use transaction SFP. I want to calculate the global variable in the initialization coding of the interface. Is it possible to do this initialisation within transaction SFP (sorry, but I'm an Adobe-Beginner)?

The form uses a document class.

Thank you again for helping me.

Kind regards, Marion

Former Member
0 Kudos

hi,

you can do that.

pavanmeda

Answers (0)