2006 Aug 29 3:50 PM
2006 Aug 29 3:59 PM
Try with tihis...
/: PERFORM NAME IN PROGRAM ZXXXX
/: USING &VAR1&
/: USING &VAR2&
/: CHANGING &ZVAR&
/: ENDPERFORM
Create report ZXXXX, on this the subrutine NAME... in this subrutine you can see the value of Var1 and Var2 and you can change de value of ZVAR.
2006 Aug 29 4:02 PM
hi,
you can NOT call a Report from the layout.what you can do is to get some calculations done or to fetch some other field values from the database we write a FORM in a either a Report program or in a Subroutine pool program.
and you will call that FORM from the script.
Let me know,if you need any help in this area ?
Regards
srikanth
2006 Aug 29 4:41 PM
hi,
A sample code of how to use performs in sap scripts.
In script program,
/:PERFORM GET_SBGRP_STEXT IN PROGRAM ZSDSCRIPT
/:USING &GV_MATNR&
/:CHANGING &GV_STEXT&
/:TABLES INPUT_TABLE
/: OUTPUT_TABLE
/:ENDPERFORM
In program ZSDSCRIPT,
form get_sbgrp_stext tables intab structure itcsy
outab structure itcsy.
DATA: LV_MATNR LIKE MARA-MATNR,
LV_TEXT(3) TYPE C VALUE 'ABC'.
clear intab.
read table intab with key name = 'GV_MATNR'.
if sy-subrc = 0.
lv_MATNR = intab-value.
ENDIF.
CLEAR OUTTAB.
READ TABLE OUTAB WITH KEY NAME = 'GV_STEXT'.
IF SY-SUBRC = 0.
OUTAB-VALUE = LV_TEXT.
modify outab index sy-tabix.
ENDIF.
endform.
Regards,
Sailaja.
2006 Aug 29 5:47 PM
hi,
in script write like thie command:
/: PERFORM GET_ORDER_REASON IN PROGRAM Z_REPT USING &VBDKR-VBELN& CHANGING &ORDER_REASON& ENDPERFORM
in z_rept do like this::(<b>note it is of type subroutine pool)</b>************************************************************************
Form to Get Order Reason for Credit memo,Debit Memo *
************************************************************************
FORM GET_ORDER_REASON TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
TABLES: VBRP,
TVAUT.
DATA: V_VBELN LIKE VBRP-VBELN,
V_TEXT1 LIKE TVAUT-BEZEI,
V_TEXT2 LIKE TVAUT-BEZEI,
V_TEXT3 LIKE TVAUT-BEZEI.
*---Read IN_TAB value, then move to local variables
READ TABLE IN_TAB WITH KEY 'VBDKR-VBELN'.
IF SY-SUBRC = 0.
*---Get Vbeln
V_VBELN = IN_TAB-VALUE+0(10).
PERFORM PAD_LEADING_ZEROS USING V_VBELN.
ENDIF.
*---
CLEAR VBRP.
SELECT AUGRU_AUFT INTO VBRP-AUGRU_AUFT
UP TO 1 ROWS
FROM VBRP
WHERE VBELN = V_VBELN.
ENDSELECT.
IF SY-SUBRC = 0.
CLEAR TVAUT.
SELECT SINGLE BEZEI INTO TVAUT-BEZEI
FROM TVAUT
WHERE SPRAS = SY-LANGU
AND AUGRU = VBRP-AUGRU_AUFT.
IF SY-SUBRC = 0.
*
SPLIT TVAUT-BEZEI AT '-'
INTO V_TEXT1
V_TEXT2
V_TEXT3.
READ TABLE OUT_TAB WITH KEY 'ORDER_REASON'.
IF SY-SUBRC = 0.
MOVE V_TEXT3 TO OUT_TAB-VALUE.
MODIFY OUT_TAB INDEX SY-TABIX.
ENDIF.
ENDIF.
ENDIF.
ENDFORM.
Regards
Ashok P