Entering content frameSyntax documentationset_data Locate the document in its SAP Library structure

Use this method to fill the form in the office application with the up-to-date data from the R/3 System. The fields in the document are altered according to the contents of the table. You can also use this method to change the entries in a list box. To do this, you must create a table containing the new list box entries. These entries are automatically entered in the list box, as long as you do not use the command ‘2’ in the Code field, since this deletes all entries in the list box.

CALL METHOD form->set_data
       EXPORTING fields   = fields
                 clear    = clear
                 no_flush = no_flush
       IMPORTING retcode  = retcode
                 error    = error.

Description of parameters

Parameter

Optional

Description

fields

 

Table with the structure soi_form_list . These entries are used to change the fields in the form.

clear

X

'X': Before the fields from the fields table are imported, all fields in the form are initialized. The exception to this are list boxes, which are not deleted.

' ' : The form fields are updated with the values from the fields table. If the table does not contain a new value for a field, its existing value in the form is not changed.

 

Examples for the fields table:

Example 1:

Type

Name

Number

Value

Code

C

Single

1

1

0

T

Name

1

A. N. Other

0

T

Department

1

ABAP

3

This table would place a value in a checkbox. The second record would place the entry A. N. Other into a text field. The final entry would change the Department field. The command ‘3’ means that the entry can no longer be changed in the document.

Example 2:

Type

Name

Number

Value

Code

L

Colors

1

Red

2

L

Colors

2

Green

1

L

Colors

3

Blue

0

This table fills a list box with entries. The command ‘2’ means that the list box can only contain entries defined in the table. The command ‘1’ selects the second entry.

Leaving content frame