*&---------------------------------------------------------------------* *& Report ZST_FI_RPT_RECIEPT *& *& This is a driver program for Reciept. *& This calls the smartform ZST_FI_SF_RECEIPT.

*&---------------------------------------------------------------------* REPORT zst_fi_rpt_reciept. ************************************************************************ **** TABLES DEFINITION **** ************************************************************************ TABLES : bseg, "Accounting Document Segm ent bkpf, "Accounting Document Head er kna1, "General Data in Customer Master spell, "Transfer structure for a mounts rendered in words lfa1, "Vendor Master (General S ection) t001, "Company Codes adrc, "Addresses (Business Addr ess Services) t005u, "Taxes: Region Key: Texts vbkpf, "Document Header for Docu ment Parking vbsegd, "Document Segment for Cus tomer Document Parking vbsegk, "Document Segment for Vend or Document Parking zfi_reciept. ************************************************************************ **** SELECTION-SCREEN **** ************************************************************************ SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001. PARAMETERS: p_bukrs LIKE bkpf-bukrs OBLIGATORY, p_gjahr LIKE bkpf-gjahr OBLIGATORY, p_blart LIKE bkpf-blart OBLIGATORY. SELECT-OPTIONS: s_belnr FOR bkpf-belnr OBLIGATORY.

PARAMETERS: p_sqft RADIOBUTTON GROUP r1 USER-COMMAND rusr MODIF ID MD0, rr RADIOBUTTON GROUP r1 DEFAULT 'X', main RADIOBUTTON GROUP r1 , coup RADIOBUTTON GROUP r1 ,

"Account Number of Vendor or Creditor buzei LIKE bseg-buzei. parameters : priv radiobutton group abc. "Accounting Document Number gjahr LIKE bkpf-gjahr. bukrs LIKE bseg-bukrs. GROUP r1 . region LIKE adrc- . "Company Code * bukrs LIKE VBKPF-bukrs.flat RADIOBUTTON shop RADIOBUTTON elec RADIOBUTTON secu RADIOBUTTON PARAMETERS: p_xsqft(40) TYPE GROUP r1 . "Posting Date in the Document blart LIKE bkpf-blart. "Amount in Local Currency koart LIKE bseg-koart. "Document Type xblnr like bkpf-xblnr. parameters : prin radiobutton group abc. "Company Code * bukrs like vbsegdbukrs. c MODIF ID MD1 . DATA: BEGIN OF wa_bseg. "Accounting Document Number gjahr LIKE bseg-gjahr. END OF wa_bkpf. selection-screen : end of block b2. belnr LIKE bseg-belnr. "Assignment sgtxt LIKE bseg-sgtxt. GROUP r1 . DATA: BEGIN OF wa_reg. "Fiscal Year dmbtr LIKE bseg-dmbtr. " For Parked Doc belnr LIKE bkpfbelnr. " ADDED ON 12. ************************************************************************ **** INTERNAL TABLES **** ************************************************************************ DATA: BEGIN OF wa_bkpf. GROUP r1 . bktxt like bkpf-bktxt. SELECTION-SCREEN: END OF BLOCK blk1. "Fiscal Year budat LIKE bkpfbudat. "Source Comp Code(For Parked Docs). "Account Type zuonr LIKE bseg-zuonr.2008 END OF wa_bseg.02. bukrs LIKE bkpf-bukrs. selection-screen : begin of block b2 with frame title text-002. "Customer Number 1 lifnr LIKE bseglifnr. DATA : text(40) TYPE c. "Item Text kunnr LIKE bseg-kunnr.

DATA: BEGIN OF wa_lfa1. DATA: BEGIN OF wa_kna1. ************************************************************************ . DATA: it_fin1 TYPE zfi_note OCCURS 0 WITH HEADER LINE. tdname TYPE thead-tdname. DATA: it_bseg LIKE STANDARD TABLE OF wa_bseg WITH HEADER LINE. DATA : p_control_parameters TYPE ssfctrlop OCCURS 0 WITH HEADER LINE. DATA: it_bsegk LIKE STANDARD TABLE OF wa_bseg WITH HEADER LINE. DATA : t_line TYPE tline OCCURS 0 WITH HEADER LINE. "Region (State. "Description END OF wa_reg. lifnr LIKE lfa1lifnr. DATA: itab3 TYPE zfi_note OCCURS 0 WITH HEADER LINE. DATA : tdid TYPE thead-tdid. County) bezei LIKE t005u-bezei. name1 LIKE lfa1-name1. data: num1 type bsec-name1. kunnr LIKE kna1-kunnr. END OF wa_kna1. Province. data: it_reciept type standard table of zfi_reciept with header line. DATA: it_bsegd LIKE STANDARD TABLE OF wa_bseg WITH HEADER LINE. "Region (State.result1(80) TYPE c. DATA : s_type(68) TYPE c. vlen TYPE i. name1 LIKE kna1-name1. DATA: it_lfa1 LIKE STANDARD TABLE OF wa_lfa1 WITH HEADER LINE.region. DATA: it_kna1 LIKE STANDARD TABLE OF kna1 WITH HEADER LINE. "Customer Number 1 "Title "Name 1 "Account Number of Vendor or Creditor "Title "Name 1 DATA: it_bkpf LIKE STANDARD TABLE OF wa_bkpf WITH HEADER LINE. tdobject TYPE thead-tdobject. data : i_output_options type ssfcompop. anred LIKE lfa1-anred. DATA: v_amt LIKE pc207-betrg. ************************************************************************ **** DATA DECLARATION **** ************************************************************************ DATA : word TYPE spell-word. END OF wa_lfa1. DATA: it_reg LIKE STANDARD TABLE OF wa_reg WITH HEADER LINE. DATA: v_words(100). County) bland LIKE t005ubland. Province. anred LIKE kna1-anred. adrnr LIKE t001-adrnr.

SELECT bukrs "For Posted Documents belnr gjahr budat blart xblnr FROM bkpf INTO CORRESPONDING FIELDS OF TABLE it_bkpf WHERE bukrs = p_bukrs AND belnr IN s_belnr AND gjahr = p_gjahr AND blart = p_blart. ' '. loop at it_bkpf .02. p_control_parameters-preview i_output_options-tdnoprint i_output_options-tdnoprev i_output_options-tdnewid i_output_options-tdimmed = = = = = ' '. IF screen-group1 EQ 'MD1'. MODIFY SCREEN. include zduplicate_print. AT SELECTION-SCREEN OUTPUT. if sy-subrc = 0. if prin = 'X'. 'X'. ENDIF. * CLEAR: p_xsqft. ENDIF.2008 **** ************************************************************************ INITIALIZATION. ENDLOOP. IF p_sqft NE 'X'. screen-active = 0. select single * from zfi_reciept into it_reciept where belnr = it_bkpfbelnr and gjahr = p_gjahr and bukrs = p_bukrs. 'X'. ************************************************************************ **** START-OF-SELECTION **** ************************************************************************ START-OF-SELECTION. . lf_formname = 'ZST_FI_SF_RECEIPT_DUPLICATE'. LOOP AT SCREEN. 'X'.**** ADDED ON 11. DATA : lf_formname TYPE tdsfname.

itab3-text1 = it_bkpf-bktxt. endif. delete it_bkpf. p_control_parameters-no_dialog = ''. message 'Given Reciept(s) has already been printed' type 'I'. itab3-budat = it_bkpf-budat. itab3-xblnr = it_bkpf-xblnr. p_control_parameters-preview = 'X'. endif. IF NOT it_bkpf[] IS INITIAL. LOOP AT itab3. SELECT bukrs belnr gjahr zuonr sgtxt dmbtr koart sgtxt kunnr lifnr buzei INTO CORRESPONDING FIELDS OF TABLE it_bseg . itab3.PERFORM f_call_smart_form USING lf_formname. endloop. MOVE-CORRESPONDING itab3 TO it_fin1. data: xblnr type bkpf-xblnr. stop. loop at it_bkpf. append itab3. elseif priv = 'X'. if it_bkpf[] is not initial. xblnr = itab3-xblnr. i_output_options-tdnoprint = 'X'. CLEAR: itab3[]. stop. ENDLOOP. APPEND it_fin1. endloop. else. endif.

itab3-bukrs = it_bseg-bukrs. itab3-gjahr = it_bseg-gjahr. CALL FUNCTION 'READ_TEXT' EXPORTING * CLIENT = SY-MANDT id = '0001' language = 'E' name = tdname object = 'DOC_ITEM' * ARCHIVE_HANDLE = 0 * LOCAL_CAT = ' ' * IMPORTING * HEADER = TABLES lines = t_line EXCEPTIONS id = 1 language = 2 name = 3 not_found = 4 object = 5 reference_check = 6 wrong_access_to_archive = 7 OTHERS = 8 . itab3-belnr = it_bseg-belnr. itab3-sgtxt = it_bseg-sgtxt. LOOP AT it_bseg. READ TABLE it_bseg INDEX sy-index INTO it_bseg. IF sy-subrc = 0. IF sy-subrc <> 0.'K'). itab3-dmbtr = it_bseg-dmbtr. ENDIF. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. itab3-budat = it_fin1-budat. CONCATENATE '1000' it_bseg-belnr it_bseg-gjahr it_bsegbuzei INTO tdname. READ TABLE t_line INDEX 1.FROM bseg FOR ALL ENTRIES IN it_bkpf WHERE bukrs = it_bkpf-bukrs AND belnr = it_bkpf-belnr AND gjahr = it_bkpf-gjahr AND koart IN ('D'. IF itab3-sgtxt = ''. . itab3-zuonr = it_bseg-zuonr.

*--------------------------------------------------------------------------* itab3-kunnr = it_bseg-kunnr. itab3-bukrs = it_bsegd-bukrs. ENDIF. READ TABLE it_bsegd INDEX sy-index INTO it_bsegd. itab3-kunnr = it_bsegd-kunnr. APPEND itab3. SELECT bukrs K. itab3-lifnr = it_bsegd-lifnr. ENDLOOP. belnr gjahr zuonr "Parked Docs from Customer Table VBSEG . LOOP AT it_bsegd. "Parked Docs from Vendor Table VBSEGD. IF sy-subrc = 0. APPEND itab3. ENDLOOP. * if sy-subrc ne 0. ENDIF. itab3-ltext4 = t_line-tdline. CLEAR tdname. itab3-belnr = it_bsegd-belnr. itab3-dmbtr = it_bsegd-dmbtr. itab3-zuonr = it_bsegd-zuonr. itab3-sgtxt = it_bsegd-sgtxt. SELECT bukrs belnr gjahr sgtxt dmbtr zuonr sgtxt kunnr INTO CORRESPONDING FIELDS OF TABLE it_bsegd FROM vbsegd FOR ALL ENTRIES IN it_bkpf WHERE bukrs = it_bkpf-bukrs AND belnr = it_bkpf-belnr AND gjahr = it_bkpf-gjahr. ENDIF. itab3-lifnr = it_bseg-lifnr. itab3-budat = it_fin1-budat.IF sy-subrc = 0. ENDIF. itab3-gjahr = it_bsegd-gjahr.

ENDLOOP. MESSAGE 'No Data Found' TYPE 'I'. IF it_bseg[] IS INITIAL. itab3-dmbtr = it_bsegk-dmbtr. itab3. LOOP AT itab3. CLEAR: itab3[]. ENDIF. IF sy-subrc = 0. itab3-budat = it_fin1-budat. itab3-bukrs = it_fin1-bukrs. it_fin1. READ TABLE it_bsegk INDEX sy-index INTO it_bsegk. MOVE-CORRESPONDING itab3 TO it_fin1. itab3-bukrs = it_bsegk-bukrs. itab3-zounr = it_bsegk-zounr. ENDIF. itab3-kunnr = it_bsegk-kunnr. IF it_bsegd[] IS INITIAL. LOOP AT it_fin1. itab3-sgtxt = it_bsegk-sgtxt. itab3-belnr = it_bsegk-belnr. * . APPEND it_fin1. itab3-gjahr = it_bsegk-gjahr. ENDIF. ENDLOOP. CLEAR: it_fin1[].sgtxt dmbtr zuonr sgtxt lifnr INTO CORRESPONDING FIELDS OF TABLE it_bsegk FROM vbsegk FOR ALL ENTRIES IN it_bkpf WHERE bukrs = it_bkpf-bukrs AND belnr = it_bkpf-belnr AND gjahr = it_bkpf-gjahr. ENDIF. itab3-lifnr = it_bsegk-lifnr. APPEND itab3. IF it_bsegk[] IS INITIAL. STOP. ENDIF. LOOP AT it_bsegk.

* FROM t001 WHERE bukrs = it_fin1-bukrs. . itab3-butxt = t001-butxt. it_fin1-gjahr. SELECT SINGLE bland bezei INTO CORRESPONDING FIELDS OF it_reg FROM t005u WHERE t005u~bland = adrc-region AND t005u~land1 = 'IN' AND t005u~spras = 'E'. itab3-kstreet = adrc-STR_SUPPL3. IF NOT it_fin1-kunnr IS INITIAL. 0. itab3-street = adrc-street. ENDIF. ENDIF. IF sy-subrc = 0. itab3-anred = kna1-anred. itab3-post_code1 = adrc-post_code1. itab3-ort01 = t001-ort01. itab3-kregion = adrc-region. itab3-kunnr = kna1-kunnr. it_fin1-budat. itab3-addrnumber = t001-adrnr. itab3-name1 = kna1-name1. itab3-butxt = adrc-name1. SELECT SINGLE * FROM adrc WHERE addrnumber = t001-adrnr. it_fin1-dmbtr. it_fin1-kunnr. ENDIF. itab3-tel_number = adrc-tel_number. it_fin1-sgtxt.itab3-belnr = itab3-gjahr = itab3-dmbtr = itab3-budat = itab3-zuonr = itab3-sgtxt = itab3-kunnr = itab3-lifnr = SELECT SINGLE IF sy-subrc = * * it_fin1-belnr. itab3-bland = it_reg-bland. ENDIF. itab3-bezei = it_reg-bezei. itab3-house_num1 = adrc-house_num1. SELECT SINGLE * FROM kna1 WHERE kunnr = it_fin1-kunnr. it_fin1-lifnr. it_fin1-zuonr. IF sy-subrc = 0. IF NOT it_fin1-lifnr IS INITIAL. IF sy-subrc = 0.

***********************SS NEW MODIFICATION END******************** DELETE ADJACENT DUPLICATES FROM itab3 COMPARING belnr. CALL FUNCTION 'STRING_UPPER_LOWER_CASE' EXPORTING delimiter = '/' string1 = v_words . ENDIF. IF v_words+0(1) EQ ''. itab3-name1 = it_lfa1-name1.SELECT SINGLE lifnr anred name1 FROM lfa1 INTO CORRESPONDING FIELDS OF it_lfa1 WHERE lifnr = it_fin1-lifnr. ENDIF. itab3-lifnr = it_lfa1-lifnr. IF sy-subrc = 0. v_amt = itab3-dmbtr. v_words = v_words+1(vlen). IF itab3-dmbtr > 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ***********************SS NEW MODIFICATION START******************** if kna1-xcpdk = 'X'. vlen = STRLEN( v_words ). select single name1 from bsec into num1 where belnr in s_belnr. ENDIF. itab3-name1 = num1. endif. CALL FUNCTION 'HR_IN_CHG_INR_WRDS' EXPORTING amt_in_num = v_amt IMPORTING amt_in_words = v_words EXCEPTIONS data_type_mismatch = 1 OTHERS = 2. IF sy-subrc <> 0. itab3-anred = it_lfa1-anred. ENDIF. ENDIF.

* * * * = sy-mandt = tdid = sy-langu = tdname = tdobject = 0 = ' ' = = t_line = 1 = 2 = 3 = 4 = 5 = 6 = 7 * * * * * * . ENDIF. LOOP AT itab3. REPLACE FIRST OCCURRENCE OF 'rupees' IN v_words WITH ' '. CONCATENATE itab3-bukrs itab3-belnr itab3-gjahr itab3-buzei tdid = '0001'. tdobject = 'DOC_ITEM'. CLEAR itab3. ENDIF. ENDLOOP. IF sy-subrc = 0. tdname = s_type. IF sy-subrc <> 0. ENDIF. CALL FUNCTION 'READ_TEXT' EXPORTING client id language name object ARCHIVE_HANDLE LOCAL_CAT IMPORTING HEADER TABLES lines EXCEPTIONS ID LANGUAGE NAME not_found OBJECT REFERENCE_CHECK WRONG_ACCESS_TO_ARCHIVE INTO s_type. itab3-words1 = v_words. APPEND itab3. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.IMPORTING string = v_words EXCEPTIONS not_valid = 1 too_long = 2 too_small = 3 OTHERS = 4.

text = 'Sale of Flat'. *********** nts *********** *********** *********** *********** *********** *********** *********** *********** *********** *********** ************ ************ ************ ************ **** **** SELECT "bukrs "For Posted Docume "belnr "gjahr "budat "blart xblnr FROM bkpf INTO CORRESPONDING FIELDS OF TABLE it_bkpf WHERE bukrs = p_bukrs AND belnr IN s_belnr AND gjahr = p_gjahr AND blart = p_blart. *--------------------------------------------------------------------* * added on 11. xblnr = itab3-xblnr. "OTHERS text = p_xsqft. OTHERS ENDLOOP. endloop. IF sy-subrc <> 0. ELSEIF main = 'X'. ENDIF. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. text = 'Security Charges'. ELSEIF coup = 'X'. text = 'Rent / Revenue'. ENDIF.* * * = 8 .2008 *--------------------------------------------------------------------* IF rr = 'X'. itab3-xblnr = it_bkpf-xblnr. ELSEIF shop = 'X'. ELSEIF flat = 'X'. text = 'Sale of Coupons'. ELSEIF elec = 'X'. ELSEIF p_sqft = 'X'. . append itab3. ELSEIF secu = 'X'. data: xblnr type bkpf-xblnr. loop at it_bkpf.02. text = 'Electricity Charges'. text = 'Sale of Shop'. text = 'Maintenance'.

* break abapdev. * p_control_parameters-preview = 'X'. PERFORM f_call_smart_form USING lf_formname. * * * * * * * CALL FUNCTION lf_fm_name EXPORTING xblnr ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS control_parameters output_options text MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER OUTPUT_OPTIONS USER_SETTINGS IMPORTING = xblnr = = = = p_control_parameters = i_output_options = text = = = = = 'X' * . *&--------------------------------------------------------------------* *& Form f_call_smart_form *&--------------------------------------------------------------------* FORM f_call_smart_form USING p_lf_formname. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. IF sy-subrc <> 0. DATA: lf_fm_name TYPE rs38l_fnam. * p_control_parameters-no_dialog = ''. lf_formname = 'ZST_FI_SF_RECEIPT_OLD'.*--------------------------------------------------------------------* * DATA : lf_formname TYPE tdsfname. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = lf_formname IMPORTING fm_name = lf_fm_name EXCEPTIONS no_form = 1 no_function_module = 2 OTHERS = 3.

* IF sy-subrc <> 0. endif. * ENDIF. "F_CALL_SMART_FORM . move-corresponding itab3 to zfi_reciept. ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO ** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. modify zfi_reciept.* * * DOCUMENT_OUTPUT_INFO = JOB_OUTPUT_INFO = JOB_OUTPUT_OPTIONS = TABLES itab = itab3 * EXCEPTIONS * FORMATTING_ERROR = 1 * INTERNAL_ERROR = 2 * SEND_ERROR = 3 * USER_CANCELED = 4 * OTHERS = 5 . if prin = 'X' . ENDFORM.

Sign up to vote on this title
UsefulNot useful