*&---------------------------------------------------------------------*
*& Report ZVVF_CHEQUE_PRINT *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT zvvf_cheque_print.
*&--------------------------------------------------------------------*
*& Form AMT_IN_WORDS
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->IN_PAR text
* -->OUT_PAR text
*---------------------------------------------------------------------*
FORM amt_in_words TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
DATA : lw_amt LIKE pc207-betrg,
lw_amt_words_temp(225) TYPE c,
lw_tmp LIKE regud-swnes,
lw_amt_words(255) TYPE c,
lw_amt_words2(75) TYPE c,
W_LEN TYPE I,
LW_OUTLEN TYPE I,
LW_LINE1(60) TYPE C,
LW_LINE2(60) TYPE C,
LW_LINE3(60) TYPE C.
READ TABLE in_par WITH KEY 'W_AMT'.
CHECK sy-subrc = 0.
lw_tmp = in_par-value.
READ TABLE IN_PAR WITH KEY NAME = 'OUTLEN'.
CHECK SY-SUBRC = 0.
LW_OUTLEN = IN_PAR-VALUE.
IF lw_tmp EQ 'XXXXXXXXXXXXXXXXXX'.
lw_amt = 0.
ELSE.
REPLACE ALL OCCURRENCES OF '*' IN lw_tmp WITH ' '.
REPLACE ALL OCCURRENCES OF ',' IN lw_tmp WITH ' '.
CONDENSE lw_tmp.
lw_amt = lw_tmp.
ENDIF.
CALL FUNCTION 'ZVVF_HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = lw_amt
IMPORTING
amt_in_words = lw_amt_words_temp
EXCEPTIONS
data_type_mismatch = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CONCATENATE lw_amt_words_temp 'ONLY' INTO LW_AMT_WORDS separated by
space.
CALL FUNCTION 'RKD_WORD_WRAP'
EXPORTING
textline = LW_AMT_WORDS
* DELIMITER = ' '
OUTPUTLEN = LW_OUTLEN
IMPORTING
OUT_LINE1 = LW_LINE1
OUT_LINE2 = LW_LINE2
OUT_LINE3 = LW_LINE3
* TABLES
* OUT_LINES =
EXCEPTIONS
OUTPUTLEN_TOO_LARGE = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
* EXPORTING
* amt_in_num = LW_AMT
* IMPORTING
* AMT_IN_WORDS = LW_AMT_WORDS
* EXCEPTIONS
* DATA_TYPE_MISMATCH = 1
* OTHERS = 2.
*
* IF sy-subrc <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
* W_LEN = STRLEN( lw_amt_words_temp ).
* IF W_LEN LE 75.
* CONCATENATE lw_amt_words_temp(75) 'ONLY' INTO lw_amt_words1
* SEPARATED BY space.
* READ TABLE out_par WITH KEY 'W_AMT_WORDS1'.
* CHECK sy-subrc = 0.
* out_par-value = lw_amt_words1.
* MODIFY out_par INDEX sy-tabix.
* ELSE.
* CONCATENATE lw_amt_words_temp(75) ' ' INTO lw_amt_words1.
* READ TABLE out_par WITH KEY 'W_AMT_WORDS1'.
* CHECK sy-subrc = 0.
* out_par-value = lw_amt_words1.
* MODIFY out_par INDEX sy-tabix.
*
* CONCATENATE lw_amt_words_temp+75 'ONLY' INTO lw_amt_words2
* SEPARATED BY SPACE.
* READ TABLE out_par WITH KEY 'W_AMT_WORDS2'.
* CHECK sy-subrc = 0.
* out_par-value = lw_amt_words2.
* MODIFY out_par INDEX sy-tabix.
READ TABLE OUT_PAR WITH KEY NAME = 'W_AMT_WORDS1'.
CHECK SY-SUBRC = 0.
OUT_PAR-VALUE = LW_LINE1.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY NAME = 'W_AMT_WORDS2'.
CHECK SY-SUBRC = 0.
OUT_PAR-VALUE = LW_LINE2.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY NAME = 'W_AMT_WORDS3'.
CHECK SY-SUBRC = 0.
OUT_PAR-VALUE = LW_LINE3.
MODIFY OUT_PAR INDEX SY-TABIX.
* ENDIF.
ENDFORM. "AMT_IN_WORDS
*&--------------------------------------------------------------------*
*& Form DOC_NO
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->IN_PAR text
* -->OUT_PAR text
*---------------------------------------------------------------------*
FORM get_po_no TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
DATA :
*W_VBLNR LIKE REGUH-VBLNR,
w_gjahr LIKE regup-gjahr,
w_belnr LIKE regup-belnr,
w_ebeln LIKE bseg-ebeln,
w_umskz like bseg-umskz,
w_koart like bseg-koart.
CLEAR : W_UMSKZ ,W_KOART .
*READ TABLE IN_PAR WITH KEY NAME = 'REGUH-VBLNR'.
*CHECK SY-SUBRC = 0.
*W_VBLNR = IN_PAR-VALUE.
READ TABLE in_par WITH KEY name = 'REGUP-GJAHR'.
CHECK sy-subrc = 0.
w_gjahr = in_par-value.
* READ TABLE in_par WITH KEY name = 'REGUP-REBZG'.
READ TABLE in_par WITH KEY name = 'REGUP-BELNR'.
CHECK sy-subrc = 0.
w_belnr = in_par-value.
* Start of Insertion by Niraj on 11-05-2005
select single umskz from bseg
INTO w_umskz
WHERE bukrs in ('VVF' , 'VITA' )
AND belnr = w_belnr
AND gjahr = w_gjahr
AND UMSKZ <> ''.
IF SY-SUBRC = 0.
W_KOART = 'K'.
ELSE.
W_KOART = 'S'.
ENDIF.
* End of insertion by Niraj on 11-05-2005
SELECT SINGLE ebeln FROM bseg
INTO w_ebeln
WHERE bukrs in ('VVF' , 'VITA' )
AND belnr = w_belnr
AND gjahr = w_gjahr
and koart = w_koart.
* AND koart = 'S'.
* AND BUZEI = 002.
* AND AUGBL = W_VBLNR.
CHECK sy-subrc = 0.
READ TABLE out_par WITH KEY name = 'WA_PO'.
CHECK sy-subrc = 0.
out_par-value = w_ebeln.
MODIFY out_par INDEX sy-tabix.
ENDFORM. "DOC_NO
FORM get_doc_no TABLES in_par STRUCTURE itcsy
out_par STRUCTURE itcsy.
data : w_bukrs like regup-bukrs,
w_belnr like bkpf-belnr,
w_gjahr like bkpf-gjahr,
w_xblnr like bkpf-xblnr,
w_vblnr like REGUH-VBLNR,
w_blart like bkpf-blart.
READ TABLE in_par WITH KEY name = 'REGUP-BUKRS'.
CHECK sy-subrc = 0.
w_bukrs = in_par-value.
* READ TABLE in_par WITH KEY name = 'REGUP-REBZG'.
READ TABLE in_par WITH KEY name = 'REGUP-BELNR'.
CHECK sy-subrc = 0.
w_belnr = in_par-value.
READ TABLE in_par WITH KEY name = 'REGUP-GJAHR'.
CHECK sy-subrc = 0.
w_gjahr = in_par-value.
READ TABLE in_par WITH KEY name = 'REGUH-VBLNR'.
CHECK sy-subrc = 0.
W_VBLNR = IN_PAR-VALUE.
select single xblnr into w_xblnr
from bkpf
where bukrs = w_bukrs
and belnr = w_belnr
and gjahr = w_gjahr.
if sy-subrc = 0.
read table out_par with key name = 'XBLNR'.
check sy-subrc = 0.
out_par-value = w_xblnr.
modify out_par index sy-tabix.
endif.
select single blart into w_blart
from bkpf
where bukrs = w_bukrs
and belnr = w_vblnr
and gjAHR = W_GJAHR.
IF SY-SUBRC = 0.
READ TABLE OUT_PAR WITH KEY NAME = 'BLART'.
IF SY-SUBRC = 0.
OUT_PAR-VALUE = W_BLART.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDIF.
ENDIF.
ENDFORM.
No comments:
Post a Comment