on 06-09-2008 11:00 AM
Hi All,
I have a doubt that why we use the 'Perform' and 'endperform' command in the script editor.
Why can't we use this 'Perform' statement in the print program itself and pass the result to Form??
Thanks in advance
Taj.
hi,
see the below .
SCRIPT
/: &TEXT& = ' '
/: PERFORM MATERIAL_DISCRIPTION IN PROGRAM ZZSDS004
/: USING &VBDPL-MATNR&
/: USING &VBDKL-VKORG&
/: USING &VBDPL-VTWEG&
/: CHANGING &TEXT&
/: ENDPERFORM
SUBROUTINE DEFINITION
form MATERIAL_DISCRIPTION in_par structure itcsy
out_par structure itcsy.
data:l_f_matnr type matnr,
l_f_vkorg type vkorg,
l_f_vtweg type vtweg,
l_f_maktx type maktx.
*get material no
READ TABLE in_par INDEX 1.
CHECK sy-subrc = 0.
l_f_matnr = in_par-value.
*get sales organization
READ TABLE in_par INDEX 2.
CHECK sy-subrc = 0.
l_f_vkorg = in_par-value.
*get distribution channel
READ TABLE in_par INDEX 3.
CHECK sy-subrc = 0.
l_f_vtweg = in_par-value.
select maktx into l_f_maktx
from maktx
where matnr = l_f_matnr.
if sy-subrc = 0.
loop at out_par.
if out_par-name = 'TEXT'.
out_par-value = l_f_maktx.
endif.
endloop.
endform.
Thanks,
NN.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can do that but if you need to understand the coding in the predefined driver program you require a lot of time and you also need to change the lot of code to suit according to your requirment. So It is better to use the perform statements in the sapscript instead of the driver program.
If you can change the driver program accordingly it is well and good it is not mandatory. One thing to remember as the format of the layout differs from one company to another company. We need to modify the lay out according to client requirement. As we are changing the layout we have to go with perform and endperform in the sapscript for any other fields that are not coming from the driver program.
Thanks,
NN.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.