HR_IN_CHG_INR_WRDS
hi experts ,
i have the following code sample.
TABLES: mseg.
TYPES: BEGIN OF st_tab ,
matnr LIKE mseg-matnr,
werks LIKE mseg-werks,
waers LIKE mseg-waers,
dmbtr LIKE mseg-dmbtr,
END OF st_tab.
DATA: itab TYPE STANDARD TABLE OF st_tab INITIAL SIZE 0,
wa TYPE st_tab,
wa_loop TYPE st_tab.
DATA: sum_comp TYPE p DECIMALS 2.
DATA:word1 TYPE spell.
DATA: V_WORD TYPE STRING.
SELECT matnr werks waers dmbtr FROM mseg INTO TABLE itab WHERE matnr <> ' '.
SORT itab BY matnr werks.
LOOP AT itab INTO wa.
wa_loop = wa.
AT NEW matnr.
WRITE:/5 'MAT-NO.' , wa_loop-matnr.
SKIP.
ENDAT.
AT NEW werks.
WRITE:/12 'PLANT#' , 20 wa_loop-werks .
ENDAT.
WRITE:/39 wa_loop-dmbtr.
AT END OF werks.
SUM.
sum_comp = wa-dmbtr.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = sum_comp
currency = 'INR'
FILLER = ' '
language = sy-langu
IMPORTING
in_words = word1
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
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 word1-word SPACE
' Rupees'
word1-decword
' Paise'
into v_word.
SKIP.
ULINE AT 42(22).
WRITE:/38 sum_comp COLOR 4.
WRITE:/61 v_word color 3.
sum_comp = 0.
SKIP.
ENDAT.
ENDLOOP.
on executing it i am getting amount in words in millionsand not coming in lakhs or crores i.e i want in indian format
i have to use fm HR_IN_CHG_INR_WRDS.
but how to utilize it in code and how to declare the variables used in this fm.pls give me the modify code.
urgent
tregards
pankaj
hi
good
pls check this code,
*& Report ZFI_CREDIT_NOTE_CREATION
REPORT ZFI_CREDIT_NOTE_CREATION NO STANDARD PAGE HEADING LINE-SIZE 120 line-count 72
message-id zvarun.
tables : vbrk,vbrp,kna1,konv,spell ,bsak.
data : camt like bsak-dmbtr.
data : begin of itab occurs 0,
vbeln like vbrk-vbeln,
fkdat like vbrk-fkdat,
xblnr like vbrk-xblnr,
knumv like vbrk-knumv,
kunrg like vbrk-kunrg,
matnr like vbrp-matnr,
arktx like vbrp-arktx,
fkimg like vbrp-fkimg,
posnr like vbrp-posnr,
end of itab.
data : begin of itab1 occurs 0,
knumv like konv-knumv,
kposn like konv-kposn,
kschl like konv-kschl,
kawrt like konv-kawrt,
kwert like konv-kwert,
KBETR LIKE KONV-KBETR,
end of itab1.
data : qty like vbrp-fkimg.
*data : tot type p decimals 2.
*data : tot1 type p decimals 2.
*data : tot2 type p decimals 2.
*data : tot3 type p decimals 2.
*data : tot like konv-kawrt.
data : sub_tot like konv-kawrt.
DATA : TOT2 LIKE KONV-KAWRT.
*DATA : TOT3 LIKE KONV-KAWRT.
*data : tot_wsp(15) type p.
data : tot_wsp(15) type p decimals 2.
data : unit_wsp like konv-kawrt.
data : tot_cst like konv-kWERT.
data : tot_VAT like konv-kWERT.
*data : unit_cst like konv-kawrt.
data : h_vbeln like vbrk-vbeln.
DATA : UNIT_MRP LIKE KONV-KBETR.
data line_no(3) type n.
data : credit_amt like konv-kwert.
DATA : cnt type i.
data amt_word like spell-word.
data : v_i_amount TYPE PC207-BETRG.
data : i_value like konv-kwert.
data : amt_in_words(255) TYPE c,
tmp_amt type TDSYMVALUE.
data : spell_fig(80).
DATA : VAT_AMT LIKE KONV-KWERT.
DATA : AMT LIKE KONV-KWERT.
selection-screen : begin of block blk1 with frame title text-001.
select-options : vbeln for vbrk-vbeln obligatory.
selection-screen : end of block blk1.
at selection-screen.
select * from vbrk where vbeln in vbeln.
endselect.
if sy-subrc ne 0.
message e999 with 'Docoment No does not exist....check'.
endif.
start-of-selection.
refresh : itab.
clear : itab.
select a~vbeln a~fkdat a~xblnr a~kunrg a~knumv
b~matnr b~arktx b~fkimg b~posnr
into corresponding fields of table itab from
vbrk as a inner join vbrp as b
on a~vbeln = b~vbeln
where a~vbeln in vbeln.
sort itab by vbeln xblnr knumv matnr.
loop at itab.
LOOP AT ITAB.
unit_wsp = 0.
tot_wsp = 0.
tot_cst = 0.
UNIT_MRP = 0.
refresh : itab1.
clear : itab1.
select knumv kposn kschl kawrt kwert KBETR from konv into table itab1
where knumv = itab-knumv and
kposn = itab-posnr and
kschl in ('ZVAT','ZCST','ZWSP','ZMRP').
sort itab1 by knumv.
loop at itab1.
CASE ITAB1-KSCHL.
WHEN 'ZWSP'.
unit_wsp = itab1-kawrt / itab-fkimg.
tot_wsp = itab1-kawrt.
WHEN 'ZMRP'.
UNIT_MRP = ITAB1-KBETR.
WHEN 'ZCST'.
tot_cst = itab1-kwert.
WHEN 'ZVAT'.
TOT_VAT = ITAB1-KWERT.
ENDCASE.
ENDLOOP.
qty = qty + itab-fkimg.
tot2 = tot2 + tot_wsp .
sub_tot = tot2 + tot_cst + tot_vat.
refresh : itab1.
clear : itab1.
select knumv kposn kschl kawrt kwert KBETR from konv into table itab1
where knumv = itab-knumv and
kposn = itab-posnr and
kschl in ('ZVAT','ZCST','ZWSP','ZMRP').
sort itab1 by knumv.
loop at itab1.
CASE ITAB1-KSCHL.
*when 'ZWSP' or 'ZVAT' OR 'ZCST'.
credit_amt = credit_amt + ITAB1-KWERT.
when 'ZVAT'.
credit_amt = credit_amt + ITAB1-KWERT.
ENDCASE.
endloop.
ENDLOOP.
line_no = 0.
new-page.
skip 1.
write : /5(115) 'TEST RETAIL LIMITED ' centered.
write : /5(115) 'Test Unit ' centered.
write : /5(115) 'PHASE IV ' centered.
write : /5(115) 'E-MAIL : [email protected]' centered.
SKIP 1.
write : 2(118) SY-Uline.
write : /5(115) 'CREDIT NOTE' centered.
line_no = 10.
data : fig1(70),
fig2(20),
fig3(20).
tmp_amt = sub_tot.
v_i_amount = tmp_amt.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = v_i_amount
IMPORTING
AMT_IN_WORDS = amt_in_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.
move space to spell_fig.
split amt_in_words at 'Rupees' into fig1 fig2 .
concatenate fig1 'AND' fig2 'Only*' into spell_fig separated by space.
*camt = credit_amt.
call function 'ZSPELL_AMOUNT'
exporting
amount = camt
currency = 'INR'
filler = ' '
language = sy-langu
importing
in_words = spell
exceptions
not_found = 1
too_large = 2
others = 3.
concatenate : spell-word 'AND' spell-decword 'PAISE'
into spell-word separated by ' '.
write spell-word to amt_word.
select single * from kna1 where kunnr = itab-kunrg.
write :/2(10) kna1-kunnr,
20(35) kna1-name1,
90(15) 'CREDIT NOTE NO.',
106(10) itab-vbeln.
write :/19(35) kna1-stras,
90(15) 'DATE',
106(10) ITAB-FKDAT.
write :/20(20) kna1-ort01,
(10) kna1-pstlz.
write : /20(3) 'PH:',
24(16) KNA1-TELF1,
41(4) 'FAX:',
46(30) KNA1-TELFX.
skip 2.
write : /1 'Dear Sir,'.
skip 1.
write : /20(45) 'We advise having Credited your account with a ',
(11) 'sum of Rs. ',
(15) sub_tot.
write : /1(1) '(',
2(78) spell_fig,
80(1) ')'.
write : /1 ' towards sale return as per particulars given below : '.
skip 3.
write : 2(118) sy-uline.
write : /3(10) 'ARTICLE NO',
22(20) 'ARTICLE DESCRIPTION',
53(10) 'QUANTITY',
69(3) 'MRP',
86(3) 'WSP',
100(9) 'TOTAL WSP'.
WRITE : /67(8) 'per UNIT',
84(8) 'per UNIT',
101(6) 'in Rs.'.
WRITE : /2(118) SY-ULINE.
skip.
line_no = line_no + 4.
LOOP AT ITAB.
unit_wsp = 0.
tot_wsp = 0.
tot_cst = 0.
UNIT_MRP = 0.
refresh : itab1.
clear : itab1.
select knumv kposn kschl kawrt kwert KBETR from konv into table itab1
where knumv = itab-knumv and
kposn = itab-posnr and
kschl in ('ZVAT','ZCST','ZWSP','ZMRP').
sort itab1 by knumv.
loop at itab1.
CASE ITAB1-KSCHL.
WHEN 'ZWSP'.
unit_wsp = itab1-kawrt / itab-fkimg.
tot_wsp = itab1-kawrt.
WHEN 'ZMRP'.
UNIT_MRP = ITAB1-KBETR.
WHEN 'ZCST'.
tot_cst = itab1-kwert.
WHEN 'ZVAT'.
TOT_VAT = ITAB1-KWERT.
ENDCASE.
ENDLOOP.
write : /2(18) itab-matnr,
(25) itab-arktx,
(13) itab-fkimg,
65(11) UNIT_MRP,
(15) unit_wsp,
(15) tot_wsp.
line_no = line_no + 1.
if line_no > 68.
write :/60(10) '___CONT___'.
skip 3.
line_no = 1.
endif.
cnt = cnt + 1.
endloop.
qty = qty + itab-fkimg.
tot2 = tot2 + tot_wsp .
sub_tot = tot2 + tot_cst + tot_vat.
IF CNT > 1.
skip 2.
WRITE : /47(13) QTY.
write : /2(140) sy-uline.
write : /50 'Total WSP :',
93(15) tot2.
WRITE :/50 'Sale Return Amount :',
93(15) tot2.
write :/50 'VAT :',
93(15) tot_vat.
WRITE :/50 'C.S.T :',
93(15) tot_cst.
WRITE :/50 'Net Amount :',
93(15) sub_tot.
write :/50 'Rounding off :'.
write :/50 'Net Amount :'.
*ENDIF.
SKIP 3.
CLEAR : TOT2,TOT_VAT,TOT_CST,SUB_TOT.
clear credit_amt.
<REMOVED BY MODERATOR>
thanks
mrutyun^
Edited by: Alvaro Tejada Galindo on Feb 21, 2008 3:29 PM
Similar Messages
-
Module "HR_IN_CHG_INR_WRDS" in Spanish & French
Hi All,
I have a requirement to output the amount on the invoice in words. Function module "HR_IN_CHG_INR_WRDS" does exactly that (although I have to do a little parsing to replace rupees and paise with dollars and cents).
My new requirement, however, is to output the amount in spanish and french. Not sure if this is possible. Do any of you have experience with this?
Thanks for your help!
Roman D.Did you try SPELL_AMOUNT?
Suresh -
Exploring on HR_IN_CHG_INR_WRDS
Dear experts,
I am just exploring this function module and find few things little strange.I dont know if other find it or not.If you take direct value of bseg-dmbtr type field ,it throws type conflict error.
But if you assign an alternative variable with decimal type.It accepts and works.This is the code.
DATA:amount type P decimals 2.
Data:amount2 type bseg-dmbtr.
DATA:in_words LIKE spell.
data : amt_in_words(255) TYPE c.
amount2 = '123433336.54'.
amount = amount2.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = amount
IMPORTING
AMT_IN_WORDS = amt_in_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.
WRITE: amt_in_words.
Further i do not see anything if i try to see a value above 99 crores.Are my findings true as per all your experience who have worked with this ?problem might be the way dmbtr is represented
-
Error while sending PO output through mail in PDF format - Urgent
Dear friends,
Developed program to send sapscript output through mail in pdf format, the program running properly, even function module SO_NEW_DOCUMENT_ATT_SEND_API1 returning sy-subrc 0. But the external mail is not going to user lying in SAP outbox with message <b>"Wait for communications service"</b> . SCOT is properly configured, tested mails sending through SAP office.
Find below the source code:
REPORT zmm_porder_gm
NO STANDARD PAGE HEADING.
TABLES: ekko, ekpa, t161t, t052, komv, j_1imocomp, t001, esll.
Internal Tables
DATA : txt LIKE tline-tdline, "HEADER LINE
your_ref LIKE ekko-ihrez, "your ref
our_ref LIKE ekko-unsez, "our ref
mcompname LIKE t001-butxt,
itemname LIKE ekpo-txz01,
del_text LIKE tline-tdline, "delivery text
mat_po_text LIKE tline-tdline. "material po text
DATA: g_ind TYPE i.
DATA: it_esll LIKE esll OCCURS 0 WITH HEADER LINE.
DATA: sub_packno LIKE esll-sub_packno.
DATA : po_flag(1) TYPE c.
DATA : it_erev LIKE erev OCCURS 0 WITH HEADER LINE.
DATA : nmebeln LIKE thead-tdname,
obj LIKE thead-tdname.
DATA : tline LIKE tline OCCURS 0 WITH HEADER LINE. "HEADER TEXT
DATA : it_ekko LIKE ekko OCCURS 0 WITH HEADER LINE.
DATA : it_ekpo LIKE ekpo OCCURS 0 WITH HEADER LINE.
DATA : it_zmm_porder LIKE zmm_porder OCCURS 0 WITH HEADER LINE.
DATA : it_konv LIKE konv OCCURS 0 WITH HEADER LINE.
DATA : it_konv_ftr LIKE konv OCCURS 0 WITH HEADER LINE.
DATA : it_konv_rate LIKE konv OCCURS 0 WITH HEADER LINE.
DATA : it_komv_tax LIKE komv OCCURS 0 WITH HEADER LINE. " For Tax Calculation
DATA : it_zmm_house_bank LIKE zmm_house_bank OCCURS 0 WITH HEADER LINE.
*DATA : mrate TYPE konv-kbetr VALUE 0, mrate1(15). rmoved by ganes and added following logic
DATA : mrate TYPE p VALUE 0 DECIMALS 2, mrate1(15).
DATA : mrate_gm TYPE p DECIMALS 2.
DATA : BEGIN OF it_konv1 OCCURS 0,
knumv LIKE konv-knumv,
kschl LIKE konv-kschl,
END OF it_konv1.
DATA : BEGIN OF it_t052u OCCURS 0.
INCLUDE STRUCTURE t052u.
DATA : END OF it_t052u.
DATA : mpay_terms LIKE t052u-text1.
DATA : mwaers LIKE konv-waers.
DATA : BEGIN OF xt052 OCCURS 0.
INCLUDE STRUCTURE t052.
DATA : END OF xt052.
DATA : it_t16ct LIKE t16ct OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF ztext OCCURS 0.
INCLUDE STRUCTURE ttext.
DATA : END OF ztext.
DATA : it_t001 LIKE t001 OCCURS 0 WITH HEADER LINE.
DATA : mtext(15) TYPE c.
DATA : it_adrc LIKE adrc OCCURS 0 WITH HEADER LINE.
DATA : it_adrc_ven LIKE adrc OCCURS 0 WITH HEADER LINE.
DATA : it_adrc_plt LIKE adrc OCCURS 0 WITH HEADER LINE.
DATA : it_makt LIKE makt OCCURS 0 WITH HEADER LINE.
DATA : it_eket LIKE eket OCCURS 0 WITH HEADER LINE. " Schedulling
DATA : it_eikp LIKE eikp OCCURS 0 WITH HEADER LINE. " Export
DATA : it_t001w LIKE t001w OCCURS 0 WITH HEADER LINE.
DATA : it_t685t LIKE t685t OCCURS 0 WITH HEADER LINE.
DATA : it_t618t LIKE t618t OCCURS 0 WITH HEADER LINE.
DATA : it_t685t_ftr LIKE t685t OCCURS 0 WITH HEADER LINE.
DATA : it_lfa1 LIKE lfa1 OCCURS 0 WITH HEADER LINE.
DATA : it_bapi_mltx_ga LIKE bapi_mltx_ga OCCURS 0 WITH HEADER LINE. "Material long text
DATA : mfirst TYPE i VALUE 0,
mpay_flag(1) TYPE c VALUE 'X',
mwerks LIKE t001w-werks,
msr TYPE i VALUE 0,
l_rate TYPE p DECIMALS 2 VALUE 0,
l_amt TYPE p DECIMALS 2 VALUE 0,
mflag(1) TYPE c,
mlctr TYPE i VALUE 0,
mfamt TYPE p DECIMALS 2 VALUE 0,
mcfamt(15) TYPE c,
mfword(100) TYPE c,
mkschl LIKE konv-kschl,
mchgamt TYPE p DECIMALS 2 VALUE 0,
mkbetr TYPE p DECIMALS 2 VALUE 0,
mkwert TYPE p DECIMALS 2 VALUE 0.
DATA : j_1iexcd TYPE j_1imocomp-j_1iexcd,
j_1icstno TYPE j_1imocomp-j_1icstno,
j_1ilstno TYPE j_1imocomp-j_1ilstno.
DATA : mjmop_r TYPE p DECIMALS 2 VALUE 0,
mjmoq_r TYPE p DECIMALS 2 VALUE 0,
mjecs_r TYPE p DECIMALS 2 VALUE 0,
mjvcs_r TYPE p DECIMALS 2 VALUE 0,
mjvrd_r TYPE p DECIMALS 2 VALUE 0,
mjsep_r TYPE p DECIMALS 2 VALUE 0.
DATA : mjmop_a TYPE p DECIMALS 2 VALUE 0,
mjmoq_a TYPE p DECIMALS 2 VALUE 0,
mjecs_a TYPE p DECIMALS 2 VALUE 0,
mjvcs_a TYPE p DECIMALS 2 VALUE 0,
mjvrd_a TYPE p DECIMALS 2 VALUE 0,
mjsep_a TYPE p DECIMALS 2 VALUE 0.
DATA : mtitle LIKE t161t-batxt.
DATA : no_ammend(10),request_by(50),ver_txt(100),ver_reason(100),stext(200).
begin of Email data declarations**************
DATA: BEGIN OF otf OCCURS 0.
INCLUDE STRUCTURE itcoo .
DATA: END OF otf.
DATA: itcpo LIKE itcpo.
DATA: itcpp LIKE itcpp.
DATA: it_docs TYPE STANDARD TABLE OF docs,
v_bin_filesize TYPE i,
it_lines TYPE STANDARD TABLE OF tline,
wa_lines TYPE tline.
DATA : i_pdf LIKE tline OCCURS 1000 WITH HEADER LINE,
v_pdf_bytecount TYPE i,
v_pdf_spoolid TYPE tsp01-rqident,
v_otf_pagecount TYPE i,
v_btc_jobname TYPE tbtcjob-jobname,
v_btc_jobcount TYPE tbtcjob-jobcount.
DATA: objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
DATA: doc_chng LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
DATA: vafilename(100) VALUE 'po_output.pdf'.
DATA: jobdata TYPE sxjobdata.
DATA arc_params TYPE arc_params.
DATA print_params TYPE pri_params.
DATA g_send_prog TYPE syrepid VALUE 'ZVF03_TEST_PROG'.
DATA immediate TYPE btcchar1.
DATA: i_jobname TYPE tbtcp-jobname,
i_jobcount TYPE tbtcp-jobcount,
i_jobstepcount TYPE tbtcp-stepcount.
DATA recipient_obj LIKE swotobjid.
CONSTANTS: sx_true TYPE sx_boolean VALUE 'X'.
TABLES: tbtcp.
end of Email data declarations**************
SELECTION-SCREEN : BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : mebeln FOR ekko-ebeln OBLIGATORY . " 75
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 12.
SELECTION-SCREEN COMMENT (20) text-b01.
PARAMETERS: b1 AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : END OF BLOCK block1.
SELECTION-SCREEN: BEGIN OF SCREEN 200 TITLE text-001 AS WINDOW.
PARAMETERS : p_email TYPE ad_smtpadr. "E-Mail Address
SELECTION-SCREEN: END OF SCREEN 200.
INITIALIZATION.
SET PF-STATUS 'ZMMPORD_STAT'.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'EMAIL'.
PERFORM zemail.
WHEN '&IC1'.
PERFORM load_data.
PERFORM process.
IF NOT p_email IS INITIAL.
PERFORM send_mail.
ENDIF.
ENDCASE.
*START-OF-SELECTION.
PERFORM load_data.
PERFORM process.
FORM load_data .
DATA : gindex LIKE sy-tabix.
SELECT * FROM t16ct INTO TABLE it_t16ct WHERE spras = 'EN'.
SELECT * FROM ekko INTO TABLE it_ekko WHERE ebeln IN mebeln.
IF sy-subrc EQ 0.
SELECT * FROM erev INTO CORRESPONDING FIELDS OF TABLE it_erev FOR ALL ENTRIES IN it_ekko
WHERE edokn = it_ekko-ebeln AND rscod <> '' .
SORT it_erev BY edokn revno DESCENDING.
LOOP AT it_ekko.
IF NOT ( it_ekko-frgke EQ 'O' OR it_ekko-frgke EQ '0' ) .
MESSAGE e000(zsd) WITH 'Purchase Order is not Realeased'.
ENDIF.
ENDLOOP.
SELECT * FROM ekpo INTO TABLE it_ekpo WHERE ebeln IN mebeln.
IF sy-subrc EQ 0.
SELECT * INTO TABLE it_makt
FROM makt
FOR ALL ENTRIES IN it_ekpo
WHERE matnr EQ it_ekpo-matnr.
SELECT * INTO TABLE it_lfa1
FROM lfa1
FOR ALL ENTRIES IN it_ekko
WHERE lifnr EQ it_ekko-lifnr.
ENDIF.
SELECT *
INTO TABLE it_t052u
FROM t052u
FOR ALL ENTRIES IN it_ekko
WHERE zterm EQ it_ekko-zterm
AND spras EQ 'EN'.
IF sy-subrc EQ 0.
SORT it_t052u BY zterm.
ENDIF.
SELECT * FROM eket INTO TABLE it_eket WHERE ebeln IN mebeln.
IF sy-subrc EQ 0.
SORT it_eket BY ebeln ebelp.
ENDIF.
SELECT *
INTO TABLE it_eikp
FROM eikp
FOR ALL ENTRIES IN it_ekko
WHERE exnum EQ it_ekko-exnum.
IF sy-subrc EQ 0.
SORT it_eikp BY exnum.
SELECT *
INTO TABLE it_t618t
FROM t618t
FOR ALL ENTRIES IN it_eikp
WHERE expvz EQ it_eikp-expvz
AND spras EQ 'E'
AND land1 EQ 'IN'.
IF sy-subrc EQ 0.
SORT it_t618t BY expvz.
ENDIF.
ENDIF.
REFRESH : it_zmm_porder.
CLEAR : it_zmm_porder.
SELECT * INTO TABLE it_zmm_porder
FROM zmm_porder
WHERE flag EQ 'L'.
IF sy-subrc EQ 0.
SORT it_zmm_porder BY kschl.
ENDIF.
SELECT * FROM konv INTO TABLE it_konv
FOR ALL ENTRIES IN it_ekko
WHERE knumv = it_ekko-knumv
AND kwert NE 0.
LOOP AT it_konv.
gindex = sy-tabix.
READ TABLE it_zmm_porder WITH KEY kschl = it_konv-kschl BINARY SEARCH.
IF sy-subrc NE 0.
DELETE it_konv INDEX gindex.
ENDIF.
ENDLOOP.
IF sy-subrc EQ 0.
SORT it_konv BY knumv kherk kschl.
ENDIF.
REFRESH : it_zmm_porder.
CLEAR : it_zmm_porder.
SELECT * INTO TABLE it_zmm_porder
FROM zmm_porder
WHERE flag EQ 'F'.
IF sy-subrc EQ 0.
SORT it_zmm_porder BY kschl.
ENDIF.
SELECT * INTO TABLE IT_KONV_FTR FROM KONV
FOR ALL ENTRIES IN IT_EKKO
WHERE KNUMV = IT_EKKO-KNUMV
AND ( KSCHL = 'ZIN1'
OR KSCHL = 'ZIN2'
OR KSCHL = 'ZINS'
OR KSCHL = 'ZPF1'
OR KSCHL = 'ZPF2'
OR KSCHL = 'ZPF3'
OR KSCHL = 'ZPKG'
OR KSCHL = 'ZPKF'
OR KSCHL = 'FRA1'
OR KSCHL = 'FRB1'
OR KSCHL = 'FRC1'
OR KSCHL = 'FRD1'
OR KSCHL = 'FRD2'
OR KSCHL = 'FRD3'
OR KSCHL = 'FRD4'
OR KSCHL = 'FRD5'
*****Added one condition type below ZFBC as on 05.06.2007 :Rajiv as per mail of Sadiq via mathew sir(RTDK906646)
OR KSCHL = 'ZFBC' )
AND KWERT NE 0
AND KPOSN GT '000000'.
AND ( KRECH = 'B' " RTDK906167
OR KRECH = 'A' ).
SELECT * INTO TABLE it_konv_ftr FROM konv
FOR ALL ENTRIES IN it_ekko
WHERE knumv = it_ekko-knumv
AND kwert NE 0
AND kposn GT '000000'.
LOOP AT it_konv_ftr.
gindex = sy-tabix.
READ TABLE it_zmm_porder WITH KEY kschl = it_konv_ftr-kschl BINARY SEARCH.
IF sy-subrc NE 0.
DELETE it_konv_ftr INDEX gindex.
ENDIF.
ENDLOOP.
IF it_konv_ftr[] IS NOT INITIAL.
SORT it_konv_ftr BY knumv kschl.
ENDIF.
SELECT KNUMV KSCHL INTO CORRESPONDING FIELDS OF TABLE IT_KONV1 FROM KONV
FOR ALL ENTRIES IN IT_EKKO
WHERE KNUMV = IT_EKKO-KNUMV
and kherk = 'D'
AND ( KSCHL = 'ZIN1'
OR KSCHL = 'ZIN2'
OR KSCHL = 'ZINS'
OR KSCHL = 'ZPF1'
OR KSCHL = 'ZPF2'
OR KSCHL = 'ZPF3'
OR KSCHL = 'ZPKG'
OR KSCHL = 'ZPKF'
OR KSCHL = 'FRA1'
OR KSCHL = 'FRB1'
OR KSCHL = 'FRC1'
OR KSCHL = 'FRD1'
OR KSCHL = 'FRD2'
OR KSCHL = 'FRD3'
OR KSCHL = 'FRD4'
OR KSCHL = 'FRD5'
*****Added one condition type below ZFBC as on 05.06.2007 :Rajiv as per mail of Sadiq via mathew sir(RTDK906646)
OR KSCHL = 'ZFBC' )
AND KWERT NE 0.
AND ( KRECH = 'B' RTDK906167
OR KRECH = 'A' ).
SELECT knumv kschl INTO CORRESPONDING FIELDS OF TABLE it_konv1 FROM konv
FOR ALL ENTRIES IN it_ekko
WHERE knumv = it_ekko-knumv
AND kwert NE 0.
DELETE ADJACENT DUPLICATES FROM it_konv1 COMPARING knumv kschl.
LOOP AT it_konv1.
gindex = sy-tabix.
READ TABLE it_zmm_porder WITH KEY kschl = it_konv1-kschl BINARY SEARCH.
IF sy-subrc NE 0.
DELETE it_konv1 INDEX gindex.
ENDIF.
ENDLOOP.
IF sy-subrc EQ 0.
SORT it_konv1 BY knumv kschl.
ENDIF.
SELECT * INTO TABLE it_t685t
FROM t685t
FOR ALL ENTRIES IN it_konv
WHERE kschl EQ it_konv-kschl
AND kappl EQ it_konv-kappl
AND spras EQ 'E'.
SELECT * INTO TABLE it_t685t_ftr
FROM t685t
FOR ALL ENTRIES IN it_konv_ftr
WHERE kschl EQ it_konv_ftr-kschl
AND kappl EQ it_konv_ftr-kappl
AND spras EQ 'E'.
it_t685t_ftr-kschl = 'JVCS'.
it_t685t_ftr-vtext = 'IN CST in vat'.
APPEND it_t685t_ftr.
SELECT * INTO TABLE it_zmm_house_bank
FROM zmm_house_bank
WHERE ebeln IN mebeln.
ELSE.
MESSAGE e899(mm) WITH 'Data not found for selection criteria...'.
ENDIF.
ENDFORM. " Load_data
FORM process .
DATA : mctr TYPE i VALUE 1.
DATA : gindex LIKE sy-tabix.
DATA : mline(75) TYPE c.
DATA : mlifn2 LIKE ekpa-lifn2.
DATA : mv_name LIKE lfa1-name1,
madrnr LIKE lfa1-adrnr.
CLEAR itcpo.
itcpo-tdgetotf = 'X'.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'ZMM_PORDER'
language = sy-langu
OPTIONS = itcpo
dialog = ' '
EXCEPTIONS
OTHERS = 1.
LOOP AT it_ekko.
CALL FUNCTION 'START_FORM'
EXPORTING
form = 'ZMM_PORDER'.
SELECT SINGLE *
FROM t001
INTO it_t001
WHERE bukrs EQ it_ekko-bukrs.
mcompname = it_t001-butxt.
TRANSLATE mcompname TO UPPER CASE.
Document Type
SELECT SINGLE batxt
INTO mtitle
FROM t161t
WHERE bstyp EQ 'F'
AND spras EQ 'E'
AND bsart EQ it_ekko-bsart.
REFRESH it_adrc.
SELECT SINGLE werks
INTO mwerks
FROM ekpo
WHERE ebeln EQ it_ekko-ebeln.
SELECT SINGLE *
INTO it_t001w
FROM t001w
WHERE werks EQ mwerks.
REFRESH it_adrc.
SELECT SINGLE *
INTO it_adrc_plt
FROM adrc
WHERE addrnumber EQ it_t001w-adrnr.
REFRESH : xt052.
mfamt = 0.
msr = 0.
in 500c this statement failed.
SELECT SINGLE * FROM T052 INTO XT052 WHERE ZTERM = IT_EKKO-ZTERM.
CALL FUNCTION 'FI_TEXT_ZTERM'
EXPORTING
I_T052 = XT052
TABLES
T_ZTEXT = ZTEXT.
As per Preeti... Shipment address should be shown on top as purchase order company address. 27.04.
PERFORM writeform USING 'PLANT' 'PLANT'.
SELECT SINGLE name1 adrnr
INTO (mv_name,madrnr)
FROM lfa1
WHERE lifnr EQ it_ekko-lifnr.
REFRESH it_adrc[].
CLEAR it_adrc[].
FREE it_adrc[].
SELECT SINGLE *
INTO it_adrc_ven
FROM adrc
WHERE addrnumber EQ madrnr.
READ TABLE it_lfa1 WITH KEY lifnr = it_ekko-lifnr.
PERFORM writeform USING 'VENDOR' 'VENDOR'.
Shipment
SELECT SINGLE werks
INTO mwerks
FROM ekpo
WHERE ebeln EQ it_ekko-ebeln.
up to 1 rows.
SELECT SINGLE *
INTO it_t001w
FROM t001w
WHERE werks EQ mwerks.
SELECT SINGLE j_1iexcd j_1icstno j_1ilstno
INTO (j_1iexcd,j_1icstno,j_1ilstno)
FROM j_1imocomp
WHERE werks = mwerks.
REFRESH it_adrc.
SELECT SINGLE *
INTO it_adrc
FROM adrc
WHERE addrnumber EQ it_t001w-adrnr.
PERFORM writeform USING 'SHIPMNT' 'SHIPMNT'.
READ TABLE it_eikp WITH KEY exnum = it_ekko-exnum.
IF sy-subrc EQ 0.
READ TABLE it_t618t WITH KEY expvz = it_eikp-expvz.
ENDIF.
your_ref = it_ekko-ihrez.
our_ref = it_ekko-unsez.
READ TABLE it_erev WITH KEY edokn = it_ekko-ebeln.
IF sy-subrc = 0.
no_ammend = it_erev-revno.
request_by = it_erev-crnam.
ver_txt = it_erev-txz01.
READ TABLE it_t16ct WITH KEY rscod = it_erev-rscod.
IF sy-subrc = 0.
ver_reason = it_t16ct-rstxt.
ELSE.
ver_reason = ''.
ENDIF.
ELSE.
no_ammend = ''.
request_by = ''.
ver_txt = ''.
ver_reason = ''.
ENDIF.
PERFORM writeform USING 'PO_INFO' 'PO_INFO'.
IF it_zmm_house_bank[] IS NOT INITIAL.
READ TABLE it_zmm_house_bank INDEX 1.
PERFORM writeform USING 'BANKDTL' 'BANKDTL'.
ENDIF.
PERFORM writeform USING 'HDR_INFO' 'HDR_INFO'.
PERFORM writeform USING 'BRK_TTL' 'MAIN'.
msr = 1.
mlctr = 1.
*added by ganesh to prevent deleted items to appear in print out
LOOP AT IT_EKPO WHERE EBELN EQ IT_EKKO-EBELN.
LOOP AT it_ekpo WHERE ebeln EQ it_ekko-ebeln AND loekz NE 'L'.
*end of change
CLEAR: mrate, mrate1.
SELECT * FROM konv INTO TABLE it_konv_rate
WHERE knumv EQ it_ekko-knumv
AND kposn EQ it_ekpo-ebelp
AND ( kschl EQ 'PBXX' OR kschl EQ 'PB00' OR kschl EQ 'P001' ).
LOOP AT it_konv_rate.
IF it_konv_rate-kpein > 0. " added by ganesh as per sudhir 12.10.2007
mrate_gm = it_konv_rate-kbetr / it_konv_rate-kpein.
mrate = mrate + mrate_gm. " added by ganesh as per sudhir 12.10.2007
ELSE.
mrate = mrate + it_konv_rate-kbetr.
ENDIF.
IF it_konv_rate-waers IS NOT INITIAL.
mwaers = it_konv_rate-waers.
ENDIF.
ENDLOOP.
For Japanies Yen "RTDK906759
IF it_ekko-waers = 'JPY'.
mrate = mrate * 100.
ENDIF.
End for japanies Yen
mrate1 = mrate.
End rate
mfirst = 0.
MFAMT = MFAMT + ( IT_EKPO-NETPR * IT_EKPO-MENGE ).
mfamt = mfamt + ( mrate * it_ekpo-menge ).
PERFORM get_mat_long_text.
DATA: lt_ctr TYPE i VALUE 0,lt_ctr1 TYPE i, lt_count TYPE i VALUE 0. " Long text counter
DESCRIBE TABLE it_bapi_mltx_ga LINES lt_count.
CLEAR it_bapi_mltx_ga.
*Added by Rajiv 10.05.2007 Read and if condition RTDK906165
READ TABLE it_konv WITH KEY knumv = it_ekko-knumv
kposn = it_ekpo-ebelp.
mkbetr = 0.
mkwert = 0.
IF sy-subrc EQ 0.
LOOP AT it_konv WHERE knumv EQ it_ekko-knumv
AND kposn EQ it_ekpo-ebelp.
IF it_konv-krech EQ 'A'.
mkbetr = it_konv-kbetr / 10.
ELSE.
mkbetr = it_konv-kbetr.
ENDIF.
For Japanies Yen "RTDK906759
IF it_ekko-waers = 'JPY'.
mkbetr = mkbetr * 100.
ENDIF.
End for japaies Yen
IF mkbetr LT '0'.
mkbetr = mkbetr * ( -1 ).
ENDIF.
mkwert = it_konv-kwert.
For Japanies Yen "RTDK906759
IF it_ekko-waers = 'JPY'.
mkwert = mkwert * 100.
ENDIF.
End for japaies Yen
mfamt = mfamt + mkwert.
IF mkwert LT '0'.
mkwert = mkwert * ( -1 ).
ENDIF.
IF it_ekpo-matnr IS INITIAL.
itemname = it_ekpo-txz01.
ELSE.
READ TABLE it_makt WITH KEY matnr = it_ekpo-matnr.
itemname = it_makt-maktx.
ENDIF.
READ TABLE it_t685t WITH KEY kschl = it_konv-kschl BINARY SEARCH.
READ TABLE it_eket WITH KEY ebeln = it_ekpo-ebeln
ebelp = it_ekpo-ebelp BINARY SEARCH.
IF mfirst EQ 0.
PERFORM writeform USING 'BRK_INFO' 'MAIN'.
mfirst = 1.
ELSE.
ADD 1 TO lt_ctr.
CLEAR it_bapi_mltx_ga.
READ TABLE it_bapi_mltx_ga INDEX lt_ctr. "For long text
IF sy-subrc NE 0.
CLEAR it_bapi_mltx_ga.
ENDIF.
PERFORM writeform USING 'BRK_INFO1' 'MAIN'.
ENDIF.
mlctr = mlctr + 1.
ENDLOOP. " it_konv.
ELSE.
IF it_ekpo-matnr IS INITIAL.
itemname = it_ekpo-txz01.
ELSE.
READ TABLE it_makt WITH KEY matnr = it_ekpo-matnr.
itemname = it_makt-maktx.
ENDIF.
READ TABLE IT_T685T WITH KEY KSCHL = IT_KONV-KSCHL BINARY SEARCH.
READ TABLE it_eket WITH KEY ebeln = it_ekpo-ebeln
ebelp = it_ekpo-ebelp BINARY SEARCH.
mfirst = 0.
IF mfirst EQ 0.
PERFORM writeform USING 'BRK_INFO' 'MAIN'.
mfirst = 1.
ELSE.
ADD 1 TO lt_ctr.
CLEAR it_bapi_mltx_ga.
READ TABLE it_bapi_mltx_ga INDEX lt_ctr. "For long text
IF sy-subrc NE 0.CLEAR it_bapi_mltx_ga.ENDIF.
PERFORM writeform USING 'BRK_INFO1' 'MAIN'.
ENDIF.
ENDIF.
*Commented by rajiv 10.05.2007 used this code in above condition.
added by ganesh on 260407 to print record
if it_konv is initial.
READ TABLE IT_MAKT WITH KEY MATNR = IT_EKPO-MATNR.
READ TABLE IT_T685T WITH KEY KSCHL = IT_KONV-KSCHL BINARY SEARCH.
READ TABLE IT_EKET WITH KEY EBELN = IT_EKPO-EBELN
EBELP = IT_EKPO-EBELP BINARY SEARCH.
mFirst = 0.
if mFirst eq 0.
PERFORM WRITEFORM USING 'BRK_INFO' 'MAIN'.
mFirst = 1.
else.
add 1 to lt_ctr.
clear it_bapi_mltx_ga.
read table IT_BAPI_MLTX_GA index lt_ctr. "For long text
if sy-subrc ne 0.clear it_bapi_mltx_ga.endif.
PERFORM WRITEFORM USING 'BRK_INFO1' 'MAIN'.
Endif.
endif.
end of change
REFRESH it_komv_tax.
PERFORM get_tax_cal USING it_ekpo-ebeln
it_ekpo-ebelp.
Changing it_komv_tax.
REFRESH : it_zmm_porder.
CLEAR : it_zmm_porder.
SELECT * INTO TABLE it_zmm_porder
FROM zmm_porder
WHERE flag EQ 'T'.
IF sy-subrc EQ 0.
SORT it_zmm_porder BY kschl.
ENDIF.
LOOP AT it_komv_tax.
gindex = sy-tabix.
READ TABLE it_zmm_porder WITH KEY kschl = it_komv_tax-kschl BINARY SEARCH.
IF sy-subrc NE 0.
DELETE it_komv_tax INDEX gindex.
ENDIF.
ENDLOOP.
LOOP AT it_komv_tax WHERE kwert IS NOT INITIAL.
IF ( IT_KOMV_TAX-KSCHL EQ 'JMOP' OR
IT_KOMV_TAX-KSCHL EQ 'JECS' OR
IT_KOMV_TAX-KSCHL EQ 'JSEP' OR
IT_KOMV_TAX-KSCHL EQ 'JMOQ' OR
IT_KOMV_TAX-KSCHL EQ 'JVCS' OR
IT_KOMV_TAX-KSCHL EQ 'JVRD' OR
IT_KOMV_TAX-KSCHL EQ 'JMIP' OR
* IT_KOMV_TAX-KSCHL EQ 'JEIP' OR
IT_KOMV_TAX-KSCHL EQ 'JSEI' OR
IT_KOMV_TAX-KSCHL EQ 'JSRT' OR
IT_KOMV_TAX-KSCHL EQ 'JEC3' OR
IT_KOMV_TAX-KSCHL EQ 'JVRN' )
AND IT_KOMV_TAX-KWERT IS NOT INITIAL.
SELECT SINGLE vtext
INTO mtext
FROM t685t
WHERE kschl EQ it_komv_tax-kschl
AND spras EQ 'E'.
l_rate = it_komv_tax-kbetr / 10.
l_amt = it_komv_tax-kwert.
For Japanies Yen "RTDK906759
IF it_ekko-waers = 'JPY'.
l_amt = l_amt * 100.
ENDIF.
End for japaies Yen
ADD l_amt TO mfamt.
IF lt_ctr LT lt_count. "Long text
ADD 1 TO lt_ctr.
READ TABLE it_bapi_mltx_ga INDEX lt_ctr.
ELSE.
CLEAR it_bapi_mltx_ga.
ENDIF.
IF l_rate EQ 0 OR l_amt EQ 0.
l_rate = ''.
l_amt = ''.
ENDIF.
PERFORM writeform USING 'TAX_LINE_ITEM' 'MAIN'.
ENDIF.
ENDLOOP.
IF lt_ctr LT lt_count.
DATA mbal_line TYPE i.
mbal_line = ( lt_count - lt_ctr ).
DO mbal_line TIMES.
ADD 1 TO lt_ctr.
READ TABLE it_bapi_mltx_ga INDEX lt_ctr.
IF sy-subrc = 0.
PERFORM writeform USING 'LTEXT' 'MAIN'.
ENDIF.
ENDDO.
ENDIF.
CONCATENATE it_ekko-ebeln it_ekpo-ebelp INTO nmebeln.
REFRESH tline.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F04'
language = sy-langu
name = nmebeln
object = 'EKPO'
TABLES
lines = tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
LOOP AT tline.
IF tline-tdline IS NOT INITIAL.
del_text = tline-tdline.
ENDIF.
CONDENSE del_text.
ENDLOOP.
CONCATENATE it_ekko-ebeln it_ekpo-ebelp INTO nmebeln.
REFRESH tline.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F03'
language = sy-langu
name = nmebeln
object = 'EKPO'
TABLES
lines = tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
refresh.
CLEAR : po_flag, mat_po_text.
LOOP AT tline.
IF tline-tdline IS NOT INITIAL.
MOVE tline-tdline TO mat_po_text.
CONDENSE mat_po_text.
PERFORM writeform USING 'MTRL_PO_TEXT' 'MAIN'.
po_flag = 'X'.
CLEAR : mat_po_text.
ENDIF.
ENDLOOP.
*Added lines below for Schedule delivery for line item on 09.05.2007:Rajiv
CLEAR g_ind.
READ TABLE it_eket WITH KEY ebeln = it_ekpo-ebeln
ebelp = it_ekpo-ebelp BINARY SEARCH.
g_ind = sy-tabix.
LOOP AT it_eket FROM g_ind.
IF it_eket-ebeln EQ it_ekpo-ebeln AND it_eket-ebelp = it_ekpo-ebelp.
PERFORM writeform USING 'SCHEDULE' 'MAIN'.
ELSE.
EXIT.
ENDIF.
ENDLOOP.
*End Addition:Rajiv
PERFORM writeform USING 'REQSLP' 'MAIN'.
mlctr = mlctr + 1.
msr = msr + 1.
CLEAR: lt_ctr, lt_ctr1.
following lines added by ganesh to add service po details as per Mr. sadiq 21.08.2007
IF it_ekpo-packno IS NOT INITIAL.
CLEAR sub_packno.
SELECT SINGLE sub_packno INTO sub_packno FROM esll WHERE packno = it_ekpo-packno.
IF sub_packno IS NOT INITIAL.
CLEAR it_esll.
REFRESH it_esll.
SELECT * FROM esll INTO CORRESPONDING FIELDS OF TABLE it_esll
WHERE packno = sub_packno.
IF sy-subrc = 0.
PERFORM writeform USING 'SERVICE_PO_TEXT' 'MAIN'.
ENDIF.
LOOP AT it_esll.
CONCATENATE sub_packno it_esll-introw INTO obj.
CALL FUNCTION 'READ_TEXT' "4500002446 C300
EXPORTING
id = 'LTXT'
language = sy-langu
name = obj
object = 'ESLL'
TABLES
lines = tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
CLEAR stext.
LOOP AT tline.
CONCATENATE stext tline-tdline INTO stext SEPARATED BY space.
ENDLOOP.
FREE tline.
CLEAR tline.
REFRESH tline.
PERFORM writeform USING 'SERVICE_PO' 'MAIN'.
PERFORM writeform USING 'SERVICE_TEXT' 'MAIN'.
ENDLOOP.
ENDIF.
ENDIF.
end of change
ENDLOOP. " it_ekpo.
IF mlctr < 15.
DO 5 TIMES.
PERFORM writeform USING 'LINEFEED' 'MAIN'.
ENDDO.
ENDIF.
added by ganesh for allding line before ECC No.
IF it_ekko-bsart NE 'ZIM'. " IF EXPORT NO NEED TO PRINT ECC.
PERFORM writeform USING 'LIN' 'MAIN'.
PERFORM writeform USING 'WERKS_TAX_DETAIL' 'MAIN'.
ENDIF.
end of change
MFLAG = 'Y'.
PERFORM writeform USING 'TERMS_VAL' 'MAIN'.
LOOP AT it_konv1 WHERE knumv EQ it_ekko-knumv.
mkschl = it_konv1-kschl.
mchgamt = 0.
LOOP AT it_konv_ftr WHERE knumv EQ it_konv1-knumv
AND kschl EQ mkschl.
mchgamt = mchgamt + it_konv_ftr-kwert.
ENDLOOP.
For Japanies Yen "RTDK906759
IF it_ekko-waers = 'JPY'.
mchgamt = mchgamt * 100.
ENDIF.
End for japaies Yen
mfamt = mfamt + mchgamt.
IF mchgamt LT '0'.
mchgamt = mchgamt * ( -1 ).
ENDIF.
READ TABLE it_t685t_ftr WITH KEY kschl = mkschl.
PERFORM writeform USING 'TERMS_FTR_VAL' 'MAIN'.
mlctr = mlctr + 1.
ENDLOOP.
mflag = 'T'.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = mfamt
IMPORTING
amt_in_words = mfword
EXCEPTIONS
data_type_mismatch = 1
OTHERS = 2.
CONDENSE mebeln.
nmebeln = it_ekko-ebeln.
REFRESH tline.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = sy-langu
name = nmebeln
object = 'EKKO'
TABLES
lines = tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
*---- CHANGED BY MATHEW BECAUSE THIS STATMENT WORKING FINE IN 300 BUT NOT IN 500C.
LOOP AT ZTEXT.
IF ZTEXT-TEXT1 IS NOT INITIAL.
PERFORM WRITEFORM USING 'TERMS_COND_VAL_PAY' 'MAIN'.
ENDIF.
MPAY_FLAG = 'Y'.
ENDLOOP.
READ TABLE it_t052u WITH KEY zterm = it_ekko-zterm.
LOOP AT it_t052u WHERE zterm EQ it_ekko-zterm.
IF it_t052u-text1 IS NOT INITIAL.
PERFORM writeform USING 'TERMS_COND_VAL_PAY' 'MAIN'.
ENDIF.
mpay_flag = 'Y'.
ENDLOOP.
PERFORM writeform USING 'TERMS_COND_VAL' 'MAIN'.
LOOP AT tline.
IF tline-tdline IS NOT INITIAL.
PERFORM writeform USING 'TERMS_COND_VAL_HDR' 'MAIN'.
ENDIF.
CONDENSE txt.
ENDLOOP.
PERFORM writeform USING 'FTR' 'FTR_LIN3'.
PERFORM writeform USING 'FTR_LIN1' 'FTR_LIN1'.
CALL FUNCTION 'END_FORM'.
ENDLOOP. " It_ekko.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = itcpp
RDI_RESULT =
TABLES
otfdata = otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " Process
*& Form WRITEFORM
text
-->P_0150 text
-->P_0151 text
FORM writeform USING value(p_0150)
value(p_0151).
CALL FUNCTION 'WRITE_FORM'Hi
I think some basis related configuartions to be done
Try like this and inform me
A cyclic job runs, which processes the messages seen in the SOST queue.
Are you sure it's not the frequency of the cyclic job, rather than the
number of messages in the queue, that you are observing? In messages
that are queued and before the cyclic job runs, "wait for comm. service"
is the normal status.
If you mean that there are always 4 items queued in SOST regardless of
the cyclic send job, then I have no ideas. I would have thought there
was no way to do that.
when the send job runs it just never
picks them up & sends them, while it picks up many others. The send job
is somehow blind to these; no error message occurs. In this case, I
'delete' them from the queue (in SOST) and then 'undelete' (drop down
menu -> /Go to /Deleted Items) them and then re-queue them. THEN they
actually get picked up & sent when the next cyclic send job executes.
Regards
Pavan -
Script- problem in printing the values in from internal table
Hi all,
I have a requiremnt that i for a particular document no there are number of invoices are there. i.e for a single document no there are 20 invoices in that. i shoudl display the invoice number , invoice date, invoice amount , number of days of intrest , start date of interest, end date of interest and intrest amount.
The problem is i should take the invoice number, invoice date, number of days from TABLE <b>BSEG</b> and inovice amount and start date, end date from table<b> INTITIT</b>. for a particular document number there are diffent invoce numbers in both the table.
i can display everthing but the prob is with invoice amount. it is repating only one values is displying in the ouput. The invoice number in INTITIT Is not changing. I have to write the syntax for that .Please help me The value in Bseg is chaing as per given syntax shown below.
data: begin of hbseg occurs 10.
include structure hsortp.
include structure bseg.
data: end of hbseg.
data: begin of hsortp,
sortp1 like sortp1,
sortp2 like sortp2,
sortp3 like sortp3,
sortp4 like sortp4,
sortp5 like sortp5,
EKVBD LIKE KNB1-EKVBD,
end of hsortp.
loop at hbseg.
WHERE BUKRS = SAVE_BUKRS.
save_bukrs = hbseg-bukrs.
if ( hbseg-kunnr = save_kunnr
and not save_kunnr is initial )
or ( hbseg-lifnr = save_lifnr
and not save_lifnr is initial ).
clear bseg.
move-corresponding hbseg to bseg.
*bseg = bseg.
if bkpf-waers ne *bkpf-waers.
perform curr_document_convert_bseg
using
bkpf-budat
*bkpf-waers
*bkpf-hwaer
bkpf-waers
changing
bseg.
if not bseg-pycur is initial.
alw_waers = bseg-pycur.
perform currency_get_subsequent
using
save_repid
bkpf-budat
bkpf-bukrs
changing
alw_waers.
if alw_waers ne bseg-pycur.
bseg-pycur = alw_waers.
perform convert_foreign_to_foreign_cur
using
bkpf-budat
*bkpf-waers
*bkpf-hwaer
bseg-pycur
changing
bseg-pyamt.
endif.
endif.
endif.
perform fill_waehrungsfelder_bseg.
perform fill_waehrungsfelder_bseg_2.
if bseg-sgtxt(1) ne '*'.
bseg-sgtxt = space.
else.
bseg-sgtxt = bseg-sgtxt+1.
endif.
clear save_bschl.
clear save_umskz.
clear tbslt.
save_bschl = bseg-bschl.
save_umskz = bseg-umskz.
perform read_tbslt.
ADDING VARIBLE V_GSALDF BY SUNIL 5.11.07******
v_gsaldf = rf140-gsaldf + rf140-wrshb.
rf140-gsaldf = v_gsaldf.
clear v_gsaldf.
SUNIL *********************
*rf140-gsaldf = *rf140-gsaldf + *rf140-wrshb.
if xmultk is initial
and xactiv is initial
and linecnt = '1'
and not xumsst is initial
and not save_xumstn is initial.
if bkpf-bstat = 'V'.
perform read_vbset.
else.
perform read_bset.
endif.
describe table hbset lines linecnt.
if linecnt = '1'.
loop at hbset.
move-corresponding hbset to bset.
*bset = bset.
if bkpf-waers ne *bkpf-waers.
perform curr_document_convert_bset
using
bkpf-budat
*bkpf-waers
*bkpf-hwaer
bkpf-waers
changing
bset.
endif.
clear rf140-msatz.
clear rf140-vtext.
save_ktosl = bset-ktosl.
perform read_t687t.
rf140-msatz = bset-kbetr / 10.
*rf140-msatz = rf140-msatz.
rf140-vtext = save_vtext.
*rf140-vtext = rf140-vtext.
if bset-shkzg = 'H'.
rf140-mwshb = bset-fwste.
*rf140-mwshb = *bset-fwste.
rf140-mdshb = bset-hwste.
*rf140-mdshb = *bset-hwste.
else.
rf140-mwshb = 0 - bset-fwste.
*rf140-mwshb = 0 - *bset-fwste.
rf140-mdshb = 0 - bset-hwste.
*rf140-mdshb = 0 - *bset-hwste.
endif.
exit.
endloop.
rf140-wrshb = rf140-wrshb - rf140-mwshb.
*rf140-wrshb = *rf140-wrshb - *rf140-mwshb.
rf140-dmshb = rf140-dmshb - rf140-mdshb.
*rf140-dmshb = *rf140-dmshb - *rf140-mdshb.
endif.
endif.
*****************Begin of Change by Karthikeyan J********************
i_count = i_count + 1.
clear rf140-element.
clear: it_bseg, i_wrbtr,i_totday,i_tempday,i_day,i_bday.
comparing with fields belnr AND SELECT * FROM INTITIT added by sunil 3.11.07*********
select single * from bseg into
corresponding fields of it_bseg where belnr = bseg-rebzg anD GJAHR = BSEG-GJAHR.
select single * from intitit into corresponding fields of it_intitit where gjahr = bseg-gjahr and belnr_to = bseg-belnr and buzei = '2' OR BELNR = INTITIT-BELNR .
added by Jayshree on 09/01/2007
MOVE ' ' TO it_kna1-name1.
SELECT SINGLE name1
INTO CORRESPONDING FIELDS OF it_kna1
FROM ( vbpa AS a INNER JOIN kna1 AS b ON akunnr = bkunnr )
WHERE a~vbeln = it_bseg-vbeln
AND a~parvw = 'zd'.
SELECT SINGLE fkdat
INTO CORRESPONDING FIELDS OF it_kna1
FROM vbrk
WHERE vbrk~vbeln = it_bseg-vbeln.
added by Jayshree on 01/02/2007
CONCATENATE it_kna1-fkdat6(2) it_kna1-fkdat4(2) it_kna1-fkdat+2(2)
INTO vfkdat SEPARATED BY '.'.
CONCATENATE it_bseg-augdt6(2) it_bseg-augdt4(2) it_bseg-augdt+2(2)
INTO vaugdt SEPARATED BY '.'.
i_wrbtr = i_wrbtr + it_bseg-wrbtr.
added as on 29.06.2007 by jayshree again transport on 21.07.2007
tot_wrbtr = tot_wrbtr + i_wrbtr.
i_totday = it_bseg-zbd1t + it_bseg-zbd2t + it_bseg-zbd3t.
CALL FUNCTION 'fima_date_create'
EXPORTING
i_date = it_bseg-zfbdt
I_FLG_END_OF_MONTH = ' '
I_YEARS = 0
I_MONTHS = 0
i_days = i_totday
I_CALENDAR_DAYS = 0
I_SET_LAST_DAY_OF_MONTH = ' '
IMPORTING
e_date = i_bday
E_FLG_END_OF_MONTH =
E_DAYS_OF_I_DATE =
added by JAYSHREE 01.02.2007
CONCATENATE i_bday6(2) i_bday4(2) i_bday+2(2)
INTO vbday SEPARATED BY '.'.
i_day = it_bseg-augdt - i_bday.
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = it_bseg-zfbdt
date2 = it_bseg-augdt
OUTPUT_FORMAT = '01'
IMPORTING
YEARS =
MONTHS =
DAYS = i_day
EXCEPTIONS
INVALID_DATES_SPECIFIED = 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.
*added by sunil 5.11.07 ***********
*read table it_intitit with key BELNR_TO = BSEG-BELNR .
*LOOP AT IT_INTITIT.
rf140-element = '521'.
CALL FUNCTION 'write_form'
EXPORTING
window = 'main'
element = '521'
EXCEPTIONS
window = 1
element = 2.
IF sy-subrc = 1.
window = 'main'.
PERFORM message_window.
ENDIF.
IF sy-subrc = 2.
window = 'main'.
ereignis = '521'.
PERFORM message_element.
ENDIF.
IF save_xumstn IS INITIAL.
*-------Umsatzsteuer -
IF xactiv IS INITIAL.
save_waers = rf140-waers.
PERFORM tax_data.
CLEAR taxlines.
DESCRIBE TABLE atax LINES taxlines.
IF NOT taxlines IS INITIAL.
LOOP AT atax.
CLEAR ereignis.
CLEAR rf140-msatz.
CLEAR rf140-vtext.
rf140-msatz = atax-msatz.
*rf140-msatz = atax-msatz.
rf140-vtext = atax-vtext.
*rf140-vtext = atax-vtext.
*******begin of change by karthikeyan on 10.03.06*********************
IF sy-tabix = '1'.
ereignis = '522'.
v_stax = rf140-msatz * rf140-gsaldf / 100.
ELSE.
ereignis = '523'.
v_ecs = rf140-msatz * v_stax / 100.
v_total = rf140-gsaldf + v_stax + v_ecs.
ENDIF.
CALL FUNCTION 'hr_in_chg_inr_wrds'
EXPORTING
amt_in_num = v_total
IMPORTING
amt_in_words = v_spell
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.
***************************end of change******************************
CLEAR rf140-element.
rf140-element = ereignis.
IF NOT ereignis IS INITIAL.
CALL FUNCTION 'write_form'
EXPORTING
window = 'main'
element = ereignis
EXCEPTIONS
window = 1
element = 2.
IF sy-subrc = 1.
window = 'main'.
PERFORM message_window.
ENDIF.
IF sy-subrc = 2.
window = 'main'.
PERFORM message_element.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
'521' is the element name in the main window where i should display the values. before select qurey the values are coming in the bseg but not in table INTITIT. Belnr is the document no with ref to that
there are number of invoices nos. so in both the tables it is selecting single value and displaying but in bseg the invoice number is getting refreshed and new number is coming in that place i.e in field bseg-rebzg but in INTITIT in belnr only it is taking single value it is not getting refreshed.
move-corresponding hbseg to bseg.
*bseg = bseg.
if bkpf-waers ne *bkpf-waers.
this is the syntax whr the values in bseg are getting refresh and new invoice number is selecting.
How to write the syntax for INTITIT? As per invoice number it is giving new values.
The invoice number in Bseg is different campare to in table INTITIT. in output is shoud show the fields as follows
it_besg-rebzg(invoice number of besg) it_besg-zuonr(invoice date) INTITIT-INT_BASAMT(base amount) i_day (no of days ) INTITIT-INT_BEGIN (INTREST START DATE) INTITIT-INT_end(INTREST END DATE) rf140-wrshb(INTREST AMOUNT).
THE VALUE OF IT_BESG-REBZG IS CHANGING BUT THE VALUE IN INTITIT-BELNR ( INVOICE NUMBER) IS NOT CHANGING THAT IS WHY IT IS SHOWING
ONLY SINGLE RECORD.
for both the table documet no is same. in besg-belnr is the document no. in intitit-BELNR_TO is the document no.
here in bseg-rebzg is chaning but in INTITIT-BELNR IS not changing.
If i take loop at INTITIT. ALL the values are repating so i am unable to take loop. so i want to write
a syntax such that intitit-belnr should be refreshed and also for every loop it shoud take new invoice no.
Please help me out it is very urgent.
<b>USEFUL ANSWERS WILL BE REWARDED.</b>
regards,
Sunil kumar.assumption: some mistake in ur posting that, How belnr and date r same for both header records, so i guess, either one is different.
try with AT NEW - ENDAT.
AT NEW belnr.
here use looping, READing of ur itabs.---> so, u need to build couple of itabs to move forth and back.
ENDAT.
pls. note that, when u use this AT NEW all the CHAR fileds of itab wuld show as STARS **.....so, this is the necessity behind building new itabs.
thanq
Edited by: SAP ABAPer on Dec 30, 2008 6:24 PM -
Logical Database of SAP Example Program
Hi all,
I need an example ABAP program using standard Logical Database ( LDB ) .
Help me.
Regards,
Peachi.Hi,
Some links to refer..
/people/alvaro.tejadagalindo/blog/2006/02/19/how-to-deal-with-hr-payroll-reports
http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/893908#
A sample prog with LDB PNP
*& Report ZH_REPT_PAYMENT *
report zh_rept_payment line-size 80 no standard page
heading.
tables: pernr, " Standard Selections for HR Master Data Reporting
pcl1, " HR Cluster 1
pcl2, " HR Cluster 2
pa0009,
PA9001,
PA9006,
pa0002,
pc260 , " Cluster Directory for Payroll Results
bnka .
Infotypes
infotypes: 0001. " Organizational Assignment
Declaration of Internal Tables
data : bnka1 like bnka occurs 0 with header line .
data: begin of t_int_rep occurs 100,
bankl like pc209-bankl, " Bank Number
zlsch like pc209-zlsch, " Payment method
pernr like pernr-pernr, " Employee Number
ename like pernr-ename, " Employee Name
bankn like pc209-bankn, " Bank Account Number
betrg like pc209-betrg, " Amount to be transfered
zweck like pa0009-zweck, " Purpose
end of t_int_rep.
data: begin of int_rep occurs 100,
bankl like pc209-bankl, " Bank Number
zlsch like pc209-zlsch, " Payment method
pernr like pernr-pernr, " Employee Number
ename like pernr-ename, " Employee Name
bankn like pc209-bankn, " Bank Account Number
betrg like pc209-betrg, " Amount to be transfered
zweck like pa0009-zweck, " Purpose
begda like pa0009-begda, "Begin date
end of int_rep.
Declaration of Data Variables
data: ws_betrg like pc209-betrg, " BT Amount
w_val like spell occurs 0 with header line,
int_rep1(6), " TYPE I, " Employee Number
cnt type i value 0, " Counter
calcmolga like t500l-molga value '40', " Country Grouping
v_id(15),
calc_currency like t001-waers value 'INR'. " Currency
data : ctr type i,
dt_merge like pa0009-begda.
data: ws_totemp(6) type c,
ws_totamt(20) type c,
r_mth(9) type c,
ws_fpbeg(6) type c,
ws_fpend(6) type c,
ws_mthyr(6) type c,
ws_mthyr_r(14) type c,
r_mth_t(3) type c,
ws_amt(8) type c,
ws_bankl(14) type c,
ws_date(6) type c,
amount_word(500),
total_page type i,
pages type i,
remain type i.
data begin of i_spell.
include structure spell .
data end of i_spell .
data : c_molga type t500l-molga value '40',
c_banks type bnka-banks value 'IN'.
Standard Includes
include rpc2cd09. "Cluster CD data definition
include pc2rxin0.
include rpc2rx09.
include rpppxd00. " Data Definition buffer PCL1/PCL2
include rpppxd10. " Common Part buffer PCL1/PCL2
include rpppxm00. " Buffer Handling RoutinePCL1/PCL2
include zrpc2rox2. " Data Definition POCLSTERS (not J,K,U)
Selection Screen
selection-screen begin of block b1 with frame title text-001.
parameter: pa_mth(2) type c default sy-datum+4(2) obligatory,
pa_year(4) type c default sy-datum(4) obligatory,
p_bankl like pc209-bankl, " Bank Number
p_zlsch like pc209-zlsch. " Payment method
selection-screen end of block b1.
save_calc_currency = calc_currency.
count_top = 0.
get_pernr_flag = 0.
Top-Of-Page
top-of-page.
perform convert_month using pa_mth(2) r_mth.
ws_mthyr_r = r_mth.
concatenate ws_mthyr_r pa_year into ws_mthyr_r separated by space.
SKIP 5.
skip 1.
skip 4.
if int_rep-bankl eq ' '.
if int_rep-zlsch eq 'C' or int_rep-zlsch eq 'E' or
int_rep-zlsch eq ' '.
write: /1(85) 'CHEQUE PAYMENT STATEMENT'(047) centered.
elseif int_rep-zlsch eq 'L'.
write: /1(85) 'DEMAND DRAFT STATEMENT'(047) centered.
endif.
else.
write: /1(85) 'BANK TRANSFER STATEMENT'(002) centered.
endif.
skip.
write: /34 ws_mthyr_r,
62 'Page :'(008),69(2) sy-pagno intensified off,
' Of ',78(2) pages intensified off.
clear pages.
read table bnka1 with key bankl = int_rep-bankl .
if sy-subrc = 0.
if int_rep-zlsch eq 'T'.
write:/03(10) 'Bank Name : ', bnka1-banka.
write:/03(10) 'Branch : ', bnka1-brnch.
write:/03(10) 'Address : ', bnka1-stras.
endif.
endif.
skip.
write:/1(80) sy-uline.
write: /1 sy-vline, 2(5) 'Sl.No'(002),
7 sy-vline, 8(8) 'Emp.No.'(003),
16 sy-vline,17(35) 'Employee Name'(004).
*--added for Demand Draft
if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
write : 47 sy-vline, 48(15) 'Payable at'(005).
else.
write : 47 sy-vline,48(15) 'Account No.'(005).
endif.
write: 63 sy-vline,64(16) 'Amount'(006),
80 sy-vline.
write:/1(80) sy-uline.
end-of-page.
write:/1(80) sy-uline.
write:/2 'Printed on ', sy-datum.
Start-of-selection.
start-of-selection.
*perform h_headr.
ctr = 0.
set margin 5.
call function 'RP_GET_CURRENCY'
exporting
molga = calcmolga
importing
waers = calc_currency
exceptions
others.
if sy-subrc ne 0.
calc_currency = 'DEM'.
calc_currency = save_calc_currency.
endif.
get pernr.
cd-key-pernr = pernr-pernr.
perform import_cluster.
get_pernr_flag = 1.
check : ocd-version-molga eq calcmolga.
The table 'tabpernr' is filled with the personnel numbers
and is used after selection is finished.
move-corresponding pernr to tabpernr.
append tabpernr.
The table 'tab_rgdir' is filled
loop at rgdir.
rx-key-pernr = pernr-pernr.
unpack rgdir-seqnr to rx-key-seqno.
perform int_tab. "fill tab_rgdir
perform import_bt.
perform validate.
endloop.
End of Selection
end-of-selection.
*perform h_headr.
perform convert_date_a using pa_mth r_mth_t.
sort int_rep by bankl zlsch pernr betrg descending.
delete adjacent duplicates from int_rep
comparing bankl zlsch pernr .
sort int_rep by bankl zlsch bankn . "PERNR.
loop at int_rep.
at new bankl.
select single * into bnka1 from bnka
where banks = c_banks and
bankl = int_rep-bankl .
append bnka1.
clear bnka1.
endat.
endloop.
for Demand Draft - purpose added
loop at int_rep.
concatenate pa_year(4) pa_mth(2) '01' into dt_merge.
select single * "zweck into int_rep-zweck
from pa0009 where
pernr = int_rep-pernr and
bankl = int_rep-bankl and
zlsch = int_rep-zlsch
and begda <= dt_merge and
endda >= dt_merge .
if sy-subrc = 0.
int_rep-zweck = pa0009-zweck.
modify int_rep.
endif.
endloop.
*-for DD and Chq sorted by PAyable at and EMPNO wise
if p_zlsch = 'T' .
sort int_rep by bankl zlsch bankn . "PERNR.
else. "added for "payable at" for DD/Chq
else.
sort int_rep by zweck pernr . "PERNR.
endif.
*delete adjacent duplicates from int_rep.
t_int_rep] = int_rep[.
loop at int_rep.
*-for page of page no.
total_page = 0.
loop at t_int_rep where bankl = int_rep-bankl
and zlsch = int_rep-zlsch.
total_page = total_page + 1.
endloop.
pages = total_page div 25.
remain = total_page mod 25.
comment bcoz its adding one extra page no.
done as on 29/11/2004
if remain > 0.
pages = pages + 1.
endif.
**-end
at new bankl.
ctr = 0 .
new-page.
endat.
at new zlsch.
ctr = 0 .
new-page.
endat.
clear v_id.
select single natio
into pa0002-natio
from pa0002
where pernr eq int_rep-pernr.
*-testing......for soma
if ctr > 24.
ctr = 0 .
write:/1(80) sy-uline.
new-page .
endif.
ctr = ctr + 1 .
cnt = cnt + 1.
pack int_rep-pernr to int_rep1.
write:/1 sy-vline, 2(3) cnt intensified off,
7 sy-vline, 9(6) int_rep1 intensified off,
16 sy-vline,17(35) int_rep-ename intensified off .
if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
write : 47 sy-vline,48(15) int_rep-zweck intensified off.
else.
write:
47 sy-vline,48(15) int_rep-bankn intensified off .
endif.
write: 63 sy-vline,64(16) int_rep-betrg
intensified off currency 'INR',
80 sy-vline.
ws_betrg = ws_betrg + int_rep-betrg.
*-testing......for soma
skip.
write :
/1 sy-vline, 7 sy-vline ,16 sy-vline ,47 sy-vline,63 sy-vline,80
sy-vline .
*-end testing......for soma
at end of zlsch.
if int_rep-bankl = ' '.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = ws_betrg
importing
amt_in_words = amount_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
w_val-word = amount_word.
concatenate 'INR.' w_val-word into w_val-word
separated by space.
write:/1(80) sy-uline.
write: /1 sy-vline, 7 'Total transfer:'(009),
64(16) ws_betrg intensified off currency 'INR',
80 sy-vline.
write:/1(80) sy-uline.
write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
80 sy-vline.
write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
80 sy-vline.
write:/1(80) sy-uline.
clear: ws_betrg,cnt.
skip 2.
write: /2 'Prepared by :'(010), '_______________'(013),
45 'Checked by :'(011),'_______________'(013).
skip 2.
write: /2 'Printed On ', sy-datum,
45 'Approved by :'(012),'_______________'(013).
clear sy-pagno.
endif.
endat.
at end of bankl.
if int_rep-bankl ' '.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = ws_betrg
importing
amt_in_words = amount_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
w_val-word = amount_word.
concatenate 'INR.' w_val-word into w_val-word
separated by space.
write:/1(80) sy-uline.
write: /1 sy-vline, 7 'Total transfer:'(009),
64(16) ws_betrg intensified off currency 'INR',
80 sy-vline.
write:/1(80) sy-uline.
write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
80 sy-vline.
write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
80 sy-vline.
write:/1(80) sy-uline.
clear: ws_betrg,cnt.
skip 2.
write: /2 'Prepared by :'(010), '_______________'(013),
45 'Checked by :'(011),'_______________'(013).
skip 2.
write: /2 'Printed on ', sy-datum,
45 'Approved by :'(012),'_______________'(013).
clear sy-pagno.
NEW-PAGE.
endif.
endat.
endloop.
End of Page
end-of-page.
write: /2 'Prepared by :'(010), '_______________',
45 'Checked by :'(011),'_______________'.
*& Form IMPORT_CLUSTER
Importing Data from Cluster *
form import_cluster.
sy-subrc = 0.
rp-imp-c2-cd.
if sy-subrc eq 0.
if cd-version-number ne ocd-version-number.
endif.
endif. " SY-SUBRC EQ 0
endform. " IMPORT_CLUSTER
*& Form INT_TAB
Filling internal table tab_rgdir
form int_tab.
*Fill internal table tab_rgdir.
move-corresponding rgdir to tab_rgdir.
tab_rgdir-pernr = pernr-pernr.
append tab_rgdir.
endform. " INT_TAB
*& Form IMPORT_bt
Import Values from Bank Transactions Table (BT)
form import_bt.
rp-init-buffer.
RP-IMP-C2-RX.
rp-imp-c2-in.
if rp-imp-in-subrc eq 0.
if in-version-number ne oin-version-number.
write: / 'Schlüssel des Clusters RX:'(015),
rx-key-pernr, rx-key-seqno.
write: / 'The imported version of the cluster'(016), 'RX',
'is not current'(017).
write: / 'Imported version :'(018),
oin-version-number.
write: / 'Current version of cluster :'(019),
in-version-number.
stop.
else.
sy-subrc = 0.
endif.
else.
sy-subrc = 8.
write: /
'Inconsistencies between cluster directory and directory for'(020).
write: /
'No payroll results found for data in cluster directory'(021).
write : /
'Please contact hotline to solve the current problem'(022).
endif.
ws_fpbeg(2) = versc-fpbeg+4(2).
ws_fpbeg+2(4) = versc-fpbeg(4).
ws_fpend(2) = versc-fpend+4(2).
ws_fpend+2(4) = versc-fpend(4).
ws_mthyr(2) = pa_mth.
ws_mthyr+2(4) = pa_year.
check ws_mthyr = ws_fpbeg.
check ws_mthyr = ws_fpend.
loop at bt. "from pc209
int_rep-pernr = pernr-pernr.
int_rep-ename = pernr-ename.
int_rep-bankl = bt-bankl.
int_rep-bankn = bt-bankn.
int_rep-betrg = bt-betrg.
int_rep-zlsch = bt-zlsch.
append int_rep.
endloop.
IF P_BANKL ' ' AND P_ZLSCH ' '.
DELETE INT_REP WHERE BANKL P_BANKL.
ELSEIF P_BANKL = ' ' AND P_ZLSCH ' '.
DELETE INT_REP WHERE ZLSCH P_ZLSCH.
ELSEIF P_BANKL ' ' AND P_ZLSCH = ' '.
DELETE INT_REP WHERE BANKL P_BANKL.
ENDIF.
endform. " IMPORT_BT
*& Form CONVERT_MONTH
Fetching Month Text
form convert_month using mth t_mth.
case mth.
when '01'.
t_mth = 'January'(023).
when '02'.
t_mth = 'February'(024).
when '03'.
t_mth = 'March'(025).
when '04'.
t_mth = 'April'(026).
when '05'.
t_mth = 'May'(027).
when '06'.
t_mth = 'June'(028).
when '07'.
t_mth = 'July'(029).
when '08'.
t_mth = 'August'(030).
when '09'.
t_mth = 'September'(031).
when '10'.
t_mth = 'October'(032).
when '11'.
t_mth = 'November'(033).
when '12'.
t_mth = 'December'(034).
endcase.
endform. " CONVERT_MONTH
*& Form CONVERT_DATE_A
Fetching Month Text *
form convert_date_a using mth_t t_mth_t.
case mth_t.
when '01'.
t_mth_t = 'Jan.'(035).
when '02'.
t_mth_t = 'Feb.'(036).
when '03'.
t_mth_t = 'Mar.'(037).
when '04'.
t_mth_t = 'Apr.'(038).
when '05'.
t_mth_t = 'May.'(039).
when '06'.
t_mth_t = 'Jun.'(040).
when '07'.
t_mth_t = 'Jul.'(041).
when '08'.
t_mth_t = 'Aug.'(042).
when '09'.
t_mth_t = 'Sep.'(043).
when '10'.
t_mth_t = 'Oct.'(044).
when '11'.
t_mth_t = 'Nov.'(045).
when '12'.
t_mth_t = 'Dec.'(046).
endcase.
endform. " CONVERT_DATE_A
*& Form VALIDATE
text
--> p1 text
<-- p2 text
form validate .
if p_bankl <> ' ' and p_zlsch ' '.
delete int_rep where bankl p_bankl.
elseif p_bankl = ' ' and p_zlsch ' '.
delete int_rep where zlsch p_zlsch.
elseif p_bankl ' ' and p_zlsch = ' '.
delete int_rep where bankl p_bankl.
endif.
endform. " VALIDATE
check this weblog.....
/people/dj.adams/blog/2003/11/13/food-for-thought-ldbs-and-abap-objects
Also , check the following link too.
http://www.datamanagementgroup.com/Resources/Articles/Article_1005_2.asp
Regards,
Satish -
Purchase order print program error
hi experts!
am facing a problem in my purchase order print program. the problem is that when i am trying to see the print preview the following dump error is throughing, which am not able to understand.
the P.O total amount should be change into words( like one million then thousand thirty three kuwait dinars)
but the total amount is not converting into as mentioned, instead the dump is encountered.
please give me solution,
thnaks
*DUMP*
Runtime Errors CONVT_NO_NUMBER
Exception CX_SY_CONVERSION_NO_NUMBER
Date and Time 05.05.2008 19:04:43
Short text
Unable to interpret "1760,778.71 " as a number.
What happened?
Error in the ABAP Application Program
The current ABAP program "ZMM_SUBROUTINES" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
What can you do?
Note down which actions and inputs caused the error.
To process the problem further, contact you SAP system
administrator.
Using Transaction ST22 for ABAP Dump Analysis, you can look
at and manage termination messages, and you can also
keep them for a long time.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_CONVERSION_NO_NUMBER', was not
caught in
procedure "GET_AMT_IN_WORDS" "(FORM)", nor was it propagated by a RAISING
clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The program attempted to interpret the value "1760,778.71 " as a number, but
since the value contravenes the rules for correct number formats,
this was not possible.
How to correct the error
Whole numbers are represented in ABAP as a sequence of numbers, possibly
with an algebraic sign.
The following are the possibilities for the representation of floating
point numbers:
[algebraic sign][mantissa]E[algebraic sign][exponent]
[algebraic sign][whole number part].[fraction part]
For example, -12E+34, +12E-34, 12E34, 12.34
If the error occurred in your own ABAP program or in an SAP
program you modified, try to remove the error.
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"CONVT_NO_NUMBER" "CX_SY_CONVERSION_NO_NUMBER"
"ZMM_SUBROUTINES" or "ZMM_SUBROUTINES"
"GET_AMT_IN_WORDS"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
The exception must either be prevented, caught within proedure
"GET_AMT_IN_WORDS" "(FORM)", or its possible occurrence must be declared in the
RAISING clause of the procedure.
To prevent the exception, note the following:
System environment
SAP-Release 700
Application server... "EHPAP1"
Network address...... "10.100.150.103"
Operating system..... "AIX"
Release.............. "5.3"
Hardware type........ "00C3B3F04C00"
Character length.... 16 Bits
Pointer length....... 64 Bits
Work process number.. 1
Shortdump setting.... "full"
Database server... "EHPDB"
Database type..... "DB6"
Database name..... "EHP"
Database user ID.. "SAPEHP"
Char.set.... "C"
SAP kernel....... 700
created (date)... "Mar 19 2007 20:40:49"
create on........ "AIX 2 5 005DD9CD4C00"
Database version. "DB6_81 "
Patch level. 102
Patch text.. " "
Database............. "DB6 08.02., DB6 09."
SAP database version. 700
Operating system..... "AIX 1 5, AIX 2 5, AIX 3 5"
Memory consumption
Roll.... 16192
EM...... 29328936
Heap.... 0
Page.... 1359872
MM Used. 19180992
MM Free. 1764848
User and Transaction
Client.............. 400
User................ "FADISULAIMAN"
Language key........ "E"
Transaction......... "ME22N "
Program............. "ZMM_SUBROUTINES"
Screen.............. "SAPLMEGUI 0014"
Screen line......... 22
Information on where terminated
Termination occurred in the ABAP program "ZMM_SUBROUTINES" - in
"GET_AMT_IN_WORDS".
The main program was "RM_MEPO_GUI ".
In the source code you have the termination point in line 398
of the (Include) program "ZMM_SUBROUTINES".
The termination is caused because exception "CX_SY_CONVERSION_NO_NUMBER"
occurred in
procedure "GET_AMT_IN_WORDS" "(FORM)", but it was neither handled locally nor
declared
in the RAISING clause of its signature.
The procedure is in program "ZMM_SUBROUTINES "; its source code begins in line
358 of the (Include program "ZMM_SUBROUTINES ".
Source Code Extract
Line SourceCde
368 DATA: lt_spell LIKE spell.
369
370 READ TABLE in_tab WITH KEY 'CURR'.
371 IF sy-subrc = 0.
372 lf_curr = in_tab-value.
373 ENDIF.
374
375 READ TABLE in_tab WITH KEY 'NETWR'.
376 IF sy-subrc = 0.
377 lf_netpr_01 = in_tab-value.
378 REPLACE ',' IN lf_netpr_01 WITH ' '.
379 CONDENSE lf_netpr_01 NO-GAPS.
380
381 IF lf_curr = 'KWD'.
382 lf_netpr_kwd = lf_netpr_01.
383
384 CALL FUNCTION 'SPELL_AMOUNT'
385 EXPORTING
386 amount = lf_netpr_kwd
387 currency = lf_curr
388 filler = ''
389 language = sy-langu
390 IMPORTING
391 in_words = lt_spell
392 EXCEPTIONS
393 not_found = 1
394 too_large = 2
395 OTHERS = 3.
396
397 ELSE.
>>>>> lf_netpr = lf_netpr_01.
399 CALL FUNCTION 'SPELL_AMOUNT'
400 EXPORTING
401 amount = lf_netpr
402 currency = lf_curr
403 filler = ''
404 language = sy-langu
405 IMPORTING
406 in_words = lt_spell
407 EXCEPTIONS
408 not_found = 1
409 too_large = 2
410 OTHERS = 3.
411 ENDIF.
412 IF sy-subrc <> 0.
413 * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
414 * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
415
416 ELSE.
417
Contents of system fields
Name Val.
SY-SUBRC 0
SY-INDEX 17
SY-TABIX 1
SY-DBCNT 18
SY-FDPOS 1
SY-LSIND 0
SY-PAGNO 0
SY-LINNO 1
SY-COLNO 1
SY-PFKEY NORMAL
SY-UCOMM PREVOUTPUT
SY-TITLE Held Imp. Pur. O r - ESG 5000000021 Created by Fadi Sulaiman
SY-MSGTY A
SY-MSGID TD
SY-MSGNO 426
SY-MSGV1 NEXTPAGE
SY-MSGV2 ZMEDRUCK_PO
SY-MSGV3
SY-MSGV4
SY-MODNO 0
SY-DATUM 20080505
SY-UZEIT 190441
SY-XPROG SAPCNVE
SY-XFORM CONVERSION_EXITHi Prasad,
Check the FM's
SPELL_AMOUNT --> for display in millions
HR_IN_CHG_INR_WRDS --> for display in lakhs and crores -
Report painter question regarding amounts in different currencies
Hi,
I have a report created in GRR2 using library 1VK. We display the total costs SWOG here but have the request to see in addition these costs in USD simulteanously. For that I included the basic key figure SWZG. When executing the report there is now a new selection parameter Target currency, Exchange rate date and Exchange rate type. I can see a new column with USD values, so far so good. But when I check the calculation I find that it can't be right, it differs from what it should calculate.
If I execute the report and select currency tranlsation of the key figure SWOG with exactly the same exchange parameters as above I'm getting different values in USD which match my manual calculation.
Any idea why this happens? What do you recommend to have both currencies ate the same time on the screen?
Thank you
Exberlinerhii sanjeev.
try this,
FM - > spell_amount
OR
data: words(50) type c.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = '100000'
importing
amt_in_words = words.
write:/ words.
OR
RF_SPELL
rgds
anver -
Need example report program using PNPCE LDB in SAP HR
Need example report program using PNPCE LDB in SAP HR.
and how to create a report category in sap hr for using it as cutomised selection screen.Hi,
Go through the following links, i hope it will help you.....
/people/alvaro.tejadagalindo/blog/2006/02/19/how-to-deal-with-hr-payroll-reports
http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/893908#
A sample prog with LDB PNP
*& Report ZH_REPT_PAYMENT *
report zh_rept_payment line-size 80 no standard page
heading.
tables: pernr, " Standard Selections for HR Master Data Reporting
pcl1, " HR Cluster 1
pcl2, " HR Cluster 2
pa0009,
PA9001,
PA9006,
pa0002,
pc260 , " Cluster Directory for Payroll Results
bnka .
Infotypes
infotypes: 0001. " Organizational Assignment
Declaration of Internal Tables
data : bnka1 like bnka occurs 0 with header line .
data: begin of t_int_rep occurs 100,
bankl like pc209-bankl, " Bank Number
zlsch like pc209-zlsch, " Payment method
pernr like pernr-pernr, " Employee Number
ename like pernr-ename, " Employee Name
bankn like pc209-bankn, " Bank Account Number
betrg like pc209-betrg, " Amount to be transfered
zweck like pa0009-zweck, " Purpose
end of t_int_rep.
data: begin of int_rep occurs 100,
bankl like pc209-bankl, " Bank Number
zlsch like pc209-zlsch, " Payment method
pernr like pernr-pernr, " Employee Number
ename like pernr-ename, " Employee Name
bankn like pc209-bankn, " Bank Account Number
betrg like pc209-betrg, " Amount to be transfered
zweck like pa0009-zweck, " Purpose
begda like pa0009-begda, "Begin date
end of int_rep.
Declaration of Data Variables
data: ws_betrg like pc209-betrg, " BT Amount
w_val like spell occurs 0 with header line,
int_rep1(6), " TYPE I, " Employee Number
cnt type i value 0, " Counter
calcmolga like t500l-molga value '40', " Country Grouping
v_id(15),
calc_currency like t001-waers value 'INR'. " Currency
data : ctr type i,
dt_merge like pa0009-begda.
data: ws_totemp(6) type c,
ws_totamt(20) type c,
r_mth(9) type c,
ws_fpbeg(6) type c,
ws_fpend(6) type c,
ws_mthyr(6) type c,
ws_mthyr_r(14) type c,
r_mth_t(3) type c,
ws_amt(8) type c,
ws_bankl(14) type c,
ws_date(6) type c,
amount_word(500),
total_page type i,
pages type i,
remain type i.
data begin of i_spell.
include structure spell .
data end of i_spell .
data : c_molga type t500l-molga value '40',
c_banks type bnka-banks value 'IN'.
Standard Includes
include rpc2cd09. "Cluster CD data definition
include pc2rxin0.
include rpc2rx09.
include rpppxd00. " Data Definition buffer PCL1/PCL2
include rpppxd10. " Common Part buffer PCL1/PCL2
include rpppxm00. " Buffer Handling RoutinePCL1/PCL2
include zrpc2rox2. " Data Definition POCLSTERS (not J,K,U)
Selection Screen
selection-screen begin of block b1 with frame title text-001.
parameter: pa_mth(2) type c default sy-datum+4(2) obligatory,
pa_year(4) type c default sy-datum(4) obligatory,
p_bankl like pc209-bankl, " Bank Number
p_zlsch like pc209-zlsch. " Payment method
selection-screen end of block b1.
save_calc_currency = calc_currency.
count_top = 0.
get_pernr_flag = 0.
Top-Of-Page
top-of-page.
perform convert_month using pa_mth(2) r_mth.
ws_mthyr_r = r_mth.
concatenate ws_mthyr_r pa_year into ws_mthyr_r separated by space.
SKIP 5.
skip 1.
skip 4.
if int_rep-bankl eq ' '.
if int_rep-zlsch eq 'C' or int_rep-zlsch eq 'E' or
int_rep-zlsch eq ' '.
write: /1(85) 'CHEQUE PAYMENT STATEMENT'(047) centered.
elseif int_rep-zlsch eq 'L'.
write: /1(85) 'DEMAND DRAFT STATEMENT'(047) centered.
endif.
else.
write: /1(85) 'BANK TRANSFER STATEMENT'(002) centered.
endif.
skip.
write: /34 ws_mthyr_r,
62 'Page :'(008),69(2) sy-pagno intensified off,
' Of ',78(2) pages intensified off.
clear pages.
read table bnka1 with key bankl = int_rep-bankl .
if sy-subrc = 0.
if int_rep-zlsch eq 'T'.
write:/03(10) 'Bank Name : ', bnka1-banka.
write:/03(10) 'Branch : ', bnka1-brnch.
write:/03(10) 'Address : ', bnka1-stras.
endif.
endif.
skip.
write:/1(80) sy-uline.
write: /1 sy-vline, 2(5) 'Sl.No'(002),
7 sy-vline, 8(8) 'Emp.No.'(003),
16 sy-vline,17(35) 'Employee Name'(004).
*--added for Demand Draft
if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
write : 47 sy-vline, 48(15) 'Payable at'(005).
else.
write : 47 sy-vline,48(15) 'Account No.'(005).
endif.
write: 63 sy-vline,64(16) 'Amount'(006),
80 sy-vline.
write:/1(80) sy-uline.
end-of-page.
write:/1(80) sy-uline.
write:/2 'Printed on ', sy-datum.
Start-of-selection.
start-of-selection.
*perform h_headr.
ctr = 0.
set margin 5.
call function 'RP_GET_CURRENCY'
exporting
molga = calcmolga
importing
waers = calc_currency
exceptions
others.
if sy-subrc ne 0.
calc_currency = 'DEM'.
calc_currency = save_calc_currency.
endif.
get pernr.
cd-key-pernr = pernr-pernr.
perform import_cluster.
get_pernr_flag = 1.
check : ocd-version-molga eq calcmolga.
The table 'tabpernr' is filled with the personnel numbers
and is used after selection is finished.
move-corresponding pernr to tabpernr.
append tabpernr.
The table 'tab_rgdir' is filled
loop at rgdir.
rx-key-pernr = pernr-pernr.
unpack rgdir-seqnr to rx-key-seqno.
perform int_tab. "fill tab_rgdir
perform import_bt.
perform validate.
endloop.
End of Selection
end-of-selection.
*perform h_headr.
perform convert_date_a using pa_mth r_mth_t.
sort int_rep by bankl zlsch pernr betrg descending.
delete adjacent duplicates from int_rep
comparing bankl zlsch pernr .
sort int_rep by bankl zlsch bankn . "PERNR.
loop at int_rep.
at new bankl.
select single * into bnka1 from bnka
where banks = c_banks and
bankl = int_rep-bankl .
append bnka1.
clear bnka1.
endat.
endloop.
for Demand Draft - purpose added
loop at int_rep.
concatenate pa_year(4) pa_mth(2) '01' into dt_merge.
select single * "zweck into int_rep-zweck
from pa0009 where
pernr = int_rep-pernr and
bankl = int_rep-bankl and
zlsch = int_rep-zlsch
and begda <= dt_merge and
endda >= dt_merge .
if sy-subrc = 0.
int_rep-zweck = pa0009-zweck.
modify int_rep.
endif.
endloop.
*-for DD and Chq sorted by PAyable at and EMPNO wise
if p_zlsch = 'T' .
sort int_rep by bankl zlsch bankn . "PERNR.
else. "added for "payable at" for DD/Chq
else.
sort int_rep by zweck pernr . "PERNR.
endif.
*delete adjacent duplicates from int_rep.
t_int_rep] = int_rep[.
loop at int_rep.
*-for page of page no.
total_page = 0.
loop at t_int_rep where bankl = int_rep-bankl
and zlsch = int_rep-zlsch.
total_page = total_page + 1.
endloop.
pages = total_page div 25.
remain = total_page mod 25.
comment bcoz its adding one extra page no.
done as on 29/11/2004
if remain > 0.
pages = pages + 1.
endif.
**-end
at new bankl.
ctr = 0 .
new-page.
endat.
at new zlsch.
ctr = 0 .
new-page.
endat.
clear v_id.
select single natio
into pa0002-natio
from pa0002
where pernr eq int_rep-pernr.
*-testing......for soma
if ctr > 24.
ctr = 0 .
write:/1(80) sy-uline.
new-page .
endif.
ctr = ctr + 1 .
cnt = cnt + 1.
pack int_rep-pernr to int_rep1.
write:/1 sy-vline, 2(3) cnt intensified off,
7 sy-vline, 9(6) int_rep1 intensified off,
16 sy-vline,17(35) int_rep-ename intensified off .
if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
write : 47 sy-vline,48(15) int_rep-zweck intensified off.
else.
write:
47 sy-vline,48(15) int_rep-bankn intensified off .
endif.
write: 63 sy-vline,64(16) int_rep-betrg
intensified off currency 'INR',
80 sy-vline.
ws_betrg = ws_betrg + int_rep-betrg.
*-testing......for soma
skip.
write :
/1 sy-vline, 7 sy-vline ,16 sy-vline ,47 sy-vline,63 sy-vline,80
sy-vline .
*-end testing......for soma
at end of zlsch.
if int_rep-bankl = ' '.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = ws_betrg
importing
amt_in_words = amount_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
w_val-word = amount_word.
concatenate 'INR.' w_val-word into w_val-word
separated by space.
write:/1(80) sy-uline.
write: /1 sy-vline, 7 'Total transfer:'(009),
64(16) ws_betrg intensified off currency 'INR',
80 sy-vline.
write:/1(80) sy-uline.
write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
80 sy-vline.
write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
80 sy-vline.
write:/1(80) sy-uline.
clear: ws_betrg,cnt.
skip 2.
write: /2 'Prepared by :'(010), '_______________'(013),
45 'Checked by :'(011),'_______________'(013).
skip 2.
write: /2 'Printed On ', sy-datum,
45 'Approved by :'(012),'_______________'(013).
clear sy-pagno.
endif.
endat.
at end of bankl.
if int_rep-bankl ' '.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = ws_betrg
importing
amt_in_words = amount_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
w_val-word = amount_word.
concatenate 'INR.' w_val-word into w_val-word
separated by space.
write:/1(80) sy-uline.
write: /1 sy-vline, 7 'Total transfer:'(009),
64(16) ws_betrg intensified off currency 'INR',
80 sy-vline.
write:/1(80) sy-uline.
write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
80 sy-vline.
write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
80 sy-vline.
write:/1(80) sy-uline.
clear: ws_betrg,cnt.
skip 2.
write: /2 'Prepared by :'(010), '_______________'(013),
45 'Checked by :'(011),'_______________'(013).
skip 2.
write: /2 'Printed on ', sy-datum,
45 'Approved by :'(012),'_______________'(013).
clear sy-pagno.
NEW-PAGE.
endif.
endat.
endloop.
End of Page
end-of-page.
write: /2 'Prepared by :'(010), '_______________',
45 'Checked by :'(011),'_______________'.
*& Form IMPORT_CLUSTER
Importing Data from Cluster *
form import_cluster.
sy-subrc = 0.
rp-imp-c2-cd.
if sy-subrc eq 0.
if cd-version-number ne ocd-version-number.
endif.
endif. " SY-SUBRC EQ 0
endform. " IMPORT_CLUSTER
*& Form INT_TAB
Filling internal table tab_rgdir form int_tab.
*Fill internal table tab_rgdir.
move-corresponding rgdir to tab_rgdir.
tab_rgdir-pernr = pernr-pernr.
append tab_rgdir.
endform. " INT_TAB
*& Form IMPORT_bt
Import Values from Bank Transactions Table (BT) form import_bt.
rp-init-buffer.
RP-IMP-C2-RX.
rp-imp-c2-in.
if rp-imp-in-subrc eq 0.
if in-version-number ne oin-version-number.
write: / 'Schlüssel des Clusters RX:'(015),
rx-key-pernr, rx-key-seqno.
write: / 'The imported version of the cluster'(016), 'RX',
'is not current'(017).
write: / 'Imported version :'(018),
oin-version-number.
write: / 'Current version of cluster :'(019),
in-version-number.
stop.
else.
sy-subrc = 0.
endif.
else.
sy-subrc = 8.
write: /
'Inconsistencies between cluster directory and directory for'(020).
write: /
'No payroll results found for data in cluster directory'(021).
write : /
'Please contact hotline to solve the current problem'(022).
endif.
ws_fpbeg(2) = versc-fpbeg+4(2).
ws_fpbeg+2(4) = versc-fpbeg(4).
ws_fpend(2) = versc-fpend+4(2).
ws_fpend+2(4) = versc-fpend(4).
ws_mthyr(2) = pa_mth.
ws_mthyr+2(4) = pa_year.
check ws_mthyr = ws_fpbeg.
check ws_mthyr = ws_fpend.
loop at bt. "from pc209
int_rep-pernr = pernr-pernr.
int_rep-ename = pernr-ename.
int_rep-bankl = bt-bankl.
int_rep-bankn = bt-bankn.
int_rep-betrg = bt-betrg.
int_rep-zlsch = bt-zlsch.
append int_rep.
endloop.
IF P_BANKL ' ' AND P_ZLSCH ' '.
DELETE INT_REP WHERE BANKL P_BANKL.
ELSEIF P_BANKL = ' ' AND P_ZLSCH ' '.
DELETE INT_REP WHERE ZLSCH P_ZLSCH.
ELSEIF P_BANKL ' ' AND P_ZLSCH = ' '.
DELETE INT_REP WHERE BANKL P_BANKL.
ENDIF.
endform. " IMPORT_BT
*& Form CONVERT_MONTH
Fetching Month Text form convert_month using mth t_mth.
case mth.
when '01'.
t_mth = 'January'(023).
when '02'.
t_mth = 'February'(024).
when '03'.
t_mth = 'March'(025).
when '04'.
t_mth = 'April'(026).
when '05'.
t_mth = 'May'(027).
when '06'.
t_mth = 'June'(028).
when '07'.
t_mth = 'July'(029).
when '08'.
t_mth = 'August'(030).
when '09'.
t_mth = 'September'(031).
when '10'.
t_mth = 'October'(032).
when '11'.
t_mth = 'November'(033).
when '12'.
t_mth = 'December'(034).
endcase.
endform. " CONVERT_MONTH
*& Form CONVERT_DATE_A
Fetching Month Text * form convert_date_a using mth_t t_mth_t.
case mth_t.
when '01'.
t_mth_t = 'Jan.'(035).
when '02'.
t_mth_t = 'Feb.'(036).
when '03'.
t_mth_t = 'Mar.'(037).
when '04'.
t_mth_t = 'Apr.'(038).
when '05'.
t_mth_t = 'May.'(039).
when '06'.
t_mth_t = 'Jun.'(040).
when '07'.
t_mth_t = 'Jul.'(041).
when '08'.
t_mth_t = 'Aug.'(042).
when '09'.
t_mth_t = 'Sep.'(043).
when '10'.
t_mth_t = 'Oct.'(044).
when '11'.
t_mth_t = 'Nov.'(045).
when '12'.
t_mth_t = 'Dec.'(046).
endcase.
endform. " CONVERT_DATE_A
*& Form VALIDATE
text
--> p1 text
<-- p2 text form validate .
if p_bankl <> ' ' and p_zlsch ' '.
delete int_rep where bankl p_bankl.
elseif p_bankl = ' ' and p_zlsch ' '.
delete int_rep where zlsch p_zlsch.
elseif p_bankl ' ' and p_zlsch = ' '.
delete int_rep where bankl p_bankl.
endif.
endform. " VALIDATE
check this weblog.....
/people/dj.adams/blog/2003/11/13/food-for-thought-ldbs-and-abap-objects
Also , check the following link too.
http://www.datamanagementgroup.com/Resources/Articles/Article_1005_2.asp
Regards,
Harish -
Dump while converting amount in script
Dear all ,
I am facing a problem while passing a value retreived from the script.
i.e
read table intab index 1.
i am reading the value from intab and the value is in this format. 1,234.00
when passing this value to the variable defined for the import paramter of FM HR_IN_CHG_INR_WRDS of type PC207-BETRG
i am getting dump. saying 'Unable to interpret "1,234.00 " as a number.
and i tried to eliminate the comma by using
SELECT SINGLE DCPFM FROM USR01
INTO VAR_DCPFM WHERE BNAME EQ SY-UNAME.
IF VAR_DCPFM EQ 'X'.
REPLACE ALL OCCURRENCES OF ',' IN: V_DATA4 WITH ''.
TRANSLATE V_DATA4 USING ','.
ELSEIF VAR_DCPFM EQ ''.
REPLACE ALL OCCURRENCES OF '.' IN: V_DATA4 WITH ''.
TRANSLATE V_DATA4 USING '.'.
TRANSLATE V_DATA4 USING ',.'.
ELSEIF VAR_DCPFM EQ 'Y'.
TRANSLATE V_DATA4 USING ',.'.
ENDIF.
CONDENSE V_DATA4 NO-GAPS.
So that it will be in the format 1234.00
now also whenever we are passing this data to the defined variable for import parameter of FM HR_IN_CHG_INR_WRDS
i am getting dump saying Unable to interpret "1234.00 " as a number
can any one help me out how to solve the problem
Thanks & regards
sreehariHi ,
Assign the result of that Value to a datatype which is declared as KWERT.
I mean packed decimal. Thn u assign that varaible to PC207-BETRG..
Data: lv_1 type KWERT.
Lv_1 = v_data4.
PC207-BETRG = lv_1. -
i want to converts amount value in numbers to Rupees .
Could anyone please explain about RF_SpellUse FM HR_IN_CHG_INR_WRDS or SPELL_AMOUNT
Here is the sample code
DATA AMT_IN_NUM LIKE PC207-BETRG.
DATA AMT_IN_WORDS(100) TYPE c.
PARAMETERS: AMOUNT LIKE AMT_IN_NUM.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = AMOUNT
IMPORTING
AMT_IN_WORDS = AMT_IN_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.
WRITE AMT_IN_WORDS.
Reward Points if it is helpful
Thanks
Seshu -
How to convert standard (Western) numerical format to Indian format?
I have been doing a lot of research and while I've repeatedly found the function module to convert numerical amounts in to words (HR_IN_CHG_INR_WRDS) I haven't found a way to convert a standard numerical format, 121,212,123 in to the Indian format of 12,12,12,123 or 505,000 to 5,05,000 for example.
I repeatedly saw in other threads people were suggesting to change the decimal format of the currency in OY01 however the Indian format option is not listed. We only have the following options:
X 1,234,567.89
Y 1 234 567,89
1.234.567,89
Whereas I would need 12,34,567.89.
Is there a Function Module we can use? Is there some CIN add-on we need to import to make the additonal decimal format available?
Thanks in advanceCheck [this link>>>|http://www.xe.com/ucc/convert.cgi?Amount=10000000&From=USD&To=INR&image.x=62&image.y=20&image=Submit]
else.. You might have to write a conversion routine...
DATA: curr TYPE netwr,
c(20) TYPE c.
curr = '1234567890'.
WRITE:/ 'before:', curr.
WRITE curr TO c USING EDIT MASK '__,__,___.__'.
WRITE:/ 'after:', c. -
Hi Experts,
I want to know the function module to convert currency in words
for example
24.05 INR as 24 rupees 5 paisa
others wise please tell me the tables in which currency data stored.....for example INR - Rupee , paise....
Regards,
Siva.Hi
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '123'.
SY-TITLE = 'SPELLING NUMBER'.
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
FORM SPELL_AMOUNT USING PWRBTR PWAERS.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = PAMOUNT
CURRENCY = PWAERS
FILLER = SPACE
LANGUAGE = 'E'
IMPORTING
IN_WORDS = T_SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
ENDFORM.
Or
DATA AMT_IN_NUM LIKE PC207-BETRG.
DATA AMT_IN_WORDS(100) TYPE c.
PARAMETERS: AMOUNT LIKE AMT_IN_NUM.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = AMOUNT
IMPORTING
AMT_IN_WORDS = AMT_IN_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.
WRITE AMT_IN_WORDS.
With Regards
Nikunj Shah -
hi all
can any buddy tell me what is c form in SAP FI?
and which are tables releted to it?
if it is help full full poit
Message was edited by:
paresh patelHi Prem,
Copy the standard program to a z-program and in the text elements remove the standard and add as per
your requirement(Vendor, Invoice).
& For Amount in words use SPELL_AMOUNT as mention above or use HR_IN_CHG_INR_WRDS
and if it is foreign currency, then change after using HR_IN_CHG_INR_WRDS
REPLACE 'Rupees' WITH 'Dollar' into amt_in_words.
REPLACE 'Paise' WITH 'Cents' into amt_in_words.
Thanks & regards,
Dileep .C -
Amount in words in F110 (sapscript -indian format)
Hi Experts.
I have changed the F110_PRENUM_CHCK to Z110_PRENUM_CHCK .
I want the amount to be in word in indian format.
say Ten Lakh ninty thousand and fifty
But i am getting the output in "One millon .. " format
Pls give me the coding and also suggest me how to incorporate in sapscript .
Window CHECKSPL
545
Amount in words -
&'*** 'SPELL-WORD& &' and 'SPELL-DECWORD&***
Example for amount and decimal places in words
&'*** 'SPELL-WORD& ®UD-WAERS&&' and 'SPELL-DECWORD' Cents'& ***
Example for numbers in words
&SPELL-DIG06(6)&&SPELL-DIG05(6)&&SPELL-DIG04(6)&&SPELL-DIG03(6)&&SPELL-DIG02(6)&&SPELL-DIG01(7)&
Pls revert back its urgent
Thanks
Pravesh Deshbhratarsame code i used in smartform:
DATA : l_spell_a TYPE pc207-betrg,
l_local TYPE string,
w_len TYPE i.
* Internal Table Declaration
DATA : BEGIN OF t_char OCCURS 0,
char(80) TYPE c,
END OF t_char.
l_spell_a = l_amtsum.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = l_spell_a
IMPORTING
amt_in_words = l_spell
EXCEPTIONS
data_type_mismatch = 1
OTHERS = 2.
IF sy-subrc = 0.
Maybe you are looking for
-
hello, since 3-4 days I notice that app updates aren't downloading on my iPad air 2. I have iOS 8.1.3. I see the message "error purchasing this app" being displayed wherever I tap the update button. When i do "update all", nothing happens...I have t
-
error when installing PS update? for 208 days! Help!
-
Iphoto won't allow import to library from previous version
I traded imacs with my sister who lives in the same house and uses the same network as I. I also find saving pages confusing but that's a story for another time. The current problem is trying to import my stuff onto this newer mac os x. Is there a wa
-
Sharing more then the drop box
I am looking for a way to share files between computers with out having to use the drop box. I have 5 computers in my office and I am looking for an easy way to transfer files between the computers, if anyone has any suggestions I would appreciate it
-
Verizon, where are my additional languages for swype?
Verizon, where are my additional languages for swype? Why I'm limited to only English and Spanish?! How to add more languages to my phone?