‎2006 Jul 19 1:20 PM
Hi everybody plz help me with following
as given below i got technical description in FS
i have to display the following in Script form
plz give me the code for that just the select quirie and how to display in the form
mainly for material description it is given as MAKT-MAKTX where MAKT-MATNR = LTAP-MATNR. how i should write the code for this .if i should use perform statement in script how it should look the perform and my form statement. Actually i should not disturb the standard print program. The standard print program given is RLKOMM40.
plz kindly help me with this .
points sure.
Regards
Siri.
Form Output Name Source Data Name
SU number LTAP-NLENR
SU Barcode Barcode 3 of 9 based on SU num r
Material Description MAKT-MAKTX where
MAKT-MATNR = LTAP-MATNR
PO Number LTAP-WENUM
Quantity (on SU) LTAP-VISTM
UOM LTAP-ALTME
Received (Date) LTAP-WDATU
Material Number LTAP-MATNR
Material Barcode Barcode 3 of 9 from Material #
Batch # LTAP-CHARG
Batch # barcode Barcode 3 of 9 from Batch #
Bin LTAP-NLPLA.
‎2006 Jul 19 1:25 PM
hi,
you have to declare perform in Print program like this : PERFORM GET_ORDER_REASON IN PROGRAM Zreport USING &VBDKR-VBELN&
CHANGING &ORDER_REASON&
ENDPERFORM.
and create zreport with following code:::
************************************************************************
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 Parupalli.
‎2006 Jul 19 1:54 PM
Hi Ashok,
i gave the table and fields for which i should retrive the data
table is LTAP and i gave the fields also in my qiurie
but u gave me a different code i din't understand that could u plz see my question once again.
Thanks
‎2006 Jul 19 1:34 PM
Hi sireesha,
i use perform in scripts like this.
<b>Sript-statement:</b>
PERFORM Z_WUSCHEINVERS3_01 IN PROGRAM Z_FORMULAR_ROUTINEN
USING &MKPF-MBLNR&
CHANGING &ZLIFNR&
ENDPERFORM
<b>Abap-Code(Report: Z_FORMULAR_ROUTINEN):</b>
FORM Z_WUSCHEINVERS3_01 TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
*
READ TABLE IN_TAB WITH KEY 'MKPF-MBLNR'.
*
SELECT * FROM MSEG WHERE MBLNR = IN_TAB-VALUE.
*
IF MSEG-LIFNR <> SPACE.
EXIT.
ENDIF.
*
ENDSELECT.
*
READ TABLE OUT_TAB WITH KEY = 'ZLIFNR'.
OUT_TAB-VALUE = MSEG-LIFNR.
MODIFY OUT_TAB INDEX SY-TABIX.
*
ENDFORM.
Regards, Dieter
‎2006 Jul 19 1:41 PM
Hi
Use the below code in the main window of the script
eg
/* This sunbrotine find the Description of the Defected Material
/*
/: DEFINE &DISC_TEXT& = &SPACE&
/: PERFORM GET_DISC IN PROGRAM Y27Q_QM_COM_ROUTINE
/: USING <AP-MATNR&
/: CHANGING &DISC_TEXT&
/: ENDPERFORM
And in the abap program for eg 'Y27Q_QM_COM_ROUTINE'
u have to write the select query
FORM get_disc TABLES d_in STRUCTURE itcsy
d_out STRUCTURE itcsy.
DATA : l_matnr LIKE mara-matnr,
l_maktx LIKE makt-maktx,
l_spras LIKE sy-langu.
DATA l_text(80) TYPE c.
CLEAR d_in.
CLEAR d_out.
Read table for language
READ TABLE d_in INDEX 1.
l_matnr = d_in-value.
select single maktx from makt where matnr = l_matnr and spras = Sy-langu.
READ TABLE d_out WITH KEY 'DISC_TEXT'.
WRITE l_text TO d_out-value. "
MODIFY d_out INDEX sy-tabix.
ENDFORM. "DISC
I think U may get the idea if you wante to do some more manupulation for the other variables.
Note : Please do not forget to mark points.
Regards
Vikas