Go on link..

link us with ...

Friday, December 31, 2010

bank

*&---------------------------------------------------------------------*
*& Report ZAMEY_BANK *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*

REPORT ZAMEY_BANK
no standard page heading
line-size 210
line-count 65(0).

DATA : W_WAERS LIKE SY-WAERS.

tables : bseg, bkpf, lfa1, kna1, skat, t003t, adrc, t001, ska1.

selection-screen begin of block contin with frame title text-001.
select-options : s_belnr for bkpf-belnr.

parameter : p_bukrs like bkpf-bukrs obligatory,
p_gjahr like bkpf-gjahr obligatory.

select-options : s_blart for bkpf-blart,
s_usnam for bkpf-usnam,
s_budat for bkpf-budat obligatory.

selection-screen end of block contin.

*--- Data definition

data : t_waers like t001-waers.

* Header data - BKPF
data : begin of i_bkpf occurs 0,
bukrs like bkpf-bukrs,
belnr like bkpf-belnr,
gjahr like bkpf-gjahr,

blart like bkpf-blart,
bldat like bkpf-bldat,
budat like bkpf-budat,
monat like bkpf-monat,
xblnr like bkpf-xblnr,
waers like bkpf-waers,
bktxt like bkpf-bktxt,
end of i_bkpf.

*--- Detail data - bseg
data : begin of i_bseg occurs 0,
bukrs like bkpf-bukrs,
belnr like bkpf-belnr,
gjahr like bkpf-gjahr,

blart like bkpf-blart,
buzei like bseg-buzei,
agzei like bseg-agzei,
koart like bseg-koart,
bschl like bseg-bschl, "Posting key
kostl like bseg-kostl, "Cost center
gsber like bseg-gsber,
hkont like bseg-hkont,
saknr like bseg-saknr,
umskz like bseg-umskz,
shkzg like bseg-shkzg,

lifnr like bseg-lifnr,
kunnr like bseg-kunnr,
c_descript(20) , " Common description for acct/vendor
qsskz like bseg-qsskz,
dmbtr like bseg-dmbtr,
wrbtr like bseg-wrbtr,
sgtxt like bseg-sgtxt,
augbl like bseg-augbl,
augdt like bseg-augdt,
hbkid like bseg-hbkid,
* WORD(255) TYPE C,

end of i_bseg.

data : begin of it_bseg occurs 0,
bukrs like bkpf-bukrs,
belnr like bkpf-belnr,
gjahr like bkpf-gjahr,

blart like bkpf-blart,
buzei like bseg-buzei,
agzei like bseg-agzei,
koart like bseg-koart,
bschl like bseg-bschl, "Posting key
kostl like bseg-kostl, "Cost center
gsber like bseg-gsber,
hkont like bseg-hkont,
saknr like bseg-saknr,
umskz like bseg-umskz,
shkzg like bseg-shkzg,

lifnr like bseg-lifnr,
kunnr like bseg-kunnr,
c_descript(20) , " Common description for acct/vendor
qsskz like bseg-qsskz,
dmbtr like bseg-dmbtr,
wrbtr like bseg-wrbtr,
sgtxt like bseg-sgtxt,
augbl like bseg-augbl,
augdt like bseg-augdt,
hbkid like bseg-hbkid,


* WORD(255) TYPE C,

end of it_bseg.


data : w_bldat like bkpf-budat,
w_xblnr like bkpf-xblnr,
w_waers1 like bkpf-waers.
data : begin of i_lfa1 occurs 0,
lifnr like bseg-lifnr,
name1 like lfa1-name1,
end of i_lfa1.

data : begin of i_kna1 occurs 0,
kunnr like bseg-kunnr,
name1 like lfa1-name1,
end of i_kna1.

data : begin of i_skat occurs 0,
saknr like skat-saknr,
txt20 like skat-txt20,
end of i_skat.

data : begin of i_t003t occurs 0,
blart like bkpf-blart,
ltext like t003t-ltext,
end of i_t003t.


data : begin of i_brep occurs 0,
zuonr like bseg-zuonr,
sgtxt like bseg-sgtxt,
valut like bseg-valut,
end of i_brep.

data : begin of i_ADDR occurs 0,
BUTXT LIKE T001-BUTXT,
ORT01 LIKE T001-ORT01,
ADRNR LIKE T001-ADRNR,
end of i_ADDR.

data : begin of i_ADRC occurs 0,
ADDRNUMBER LIKE ADRC-ADDRNUMBER,
NAME1 LIKE ADRC-NAME1,
POST_CODE1 LIKE ADRC-POST_CODE1,
STR_SUPPL1 LIKE ADRC-STR_SUPPL1,
STR_SUPPL2 LIKE ADRC-STR_SUPPL2,
STR_SUPPL3 LIKE ADRC-STR_SUPPL3,
CITY1 LIKE ADRC-CITY1,
end of i_ADRC.

data : w_lines type i,
repsize type i,
w_string(13) .

DATA : BEGIN OF IT_REF OCCURS 0,
WS_XBLNR LIKE BKPF-XBLNR,
END OF IT_REF.

DATA : W_WORD(255) TYPE C.
DATA : AMT LIKE PC207-BETRG.

DATA: HEADER(30) TYPE C.
DATA W_AUGBL TYPE I.
DATA: ADDR(150) TYPE C, temp type c, one type c, two(20) type c.
*--------------------------------------------------------------
start-of-selection.
*--------------------------------------------------------------
select single waers
from t001 into (t_waers)
where bukrs = p_bukrs.


select * from bkpf
into corresponding fields of table i_bkpf
where bukrs = p_bukrs
and belnr in s_belnr
and gjahr = p_gjahr
and blart in s_blart
and budat in s_budat
and usnam in s_usnam.

if sy-subrc ne 0 or i_bkpf[] is initial.
message 'No records exist for this selection' type 'I'.
leave program.
endif.
sort i_bkpf by bukrs belnr gjahr.

select * from bseg
into corresponding fields of table i_bseg
for all entries in i_bkpf
where bukrs = i_bkpf-bukrs
and belnr = i_bkpf-belnr
and gjahr = i_bkpf-gjahr.


if sy-subrc ne 0.
message 'Unable to fetch records from bseg for further processing'
type 'I'.
leave program.
endif.

************************************************************
* LOGIC FOR DISPLAYING DATA WHEN DOC TYPE IS BANK REP.
************************************************************
SELECT BUTXT ORT01 ADRNR
INTO CORRESPONDING FIELDS OF TABLE I_ADDR
FROM T001
FOR ALL ENTRIES IN I_BKPF
WHERE BUKRS = I_BKPF-BUKRS.

SELECT NAME1 POST_CODE1 STR_SUPPL1 STR_SUPPL2 STR_SUPPL3 CITY1
INTO CORRESPONDING FIELDS OF TABLE I_ADRC
FROM ADRC
FOR ALL ENTRIES IN I_ADDR
WHERE ADDRNUMBER = I_ADDR-ADRNR.

SELECT bukrs belnr gjahr buzei agzei koart bschl kostl gsber saknr umskz shkzg
lifnr kunnr qsskz dmbtr wrbtr sgtxt augbl augdt hbkid
INTO CORRESPONDING FIELDS OF TABLE IT_BSEG
FROM BSEG
FOR ALL ENTRIES IN I_BSEG
WHERE
* bukrs = it_bseg-bukrs and
* belnr = it_bseg-belnr and
gjahr = i_bseg-gjahr and
AUGBL = I_BSEG-AUGBL and
augbl ne space and
augdt = i_bseg-augdt.

select zuonr sgtxt valut
into corresponding fields of table i_brep
from bseg
for all entries in i_bkpf
where bukrs = i_bkpf-bukrs
and belnr = i_bkpf-belnr
and gjahr = i_bkpf-gjahr.

* if sy-subrc ne 0.
* message 'records not existing for this selection' type 'I'.
*
* endif.



loop at i_bkpf.

LOOP AT IT_BSEG.
IF IT_BSEG-BELNR <> IT_BSEG-AUGBL.
SELECT single XBLNR INTO IT_REF-WS_XBLNR FROM BKPF
WHERE BELNR = IT_BSEG-BELNR.
ENDIF.
ENDLOOP.
IF ( I_BKPF-BLART EQ 'C1' )
OR ( I_BKPF-BLART EQ 'C2' )
OR ( I_BKPF-BLART EQ 'C3' )
OR ( I_BKPF-BLART EQ 'C4' )
OR ( I_BKPF-BLART EQ 'C5' )
OR ( I_BKPF-BLART EQ 'C6' ).

HEADER = 'CASH RECEIPT VOUCHER'.

ELSEIF
( I_BKPF-BLART EQ 'B1' )
OR ( I_BKPF-BLART EQ 'B2' )
OR ( I_BKPF-BLART EQ 'B3' )
OR ( I_BKPF-BLART EQ 'B4' )
OR ( I_BKPF-BLART EQ 'B5' )
OR ( I_BKPF-BLART EQ 'B6' )
OR ( I_BKPF-BLART EQ 'BA' )
OR ( I_BKPF-BLART EQ 'BB' )
OR ( I_BKPF-BLART EQ 'BC' )
OR ( I_BKPF-BLART EQ 'BD' ).

HEADER = 'BANK RECEIPT VOUCHER'.

* select zuonr sgtxt valut
* into corresponding fields of table i_brep
* from bseg
* for all entries in i_bkpf
* where bukrs = i_bkpf-bukrs
* and belnr = i_bkpf-belnr
* and gjahr = i_bkpf-gjahr.
*
*
* if sy-subrc ne 0.
* message 'records not existing for this selection' type 'I'.
*
* endif.


ELSEIF ( I_BKPF-BLART EQ 'B7' ).


HEADER = 'BANK RECEIPT VOUCHER'.




ELSEIF ( I_BKPF-BLART EQ 'C7' ).

HEADER = 'CASH RECEIPT VOUCHER'.

elseif ( I_BKPF-BLART EQ 'J1' )
OR ( I_BKPF-BLART EQ 'J2' )
OR ( I_BKPF-BLART EQ 'J3' )
OR ( I_BKPF-BLART EQ 'J4' )
OR ( I_BKPF-BLART EQ 'J5' )
OR ( I_BKPF-BLART EQ 'J6' ).

HEADER = 'JOURNAL VOUCHER'.

ELSEIF ( I_BKPF-BLART EQ 'J7' ).

HEADER = 'JOURNAL VOUCHER'.

ELSEIF ( I_BKPF-BLART EQ 'JP' ).

HEADER = 'PAYROLL VOUCHER'.

ELSEIF ( I_BKPF-BLART EQ 'JA' ).

HEADER = 'LC/BG VOUCHER'.

elseif ( I_BKPF-BLART EQ 'P1' )
OR ( I_BKPF-BLART EQ 'P2' )
OR ( I_BKPF-BLART EQ 'P3' )
OR ( I_BKPF-BLART EQ 'P4' )
OR ( I_BKPF-BLART EQ 'P5' )
OR ( I_BKPF-BLART EQ 'P6' ).

HEADER = 'PROVISION VOUCHER'.

ELSEIF ( I_BKPF-BLART EQ 'P7' ).

HEADER = 'PROVISION VOUCHER'.

elseif ( I_BKPF-BLART EQ 'K1' )
OR ( I_BKPF-BLART EQ 'K2' )
OR ( I_BKPF-BLART EQ 'K3' )
OR ( I_BKPF-BLART EQ 'K4' )
OR ( I_BKPF-BLART EQ 'K5' )
OR ( I_BKPF-BLART EQ 'K6' ).

HEADER = 'PURCHASE VOUCHER(MATERIAL)'.

ELSEIF ( I_BKPF-BLART EQ 'K7' ).

HEADER = 'PURCHASE VOUCHER(MATERIAL)'.

elseif ( I_BKPF-BLART EQ 'L1' )
OR ( I_BKPF-BLART EQ 'L2' )
OR ( I_BKPF-BLART EQ 'L3' )
OR ( I_BKPF-BLART EQ 'L4' )
OR ( I_BKPF-BLART EQ 'L5' )
OR ( I_BKPF-BLART EQ 'L6' ).

HEADER = 'PURCHASE VOUCHER(SERVICES)'.

ELSEIF ( I_BKPF-BLART EQ 'L7' ).

HEADER = 'PURCHASE VOUCHER(SERVICES)'.

elseif ( I_BKPF-BLART EQ 'M1' )
OR ( I_BKPF-BLART EQ 'M2' )
OR ( I_BKPF-BLART EQ 'M3' )
OR ( I_BKPF-BLART EQ 'M4' )
OR ( I_BKPF-BLART EQ 'M5' )
OR ( I_BKPF-BLART EQ 'M6' ).

HEADER = 'PURCHASE VOUCHER(CAPITAL GOODS)'.

ELSEIF ( I_BKPF-BLART EQ 'M7' ).

HEADER = 'PURCHASE VOUCHER(CAPITAL GOODS)'.

elseif ( I_BKPF-BLART EQ 'O1' )
OR ( I_BKPF-BLART EQ 'O2' )
OR ( I_BKPF-BLART EQ 'O3' )
OR ( I_BKPF-BLART EQ 'O4' )
OR ( I_BKPF-BLART EQ 'O5' )
OR ( I_BKPF-BLART EQ 'O6' )
OR ( I_BKPF-BLART EQ 'O7' ).


HEADER = 'VENDOR DEBIT NOTE'.

elseif ( I_BKPF-BLART EQ 'G1' )
OR ( I_BKPF-BLART EQ 'G2' )
OR ( I_BKPF-BLART EQ 'G3' )
OR ( I_BKPF-BLART EQ 'G4' )
OR ( I_BKPF-BLART EQ 'G5' )
OR ( I_BKPF-BLART EQ 'G6' )
OR ( I_BKPF-BLART EQ 'G7' ).


HEADER = 'CUSTOMER CREDIT NOTE'.
ENDIF.

endloop.

select saknr txt20 from skat
into corresponding fields of table i_skat
for all entries in i_bseg
where saknr = i_bseg-hkont
and ktopl = 'VCOA'.


select * from lfa1
into corresponding fields of table i_lfa1
for all entries in i_bseg
where lifnr = i_bseg-lifnr.

select * from kna1
into corresponding fields of table i_kna1
for all entries in i_bseg
where kunnr = i_bseg-kunnr.

* endloop.

select * from t003t
into corresponding fields of table i_t003t
for all entries in i_bkpf
where blart = i_bkpf-blart
and spras = 'E '.

loop at i_bkpf.

concatenate 'Amount (' i_bkpf-waers ')' into w_string.

if t_waers eq i_bkpf-waers.
write :/ sy-uline(95).
else.
write :/ sy-uline(140).
endif.

format reset.
write :/ sy-vline,
2 'Itm',
5 sy-vline,
6 ' ClgI',
11 sy-vline,
12 'PK',
14 sy-vline,
15 'Cost Centre',
26 sy-vline,
27 'BA ',
31 sy-vline,
32 'G/L acct',
42 sy-vline,
43 'S',
44 sy-vline,
45 'Account',
55 sy-vline,
56 'Account short text ',
76 sy-vline,
77 'Tx',
79 sy-vline.

if t_waers eq i_bkpf-waers.
write : 80 'Amount(INR) ',
95 sy-vline.
* 96 'Bill No.',
*
* 125 sy-vline,
* 126 'Bill Date',
*
* 140 sy-vline.
else.
write : 80 w_string,
95 sy-vline,
96 'Amount(INR) ',
111 sy-vline,
125 sy-vline,
140 sy-vline.
endif.


if t_waers eq i_bkpf-waers.
write :/ sy-uline(95).
else.
write :/ sy-uline(140).
endif.


loop at i_bseg where bukrs = i_bkpf-bukrs
and belnr = i_bkpf-belnr
and gjahr = i_bkpf-gjahr.

write: / sy-vline,2 i_bseg-buzei,5 sy-vline,6 i_bseg-agzei,11 sy-vline,12 i_bseg-bschl,
14 sy-vline,15 i_bseg-kostl,26 sy-vline,27 i_bseg-gsber,31 sy-vline,32 i_bseg-hkont,42 sy-vline.

if i_bseg-shkzg = 'S'.
write : 43 'D'.
else.
write : 43 'C'.
endif.
write : 44 sy-vline.
if i_bseg-koart = 'K'.
write :45 i_bseg-lifnr.
read table i_lfa1 with key lifnr = i_bseg-lifnr.
if sy-subrc eq 0.
i_bseg-c_descript = i_lfa1-name1.
endif.
endif.

if i_bseg-koart = 'D'.
write :45 i_bseg-kunnr.
read table i_kna1 with key kunnr = i_bseg-kunnr.
if sy-subrc eq 0.
i_bseg-c_descript = i_kna1-name1.
endif.
endif.


if not ( i_bseg-koart = 'D'
or i_bseg-koart = 'K' ).
write :45 i_bseg-hkont.
* -------changes made below
read table i_skat with key saknr = i_bseg-hkont.
if sy-subrc eq 0.
i_bseg-c_descript = i_skat-txt20.
endif.
endif.
write: 55 sy-vline,
56 i_bseg-c_descript,
76 sy-vline,
77 i_bseg-qsskz,
79 sy-vline.
if t_waers eq i_bkpf-waers.
write : 80 i_bseg-dmbtr,
95 sy-vline.
** 112 i_brep-zuonr,
** 112 i_bkpf-xblnr,
* 125 sy-vline,
* 126 i_bkpf-bldat.

write :/ sy-uline(95).
* write : 140 sy-vline.
else.
write : 80 i_bseg-wrbtr,
95 sy-vline.
write: 96 i_bseg-dmbtr,
111 sy-vline,
112 i_bkpf-belnr,
* 112 IT_REF-WS_XBLNR,
125 sy-vline,
126 i_bkpf-bldat.
write : 140 sy-vline.
write :/ sy-uline(140).
endif.


endloop.


LOOP AT It_BSEG WHERE bukrs = i_bkpf-bukrs AND augbl = i_bkpf-belnr AND gjahr = i_bkpf-gjahr AND SHKZG = 'S'.
IF It_BSEG-AUGBL NE SPACE.
W_AUGBL = 1.
ENDIF.
ENDLOOP.
* read table i_bseg with key bukrs = i_bkpf-bukrs belnr = i_bkpf-belnr gjahr = i_bkpf-gjahr.
IF W_AUGBL EQ 1.
W_AUGBL = 0.

skip 1.
write :/ '********Towards'.
SKIP 1.
write :/ sy-uline(109).

* write :/ sy-vline, 2 'Itm', 5 sy-vline, 6 ' ClgI', 11 sy-vline, 12 'PK', 14 sy-vline, 15 'Cost Centre',
* 26 sy-vline, 27 'BA ', 31 sy-vline, 32 'G/L acct', 42 sy-vline, 43 'S', 44 sy-vline, 45 'Account',
* 55 sy-vline, 56 'Account short text ', 76 sy-vline, 77 'Document no', 89 sy-vline ,90 'Type',92 sy-vline, 93 'Amount(INR) ', 108 sy-vline,
* 109 'Bill No.', 138 sy-vline,138 'Bill Date',152 sy-vline.
write :/ sy-vline,2 'Cost Centre',13 sy-vline, 14 'BA', 19 sy-vline, 20 'Document no', 31 sy-vline ,32 'Type',35 sy-vline, 36 'Amount(loc.curr) ',
52 sy-vline,53 'Curr',57 sy-vline ,58 'Amount(doc.curr)',75 sy-vline , 76 'Bill No.', 97 sy-vline,98 'Bill Date',109 sy-vline.

write :/ sy-uline(109).


loop at it_bseg where bukrs = i_bkpf-bukrs
and augbl = i_bkpf-belnr
and gjahr = i_bkpf-gjahr AND SHKZG = 'S'.

write: / sy-vline,2 it_bseg-kostl,13 sy-vline,14 it_bseg-gsber,19 sy-vline,20 it_bseg-belnr,31 sy-vline.

if it_bseg-shkzg = 'S'.
write : 32 'D'.
endif.

select single bldat xblnr waers into (w_bldat, w_xblnr, w_waers1) from bkpf where
bukrs = it_bseg-bukrs and gjahr = it_bseg-gjahr and belnr = it_bseg-belnr.

write: 35 sy-vline, 36 it_bseg-dmbtr ,52 sy-vline ,53 w_waers1,57 sy-vline,58 it_bseg-wrbtr,
75 sy-vline ,76 w_xblnr, 97 sy-vline , 98 w_bldat, 109 sy-vline.

endloop.
write :/ sy-uline(109).



ENDIF.
* if t_waers eq i_bkpf-waers.
* write :/ sy-uline(140).
* else.
** write :/ sy-uline(184).
* write :/ sy-uline(140).
* endif.

data : ws_belnr(132) type c, ws_wrbtr(132) type c.
data : ws_ZFBDT(132) type c, ws_wrbtr_temp(13) type n.
data : w_int type i.
data : w_date_f(132) type c.

skip 5.

if
( I_BKPF-BLART EQ 'B1' )
OR ( I_BKPF-BLART EQ 'B2' )
OR ( I_BKPF-BLART EQ 'B3' )
OR ( I_BKPF-BLART EQ 'B4' )
OR ( I_BKPF-BLART EQ 'B5' )
OR ( I_BKPF-BLART EQ 'B6' )
OR ( I_BKPF-BLART EQ 'BA' )
OR ( I_BKPF-BLART EQ 'BB' )
OR ( I_BKPF-BLART EQ 'BC' )
OR ( I_BKPF-BLART EQ 'BD' )
OR ( I_BKPF-BLART EQ 'B7' ).

WRITE: / 'Subject To Realisation of Cheque'.
ENDIF.



* if sy-subrc eq 0.



write :/ sy-uline(105).

write :/ sy-vline,
35 sy-vline,
70 sy-vline,
105 sy-vline.

write :/ sy-vline,
35 sy-vline,
70 sy-vline,
105 sy-vline.

write :/ sy-vline,
35 sy-vline,
70 sy-vline,
105 sy-vline.

write :/ sy-vline,
35 sy-vline,
70 sy-vline,
105 sy-vline.

write :/ sy-vline,
35 sy-vline,
70 sy-vline,
105 sy-vline.

write :/ sy-vline,
35 sy-vline,
70 sy-vline,
105 sy-vline.


write :/ sy-vline,
2 sy-uname,
35 sy-vline,
70 sy-vline,
105 sy-vline.


write :/ sy-vline,
2 'Prepared by ',
35 sy-vline,
36'Checked by' ,
70 sy-vline,
71 'Authorised by',
105 sy-vline.
write :/ sy-uline(105).
* endif.

new-page.

endloop.


end-of-selection.

*----------------------
TOP-OF-PAGE.
*----------------------
read table i_bseg with key belnr = i_bkpf-belnr.
READ TABLE I_ADRC INDEX 1.
write :/ sy-uline(140).
format color col_normal.
write : /2(140) I_ADRC-NAME1.
write : /2(140) I_ADRC-STR_SUPPL1.
write : /2(140) I_ADRC-STR_SUPPL2.
write : /2(140) I_ADRC-STR_SUPPL3.
write : /2(140) I_ADRC-CITY1, 20 I_ADRC-POST_CODE1.
format reset.
write :/ sy-uline(140).
FORMAT COLOR COL_HEADING.
WRITE : / HEADER.
FORMAT RESET.
write :/ sy-uline(140).
read table i_brep index 1.
* split i_brep-sgtxt at '' into one two.

format color col_normal.
write :/ sy-vline,
2 'Doc.type ',
20 i_bkpf-blart.
read table i_t003t with key blart = i_bkpf-blart.
if sy-subrc eq 0.
write : '( ' ,
i_t003t-ltext,
' )'.

endif.
write: 60 sy-vline.
if ( I_BKPF-BLART EQ 'B1' )
OR ( I_BKPF-BLART EQ 'B2' )
OR ( I_BKPF-BLART EQ 'B3' )
OR ( I_BKPF-BLART EQ 'B4' )
OR ( I_BKPF-BLART EQ 'B5' )
OR ( I_BKPF-BLART EQ 'B6' )
OR ( I_BKPF-BLART EQ 'BA' )
OR ( I_BKPF-BLART EQ 'BB' )
OR ( I_BKPF-BLART EQ 'BC' )
OR ( I_BKPF-BLART EQ 'BD' )
OR ( I_BKPF-BLART EQ 'B7' ).

WRITE : 62 'Cheque/DD No.:', i_BREP-ZUONR.

endif.
write : 140 sy-vline.
format reset.
****************************
* read table i_brep
****************************
*read table i_BREP index 1.
*split i_brep-sgtxt at '' into one two.

write :/ sy-vline,
2 'Doc. number ',
20 i_bkpf-belnr,
35 'Company code ' ,
48 i_bkpf-bukrs,
* 65 'Fiscal year',
* 72 i_bkpf-gjahr,
60 sy-vline.
* 85 I_ADDR-ORT01.

* write : 125 sy-vline.
if ( I_BKPF-BLART EQ 'B1' )
OR ( I_BKPF-BLART EQ 'B2' )
OR ( I_BKPF-BLART EQ 'B3' )
OR ( I_BKPF-BLART EQ 'B4' )
OR ( I_BKPF-BLART EQ 'B5' )
OR ( I_BKPF-BLART EQ 'B6' )
OR ( I_BKPF-BLART EQ 'BA' )
OR ( I_BKPF-BLART EQ 'BB' )
OR ( I_BKPF-BLART EQ 'BC' )
OR ( I_BKPF-BLART EQ 'BD' )
OR ( I_BKPF-BLART EQ 'B7' ).

write : 62 'Cheque/DD Date :', i_brep-valut.

endif.
write : 140 sy-vline.
*
*read table i_brep index 1.
*

read table i_skat with key saknr = i_bseg-hkont.
read table i_BREP index 1.
split i_brep-sgtxt at '' into one two.

write :/ sy-vline,
2 'Doc. date ',
20 i_bkpf-bldat,
35 'Posting Date ' ,
48 i_bkpf-budat,
* 65 'Period',
* 72 i_bkpf-monat,
60 sy-vline.
if ( I_BKPF-BLART EQ 'B1' )
OR ( I_BKPF-BLART EQ 'B2' )
OR ( I_BKPF-BLART EQ 'B3' )
OR ( I_BKPF-BLART EQ 'B4' )
OR ( I_BKPF-BLART EQ 'B5' )
OR ( I_BKPF-BLART EQ 'B6' )
OR ( I_BKPF-BLART EQ 'BA' )
OR ( I_BKPF-BLART EQ 'BB' )
OR ( I_BKPF-BLART EQ 'BC' )
OR ( I_BKPF-BLART EQ 'BD' )
OR ( I_BKPF-BLART EQ 'B7' ).

write : 62 'Drawn On:', two.

endif.
write : 140 sy-vline.

AMT = I_BSEG-DMBTR.

CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
AMT_IN_NUM = AMT
IMPORTING
AMT_IN_WORDS = W_WORD
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.


data : w_ln type i.


w_ln = strlen( w_word ).
write :/ sy-vline,
2 'Ref.doc. ' ,
20 i_bkpf-xblnr,
48 'Fiscal year',
55 i_bkpf-gjahr,
60 sy-vline.
write : 62 'Amount(In Words):'.

write : 140 sy-vline.


write :/ sy-vline,
2 'Doc. currency ' ,
20 i_bkpf-waers,
48 'Period',
55 i_bkpf-monat,
60 sy-vline,
62 W_Word(W_ln), 'Only'.
*write : 125 sy-vline.
write : 140 sy-vline.

write :/ sy-vline,
2 'Doc.head.text ',
20 i_bkpf-bktxt,
60 sy-vline.

*write : 125 sy-vline.
write : 140 sy-vline.
write :/ sy-uline(140).

No comments:

link us...

For Visitors

if you want to publish or Add something on ERP, SAP , SAP FUNCTIONAL, SAP ABAP then mail us along with your email-id. contain must be yours

email-id :- avinashkr_raj@yahoo.com(any email)

email-id :- avinaskr_raj.abap@blogger.com ( use only gmail)