cancel
Showing results for 
Search instead for 
Did you mean: 

Script data population

Former Member
0 Kudos

Hii Gurus

please help me

when I am calling a script from print program data not coming to script .

on debugging the data in print program are ok and as per requirement available .

I have designed the print program like wise

defined all the variables

since I am using upto 1 rows so no internal table defined and all the data to variables .

select statement to populate the variables .

call function "open_form" with no parameter .

call function "start_form"

CALL FUNCTION 'START_FORM'

EXPORTING

  • ARCHIVE_INDEX =

form = 'ZFIL_CHQPRNT_EG'

language = sy-langu

program = sy-repid .

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'E1'

window = 'MAIN'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'E2'

window = 'HEADER'.

call function 'end_form'

call function 'close_form' .

In debug mode I found the controll flow to all the elements are coming fine .

but no data availble in the form though data with same varible in print program .

Thanks

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Self answered

Former Member
0 Kudos

Like Sandra said, global variables in driver program are available in script automatically, without any further action.

So you should make sure that your variables you want to use in script are defined globally in your driver program.

Another tip: you should not hardcode which form to call when calling FM START_FORM.

Customers are used to be able to customize another form via the accroding cutomizing transactions, and WITHOUT having to modify the coding of the driver program.

Former Member
0 Kudos

Hi,

end_form and close_form should be in capitals. Please modified calling for end form and close form and try it.

Regards,

Chandra Kavali

Sandra_Rossi
Active Contributor
0 Kudos

You are talking about variables, but you don't say how they are declared in the abap program, and how they are referred in the sapscript form.

They should be declared as global in the ABAP, and referred as &VARNAME& in the form. Be careful with the language if you use a different one between the definition and the execution: you must translate the form.