Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying script

Former Member
0 Kudos
182

can anyone send me sample modified script like medruck

i.e by passing ITCSY structure.

1 ACCEPTED SOLUTION

former_member221770
Contributor
0 Kudos
62

Hi Karthik,

Here is a quick example of how to use the PERFORM statement in SAPscript:

In SAPScript:

perform get_net_amount in program zinvoice01

using &GROSS_AMOUNT&

using &TAX_AMOUNT&

changing &NET_AMOUNT&

endperform.

In program ZINVOICE01:

form get_net_amount tables t_input structure itcsy

t_output structure itcsy.

data: l_gross type wrbtr,

l_tax type wrbtr,

l_net type wrbtr.

loop at t_input.

case i_input-name.

when 'GROSS_AMOUNT'.

l_gross = t_input-value.

when 'TAX_AMOUNT'.

l_tax = t_input-value.

endcase.

endloop.

endform.

l_net = l_gross - l_tax.

loop at t_output.

case t_output-name.

when 'NET_AMOUNT'.

t_output-value = l_net.

endcase.

modify t_output transporting value.

endloop.

Hope this points you in the right direction!

Cheers,

Pat.

PS. kindly assign reward points to the responses that you find helpful.

1 REPLY 1

former_member221770
Contributor
0 Kudos
63

Hi Karthik,

Here is a quick example of how to use the PERFORM statement in SAPscript:

In SAPScript:

perform get_net_amount in program zinvoice01

using &GROSS_AMOUNT&

using &TAX_AMOUNT&

changing &NET_AMOUNT&

endperform.

In program ZINVOICE01:

form get_net_amount tables t_input structure itcsy

t_output structure itcsy.

data: l_gross type wrbtr,

l_tax type wrbtr,

l_net type wrbtr.

loop at t_input.

case i_input-name.

when 'GROSS_AMOUNT'.

l_gross = t_input-value.

when 'TAX_AMOUNT'.

l_tax = t_input-value.

endcase.

endloop.

endform.

l_net = l_gross - l_tax.

loop at t_output.

case t_output-name.

when 'NET_AMOUNT'.

t_output-value = l_net.

endcase.

modify t_output transporting value.

endloop.

Hope this points you in the right direction!

Cheers,

Pat.

PS. kindly assign reward points to the responses that you find helpful.