cancel
Showing results for 
Search instead for 
Did you mean: 

script-perform in prog

Former Member
0 Kudos

In form i have given PERFORM form in PROGRAM prog

using &EKPO-BRTWR&

changing &GV_NETPR&

endperform

in prog

form prog TABLES in_par STRUCTURE itcsy

out_par STRUCTURE itcsy.

***calculated gv_netpr

out_par-name = 'GV_NETPR'.

out_par-value = gv_netpr. --> tried commenting this line ..adding below loop

APPEND out_par.

LOOP AT OUT_PAR WHERE NAME EQ 'GV_NETPR'.

MOVE gv_netpr TO OUT_PAR-VALUE.

MODIFY OUT_PAR.

endloop.

both times the out_par-value is not getting populated with value in gv_netpr ..Pls Help

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

THANKS

Former Member
0 Kudos

Hi,

In program write like this.

form prog TABLES in_par STRUCTURE itcsy

out_par STRUCTURE itcsy.

Calculate gv_netpr.

READ TABLE out_tab WITH KEY name = 'GV_NETPR'.

if sy-subrc is initial.

Move gv_netpr to OUT_PAR-VALUE. ( Here gv_netpr must be a character format.)

Modify out_par index sy-tsbix.

endif.

U can pass only Character values to the OUTTAB.

former_member585865
Contributor
0 Kudos

Hi Raj,

Convert your GV_NETPR to character format.

just do your calacuation in g_netpr and finally pass to that gv_netpr(it should be in the character format)

then if you give like this it will work,

condense GV_NETPR NO-GAPS.

out_par-value = GV_NETPR.

out_par-name = 'GV_NETPR'.

MODIFY out_par INDEX 1.

Former Member
0 Kudos

Hi,

First thing that i observed is, the name of the FORM given in program is wrong when i check in calling the PERFORM in ur script, also dont declare with standard names (FORM as form name).

I dont understand why did u LOOP OUT_PAR table. U can directly Modify the table once u get Net price value.

In Script:

PERFORM cal_net_price in PROGRAM prog

using &EKPO-BRTWR&

changing &GV_NETPR&

endperform

In Program:

form cal_net_price TABLES in_par STRUCTURE itcsy

out_par STRUCTURE itcsy.

***calculated gv_netpr

out_par-name = 'GV_NETPR'.

out_par-value = gv_netpr.

MODIFY out_par INDEX 1.

it will automatically updates the Internal table...

Hope it helps!!

Former Member
0 Kudos

Hi,

I don't think APPEND is needed in the form as it already has the program symbol name

read table out_par index 2. 
  out_par -value = gv_netpr.
  modify out_par index 1.

Regards

Former Member
0 Kudos

tried the REAd one...one thing here..the subroutine here is in not in the DRIVER program...but in a subroutine pool

Former Member
0 Kudos

Hi,

So if you want to use LOOP try this.

FIELD-SYMBOLS : <fs> TYPE itcsy.

LOOP AT out_par ASSIGNING <fs>.

  IF <fs>-name = 'GV_NETPR'.
    <fs>-value = gv_netpr.
  ENDIF.
ENDLOOP.

Former Member
0 Kudos

Hi,

U can use 'Read table'.

Regards,

Manjula

Former Member
0 Kudos

Hi,

You need not use append and modify together any one will do i guess.

Check if the GV_NETPR is defined in the top include of the driver program.

Hope this will help you.

Regards,

Ranjitha