How i can add document nu in below query
i want to add one field in below query
field is bkpf-xblnr
i want document number after d_text.
here d_text = 'Payment for'
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'D_TEXT'.
tab_out-value = d_text.
MODIFY tab_out INDEX sy-tabix.
please help
thanks in advanced.
hi help yar i m totaly new for this
i m pasting whole code here just see yar and where u changing please hight light that things
thanks yar
PROGRAM zfisp0001.
*& Subroutine pool ZFISP0001 *
*& Author: Rakesh Rao on 01.04.05 *
*& Modified by: Rakesh Rao on 15.07.2005 *
*& Description: This subroutine pool is called from Check and Payment *
*& Advice SAPScripts *
TABLES: itcsy.
TYPES: BEGIN OF t_itcsy.
INCLUDE STRUCTURE itcsy.
TYPES: END OF t_itcsy.
DATA: tab_in TYPE STANDARD TABLE OF t_itcsy WITH NON-UNIQUE
DEFAULT KEY INITIAL SIZE 0.
DATA: tab_out TYPE STANDARD TABLE OF t_itcsy WITH NON-UNIQUE
DEFAULT KEY INITIAL SIZE 0.
DATA: d_count(3) VALUE 0,
d_netamt_tot TYPE p DECIMALS 2,
d_tdsamt_tot TYPE p DECIMALS 2,
d_grossamt_tot TYPE p DECIMALS 2,
d_tdsamt TYPE p DECIMALS 2.
DATA flag.
DATA: bschl LIKE bseg-bschl.
DATA: shkzg LIKE bseg-shkzg.
clear: d_count,d_netamt_tot.
*& Form ZPAYMENT
text
--> p1 text
<-- p2 text
FORM zpayment TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.
tables : bsak.
TYPES: imis_type_c20(20) TYPE c,
imis_type_c10(10) TYPE c.
DATA: l_intern TYPE imis_type_c20.
DATA: e_intern TYPE imis_type_c10.
DATA: i_extern TYPE imis_type_c10.
DATA: d_belnr(10),
D_VBLNR(10),
d_bukrs TYPE bseg-bukrs,
d_gjahr TYPE bseg-gjahr,
d_gjahr1 TYPE bseg-gjahr, " 15.07.2005 Rakesh
d_buzei TYPE bseg-buzei,
d_augbl TYPE bseg-augbl,
d_umskz TYPE bseg-umskz,
d_bschl TYPE bseg-bschl,
d_bktxt TYPE bkpf-bktxt,
d_budat(10),
d_rebzg TYPE bseg-rebzg,
D_SHKZG TYPE REGUP-SHKZG,
d_swnes TYPE regud-swnes,
d_netamt TYPE p DECIMALS 2,
d_tdsamt TYPE p DECIMALS 2,
d_discamt TYPE regud-wskto,
d_gross TYPE regud-wrbtr.
DATA: BEGIN OF t_bkpf,
bukrs TYPE bkpf-bukrs,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
budat TYPE bkpf-budat,
bktxt TYPE bkpf-bktxt,
xblnr TYPE bkpf-xblnr,
END OF t_bkpf.
DATA: BEGIN OF t_bseg,
bukrs TYPE bseg-bukrs,
belnr TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
buzei TYPE bseg-buzei,
umskz TYPE bseg-umskz,
bschl TYPE bseg-bschl,
qbshb TYPE bseg-qbshb,
augbl TYPE bseg-augbl,
rebzg TYPE bseg-rebzg,
rebzj TYPE bseg-rebzj,
sgtxt TYPE bseg-sgtxt,
xref1 TYPE bseg-xref1,
ebeln TYPE bseg-ebeln,
shkzg type bseg-shkzg,
END OF t_bseg.
DATA: num VALUE ' ',
d_result VALUE ' '.
DATA: d_symbol VALUE '/',
d_text(11) VALUE 'Payment for'.
DATA: d_belnr1 LIKE bseg-belnr.
DATA: wa_payrq TYPE payrq. " 15.07.2005 Rakesh
18.05.2006
data : wa_belnr like bseg-belnr,wa_augbl like bseg-augbl.
18.05.2006
06.09.2006
data : d_other type p decimals 2.
Read incoming data
*break-point.
*zpayment.
CLEAR: d_belnr,d_bukrs,d_gjahr,d_result.
clear d_tdsamt.
Company code
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BUKRS'.
d_bukrs = tab_in-value.
Document number
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BELNR'.
wa_belnr = d_belnr(10) = tab_in-value(10).
Posting Key
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BSCHL'.
d_bschl = tab_in-value.
Special G/L Indicator
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-UMSKZ'.
d_umskz = tab_in-value.
Fiscal year
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-GJAHR'.
d_gjahr = tab_in-value.
<-- 15.07.2005 Rakesh
Fiscal year1 - For Payment request case
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-GJAHR'.
d_gjahr1 = tab_in-value.
15.07.2005 Rakesh -->
Document item
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BUZEI'.
d_buzei = tab_in-value.
Discount amount, if any
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-WSKTO'.
REPLACE ALL OCCURRENCES OF ',' IN tab_in-value WITH ' '.
d_discamt = tab_in-value.
Gross Amount
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-WRBTR'.
REPLACE ALL OCCURRENCES OF ',' IN tab_in-value WITH ' '.
d_gross = tab_in-value.
Gross Amount
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-WNETT'.
REPLACE ALL OCCURRENCES OF ',' IN tab_in-value WITH ' '.
d_netamt = tab_in-value.
Clearing document 18.05.2006
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
wa_augbl = tab_in-value.
DEBIT/CREDIT INDICATOR
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-SHKZG'.
d_SHKZG = tab_in-value(1).
IF d_netamt < 0 AND D_SHKZG = 'S'.
D_NETAMT = D_NETAMT * '-1'.
ENDIF.
Check document no. is clearing document than reset wnett = 0.
18.05.2006
select single * from bsak where augbl = wa_augbl
and bukrs = d_bukrs and gjahr = d_gjahr1.
if sy-subrc = 0 and wa_belnr = wa_augbl.
d_netamt = 0.
endif.
18.05.2006
Check if Down payment request
IF d_bschl = '39'.
This line item is not considered
d_result = 'X'.
ELSE.
Check if Down payment
IF d_bschl = '29'
and wa_augbl = wa_belnr. "18.05.2006
IF d_umskz EQ 'A'
OR d_umskz EQ 'B'
OR d_umskz EQ 'I'
OR d_umskz EQ 'M'
OR d_umskz EQ 'D'.
Put Document Number of the Payment Document value to 'd_belnr'
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
ENDIF.
ENDIF.
<--15.07.2005 Rakesh
Check if Payment request exists in 'payrq'
CLEAR wa_payrq.
Convert 'd_belnr' to 10 digits,if required
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
d_belnr1 = d_belnr.
CLEAR d_belnr.
d_belnr = e_intern.
SELECT SINGLE keyno augbl FROM payrq
INTO CORRESPONDING FIELDS OF wa_payrq
WHERE keyno = d_belnr.
IF sy-subrc = 0. " Yes
Take clearing document which is the required accounting document
d_belnr = wa_payrq-augbl.
Convert 'd_belnr' to 10 digits,if required
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
CLEAR d_belnr.
d_belnr = e_intern.
Assign 'd_gjahr1' to 'd_gjahr' as this is relevant here.
d_gjahr = d_gjahr1. " 15.07.2005 Rakesh
Get BSEG data
SELECT SINGLE bukrs belnr gjahr buzei augbl rebzg rebzj
sgtxt qbshb umskz bschl xref1 ebeln
FROM bseg INTO CORRESPONDING FIELDS OF t_bseg
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr
AND buzei EQ d_buzei " not relevant
AND bschl EQ '25' " Posting key - Outgoing payment
AND koart EQ 'S' " G/L accounts
AND shkzg EQ 'S'. " Debit
ELSE. " No
For all other cases, we use this final logic, even though we have
taken d_belnr value from accounting doc no., in some earlier cases.
Put document number of the payment document(vblnr) value to 'd_belnr',
IF d_bschl = '29'
and wa_augbl <> wa_belnr. "18.05.2006
IF d_umskz EQ 'A'
OR d_umskz EQ 'B'
OR d_umskz EQ 'I'
OR d_umskz EQ 'M'
OR d_umskz EQ 'D'.
else.
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
endif.
else.
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
endif.
-->15.07.2005
Convert 'd_belnr' to 10 digits,if required
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
CLEAR d_belnr.
d_belnr = e_intern.
Get BSEG data
SELECT SINGLE bukrs belnr gjahr buzei augbl rebzg rebzj
sgtxt qbshb umskz bschl xref1 ebeln shkzg
FROM bseg INTO CORRESPONDING FIELDS OF t_bseg
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr1
"changed by Bharat 15.04.2006 - d_gjahr1 contains payment doc fiscal yea
"r and d_gjahr contains invoice fiscal year
AND buzei EQ d_buzei "amisha 10-10-2005
AND bschl EQ '25' " Posting key - Outgoing payment
AND shkzg EQ 'S' "added by Bharat 17.04.2006
AND ( koart EQ 'K' OR koart EQ 'D').
<--15.07.2005 Rakesh
18.05.2006
in clearing document payment advice not consider TDS amount of
payment document
if wa_belnr <> wa_augbl and d_shkzg = 'S'.
t_bseg-qbshb = t_bseg-qbshb * '-1'.
d_netamt = d_netamt + t_bseg-qbshb.
t_bseg-qbshb = 0.
endif.
18.05.2006
ENDIF.
-->15.07.2005
Get corresponding BKPF data
If Down payment
IF d_bschl = '29'.
IF d_umskz EQ 'A'
OR d_umskz EQ 'B'
OR d_umskz EQ 'I'
OR d_umskz EQ 'M'
OR d_umskz EQ 'D'.
SELECT SINGLE bukrs belnr gjahr budat bktxt xblnr
FROM bkpf INTO CORRESPONDING FIELDS OF t_bkpf
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr1.
"changed by Bharat 15.04.2006 - d_gjahr1 contains payment doc fiscal yea
"r and d_gjahr contains invoice fiscal year
ENDIF.
ELSE.
If Partial payment/On-account payment
IF t_bseg-augbl IS INITIAL.
On-Account case
IF t_bseg-augbl IS INITIAL.
IF t_bseg-rebzg IS INITIAL.
t_bseg-rebzg = t_bseg-belnr. " Payment Document Number
t_bseg-rebzj = t_bseg-gjahr. " Fiscal year
ENDIF.
ENDIF.
SELECT SINGLE bukrs belnr gjahr budat bktxt xblnr
FROM bkpf INTO CORRESPONDING FIELDS OF t_bkpf
WHERE bukrs EQ t_bseg-bukrs
AND belnr EQ t_bseg-rebzg
AND gjahr EQ t_bseg-rebzj.
ELSE.
FULL PAYMENT with Discount
clear d_tdsamt.
Following code added for GSPL by bharat06092006
if d_bukrs eq 'GSPL'.
DATA : V_TEXT(20) TYPE C.
V_TEXT = 'W%'.
SELECT SINGLE wrbtr FROM bseg
INTO d_tdsamt
WHERE bukrs EQ d_bukrs AND
belnr EQ d_belnr1 AND
gjahr EQ d_gjahr AND " Added by bharat on 10-04-2006 fiscal year
bschl EQ '50' AND
KTOSL EQ 'WIT' AND
QSSKZ NOT LIKE V_TEXT.
SELECT single wrbtr FROM bseg
INTO d_other
WHERE bukrs EQ d_bukrs AND
belnr EQ d_belnr1 AND
gjahr EQ d_gjahr AND " Added by bharat on 10-04-2006 fiscal year
bschl EQ '50' AND
KTOSL EQ 'WIT' AND
QSSKZ LIKE V_TEXT.
ELSE.
Added by bharat 06.09.2006
SELECT SINGLE wrbtr
FROM bseg INTO d_tdsamt
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr1
AND gjahr EQ d_gjahr
" Added by bharat on 10-04-2006 fiscal year
AND bschl EQ '50' AND KTOSL EQ 'WIT'.
ENDIF.
SELECT SINGLE bukrs belnr gjahr budat bktxt xblnr
FROM bkpf INTO CORRESPONDING FIELDS OF t_bkpf
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr1.
"changed by Bharat 15.04.2006 - d_gjahr1 contains payment doc fiscal yea
"r and d_gjahr contains invoice fiscal year
tab_in-value
*d_tdsamt_tot
ENDIF.
ENDIF.
IF sy-subrc = 0.
Sr. no. for Line items
d_count = d_count + 1.
ELSE.
Else, this line item is not considered
d_result = 'X'.
ENDIF.
ENDIF. " if d_bschl = '39'
Pass the output to the outgoing table 'tab_out', if 'd_result' is not
*set.
IF d_result = ' '.
Line count
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'COUNT'.
tab_out-value = d_count.
MODIFY tab_out INDEX sy-tabix.
Result flag
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'RESULT1'.
tab_out-value = d_result.
MODIFY tab_out INDEX sy-tabix.
Clearing document
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'AUGBL'.
tab_out-value = t_bseg-augbl.
MODIFY tab_out INDEX sy-tabix.
IF d_bschl <> '29'.
On-Account case
IF t_bseg-augbl IS INITIAL.
IF t_bseg-rebzg IS INITIAL.
t_bseg-rebzg = t_bseg-belnr. " Payment Document Number
ENDIF.
ENDIF.
ELSE.
Payment document request
IF NOT t_bseg-ebeln IS INITIAL. " First preference
t_bseg-rebzg = t_bseg-ebeln.
ELSE.
t_bseg-rebzg = d_belnr.
ENDIF.
ENDIF.
Number of the Invoice the Transaction Belongs to
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'REBZG'.
SHIFT t_bseg-rebzg LEFT DELETING LEADING num.
tab_out-value = t_bseg-rebzg.
MODIFY tab_out INDEX sy-tabix.
Document number - check use??
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'BELNR'.
tab_out-value = d_belnr. " check!!
MODIFY tab_out INDEX sy-tabix.
Net amount
d_netamt = d_gross - d_discamt - t_bseg-qbshb.
Gross amount
d_gross = d_netamt + d_tdsamt + t_bseg-qbshb.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'NETAMT'.
tab_out-value = d_netamt.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
TDS Amount
IF t_bseg-qbshb IS INITIAL.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'TDSAMT'.
tab_out-value = d_tdsamt.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
Added by bharat 06.09.2006
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'D_OTHER'.
tab_out-value = d_other.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
Added by bharat 06.09.2006
ELSE.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'TDSAMT'.
tab_out-value = t_bseg-qbshb.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
ENDIF.
*Calculate Total Net amount & TDS amount which is stored in Global
*memory and accessed later
from 'FORM Z_TOTAL_AMT'
d_netamt_tot = d_netamt_tot + d_netamt.
d_grossamt_tot = d_grossamt_tot + d_gross.
d_tdsamt_tot = d_tdsamt_tot + t_bseg-qbshb + d_tdsamt + d_other.
CLEAR: tab_OUT-value,tab_out-name.
READ TABLE tab_OUT WITH KEY 'NETAMT_TOT'.
tab_out-value = d_netamt_tot.
shift tab_out-value left deleting leading space.
MODIFY tab_out INDEX sy-tabix.
Document Header text
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'BKTXT'.
IF d_bschl = '29'.
tab_out-value = t_bseg-sgtxt. " for down payment request
ELSE.
tab_out-value = t_bkpf-bktxt.
ENDIF.
MODIFY tab_out INDEX sy-tabix.
Reference Document Number - Header
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'XBLNR'.
IF d_bschl = '29'.
tab_out-value = t_bseg-xref1. " for down payment request
ELSE.
tab_out-value = t_bkpf-xblnr.
ENDIF.
MODIFY tab_out INDEX sy-tabix.
Symbol '/'
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'D_SYMBOL'.
tab_out-value = d_symbol.
MODIFY tab_out INDEX sy-tabix.
Text 'Payment for'
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'D_TEXT'.
tab_out-value = d_text.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'D_TEXT'.
tab_out-value = d_text.
tab_out-xblnr = t_bkpf-xblnr.
MODIFY tab_out by bkpf-xblnr INDEX sy-tabix.
Posting date
CLEAR d_budat.
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
date_internal = t_bkpf-budat
IMPORTING
date_external = d_budat
EXCEPTIONS
date_internal_is_invalid = 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.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'BUDAT'.
tab_out-value = d_budat.
MODIFY tab_out INDEX sy-tabix.
ELSE.
Result flag
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'RESULT1'.
tab_out-value = d_result.
MODIFY tab_out INDEX sy-tabix.
ENDIF.
d_gross = d_netamt + d_tdsamt + t_bseg-qbshb.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'GROSSAMT'.
tab_out-value = d_gross.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
ENDFORM. " ZPAYMENT
*& Form zamtwords
text - If only 'Net Amount' is required
--> p1 text
<-- p2 text
FORM zamtwords TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.
DATA: d_swnet TYPE regud-swnes, " take character format type
d_swnet1 TYPE bseg-dmbtr.
d_words(160),
d_words1(80),
d_words2(80).
<-- 21.05.2005
DATA: d_words(160),
d_words1(80) TYPE c,
d_words2(80) TYPE c.
DATA: len TYPE i.
<-- 21.05.2005
*zamtwords
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-SWNET'.
d_swnet = tab_in-value.
REPLACE ALL OCCURRENCES OF '*' IN d_swnes WITH ' '.
REPLACE ALL OCCURRENCES OF ',' IN d_swnet WITH ' '.
d_swnet1 = d_swnet.
CLEAR d_swnet.
PERFORM z_conv_amt USING d_swnet1 CHANGING d_swnet.
Return 'SWNET1' without commas
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'SWNET1'.
d_swnet = d_swnet1.
tab_out-value = d_swnet.
MODIFY tab_out INDEX sy-tabix.
Amount in Indian currency format
CALL FUNCTION 'Z_SPELL_AMOUNT_INR'
EXPORTING
amount = d_swnet1
IMPORTING
rupees_str = d_words.
Adjust 'd_words' left aligned
SHIFT d_words LEFT DELETING LEADING space.
<-- 21.05.2005
Split 'd_words' into 'd_words1' and 'd_words2'
since 'DEFINE' in SAPScript displays maximum 80 characters
d_words1 = d_words(80).
d_words2 = d_words+80(80).
*CALL FUNCTION 'C147_STRING_SPLIT_AT_POSITION'
EXPORTING
i_string = d_words
i_position = 80
IMPORTING
E_HEAD = d_words1
E_TAIL = d_words2.
len = STRLEN( d_words ).
Only 80 characters can be passed to one SAPScript symbol
Split 'd_words' into 'd_words1' and 'd_words2'
since 'DEFINE' in SAPScript displays maximum 80 characters
Check if string split is required
IF len > 80.
d_words1 = d_words(80). " First 80
d_words2 = d_words+80(80). " Next 80
Introduce an initial space in 'd_words2' if 80th character in
'd_words1' is space, as this space is not considered when 'd_words1'
value is passed to the SAPScript, since we need proper spacing
between 'd_words1' and 'd_words2' in the Cheque layout.
IF d_words1+79(1) = ' '.
SHIFT d_words2 RIGHT BY 1 PLACES.
ENDIF.
ELSE.
d_words1 = d_words.
d_words2 = space.
ENDIF.
21.05.2005 -->
Amount in words1
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'WORDS'.
tab_out-value = d_words1.
MODIFY tab_out INDEX sy-tabix.
Amount in words2
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'WORDS1'.
tab_out-value = d_words2.
MODIFY tab_out INDEX sy-tabix.
ENDFORM. " zamtwords
*& Form z_address
text
--> p1 text
<-- p2 text
FORM z_address TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.
DATA d_bukrs TYPE bseg-bukrs.
DATA: t_t001 TYPE t001,
t_adrc TYPE adrc.
CLEAR: tab_in-value,t_t001,t_adrc.
READ TABLE tab_in WITH KEY 'REGUP-BUKRS'.
d_bukrs = tab_in-value.
CALL FUNCTION 'K_READ_T001'
EXPORTING
i_bukrs = d_bukrs
IMPORTING
e_t001 = t_t001
EXCEPTIONS
not_found = 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.
ELSE.
CALL FUNCTION 'RTP_US_DB_ADRC_READ'
EXPORTING
i_address_number = t_t001-adrnr
I_NATION = ' '
I_READ_DB =
IMPORTING
e_adrc = t_adrc
EXCEPTIONS
not_found = 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.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'ADRC-NAME1'.
tab_out-value = t_adrc-name1.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'ADRC-STREET'.
tab_out-value = t_adrc-street.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'ADRC-CITY1'.
tab_out-value = t_adrc-city1.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'ADRC-POST_CODE1'.
tab_out-value = t_adrc-post_code1.
MODIFY tab_out INDEX sy-tabix.
ENDIF.
ENDFORM. " z_address
*& Form z_total_amt
text
--> p1 text
<-- p2 text
FORM z_total_amt TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'NETAMT_TOT'.
tab_out-value = d_netamt_tot.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'TDSAMT_TOT'.
tab_out-value = d_tdsamt_tot.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'GROSSAMT_TOT'.
tab_out-value = d_grossamt_tot.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
ENDFORM. " z_total_amt
*& Form Z_NET_AMT
text
-->TAB_IN text
-->TAB_OUT text
FORM z_net_amt TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.
TYPES: imis_type_c20(20) TYPE c,
imis_type_c10(10) TYPE c.
DATA: l_intern TYPE imis_type_c20.
DATA: e_intern TYPE imis_type_c10.
DATA: i_extern TYPE imis_type_c10.
DATA: d_belnr(10),
d_bukrs TYPE bseg-bukrs,
d_gjahr TYPE bseg-gjahr,
d_umskz TYPE bseg-umskz,
d_bschl TYPE bseg-bschl,
d_dmbtr1 TYPE bseg-dmbtr,
d_dmbtr(17). "prb16052006
d_dmbtr1 like regud-swnes. "prb16052006
DATA d_amt TYPE char18.
DATA: BEGIN OF t_bseg OCCURS 10,
bukrs TYPE bseg-bukrs,
belnr TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
buzei TYPE bseg-buzei,
dmbtr TYPE bseg-dmbtr,
wrbtr TYPE bseg-wrbtr,
umskz TYPE bseg-umskz,
bschl TYPE bseg-bschl,
qbshb TYPE bseg-qbshb,
NEbtR TYPE BSEG-nebtr, "prb13052006
END OF t_bseg.
<-- 21.05.2005
DATA: d_words(160),
d_words1(80) TYPE c,
d_words2(80) TYPE c.
DATA: len TYPE i.
<-- 21.05.2005
DATA wa_payrq TYPE payrq. " 15.07.2005 Rakesh
Read incoming data
CLEAR: d_belnr,d_bukrs,d_gjahr.
Company code
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BUKRS'.
d_bukrs = tab_in-value.
Document number
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BELNR'.
d_belnr(10) = tab_in-value(10).
Posting Key
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BSCHL'.
d_bschl = tab_in-value.
Special G/L Indicator
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-UMSKZ'.
d_umskz = tab_in-value.
Fiscal Year
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-GJAHR'. " Note
CHECK sy-subrc = 0.
d_gjahr = tab_in-value.
Check if Down payment
IF d_bschl = '29'.
IF d_umskz EQ 'A'
OR d_umskz EQ 'B'
OR d_umskz EQ 'I'
OR d_umskz EQ 'M'
OR d_umskz EQ 'D'.
Put Document Number of the Payment Document value to 'd_belnr'
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
ENDIF.
ENDIF.
Check if Down payment request
IF d_bschl = '39'.
Put Document Number of the Payment Document value to 'd_belnr'
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
ENDIF.
<--15.07.2005 Rakesh
Check if Payment request exists in 'payrq'
CLEAR wa_payrq.
Convert 'd_belnr' to 10 digits,if required
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
CLEAR d_belnr.
d_belnr = e_intern.
SELECT SINGLE keyno augbl FROM payrq
INTO CORRESPONDING FIELDS OF wa_payrq
WHERE keyno = d_belnr.
IF sy-subrc = 0. " Yes
Take clearing document which is the required accounting document
d_belnr = wa_payrq-augbl.
Convert 'd_belnr' to 10 digits,if required
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
CLEAR d_belnr.
d_belnr = e_intern.
Get BSEG data
SELECT bukrs belnr gjahr buzei augbl rebzg rebzj sgtxt dmbtr wrbtr
qbshb nebtr
FROM bseg INTO CORRESPONDING FIELDS OF TABLE t_bseg
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr
AND buzei EQ d_buzei
AND bschl EQ '25'
AND koart EQ 'S' " G/L accounts
AND shkzg EQ 'S'. " Debit
ELSE. " No
For all other cases, we use this final logic, even though we have
taken d_belnr value from accounting doc no., in some earlier cases.
Put document number of the payment document(vblnr) value to 'd_belnr',
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
-->15.07.2005
Convert 'd_belnr' to 10 digits.
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
CLEAR d_belnr.
d_belnr = e_intern.
*BSEG - PARTIAL PAYMT/FULL PAYMT WT DISC - Get Total Amount without Bank
*charges
SELECT bukrs belnr gjahr buzei augbl rebzg rebzj sgtxt dmbtr wrbtr
qbshb bschl NEBTR
FROM bseg INTO CORRESPONDING FIELDS OF TABLE t_bseg
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr
AND buzei EQ d_buzei
AND bschl EQ '25'
AND ( koart EQ 'K' OR koart EQ 'D' ).
<--15.07.2005 Rakesh
ENDIF.
-->20.10.2005 By Yogesh.
CLEAR d_dmbtr.
IF sy-subrc = 0.
LOOP AT t_bseg.
d_dmbtr = d_dmbtr + t_bseg-dmbtr - t_bseg-qbshb.
SELECT SINGLE shkzg INTO (shkzg) FROM tbsl
WHERE bschl = t_bseg-bschl.
*BREAK-POINT.
*******prb13052
IF shkzg = 'S'.
d_dmbtr = d_dmbtr + t_bseg-wrbtr - t_bseg-qbshb.
ELSEIF shkzg = 'H'.
d_dmbtr = d_dmbtr - t_bseg-wrbtr - t_bseg-qbshb.
ENDIF.
IF shkzg = 'S'.
d_dmbtr = d_dmbtr + t_bseg-nebtr." - t_bseg-qbshb.
ELSEIF shkzg = 'H'.
if t_bseg-nebtr <> ''.
d_dmbtr = d_dmbtr - t_bseg-nebtr." - t_bseg-qbshb.
else.
d_dmbtr = d_dmbtr - t_bseg-wrbtr." - t_bseg-qbshb.
endif.
ENDIF.
*tables: reguh, payr.
select single * from reguh where zbukr = d_bukrs
and vblnr = d_belnr
and LAUFD+6(4) = d_gjahr.
*select single * from payr where zbukr = d_bukrs
*and vblnr = d_belnr
*and hbkid = reguh-hbkid
*and hktid = reguh-hktid.
*d_dmbtr = payr-rwbtr.
*if d_dmbtr < 0.
*d_dmbtr = d_dmbtr * ( -1 ).
*endif.
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-SWNES'.
d_DMBTR = tab_in-value.
translate d_dmbtr using '* '.
translate d_dmbtr using ', '.
condense d_dmbtr no-gaps.
d_dmbtr1 = d_dmbtr.
*******prb13052
ENDLOOP.
PERFORM z_conv_amt USING d_dmbtr CHANGING d_amt.
*Pass the Net Amount output to the outgoing table tab_out-name =
*'NETAMT_TOT'.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'NETAMT_TOT'.
tab_out-value = d_amt.
" For inserting '*' ahead of value
SHIFT tab_out-value LEFT DELETING LEADING space. """"????IMP
MODIFY tab_out INDEX sy-tabix.
Get the Amount in words for Indian currency
Can also use the FM 'HR_IN_CHG_INR_WRDS'
CALL FUNCTION 'Z_SPELL_AMOUNT_INR'
EXPORTING
amount = d_dmbtr1
IMPORTING
rupees_str = d_words.
Shift left since above Function Module introduces an initial space
SHIFT d_words LEFT DELETING LEADING space.
<-- 21.05.2005
*CALL FUNCTION 'C147_STRING_SPLIT_AT_POSITION'
EXPORTING
i_string = d_words
i_position = 80
IMPORTING
E_HEAD = d_words1
E_TAIL = d_words2.
len = STRLEN( d_words ).
Only 80 characters can be passed to one SAPScript symbol
Split 'd_words' into 'd_words1' and 'd_words2'
since 'DEFINE' in SAPScript displays maximum 80 charact
Similar Messages
-
How we can add custom field in standard report 2kee.
Hi,
How we can add custom field in standard report 2kee.
I need one extra field to add in 2kee report for the same is there any customization req.
Regards
RaviRavi,
Which extra field do you want to add or see? Without specifying the field, it is difficult for one to tell you precisely whether you need a custom field or just change the layout to get the standard one.
There are so many fields which exists but are not displayed when you execute 2KEE. You need to change the layout selections to your preference.
Nonetheless, if the field you want to add does not already exist, then yes you can do customization. Is there a customization requirement? No. But remember, you are making changes to SAP Standard program which will no longer be supported by SAP should in the case an issue arise in the future related to this very program.
Have your abaper add the said field in the program or why not just create a query to pull the report?
Elias
Edited by: Elias Akorli on Sep 18, 2009 9:02 PM -
I am making a graduation video for my cousin using Final Cut Pro. I have photos layered over videos, and I was wanted to find out how you can add a border around the photos so they stand off of the video. Anyone know what I could do?
You would need an image editor to edit the images and add a border to the image first before importing them into Final Cut.
Cheapest and very good image editor?
PIxelmator.
Located in the Mac App Store. $14.99 USD.
Here is the Pixelmator website to give you an overview of the app.
http://www.pixelmator.com/
Good Luck! -
When sending an email I used to be able to click on a distribution list in my contacts and it would add all the email addresses, I now have to add each email address individually and this takes a lot of time. Could someone tell me how I can add a distibution list/group to my emails?
Barney,
I have four groups.
I just typed the name of one of those groups in the To field on the iPhone's email, and received:
Invalid Address
"<group name>" does not appear to be a valid email address. Do you want to send it anyway?
I clicked continue and it remains in my outbox.
Help is appreciated.
Thanks,
Michael -
HT1937 how i can add the ipad in my acount using the s.n. only
how i can add the ipad to my acount without connecting it to the pc only using the serial number
Sorry. The question doesn't make sense.
-
HT1347 from this site how i can add software to iphone
from this site how i can add software to iphone
From what site?
You can only get apps/softare from the app store in itunes. -
Hi. How I can add russian keyboard in to Firefox OS?
I am using OS on nexus 4.
Version Firefox OS 1.1
Instruction to install http://www.addictivetips.com/android/dual-boot-android-ubuntu-touch-or-firefox-os-on-nexus-4-7-with-multirom/
Thanks.Hello,
As per the release notes of [https://www.mozilla.org/en-US/firefox/os/notes/1.1/ FirefoxOS 1.1] the Russian locale is supported. So, you wouldn't need to add a keyboard separately. Can you please confirm what is the issue you are seeing when you try to select the locale as Russian? Are you not able to view the Russian keyboard?
Thank you -
I bought my iPad from USA. How I can add Arabic keyboard to iPad?
I bought my ipad from usa. how i can add arabic keyboard to it?
Settings > General > Keyboard > International Keyboards > Add New Keyboard > Arabic.
-
How to configure add document types in pr
how to configure add document types in pr
Hi
Just check out the following document for Configuring PO doc tpe , PR config is similar to that just need to do selection form PR
[Po doc configuration|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/703cdc83-d604-2c10-c79c-c30eab6c56a8?QuickLink=index&overridelayout=true ] -
How i can add music from my computer to my i5c
how i can add music from my computer to my i5c
Use iTunes on your computer to sync music to your iPhone.
See: http://support.apple.com/kb/ht1386 -
8100 doesnt support Russian..Any suggestions on how i can add the language?
hey,
I just got a new pearl 8100. Russian language is not on the list for language support. Any suggestions on how i can add russian language? thanks for any help.
AInstall multi-langual Blackberry OS on to your device.
Check this link
It may be helpful for you to find the necessary OS package. -
Hola, necesito agregar un archivo PDF o JPG a un boton en Flash Catalyst... como lo hago???
Hello, i need to add a file (PDF, JPG) to a button in flash catalyst... how can i do that???Hello Saransoft84:
I saw that, my script not same as your script, but I do not know how I can write it as you, from where in action script I can found your command, as: but.onPress = function():Void
You attached same my file, I am very sorry as I trouble you in simple problem, but I did not found solution yet.
Regards -
How I can add polishkeyboard in to Firefox OS?
My ZTE open c does not support the Polish language. This is not a problem for me.
I have a problem with writing in Polish. Is there any way to change the keyboard layout in Firefox OS 1.3?You can add Polski(Polish) keyboard from settings app, See:
* https://support.mozilla.org/kb/keyboard-settings-and-tips-firefox-os -
How i can add jar or dll file to VM lib by code or installer
iam working at project to interact with rs232 port using comm api
to work program corectly i must insert some files(jar,dll,broperty files)
to the VM by copy and past ...
the problem is how i can do it by installer?
iam will be very thanks if i get helpReader has to be installed on the user's machine and most folks have already installed a PDF reader. You do not supply the code, but provide a link to Reader at the Adobe site so folks can get it if needed. There are many sites that provide such. If you distribute the code yourself, you have to follow certain rules and get permission. I am not sure, but I do not think there is any issue with providing the link, though you may have to have permission to use the Adobe logo with the link.
-
How I can add a LOV in Business View Manager?
Hi,
I am working with crystal report XI. After finishing with a report, I published it on Business Object Enterprises.(I will connect with it remotely from my system)
I am having priviledge to log in into InfoView to check the same report there.
But i don't know about Business View Manager. How I can access it. I need to contact administrator for that?
Thanks in advance...Hi Deepak,
You can find Business View Manager at the following path if it is installed on your machine.
Click on Start>All Program>BusinessObjects XI Release 2>BusinessObjects Enterprise>Business View Manager.
In case it is not installed you can contact your administrator
To know more about Business View Manager go to http://help.sap.com and under Business Objects tab search for u2018xi3_bv_admin_en.pdfu2019. Select Product as Business Objects Enterprise.
Please let us know if this solves your queries.
Regards,
Aditya Joshi
Edited by: Aditya Joshi on Oct 1, 2008 12:12 PM
Edited by: Aditya Joshi on Oct 1, 2008 12:15 PM
Maybe you are looking for
-
I have a image gallery (slideshow) created with Flash and XML. My website uses a css/javasript dropdown menu for navigation. The dropdown menu is hiding behind the slideshow no matter what I set it's z-index to. Is there something in flash that lets
-
Problems in pdk and jpdk samples?
Any known problems in the samples externalApp and iFame that comes with the latest PDK and JPDK? I tried to install these samples by following exactly the steps in the installation html files. But, when trying to test the installation in the last ste
-
Hi guys, I am just wanting to know how to do, hopefully something simple. I have a logo which I can drag around the screen. When I drop this logo over a particular area I call a fuction to run. This works perfect except the fact it doesnt work, if th
-
Preventing expired batch from being sold
Currently in one of our client's setup, I can select expired batch from the list of items. Is there a way to prevent expired items from being selected when creating sales order (VA01) or, if the user can select the expired item, at least display an e
-
Workspace not retaining presets
I'm running Premiere 5.5 and recently it has stopped holding onto my Workspace settings. I had set up a custom Workspace on my second monitor and used it for weeks. Now all the items in the worplace are centered in my second monitor when I open Premi