cancel
Showing results for 
Search instead for 
Did you mean: 

Perform in script form , value not reflected in script form

Former Member
0 Kudos

Hallo Experts ,

I had used a perform in scriptform to calculate some values , but the changed value of one variable is not being reflected . I could not find the reason so far , i checked every possible case . Any further help on this .

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

used another variable because variable declared in the driver prog can not be changed within the script form .

Answers (3)

Answers (3)

Former Member
0 Kudos

if assigning a value to the variable does not work in the scriptform , then it seems like the value of this variable can not be changed . But it should not be like that .

former_member209818
Active Contributor
0 Kudos

Check if you are trying to change a Constant 🙂

Former Member
0 Kudos

ah nooo 🙂 it is a data declaration .

Former Member
0 Kudos

If i locally define the variables in the scriptform and then call the perform then i can see the updated values in the scriptform .

the variables whose values i want to change are defined in the driver program which is calling the script form . and am trying to call a perform from within the script to change the values of these variables .

report -> script form -> perform in other report.

How can i change the values . please help .

Thanks

former_member209818
Active Contributor
0 Kudos

Yes you can do the changes.

But check if you are calling the Perform in in one Element and trying to Print the Variable in some other Element.

If that is the case, in between control will go back to Driver program and it may refresh the variable value.

- harshad

Former Member
0 Kudos

Hello Harshad,

Sry , i did nt get it exactly .

Scenario is in driver prog variable is BAR008 and in script form i am calling a perform present in some other report to do the manipulation of this value . but in the script form after the perform call i am not seeing any change in the value of this BAR008.

Moreover i tried a temp variable and passed to the report for manipulation , and i could see the changed value and then i tried to use an assignment statement

&bar008& = &tempvariable& , still the value in bar008 didnt changed .

Thanks 

former_member209818
Active Contributor
0 Kudos

Hi Linda,

are you passing the field to be changes as a Changing parameter?

You can put a breakpoint and check if return table is really getting updated or not.

- Harshad

Former Member
0 Kudos

Hello Harshad,

Yes . its like following .

PERFORM DETERMINE_DATA IN PROGRAM ZLEX_V6_STANDARD_OUTPUT

CHANGING &BARC008&

Thanks

former_member209818
Active Contributor
0 Kudos

And how is your code inside the Form / Enform?

- Harshad

Former Member
0 Kudos

and i can see the out_par table . it contains the updated value but not seeing the value in scrpt form during debug .

Former Member
0 Kudos

after calculating the value a macro used to update output table

  DEFINE _write. "Macro to write data back to sapscript
  read table out_par with key name = &1.
  if sy-subrc is initial.
    move &2 to out_par-value.
    modify out_par index sy-tabix.
  endif.
END-OF-DEFINITION.

former_member209818
Active Contributor
0 Kudos

actually, it should not happen. If its updating on the Output table, then it should reflect in the Script as well...

is it not reflecting only that field or any field is not getting updated?

Former Member
0 Kudos

yes dats wat strange is .

can you tell me one thing . if a variable is defined in a driver program then can we change its value in the script form or not . may be this could be the reason ?

do you know ?

Thanks