2005 Aug 08 7:28 AM
can anyone send me sample modified script like medruck
i.e by passing ITCSY structure.
2005 Aug 08 7:33 AM
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.
can anyone send me sample modified script like medruck
i.e by passing ITCSY structure.
2005 Aug 08 7:33 AM
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.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |