You are on page 1of 171

Excel conversion in sap

EPSI_2010723952.X LS

2011000085.pdf

EXCISE_0000000623 .XLS

*&---------------------------------------------------------------------* *& Report YPRESHP_INV1 * *& * *&---------------------------------------------------------------------* *& * *& * *&---------------------------------------------------------------------* REPORT ypreshp_inv1 .

******* Gate Pass - Ropson TYPE-POOLS : vrm. DATA: param TYPE vrm_id, values TYPE vrm_values, value LIKE LINE OF values.

TYPES: BEGIN OF ty_contno, key TYPE i, contno TYPE yxp_contman_itm-contno, lrno(15), lrdate TYPE datum, transname(40), truckno(15), END OF ty_contno. DATA : it_contno TYPE STANDARD TABLE OF ty_contno WITH HEADER LINE. DATA : wa_contno TYPE ty_contno. DATA : icount TYPE i. DATA DATA ok_code LIKE sy-ucomm. ok_code_sav LIKE sy-ucomm.

CONTROLS tbl_01 TYPE TABLEVIEW USING SCREEN 1010. DATA: dynpfields LIKE dynpread OCCURS 0. TYPES : BEGIN OF ty_cont, mark TYPE c, contno TYPE yxp_contman_itm-contno, lrno(15), lrdate TYPE datum, transname(40), truckno(15), status(1), t_date type datum, t_time type sy-uzeit,

END OF ty_cont. DATA : it_cont1 TYPE TABLE OF ty_cont WITH HEADER LINE. DATA : wa_cont1 TYPE ty_cont. DATA : lines TYPE i. DATA : cur_row TYPE i. DATA : gatepass TYPE yxp_gatepass-gpass, v_lrno TYPE yxp_gatepass-lrno, v_lrdate TYPE yxp_gatepass-lrdate, v_transname TYPE yxp_gatepass-transname, v_truckno TYPE yxp_gatepass-truckno, v_date TYPE yxp_gatepass-t_date, v_time TYPE yxp_gatepass-t_time, v_createdon TYPE yxp_gatepass-createdon, v_createdby TYPE yxp_gatepass-createdby. TABLES : yxp_gatepass. DATA : BEGIN OF it_gpass OCCURS 0, mandt TYPE yxp_gatepass-mandt, auto_id TYPE yxp_gatepass-auto_id, contno TYPE yxp_gatepass-contno, gpass TYPE yxp_gatepass-gpass, createdby TYPE yxp_gatepass-createdby, createdon TYPE yxp_gatepass-createdon, lrno TYPE yxp_gatepass-lrno, lrdate TYPE yxp_gatepass-lrdate, transname TYPE yxp_gatepass-transname, truckno TYPE yxp_gatepass-truckno, t_date TYPE yxp_gatepass-t_date, t_time TYPE yxp_gatepass-t_time, cancelstat TYPE yxp_gatepass-cancelstat, cancelby TYPE yxp_gatepass-cancelby, cancelon TYPE yxp_gatepass-cancelon, changeby TYPE yxp_gatepass-changeby, changeon TYPE yxp_gatepass-changeon, END OF it_gpass. DATA : wa_gpass TYPE yxp_gatepass. DATA : it_gpass1 TYPE STANDARD TABLE OF yxp_gatepass. DATA : BEGIN OF tab_gpass OCCURS 0, mandt TYPE yxp_gatepass-mandt, auto_id TYPE yxp_gatepass-auto_id, contno TYPE yxp_gatepass-contno, gpass TYPE yxp_gatepass-gpass, createdby TYPE yxp_gatepass-createdby, createdon TYPE yxp_gatepass-createdon, lrno TYPE yxp_gatepass-lrno, lrdate TYPE yxp_gatepass-lrdate,

transname TYPE yxp_gatepass-transname, truckno TYPE yxp_gatepass-truckno, t_date TYPE yxp_gatepass-t_date, t_time TYPE yxp_gatepass-t_time, cancelstat TYPE yxp_gatepass-cancelstat, cancelby TYPE yxp_gatepass-cancelby, cancelon TYPE yxp_gatepass-cancelon, changeby TYPE yxp_gatepass-changeby, changeon TYPE yxp_gatepass-changeon, END OF tab_gpass. ************** DATA : fmname TYPE rs38l_fnam. DATA : fmname1 TYPE rs38l_fnam. DATA : fmname2 TYPE rs38l_fnam. DATA : fmname4 TYPE rs38l_fnam. DATA : p_answer TYPE c. DATA : fmname5 TYPE rs38l_fnam. DATA : fmname6 TYPE rs38l_fnam. DATA : fmname7 TYPE rs38l_fnam. DATA : fmname8 TYPE rs38l_fnam. DATA : fmname9 TYPE rs38l_fnam. DATA :gid TYPE yxp_gatepass-gpass. TABLES: yxp_soaddr, yxp_invpre, yxp_contman_itm, vbkd, adrc, ylcesadr, yxp_shphd, ylcelcmst, yxp_item, vbrp, ylceord, vbak,vbpa . DATA : ar(2) TYPE c. DATA: it_yxp_invpre TYPE yxp_invpre OCCURS 0 WITH HEADER LINE. DATA: wa_yxp_invpre TYPE yxp_invpre, wa_yxp_shphd TYPE yxp_shphd, wa_yxp_soaddr TYPE yxp_soaddr, wa_vbkd TYPE vbkd, wa_ylceord TYPE ylceord, wa_ylcesadr TYPE ylcesadr, wa_vbak TYPE vbak, wa_t001 TYPE t001, wa_adrc TYPE adrc, cadrc TYPE adrc,

wa_yxp_exptd_lic TYPE yxp_exptd_lic, wa_yxp_exptd_lic1 TYPE yxp_exptd_lic. DATA: fcode TYPE TABLE OF sy-ucomm, wa_fcode TYPE sy-ucomm. DATA: p_vgbel TYPE lips-vgbel. DATA: p_lic_product TYPE yxp_exptd_lic-lic_product. DATA : it_ylcelcmst TYPE ylcelcmst. DATA : form TYPE tdsfname. DATA : form1 TYPE tdsfname. DATA : form2 TYPE tdsfname. DATA : form3 TYPE tdsfname. DATA : tenas TYPE yxp_invpre-tena. DATA : tenbs TYPE yxp_invpre-tenb. DATA : tencs TYPE yxp_invpre-tenc. *DATA : elva TYPE STRING. * DATA : BEGIN OF it_manidf4 OCCURS 0, manid TYPE yxp_contman_itm-manid, delv TYPE yxp_contman_itm-delv, END OF it_manidf4. DATA : wa_manidf4 LIKE it_manidf4. DATA : it_tmpf4 LIKE it_manidf4 OCCURS 0. *DATA : BEGIN OF IT_TMPF4 OCCURS 0, * MANID TYPE YXP_CONTMAN_ITM-MANID, * DELV TYPE YXP_CONTMAN_ITM-DELV, * END OF IT_TMPF4. DATA : BEGIN OF it_docnr OCCURS 0, doc_nr TYPE yxp_invpre-doc_nr, END OF it_docnr. DATA : wa_docnr LIKE it_docnr. DATA : wa_gatepass TYPE yxp_gatepass.

DATA: it_otf TYPE STANDARD TABLE OF itcoo, it_docs TYPE STANDARD TABLE OF docs, it_lines TYPE STANDARD TABLE OF tline, st_job_output_info TYPE ssfcrescl, st_document_output_info TYPE ssfcrespd, st_job_output_options TYPE ssfcresop, st_output_options TYPE ssfcompop, st_control_parameters TYPE ssfctrlop, v_len_in TYPE so_obj_len, v_language TYPE sflangu VALUE 'E', v_e_devtype TYPE rspoptype, v_bin_filesize TYPE i, v_name TYPE string, v_path TYPE string, v_fullpath TYPE string,

v_filter TYPE string, v_uact TYPE i, v_guiobj TYPE REF TO cl_gui_frontend_services, v_filename TYPE string.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. PARAMETERS : p_autoid TYPE yxp_invpreauto_id MATCHCODE OBJECT yxp_invau." OBLIGATORY. PARAMETERS : p_manid TYPE yxp_contman_itm-manid. PARAMETERS : com TYPE char5. PARAMETERS : r1 RADIOBUTTON GROUP g2 DEFAULT 'X', r2 RADIOBUTTON GROUP g2. SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002. PARAMETERS: rd_1 RADIOBUTTON GROUP g1 DEFAULT 'X', rd_2 RADIOBUTTON GROUP g1, *{Added By Manoj WVDK931404 31.08.2012 rd_12 RADIOBUTTON GROUP g1, *} rd_3 RADIOBUTTON GROUP g1, rd_5 RADIOBUTTON GROUP g1, rd_6 RADIOBUTTON GROUP g1, rd_4 RADIOBUTTON GROUP g1, rd_7 RADIOBUTTON GROUP g1, rd_8 RADIOBUTTON GROUP g1, rd_9 RADIOBUTTON GROUP g1, rd_10 RADIOBUTTON GROUP g1, rd_11 RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b2. SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003. PARAMETERS : exdat1 TYPE yxp_invpre-exdat. PARAMETERS : extm TYPE sy-uzeit. PARAMETERS : exname TYPE yxp_invpre-exname. PARAMETERS : supname TYPE yxp_invpre-supname. PARAMETERS : nameauth TYPE yxp_invpre-nameauth. PARAMETERS : des(20) TYPE c. PARAMETERS : nameaut1 TYPE yxp_invpre-nameauth. PARAMETERS : des1(20) TYPE c.

PARAMETERS : tena TYPE checkbox DEFAULT 'X', tenb TYPE checkbox, tenc TYPE checkbox, tend TYPE checkbox. PARAMETERS : consamno TYPE yxp_invpre-consamno.

*PARAMETERS : CONTABA RADIOBUTTON GROUP G3 DEFAULT 'X', * CONTABB RADIOBUTTON GROUP G3. SELECTION-SCREEN END OF BLOCK b3. SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-004. PARAMETERS : str1(75) TYPE c. PARAMETERS : str2(75) TYPE c.

SELECTION-SCREEN END OF BLOCK b4. AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_manid. PERFORM gethelp. INITIALIZATION. SET PF-STATUS 'YPRESHP_INV1' . START-OF-SELECTION. SET PF-STATUS 'YPRESHP_INV1' . AT LINE-SELECTION. IF sy-lsind = 20. SET PF-STATUS 'YPRESHP_INV1' ."EXCLUDING FCODE. ENDIF. AT SELECTION-SCREEN. *BREAK-POINT. CASE sy-ucomm. WHEN 'F8'. PERFORM data. WHEN 'PDF'. PERFORM dataf. WHEN 'EXCEL'. PERFORM xldata. WHEN 'BACK' OR 'EXIT' OR 'CANC'. LEAVE PROGRAM. WHEN 'ENTR'. PERFORM get_stuffid. ENDCASE.

*&---------------------------------------------------------------------* *& Form GET_STUFFID *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM get_stuffid . IF it_manidf4[] IS NOT INITIAL. CLEAR it_manidf4[]. ENDIF. IF p_autoid IS NOT INITIAL. SELECT * INTO CORRESPONDING FIELDS OF TABLE it_docnr FROM yxp_invpre WHERE auto_id = p_autoid. LOOP AT it_docnr INTO wa_docnr. SELECT * INTO CORRESPONDING FIELDS OF TABLE it_tmpf4 FROM yxp_contman_itm WHERE delv = wa_docnr-doc_nr. APPEND LINES OF it_tmpf4 TO it_manidf4. ENDLOOP. DELETE ADJACENT DUPLICATES FROM it_manidf4 COMPARING manid. ENDIF. LOOP AT it_manidf4 INTO wa_manidf4 . p_manid = wa_manidf4-manid. ENDLOOP. ENDFORM. " GET_STUFFID *&---------------------------------------------------------------------* *& Form GETHELP *&---------------------------------------------------------------------* FORM gethelp . DATA :field_tab LIKE dfies OCCURS 0 WITH HEADER LINE. *REFRESH field_tab. * field_tab-fieldname = 'Manid'. * field_tab-tabname = 'IT_MANIDF4'. *APPEND field_tab.

IF it_manidf4[] IS NOT INITIAL. CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' EXPORTING * DDIC_STRUCTURE = ' ' retfield = 'MANID'

* * * * * * * * *

* * *

PVALKEY = ' ' dynpprog = sy-cprog dynpnr = sy-dynnr dynprofield = 'P_MANID' STEPL = 0 WINDOW_TITLE = '' VALUE = ' ' value_org = 'S' MULTIPLE_CHOICE = '' display = 'F' CALLBACK_PROGRAM = ' ' CALLBACK_FORM = ' ' MARK_TAB = IMPORTING USER_RESET = TABLES value_tab = it_manidf4 FIELD_TAB = RETURN_TAB = DYNPFLD_MAPPING = EXCEPTIONS parameter_error = 1 no_values_found = 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. ELSE. MESSAGE 'Help Does not found' TYPE 'S'. ENDIF. " GETHELP

ENDFORM.

* *&---------------------------------------------------------------------* *& Form DATA *&---------------------------------------------------------------------* FORM data . *BREAK-POINT. IF rd_1 = 'X'. PERFORM getdata_inv. PERFORM disp_smrtfrm_inv. *ELSEIF RD_3 = 'X'. * PERFORM GETDATA_INV. * PERFORM CALLFORM. ELSEIF rd_2 = 'X'. PERFORM getdata_inv. PERFORM disp_smartfrm_are1.

*{Added By Manoj WVDK931404 31.08.2012 ELSEIF rd_12 = 'X'. PERFORM getdata_inv. PERFORM disp_smartfrm_are1. *} ELSEIF rd_3 = 'X'. PERFORM getdata_inv. PERFORM pack_smarforms. ELSEIF rd_4 = 'X'. PERFORM getdata_inv. PERFORM annexure_smartform. ELSEIF rd_5 = 'X'. PERFORM getdata_inv. PERFORM detail_packlist. ELSEIF rd_6 = 'X'. PERFORM getdata_inv. PERFORM loadslip. ELSEIF rd_7 = 'X'. IF p_manid IS INITIAL. MESSAGE : 'NO STUFFING ID AVAILABLE' TYPE 'E'. ELSE. PERFORM getdata_inv. REFRESH: dynpfields. CLEAR: it_cont1[], it_contno[], dynpfields. CALL SCREEN 1010 STARTING AT 35 8. IF sy-ucomm = 'OK'. PERFORM gate_pass. ENDIF. ENDIF. ELSEIF rd_8 = 'X'. PERFORM getdata_inv. PERFORM ssp_are1. ELSEIF rd_9 = 'X'. PERFORM getdata_inv. PERFORM ssp_annexure1. ELSEIF rd_10 = 'X'. PERFORM getdata_inv. PERFORM disp_smrtfrm_inv. ELSEIF rd_11 = 'X'. PERFORM getdata_inv. PERFORM disp_smrtfrm_form402. ENDIF. ENDFORM. " DATA *&---------------------------------------------------------------------* *& Form DATAF *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------*

* --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM xldata. IF rd_1 = 'X'. PERFORM getxldata. PERFORM print_excel USING p_autoid. ""add by sandip 2.08.2012 ENDIF. IF rd_2 = PERFORM PERFORM ENDIF. IF rd_3 = PERFORM PERFORM ENDIF. IF rd_4 = PERFORM PERFORM ENDIF. ENDFORM. 'X'. getxldata. print_excel USING p_autoid. ""add by sandip 2.08.2012 'X'. getxldata. print_excel USING p_autoid. ""add by sandip 2.08.2012 'X'. getxldata. print_excel USING p_autoid. ""add by sandip 2.08.2012 "XLDATA

*&---------------------------------------------------------------------* *& Form GETXLDATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM getxldata. IF p_autoid IS NOT INITIAL. SELECT * INTO CORRESPONDING FIELDS OF TABLE it_yxp_invpre FROM yxp_invpre WHERE yxp_invpre~auto_id = p_autoid. ELSE. MESSAGE 'Enter Invoice No' TYPE 'E'. ENDIF. ENDFORM. "GETXLDATA *&---------------------------------------------------------------------* *& Form PRINTXLDATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM printxldata. IF rd_1 = 'X'. ENDIF. IF rd_3 = 'X'. ENDIF.

ENDFORM. "PRINTXLDATA *&---------------------------------------------------------------------* *& Form DATAF *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM dataf . IF rd_1 = 'X'. PERFORM getdata_inv. PERFORM pdisp_smrtfrm_inv1. *ELSEIF RD_3 = 'X'. * PERFORM GETDATA_INV. * PERFORM CALLFORM. ELSEIF rd_2 = 'X'. PERFORM getdata_inv. PERFORM pdisp_smartfrm_are1. *{Added By Manoj WVDK931418 01.09.2012 ELSEIF rd_12 = 'X'. PERFORM getdata_inv. PERFORM pdisp_smartfrm_are1. *} ELSEIF rd_3 = 'X'. PERFORM getdata_inv. PERFORM pack_smarforms1. ELSEIF rd_4 = 'X'. PERFORM getdata_inv. PERFORM pannexure_smartform1. ELSEIF rd_5 = 'X'. PERFORM getdata_inv. PERFORM dtls_packlst. ELSEIF rd_6 = 'X'. PERFORM getdata_inv. PERFORM loading_slip. ELSEIF rd_7 = 'X'. IF p_manid IS INITIAL. MESSAGE : 'NO STUFFING ID AVAILABLE' TYPE 'E'. ELSE. PERFORM getdata_inv. REFRESH: dynpfields. CLEAR: it_cont1[], it_contno[], dynpfields. CALL SCREEN 1010 STARTING AT 35 8. IF sy-ucomm = 'OK'. PERFORM gate_pass1. ENDIF. ENDIF. ELSEIF rd_8 = 'X'. PERFORM getdata_inv. PERFORM are_ssp1.

ELSEIF rd_9 = 'X'. PERFORM getdata_inv. PERFORM annexurec1_ssp1. ELSEIF rd_11 = 'X'. PERFORM getdata_inv. PERFORM disp_smrtfrm_form402_1. ENDIF. ENDFORM. " DATAF

*&---------------------------------------------------------------------* *& Form GETDATA *&---------------------------------------------------------------------* FORM getdata_inv . IF p_autoid IS NOT INITIAL.

SELECT * INTO CORRESPONDING FIELDS OF TABLE it_yxp_invpre "WA_YXP_INVPRE FROM yxp_invpre WHERE yxp_invpre~auto_id = p_autoid. ELSE. MESSAGE 'Enter Invoice No' TYPE 'E'. ENDIF. LOOP AT it_yxp_invpre INTO wa_yxp_invpre. SELECT SINGLE * INTO CORRESPONDING FIELDS OF wa_yxp_shphd FROM yxp_shphd WHERE yxp_shphd~doc_nr = wa_yxp_invpre-auto_id AND doc_clas = '0009'. IF ar IS INITIAL. ar = wa_yxp_shphd-ar. ENDIF. * goto LIPS take VGBL and go YXP_SOADDR-vbeln = LIPSVGBL. Get Expoter Details SELECT SINGLE vgbel INTO p_vgbel FROM lips WHERE vbeln = wa_yxp_invpre-doc_nr. SELECT SINGLE * INTO CORRESPONDING FIELDS OF wa_yxp_soaddr FROM yxp_soaddr WHERE vbeln = p_vgbel. get Buyer's Ord No & Date SELECT SINGLE * INTO CORRESPONDING FIELDS OF wa_vbkd FROM vbkd WHERE vbeln = p_vgbel. Get Consignee Details SELECT SINGLE * FROM ylceord WHERE vbeln = vbrp-aubel . SELECT SINGLE * FROM ylcelcmst INTO it_ylcelcmst WHERE lc_refnr = ylceord-lc_refnr.

GET Consignee Details SELECT SINGLE * FROM ylcesadr INTO CORRESPONDING FIELDS OF wa_ylcesadr WHERE adrnr = ylcelcmst-adrnr. SELECT SINGLE * FROM vbak WHERE vbeln = p_vgbel. SELECT SINGLE * FROM vbak INTO CORRESPONDING FIELDS OF wa_vbak WHERE vbeln = p_vgbel."VBAK-BNAME. SELECT SINGLE * FROM vbpa WHERE vbeln = wa_vbak-vbeln AND parvw = 'WE'. SELECT SINGLE * FROM adrc INTO cadrc WHERE addrnumber = vbpa-adrnr. SELECT SINGLE * FROM t001 INTO CORRESPONDING FIELDS OF wa_t001 WHERE bukrs = wa_vbak-vkorg. Get Buyer (if other then Consignee) Details SELECT SINGLE * FROM adrc INTO wa_adrc WHERE addrnumber = wa_t001-adrnr . Get Product List SELECT SINGLE * INTO wa_yxp_exptd_lic FROM yxp_exptd_lic WHERE doc_nr = wa_yxp_invpre-auto_id. SELECT SINGLE * FROM yxp_exptd_lic INTO wa_yxp_exptd_lic1 WHERE doc_nr = wa_yxp_invpre-auto_id AND licenceno EQ ' '. ENDLOOP. IF tenb = 'X'. tenbs = 'YES'. ELSE. tenbs = 'NO'. ENDIF.

ENDFORM.

" GETDATA

*&---------------------------------------------------------------------* *& Form DISP_SMRTFRM_FORM402

*&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM disp_smrtfrm_form402 . IF wa_yxp_invpre-werks = '3700'. form = 'YXP_FORM402'. ELSE. form = 'YXP_FORM402'. ENDIF.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = form IMPORTING fm_name = fmname EXCEPTIONS no_form = 1 no_function_module = 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. CALL FUNCTION fmname EXPORTING p_autoid = p_autoid EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5. 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. "DISP_SMRTFRM_FORM402 *&---------------------------------------------------------------------* *& Form DISP_SMRTFRM_FORM402_1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM disp_smrtfrm_form402_1 . CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING

i_language = v_language i_application = 'SAPDEFAULT' IMPORTING e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'. IF wa_yxp_invpre-werks = '3700'. form = 'YXP_FORM402'. ELSE. form = 'YXP_FORM402'. ENDIF.

" form = 'YXP_FORM402' . CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = form IMPORTING fm_name = fmname EXCEPTIONS no_form = 1 no_function_module = 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. CALL FUNCTION fmname EXPORTING control_parameters output_options p_autoid IMPORTING document_output_info job_output_info job_output_options EXCEPTIONS formatting_error internal_error send_error user_canceled OTHERS

= st_control_parameters = st_output_options = p_autoid = st_document_output_info = st_job_output_info = st_job_output_options = = = = = 1 2 3 4 5.

IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 2 OTHERS = 3. *--- Get filename to store CONCATENATE 'Form402-' p_autoid '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = filename = filetype = TABLES data_tab = EXCEPTIONS file_write_error = no_batch = gui_refuse_filetransfer = invalid_type = no_authority = unknown_error = header_not_allowed = separator_not_allowed =

v_bin_filesize v_filename 'BIN' it_lines 1 2 3 4 5 6 7 8

filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ENDFORM. "DISP_SMRTFRM_FORM402_1 *&---------------------------------------------------------------------* *& Form DISP_SMRTFRM *&---------------------------------------------------------------------* FORM disp_smrtfrm_inv . IF r1 IS NOT INITIAL AND wa_vbak-vtweg = 'WE'. form = 'YPRESHP_INV1_ANJAR'. "'YPRESHP_INV1_NEW1'. IF rd_10 IS NOT INITIAL. form = 'YPRESHP_INV1_ANJAR_N'. ENDIF. ELSEIF r2 IS NOT INITIAL AND wa_vbak-vtweg = 'WE'. . form = 'YPRESHP_INV3'. ELSE. * FORM = 'YPRESHP_INV1_VAPI' . form = 'YPRESHP_INV1_V' . ENDIF.

"'YPRESHP_INV1'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = form * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname EXCEPTIONS no_form = 1

no_function_module OTHERS

= 2 = 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. IF r1 IS NOT INITIAL. *'/1BCDWB/SF00000418' CALL FUNCTION fmname EXPORTING * ARCHIVE_INDEX * ARCHIVE_INDEX_TAB * ARCHIVE_PARAMETERS * CONTROL_PARAMETERS * MAIL_APPL_OBJ * MAIL_RECIPIENT * MAIL_SENDER * OUTPUT_OPTIONS * USER_SETTINGS p_manid wa_yxp_shphd wa_yxp_invpre wa_yxp_soaddr wa_vbkd wa_ylcesadr wa_adrc wa_yxp_exptd_lic wa_yxp_exptd_lic1 p_spart it_ylcelcmst * CADRC com extm exdat str1 str2 IMPORTING DOCUMENT_OUTPUT_INFO JOB_OUTPUT_INFO JOB_OUTPUT_OPTIONS EXCEPTIONS formatting_error internal_error send_error user_canceled OTHERS

= = = = = = = = = 'X' = = = = = = = = = = =

p_manid wa_yxp_shphd wa_yxp_invpre wa_yxp_soaddr wa_vbkd wa_ylcesadr wa_adrc wa_yxp_exptd_lic wa_yxp_exptd_lic1 wa_vbak-spart it_ylcelcmst = CADRC = com = = = = extm exdat1 str1 str2

* * * *

= = = = = = = = 1 2 3 4 5.

IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ELSE. '/1BCDWB/SF00000445' CALL FUNCTION fmname EXPORTING * ARCHIVE_INDEX = * ARCHIVE_INDEX_TAB = * ARCHIVE_PARAMETERS = * CONTROL_PARAMETERS = * MAIL_APPL_OBJ = * MAIL_RECIPIENT = * MAIL_SENDER = * OUTPUT_OPTIONS = * USER_SETTINGS = 'X' p_doc_nr = p_autoid exdat = exdat1 " extm = extm * STR1 = STR1 * STR2 = STR2 * IMPORTING * DOCUMENT_OUTPUT_INFO = * JOB_OUTPUT_INFO = * JOB_OUTPUT_OPTIONS = * EXCEPTIONS * FORMATTING_ERROR = 1 * INTERNAL_ERROR = 2 * SEND_ERROR = 3 * USER_CANCELED = 4 * OTHERS = 5 . IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. * ENDIF. ENDFORM. " DISP_SMRTFRM *&---------------------------------------------------------------------* *& Form DISP_SMARTFRM_ARE1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text

*----------------------------------------------------------------------* FORM disp_smartfrm_are1 . IF wa_yxp_invpre-werks = '3700'. form1 = 'YARE_N2'. ELSEIF rd_12 IS INITIAL. form1 = 'YARE_N2_VAPI'. *{Added By Manoj WVDK931404 31.08.2012 ELSE. form1 = 'YARE_N2_VAPI_STNY'. *} ENDIF.

IF ar = 'A2'. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YXP_ARE2' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname EXCEPTIONS no_form = 1 no_function_module = 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. * '/1BCDWB/SF00000421' CALL FUNCTION fmname EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS CONTROL_PARAMETERS MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER OUTPUT_OPTIONS USER_SETTINGS p_manid p_auto_id

* * * * * * * * *

= = = = = = = = = 'X' = p_manid = p_autoid

WA_YXP_EXPTD_LIC1 tenb exdat2

= WA_YXP_EXPTD_LIC1 = tenbs = exdat1

* * * *

IMPORTING DOCUMENT_OUTPUT_INFO = JOB_OUTPUT_INFO = JOB_OUTPUT_OPTIONS = EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ELSE. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = form1"'YARE_N2' "'YAREN_1' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname EXCEPTIONS no_form = 1 no_function_module = 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. * '/1BCDWB/SF00000421' CALL FUNCTION fmname EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS CONTROL_PARAMETERS MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER OUTPUT_OPTIONS

* * * * * * * *

= = = = = = = =

USER_SETTINGS p_manid p_auto_id wa_yxp_exptd_lic1 tenb exdat2 str1 str2

= 'X' = p_manid = p_autoid = wa_yxp_exptd_lic1 = tenbs = exdat1 = str1 = str2

* * * *

IMPORTING DOCUMENT_OUTPUT_INFO = JOB_OUTPUT_INFO = JOB_OUTPUT_OPTIONS = EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ENDFORM. " DISP_SMARTFRM_ARE1 *&---------------------------------------------------------------------* *& Form CALLFORM *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM callform .

ENDFORM.

" CALLFORM

*&---------------------------------------------------------------------* *& Form PDISP_SMRTFRM_INV1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM pdisp_smrtfrm_inv1 . * IF R1 IS NOT INITIAL.

* * * *

FORM = 'YPRESHP_INV1_NEW1'. "YPRESHP_INV1'. ELSE. FORM = 'YPRESHP_INV3'. ENDIF. IF r1 IS NOT INITIAL AND wa_vbak-vtweg = 'WE'. form = 'YPRESHP_INV1_ANJAR'."'YPRESHP_INV1_NEW1'. ELSEIF r2 IS NOT INITIAL AND wa_vbak-vtweg = 'WE'. form = 'YPRESHP_INV3'. ELSE. * FORM = 'YPRESHP_INV1_VAPI' . form = 'YPRESHP_INV1_V' . ENDIF. CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = form * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname EXCEPTIONS no_form = 1 no_function_module = 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. IF r1 IS NOT INITIAL. *'/1BCDWB/SF00000418' CALL FUNCTION fmname EXPORTING * ARCHIVE_INDEX * ARCHIVE_INDEX_TAB * ARCHIVE_PARAMETERS control_parameters * MAIL_APPL_OBJ

"'YPRESHP_INV1'.

= = = = st_control_parameters =

* * * * * * * * * * * * * *

MAIL_RECIPIENT MAIL_SENDER output_options USER_SETTINGS WA_YXP_SHPHD WA_YXP_INVPRE WA_YXP_SOADDR WA_VBKD WA_YLCESADR WA_ADRC WA_YXP_EXPTD_LIC WA_YXP_EXPTD_LIC1 P_SPART IT_YLCELCMST CADRC p_manid wa_yxp_shphd wa_yxp_invpre wa_yxp_soaddr wa_vbkd wa_ylcesadr wa_adrc wa_yxp_exptd_lic wa_yxp_exptd_lic1 p_spart it_ylcelcmst CADRC

= = = st_output_options = 'X' = WA_YXP_SHPHD = WA_YXP_INVPRE = WA_YXP_SOADDR = WA_VBKD = WA_YLCESADR = WA_ADRC = WA_YXP_EXPTD_LIC = WA_YXP_EXPTD_LIC1 = WA_VBAK-SPART = IT_YLCELCMST = CADRC = p_manid = wa_yxp_shphd = wa_yxp_invpre = wa_yxp_soaddr = wa_vbkd = wa_ylcesadr = wa_adrc = wa_yxp_exptd_lic = wa_yxp_exptd_lic1 = wa_vbak-spart = it_ylcelcmst = CADRC

com = com extm = extm exdat = exdat1 str1 = str1 str2 = str2 IMPORTING document_output_info = st_document_output_info job_output_info = st_job_output_info job_output_options = st_job_output_options EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE.

CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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. *--- Get filename to store * CONCATENATE 'Converted_Smartform' '.pdf' INTO V_NAME. CONCATENATE 'PSI' wa_yxp_invpre-auto_id '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = v_bin_filesize filename = v_filename filetype = 'BIN' TABLES data_tab = it_lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5

unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF.

* * * * * * *

* * * *

ELSE. '/1BCDWB/SF00000445' CALL FUNCTION fmname EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS control_parameters MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER output_options USER_SETTINGS p_doc_nr exdat IMPORTING document_output_info job_output_info job_output_options EXCEPTIONS FORMATTING_ERROR INTERNAL_ERROR SEND_ERROR

= = = = st_control_parameters = = = = st_output_options = 'X' = p_autoid = exdat1 = st_document_output_info = st_job_output_info = st_job_output_options = 1 = 2 = 3

* *

USER_CANCELED = 4 OTHERS = 5 . IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. * ENDIF. ELSE. CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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. *--- Get filename to store CONCATENATE 'Converted_Smartform' '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = v_bin_filesize filename = v_filename filetype = 'BIN'

TABLES data_tab = it_lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF.

ENDIF.

ENDIF.

ENDFORM. " PDISP_SMRTFRM_INV1 *&---------------------------------------------------------------------* *& Form PDISP_SMARTFRM_ARE1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM pdisp_smartfrm_are1 .

IF wa_yxp_invpre-werks = '3700'. form1 = 'YARE_N2'. ELSEIF rd_12 IS INITIAL. form1 = 'YARE_N2_VAPI'. *{Added By Manoj WVDK931418 01.09.2012 ELSE. form1 = 'YARE_N2_VAPI_STNY'. *} ENDIF. IF ar = 'A2'. CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'.

* *

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YXP_ARE2' VARIANT = ' ' DIRECT_CALL = ' ' IMPORTING fm_name = fmname EXCEPTIONS no_form = 1 no_function_module = 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. '/1BCDWB/SF00000421' CALL FUNCTION fmname EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS control_parameters MAIL_APPL_OBJ MAIL_RECIPIENT

* * * * *

= = = = st_control_parameters = =

* *

* *

* *

MAIL_SENDER = output_options = st_output_options USER_SETTINGS = 'X' p_auto_id = p_autoid p_manid = p_manid WA_YXP_EXPTD_LIC1 = WA_YXP_EXPTD_LIC1 tenb = tenbs exdat2 = exdat1 STR1 = STR1 STR2 = STR2 IMPORTING document_output_info = st_document_output_info job_output_info = st_job_output_info job_output_options = st_job_output_options EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. *--- Convert OTF to PDF CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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.

*--- Get filename to store CONCATENATE 'ARE2' p_autoid '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name

file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = v_bin_filesize filename = v_filename filetype = 'BIN' TABLES data_tab = it_lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ELSE.

CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'.

* *

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = form1 "'YARE_N2'"'YAREN_1' VARIANT = ' ' DIRECT_CALL = ' ' IMPORTING fm_name = fmname EXCEPTIONS no_form = 1 no_function_module = 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. '/1BCDWB/SF00000421' CALL FUNCTION fmname EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS control_parameters MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER output_options USER_SETTINGS p_auto_id p_manid wa_yxp_exptd_lic1 tenb exdat2 str1 str2

* * * * * * *

= = = = st_control_parameters = = = = st_output_options = 'X' = p_autoid = p_manid = wa_yxp_exptd_lic1 = tenbs = exdat1 = str1 = str2

IMPORTING document_output_info = st_document_output_info job_output_info = st_job_output_info job_output_options = st_job_output_options EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. * *--- Convert OTF to PDF CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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. *--- Get filename to store CONCATENATE 'ARE1' p_autoid '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF.

*--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = v_bin_filesize filename = v_filename filetype = 'BIN' TABLES data_tab = it_lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ENDIF.

ENDFORM. " PDISP_SMARTFRM_ARE1 *&---------------------------------------------------------------------* *& Form PACK_SMARFORMS *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------*

FORM pack_smarforms . IF * wa_vbak-vtweg = 'WE'. FORM3 = 'YPACK_PRESHIP'. form3 = 'YPACK_NEW'. ELSE. form3 = 'YPACK_PRESHIP_VAPI' . ENDIF.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = form3 "'YPACK_PRESHIP'" ankur 'YXP_PACKING1' " OLD PACKING LIST 'YPREPACK_INV1' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname1 EXCEPTIONS no_form = 1 no_function_module = 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. CALL FUNCTION fmname1 EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS CONTROL_PARAMETERS MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER OUTPUT_OPTIONS USER_SETTINGS p_autoid p_manid wa_yxp_shphd wa_yxp_invpre wa_yxp_soaddr wa_vbkd wa_ylcesadr wa_adrc wa_yxp_exptd_lic wa_yxp_exptd_lic1

* * * * * * * * *

= = = = = = = = = = = = = = = = = = =

'X' p_autoid p_manid wa_yxp_shphd wa_yxp_invpre wa_yxp_soaddr wa_vbkd wa_ylcesadr wa_adrc wa_yxp_exptd_lic wa_yxp_exptd_lic1

p_spart it_ylcelcmst cadrc

= wa_vbak-spart = it_ylcelcmst = cadrc

* * * * * * * * * * *

com = com exdat = exdat1 str1 = str1 str2 = str2 DESC = DESC IMPORTING DOCUMENT_OUTPUT_INFO = JOB_OUTPUT_INFO = JOB_OUTPUT_OPTIONS = EXCEPTIONS FORMATTING_ERROR = 1 INTERNAL_ERROR = 2 SEND_ERROR = 3 USER_CANCELED = 4 OTHERS = 5 . 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. " PACK_SMARFORMS *&---------------------------------------------------------------------* *& Form PACK_SMARFORMS1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM pack_smarforms1 . IF * wa_vbak-vtweg = 'WE'. FORM3 = 'YPACK_PRESHIP'. form3 = 'YPACK_NEW'. ELSE. form3 = 'YPACK_PRESHIP_VAPI' . ENDIF. CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING

e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = form3 "'YPACK_PRESHIP'" ANKUR 'YXP_PACKING1 ' " OLD PACKING LIST 'YPREPACK_INV1' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname1 EXCEPTIONS no_form = 1 no_function_module = 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.

* * * * * * *

CALL FUNCTION fmname1 EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS control_parameters MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER output_options USER_SETTINGS p_autoid p_manid wa_yxp_shphd wa_yxp_invpre wa_yxp_soaddr wa_vbkd wa_ylcesadr wa_adrc wa_yxp_exptd_lic wa_yxp_exptd_lic1 p_spart it_ylcelcmst cadrc

= = = = st_control_parameters = = = = st_output_options = 'X' = p_autoid = p_manid = wa_yxp_shphd = wa_yxp_invpre = wa_yxp_soaddr = wa_vbkd = wa_ylcesadr = wa_adrc = wa_yxp_exptd_lic = wa_yxp_exptd_lic1 = wa_vbak-spart = it_ylcelcmst = cadrc

com = com exdat = exdat1 str1 = str1 str2 = str2 IMPORTING document_output_info = st_document_output_info job_output_info = st_job_output_info job_output_options = st_job_output_options * EXCEPTIONS * FORMATTING_ERROR = 1 * INTERNAL_ERROR = 2 * SEND_ERROR = 3 * USER_CANCELED = 4 * OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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. *--- Get filename to store CONCATENATE 'PL' p_autoid '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath

user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = v_bin_filesize filename = v_filename filetype = 'BIN' TABLES data_tab = it_lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ENDFORM. " PACK_SMARFORMS1

*&---------------------------------------------------------------------* *& Form ANNEXURE_SMARTFORM

*&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM annexure_smartform . *BREAK-POINT. IF tena = 'X'. tenas = tena. ENDIF. IF tenb = 'X'. tenbs = tenb. ENDIF. IF tenc = 'X'. tencs = tenc. ENDIF. IF tend = 'X'. tend = 'ACC6'. ENDIF. *IF CONTABA = 'X'. * elva = CONTABA. *ENDIF. * *IF CONTABB = 'X'. * elva = CONTABB. *ENDIF. IF wa_vbak-vtweg = 'WE'. form2 = 'YANNEXUREC1'. ELSE. form2 = 'YANNEXUREC1_VAPI' . ENDIF.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = form2"'YANNEXUREC1' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname4 EXCEPTIONS no_form = 1 no_function_module = 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. *'/1BCDWB/SF00000444' CALL FUNCTION fmname4 EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS CONTROL_PARAMETERS MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER OUTPUT_OPTIONS USER_SETTINGS p_manid p_autoid exdat exname supname nameauth des tena tenb tenc tend consamno

* * * * * * * * *

= = = = = = = = = 'X' = p_manid = p_autoid = exdat1 = exname = supname = nameauth = des = tenas = tenbs = tencs = tend = consamno

* IMPORTING * DOCUMENT_OUTPUT_INFO = * JOB_OUTPUT_INFO = * JOB_OUTPUT_OPTIONS = EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5. 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. " ANNEXURE_SMARTFORM *&---------------------------------------------------------------------* *& Form PANNEXURE_SMARTFORM1 *&---------------------------------------------------------------------*

* text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM pannexure_smartform1 . IF tena = 'X'. tenas = tena. ENDIF. IF tenb = 'X'. tenbs = tenb. ENDIF. IF tenc = 'X'. tencs = tenc. ENDIF. IF tend = 'X'. tend = 'ACC6'. ENDIF. IF wa_vbak-vtweg = 'WE'. form2 = 'YANNEXUREC1'. ELSE. form2 = 'YANNEXUREC1_VAPI' . ENDIF. CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = form2"'YANNEXUREC1' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname4 EXCEPTIONS no_form = 1 no_function_module = 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.

* * * * * * * *

CALL FUNCTION fmname4 EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS control_parameters MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER output_options USER_SETTINGS P_DOC_NR p_manid p_autoid exdat exname supname nameauth des tena tenb tenc tend consamno

= = = = st_control_parameters = = = = st_output_options = 'X' = P_AUTOID = p_manid = p_autoid = exdat1 = exname = supname = nameauth = des = tenas = tenbs = tencs = tend = consamno

IMPORTING document_output_info = st_document_output_info job_output_info = st_job_output_info job_output_options = st_job_output_options * EXCEPTIONS * FORMATTING_ERROR = 1 * INTERNAL_ERROR = 2 * SEND_ERROR = 3 * USER_CANCELED = 4 * OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. CALL FUNCTION 'CONVERT_OTF_2_PDF'

IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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. *--- Get filename to store CONCATENATE 'ANNX' p_autoid '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = v_bin_filesize filename = v_filename filetype = 'BIN' TABLES data_tab = it_lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7

separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF.

ENDFORM. " PANNEXURE_SMARTFORM1 *&---------------------------------------------------------------------* *& Form DETAIL_PACKLIST *&---------------------------------------------------------------------* FORM detail_packlist . CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YXP_PACKDTLS' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname5 EXCEPTIONS no_form = 1 no_function_module = 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. *'/1BCDWB/SF00000700' CALL FUNCTION fmname5 EXPORTING * ARCHIVE_INDEX =

* * * * * * * *

* * * *

ARCHIVE_INDEX_TAB = ARCHIVE_PARAMETERS = CONTROL_PARAMETERS = MAIL_APPL_OBJ = MAIL_RECIPIENT = MAIL_SENDER = OUTPUT_OPTIONS = USER_SETTINGS = 'X' p_autoid = p_autoid p_manid = p_manid IMPORTING DOCUMENT_OUTPUT_INFO = JOB_OUTPUT_INFO = JOB_OUTPUT_OPTIONS = EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5 . 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. " DETAIL_PACKLIST *&---------------------------------------------------------------------* *& Form LOADSLIP *&---------------------------------------------------------------------* FORM loadslip . CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YXP_LOADSLIP' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname6 EXCEPTIONS no_form = 1 no_function_module = 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.

*'/1BCDWB/SF00000699' CALL FUNCTION fmname6 EXPORTING * ARCHIVE_INDEX = * ARCHIVE_INDEX_TAB = * ARCHIVE_PARAMETERS = * CONTROL_PARAMETERS = * MAIL_APPL_OBJ = * MAIL_RECIPIENT = * MAIL_SENDER = * OUTPUT_OPTIONS = * USER_SETTINGS = 'X' p_autoid = p_autoid p_manid = p_manid * IMPORTING * DOCUMENT_OUTPUT_INFO = * JOB_OUTPUT_INFO = * JOB_OUTPUT_OPTIONS = EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5 . 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. " LOADSLIP *&---------------------------------------------------------------------* *& Form DTLS_PACKLST *&---------------------------------------------------------------------* FORM dtls_packlst . CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING

* *

formname = 'YXP_PACKDTLS' VARIANT = ' ' DIRECT_CALL = ' ' IMPORTING fm_name = fmname5 EXCEPTIONS no_form = 1 no_function_module = 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.

* * * * * * * *

CALL FUNCTION fmname5 EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS control_parameters MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER output_options USER_SETTINGS P_DOC_NR p_manid p_autoid exdat exname supname nameauth tena tenb tenc tend consamno

= = = = st_control_parameters = = = = st_output_options = 'X' = P_AUTOID = p_manid = p_autoid = exdat1 = exname = supname = nameauth = tenas = tenbs = tencs = tend = consamno

IMPORTING document_output_info job_output_info job_output_options * EXCEPTIONS * FORMATTING_ERROR * INTERNAL_ERROR * SEND_ERROR

= st_document_output_info = st_job_output_info = st_job_output_options = 1 = 2 = 3

* *

USER_CANCELED = 4 OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE.

CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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. *--- Get filename to store CONCATENATE p_autoid '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = v_bin_filesize filename = v_filename filetype = 'BIN' TABLES

data_tab = it_lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ENDFORM. " DTLS_PACKLST *&---------------------------------------------------------------------* *& Form LOADING_SLIP *&---------------------------------------------------------------------* FORM loading_slip . CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING

* *

formname = 'YXP_LOADSLIP' VARIANT = ' ' DIRECT_CALL = ' ' IMPORTING fm_name = fmname6 EXCEPTIONS no_form = 1 no_function_module = 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.

* * * * * * * *

CALL FUNCTION fmname6 EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS control_parameters MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER output_options USER_SETTINGS P_DOC_NR p_manid p_autoid exdat exname supname nameauth tena tenb tenc tend consamno

= = = = st_control_parameters = = = = st_output_options = 'X' = P_AUTOID = p_manid = p_autoid = exdat1 = exname = supname = nameauth = tenas = tenbs = tencs = tend = consamno

IMPORTING document_output_info job_output_info job_output_options * EXCEPTIONS * FORMATTING_ERROR * INTERNAL_ERROR * SEND_ERROR

= st_document_output_info = st_job_output_info = st_job_output_options = 1 = 2 = 3

* *

USER_CANCELED = 4 OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE.

CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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. *--- Get filename to store CONCATENATE p_autoid '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = v_bin_filesize filename = v_filename filetype = 'BIN' TABLES

data_tab = it_lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF.

ENDFORM. " LOADING_SLIP *&---------------------------------------------------------------------* *& Form GATE_PASS *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM gate_pass. CLEAR: tab_gpass[], it_gpass[], it_gpass1[]. LOOP AT it_cont1. IF it_cont1-mark = 'X'. SELECT SINGLE gpass createdby createdon lrno lrdate transname truckno T _DATE T_TIME INTO (gatepass, v_createdby, v_createdon, v_lrno, v_lrdate, v_transna me, v_truckno, V_date, v_time) FROM yxp_gatepass

WHERE contno EQ it_cont1-contno. IF v_lrno IS INITIAL. IF gatepass IS INITIAL. CALL FUNCTION 'NUMBER_GET_NEXT' EXPORTING nr_range_nr = '01' object = 'YGATE' ignore_buffer = 'X' IMPORTING number = gid EXCEPTIONS interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 7 OTHERS = 8. wa_gpass-mandt = '310'. wa_gpass-auto_id = p_autoid. wa_gpass-contno = it_cont1-contno. wa_gpass-gpass = gid. wa_gpass-lrno = it_cont1-lrno. wa_gpass-lrdate = it_cont1-lrdate. wa_gpass-transname = it_cont1-transname. wa_gpass-truckno = it_cont1-truckno. wa_gpass-t_date = it_cont1-t_date. wa_gpass-t_time = it_cont1-t_time. wa_gpass-createdby = sy-uname. wa_gpass-createdon = sy-datum. ELSE. wa_gpass-mandt = '310'. wa_gpass-auto_id = p_autoid. wa_gpass-contno = it_cont1-contno. wa_gpass-gpass = gatepass. wa_gpass-lrno = it_cont1-lrno. wa_gpass-lrdate = it_cont1-lrdate. wa_gpass-transname = it_cont1-transname. wa_gpass-truckno = it_cont1-truckno. wa_gpass-t_date = it_cont1-t_date. wa_gpass-t_time = it_cont1-t_time. wa_gpass-createdby = v_createdby. wa_gpass-createdon = v_createdon. ENDIF. APPEND wa_gpass TO it_gpass1. ELSE. wa_gpass-mandt = '310'.

wa_gpass-auto_id = p_autoid. wa_gpass-contno = it_cont1-contno. wa_gpass-gpass = gatepass. wa_gpass-lrno = v_lrno. wa_gpass-lrdate = v_lrdate. wa_gpass-transname = v_transname. wa_gpass-truckno = v_truckno. wa_gpass-t_date = v_date. wa_gpass-t_time = v_time. wa_gpass-createdon = v_createdon. ENDIF. APPEND wa_gpass TO it_gpass. CLEAR: gatepass, v_lrno, v_lrdate, v_transname, v_truckno, v_createdby, v_createdon, v_date ,v_time. ENDIF. ENDLOOP. LOOP AT it_gpass." into wa_gpass. tab_gpass-mandt = '310'. tab_gpass-auto_id = it_gpass-auto_id. tab_gpass-contno = it_gpass-contno. tab_gpass-gpass = it_gpass-gpass. tab_gpass-createdby = it_gpass-createdby. tab_gpass-createdon = it_gpass-createdon. tab_gpass-lrno = it_gpass-lrno. tab_gpass-lrdate = it_gpass-lrdate. tab_gpass-transname = it_gpass-transname. tab_gpass-truckno = it_gpass-truckno. tab_gpass-t_date = it_gpass-t_date. tab_gpass-t_time = it_gpass-t_time. APPEND tab_gpass. ENDLOOP. IF it_gpass1[] IS NOT INITIAL. MODIFY yxp_gatepass FROM TABLE it_gpass1. COMMIT WORK. ENDIF. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YPRE_GATE' IMPORTING fm_name = fmname7 EXCEPTIONS no_form = 1 no_function_module = 2 OTHERS = 3. CALL FUNCTION fmname7 EXPORTING p_autoid = p_autoid

p_manid = p_manid TABLES tab_gpass = tab_gpass. ENDFORM. " GATE_PASS *&---------------------------------------------------------------------* *& Form GATE_PASS1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM gate_pass1 . CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'. CLEAR: tab_gpass[], it_gpass[], it_gpass1[]. LOOP AT it_cont1. IF it_cont1-mark = 'X'. SELECT SINGLE gpass createdby createdon lrno lrdate transname truckno t _date t_time INTO (gatepass, v_createdby, v_createdon, v_lrno, v_lrdate, v_transna me, v_truckno, V_date, v_time ) FROM yxp_gatepass WHERE contno EQ it_cont1-contno. IF v_lrno IS INITIAL. IF gatepass IS INITIAL. CALL FUNCTION 'NUMBER_GET_NEXT' EXPORTING nr_range_nr = '01' object = 'YGATE' ignore_buffer = 'X' IMPORTING number = gid EXCEPTIONS interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 7 OTHERS = 8.

wa_gpass-mandt = '310'. wa_gpass-auto_id = p_autoid. wa_gpass-contno = it_cont1-contno. wa_gpass-gpass = gid. wa_gpass-lrno = it_cont1-lrno. wa_gpass-lrdate = it_cont1-lrdate. wa_gpass-transname = it_cont1-transname. wa_gpass-truckno = it_cont1-truckno. wa_gpass-t_date = it_cont1-t_date. wa_gpass-t_time = it_cont1-t_time. wa_gpass-createdby = sy-uname. wa_gpass-createdon = sy-datum. ELSE. wa_gpass-mandt = '310'. wa_gpass-auto_id = p_autoid. wa_gpass-contno = it_cont1-contno. wa_gpass-gpass = gatepass. wa_gpass-lrno = it_cont1-lrno. wa_gpass-lrdate = it_cont1-lrdate. wa_gpass-transname = it_cont1-transname. wa_gpass-truckno = it_cont1-truckno. wa_gpass-t_date = it_cont1-t_date. wa_gpass-t_time = it_cont1-t_time. wa_gpass-createdby = v_createdby. wa_gpass-createdon = v_createdon. ENDIF. APPEND wa_gpass TO it_gpass1. ELSE. wa_gpass-mandt = '310'. wa_gpass-auto_id = p_autoid. wa_gpass-contno = it_cont1-contno. wa_gpass-gpass = gatepass. wa_gpass-lrno = v_lrno. wa_gpass-lrdate = v_lrdate. wa_gpass-transname = v_transname. wa_gpass-truckno = v_truckno. wa_gpass-t_date = v_date. wa_gpass-t_time = v_time. wa_gpass-createdon = v_createdon. ENDIF. APPEND wa_gpass TO it_gpass. CLEAR: gatepass, v_lrno, v_lrdate, v_transname, v_truckno, v_createdby, v_createdon ,v_date ,v_time. ENDIF. ENDLOOP. LOOP AT it_gpass." into wa_gpass. tab_gpass-mandt = '310'. tab_gpass-auto_id = it_gpass-auto_id. tab_gpass-contno = it_gpass-contno.

tab_gpass-gpass = it_gpass-gpass. tab_gpass-createdby = it_gpass-createdby. tab_gpass-createdon = it_gpass-createdon. tab_gpass-lrno = it_gpass-lrno. tab_gpass-lrdate = it_gpass-lrdate. tab_gpass-transname = it_gpass-transname. tab_gpass-truckno = it_gpass-truckno. tab_gpass-t_date = it_gpass-t_date. tab_gpass-t_time = it_gpass-t_time. APPEND tab_gpass. ENDLOOP. IF it_gpass1[] IS NOT INITIAL. MODIFY yxp_gatepass FROM TABLE it_gpass1. COMMIT WORK. ENDIF. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YPRE_GATE' IMPORTING fm_name = fmname7 EXCEPTIONS no_form = 1 no_function_module = 2 OTHERS = 3. CALL FUNCTION fmname7 EXPORTING control_parameters = st_control_parameters output_options = st_output_options p_autoid = p_autoid p_manid = p_manid IMPORTING document_output_info = st_document_output_info job_output_info = st_job_output_info job_output_options = st_job_output_options TABLES tab_gpass = tab_gpass. . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs

lines EXCEPTIONS err_conv_not_possible err_otf_mc_noendmarker OTHERS

= it_lines = 1 = 2 = 3.

*--- Get filename to store CONCATENATE 'GP' p_autoid '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = filename = filetype = TABLES data_tab = EXCEPTIONS file_write_error = no_batch = gui_refuse_filetransfer = invalid_type = no_authority = unknown_error = header_not_allowed = separator_not_allowed = filesize_not_allowed = header_too_long = dp_error_create = dp_error_send = dp_error_write = unknown_dp_error = access_denied = dp_out_of_memory =

v_bin_filesize v_filename 'BIN' it_lines 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ENDFORM.

"GATE_PASS1

*&---------------------------------------------------------------------* *& Form GATE_PASS_OLD *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* FORM gate_pass_old . CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YPRE_GATE' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname7 EXCEPTIONS no_form = 1 no_function_module = 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. SELECT SINGLE * FROM yxp_gatepass INTO wa_gatepass WHERE auto_id = p_autoid . IF sy-subrc EQ 0. CALL FUNCTION 'POPUP_TO_CONFIRM_STEP' EXPORTING defaultoption = 'Y' textline1 = 'GatePass Already Generated' textline2 = 'Do you Want to generate New Gatepass Number?' titel = 'Confirm To create New Number' start_column = 25 start_row = 6 cancel_display = 'X' IMPORTING

answer

= p_answer.

IF p_answer EQ 'A'. LEAVE SCREEN. ELSEIF p_answer EQ 'J'. CALL FUNCTION 'NUMBER_GET_NEXT' EXPORTING nr_range_nr = '01' object = 'YGATE' QUANTITY = '1' SUBOBJECT = ' ' TOYEAR = '0000' ignore_buffer = 'X' IMPORTING number = gid QUANTITY = RETURNCODE = EXCEPTIONS interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 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. ELSE. gid = wa_gatepass-gpass. ENDIF. ELSE. CALL FUNCTION 'NUMBER_GET_NEXT' EXPORTING nr_range_nr object QUANTITY = SUBOBJECT = TOYEAR = ignore_buffer IMPORTING number QUANTITY =

* * *

* *

* *

* * *

= '01' = 'YGATE' '1' ' ' '0000' = 'X' = gid

RETURNCODE = EXCEPTIONS interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 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.

ENDIF.

DELETE yxp_gatepass FROM wa_gatepass. wa_gatepass-gpass = gid. wa_gatepass-auto_id = p_autoid. *delete yxp_gatepass FROM wa_gatepass. MODIFY yxp_gatepass FROM wa_gatepass. *'/1BCDWB/SF00000705' CALL FUNCTION fmname7 EXPORTING * ARCHIVE_INDEX = * ARCHIVE_INDEX_TAB = * ARCHIVE_PARAMETERS = * CONTROL_PARAMETERS = * MAIL_APPL_OBJ = * MAIL_RECIPIENT = * MAIL_SENDER = * OUTPUT_OPTIONS = * USER_SETTINGS = 'X' p_autoid = p_autoid p_manid = p_manid gid = gid * IMPORTING * DOCUMENT_OUTPUT_INFO = * JOB_OUTPUT_INFO = * JOB_OUTPUT_OPTIONS = * EXCEPTIONS * FORMATTING_ERROR = 1 * INTERNAL_ERROR = 2 * SEND_ERROR = 3

* *

USER_CANCELED = 4 OTHERS = 5 . 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. " GATE_PASS *&---------------------------------------------------------------------* *& Form GATE_PASS1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM gate_pass1_old . CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YPRE_GATE' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname7 EXCEPTIONS no_form = 1 no_function_module = 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. SELECT SINGLE * FROM yxp_gatepass INTO wa_gatepass WHERE auto_id = p_autoid .

IF sy-subrc EQ 0. CALL FUNCTION 'POPUP_TO_CONFIRM_STEP' EXPORTING defaultoption = 'Y' textline1 = 'GatePass Already Generated' textline2 = 'Do you Want to generate New Gatepass Number?' titel = 'Confirm To create New Number' start_column = 25 start_row = 6 IMPORTING answer = p_answer. IF p_answer EQ 'J'. CALL FUNCTION 'NUMBER_GET_NEXT' EXPORTING nr_range_nr = '01' object = 'YGATE' QUANTITY = '1' SUBOBJECT = ' ' TOYEAR = '0000' ignore_buffer = 'X' IMPORTING number = gid QUANTITY = RETURNCODE = EXCEPTIONS interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 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. ELSE. gid = wa_gatepass-gpass. ENDIF. ELSE. CALL FUNCTION 'NUMBER_GET_NEXT' EXPORTING nr_range_nr object

* * *

* *

* *

= '01' = 'YGATE'

* * *

* *

* *

QUANTITY = '1' SUBOBJECT = ' ' TOYEAR = '0000' ignore_buffer = 'X' IMPORTING number = gid QUANTITY = RETURNCODE = EXCEPTIONS interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 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.

ENDIF.

DELETE yxp_gatepass FROM wa_gatepass. wa_gatepass-gpass = gid. wa_gatepass-auto_id = p_autoid. *delete yxp_gatepass FROM wa_gatepass. MODIFY yxp_gatepass FROM wa_gatepass.

* '/1BCDWB/SF00000705' CALL FUNCTION fmname7 EXPORTING * ARCHIVE_INDEX * ARCHIVE_INDEX_TAB * ARCHIVE_PARAMETERS control_parameters * MAIL_APPL_OBJ * MAIL_RECIPIENT * MAIL_SENDER output_options * USER_SETTINGS p_autoid p_manid

= = = = st_control_parameters = = = = st_output_options = 'X' = p_autoid = p_manid

* * * * * *

* * *

* *

gid = gid IMPORTING document_output_info = st_document_output_info job_output_info = st_job_output_info job_output_options = st_job_output_options EXCEPTIONS FORMATTING_ERROR = 1 INTERNAL_ERROR = 2 SEND_ERROR = 3 USER_CANCELED = 4 OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. CALL FUNCTION 'CONVERT_OTF_2_PDF' EXPORTING USE_OTF_MC_CMD = 'X' ARCHIVE_INDEX = IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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.

*--- Get filename to store CONCATENATE 'Converted_Smartform' '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact.

IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize filename filetype APPEND WRITE_FIELD_SEPARATOR HEADER TRUNC_TRAILING_BLANKS WRITE_LF COL_SELECT COL_SELECT_MASK DAT_MODE CONFIRM_OVERWRITE NO_AUTH_CHECK CODEPAGE IGNORE_CERR REPLACEMENT WRITE_BOM TRUNC_TRAILING_BLANKS_EOL WK1_N_FORMAT WK1_N_SIZE WK1_T_FORMAT WK1_T_SIZE WRITE_LF_AFTER_LAST_LINE SHOW_TRANSFER_STATUS IMPORTING FILELENGTH TABLES data_tab FIELDNAMES EXCEPTIONS file_write_error no_batch gui_refuse_filetransfer invalid_type no_authority unknown_error header_not_allowed separator_not_allowed filesize_not_allowed header_too_long dp_error_create

* * * * * * * * * * * * * * * * * * * * * * *

= v_bin_filesize = v_filename = 'BIN' = ' ' = ' ' = '00' = ' ' = 'X' = ' ' = ' ' = ' ' = ' ' = ' ' = ' ' = ABAP_TRUE = '#' = ' ' = 'X' = ' ' = ' ' = ' ' = ' ' = ABAP_TRUE = ABAP_TRUE = = it_lines = = = = = = = = = = = = 1 2 3 4 5 6 7 8 9 10 11

dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ENDFORM. " GATE_PASS1 *&---------------------------------------------------------------------* *& Form SSP_ARE1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM ssp_are1 . CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YARE_N2_SSP' "'YAREN_1' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname8 EXCEPTIONS no_form = 1 no_function_module = 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. * '/1BCDWB/SF00000421' CALL FUNCTION fmname8 EXPORTING * ARCHIVE_INDEX

* * * * * * * *

ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS CONTROL_PARAMETERS MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER OUTPUT_OPTIONS USER_SETTINGS p_manid p_auto_id wa_yxp_exptd_lic1 tenb exdat2

= = = = = = = = 'X' = p_manid = p_autoid = wa_yxp_exptd_lic1 = tenbs = exdat1

* * * *

IMPORTING DOCUMENT_OUTPUT_INFO = JOB_OUTPUT_INFO = JOB_OUTPUT_OPTIONS = EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5 . 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. " SSP_ARE1 *&---------------------------------------------------------------------* *& Form ARE_SSP1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM are_ssp1 . CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING

e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YARE_N2_SSP' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname8 EXCEPTIONS no_form = 1 no_function_module = 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. * '/1BCDWB/SF00000421' CALL FUNCTION fmname8 EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS control_parameters MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER output_options USER_SETTINGS p_auto_id p_manid wa_yxp_exptd_lic1 tenb exdat2 IMPORTING document_output_info job_output_info job_output_options EXCEPTIONS formatting_error internal_error send_error

"'YAREN_1'

* * * * * * *

= = = = = = = = = = = =

st_control_parameters

st_output_options 'X' p_autoid p_manid wa_yxp_exptd_lic1 = tenbs = exdat1

= st_document_output_info = st_job_output_info = st_job_output_options = 1 = 2 = 3

user_canceled = 4 OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. * *--- Convert OTF to PDF CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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. *--- Get filename to store CONCATENATE 'ARE1' p_autoid '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = v_bin_filesize filename = v_filename filetype = 'BIN' TABLES

data_tab = it_lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ENDFORM. " ARE_SSP1 *&---------------------------------------------------------------------* *& Form SSP_ANNEXURE1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM ssp_annexure1 . IF tena = 'X'. tenas = tena. ENDIF. IF tenb = 'X'. tenbs = tenb. ENDIF. IF tenc = 'X'. tencs = tenc. ENDIF.

IF tend = 'X'. tend = 'ACC6'. ENDIF. *IF CONTABA = 'X'. * elva = CONTABA. *ENDIF. * *IF CONTABB = 'X'. * elva = CONTABB. *ENDIF.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YANNEXUREC1_SSP' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname9 EXCEPTIONS no_form = 1 no_function_module = 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. *'/1BCDWB/SF00000444' CALL FUNCTION fmname9 EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS CONTROL_PARAMETERS MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER OUTPUT_OPTIONS USER_SETTINGS p_manid p_autoid exdat exname supname nameauth

* * * * * * * * *

= = = = = = = = = 'X' = p_manid = p_autoid = exdat1 = exname = supname = nameauth

des tena tenb tenc tend consamno nameaut1 des1

des tenas tenbs tencs tend consamno = nameaut1 = des1

= = = = = =

* IMPORTING * DOCUMENT_OUTPUT_INFO = * JOB_OUTPUT_INFO = * JOB_OUTPUT_OPTIONS = EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5. 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. " SSP_ANNEXURE1 *&---------------------------------------------------------------------* *& Form ANNEXUREC1_SSP1 *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM annexurec1_ssp1 . IF tena = 'X'. tenas = tena. ENDIF. IF tenb = 'X'. tenbs = tenb. ENDIF. IF tenc = 'X'. tencs = tenc. ENDIF. IF tend = 'X'. tend = 'ACC6'. ENDIF.

CALL FUNCTION 'SSF_GET_DEVICE_TYPE' EXPORTING i_language = v_language i_application = 'SAPDEFAULT' IMPORTING e_devtype = v_e_devtype. st_output_options-tdprinter = v_e_devtype. st_control_parameters-no_dialog = 'X'. st_control_parameters-getotf = 'X'. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = 'YANNEXUREC1_SSP' "'YANNEXUREC1' * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fmname9 EXCEPTIONS no_form = 1 no_function_module = 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.

* * * * * * * *

CALL FUNCTION fmname9 EXPORTING ARCHIVE_INDEX ARCHIVE_INDEX_TAB ARCHIVE_PARAMETERS control_parameters MAIL_APPL_OBJ MAIL_RECIPIENT MAIL_SENDER output_options USER_SETTINGS P_DOC_NR p_manid p_autoid exdat exname supname nameauth des tena

= = = = st_control_parameters = = = = st_output_options = 'X' = P_AUTOID = p_manid = p_autoid = exdat1 = exname = supname = nameauth = des = tenas

tenb tenc tend consamno nameaut1 des1

tenbs tencs tend consamno = nameaut1 = des1

= = = =

IMPORTING document_output_info = st_document_output_info job_output_info = st_job_output_info job_output_options = st_job_output_options * EXCEPTIONS * FORMATTING_ERROR = 1 * INTERNAL_ERROR = 2 * SEND_ERROR = 3 * USER_CANCELED = 4 * OTHERS = 5 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. CALL FUNCTION 'CONVERT_OTF_2_PDF' IMPORTING bin_filesize = v_bin_filesize TABLES otf = st_job_output_info-otfdata doctab_archive = it_docs lines = it_lines EXCEPTIONS err_conv_not_possible = 1 err_otf_mc_noendmarker = 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. *--- Get filename to store CONCATENATE 'ANNX' p_autoid '.pdf' INTO v_name. CREATE OBJECT v_guiobj. CALL METHOD v_guiobj->file_save_dialog EXPORTING default_extension = 'pdf' default_file_name = v_name

file_filter = v_filter CHANGING filename = v_name path = v_path fullpath = v_fullpath user_action = v_uact. IF v_uact = v_guiobj->action_cancel. EXIT. ENDIF. *--- Download PDF to local PC MOVE v_fullpath TO v_filename. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = v_bin_filesize filename = v_filename filetype = 'BIN' TABLES data_tab = it_lines EXCEPTIONS file_write_error = 1 no_batch = 2 gui_refuse_filetransfer = 3 invalid_type = 4 no_authority = 5 unknown_error = 6 header_not_allowed = 7 separator_not_allowed = 8 filesize_not_allowed = 9 header_too_long = 10 dp_error_create = 11 dp_error_send = 12 dp_error_write = 13 unknown_dp_error = 14 access_denied = 15 dp_out_of_memory = 16 disk_full = 17 dp_timeout = 18 file_not_found = 19 dataprovider_exception = 20 control_flush_error = 21 OTHERS = 22. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF.

ENDFORM. INCLUDE INCLUDE INCLUDE INCLUDE INCLUDE myinclude_top. myinclude_inp. myinclude_out. myexcel_preshp. myexcel01.

" ANNEXUREC1_SSP1

INCLUDE myexcel_preshp_pack. INCLUDE myexcel_preshp_annexure. INCLUDE myexcel_preshp_are_1.

>>>>>>>>>>>>>myinclude_to>>>>>>start>>>>>>> type-pools ole2. data : h_excel type ole2_object, h_wrkbookl type ole2_object, h_wrkbook type ole2_object, h_activesheet type ole2_object, h_pagesetup type ole2_object, h_range type ole2_object, h_column type ole2_object, h_cell type ole2_object, h_cell1 type ole2_object, h_cell2 type ole2_object, h_font type ole2_object, h_color type ole2_object, h_border type ole2_object, h_rw_hgt type ole2_object, "add by sandip shapes type ole2_object, h_rightheader type ole2_object, excel_filename type draw-filep, excel_new type rlgrap-filename, l_image_path type string.

constants : xltop type i value '1', xlcenter type i value '-4108', xlbottom type i value '-4107',

xlleft type i value '-4131', xlright type i value '-4152', xlnone type i value '-4142', xlautomatic type i value '-4105', xlcontinuous type i value '1', xlinsidevertical type i value '11', xlthin type i value '2', xllandscape type i value '2', xlportrait type i value '1', xlletter type i value '1', xllegal type i value '5', xlthick type i value '4', XLPAGEFIELD type i value '3', XLNORMAL type i value '2', XLWIDE type i value '4'.

data :

filename type string, path type string, fullpath type string, excelname type string, row(10), col(10), l_range(30). "============================================FOR LINE COLUMN AND TEXT======== ======= data : text3 type string, text4 type string. data: m type i, "row n type i value 0. "column data: sel_1 type i value 0," select row first sel_2 type i value 0. "select last row "===================================================================== " add by sandip for image download from application server data : l_bytecount type i, l_tdbtype like stxbitmaps-tdbtype, l_content type standard table of bapiconten initial size 0. data: graphic_size type i. data: begin of graphic_table occurs 0, line(255) type x, end of graphic_table. "======================================================================= types: begin of ty_final, doc_nr type yxp_invpre-doc_nr, * HS_CODE TYPE STRING, hs_code(8) type c,

desc_good type yxp_item-arktx, arktx type yxp_item-arktx, size type yxp_item-arktx, gsm type string, typ type string, const type string, tc type string, qty type yxp_item-kwmeng, ntwt type yxp_item-ntgew, vrkme type yxp_item-vrkme, * RATE TYPE YXP_ITEM-NETPR, * RATE TYPE KONV-KBETR, rate type zexproduct-rate, * RATE TYPE BAPICURR-BAPICURR, amt type yxp_item-netpr, waerk type yxp_item-waerk, end of ty_final.

types : begin of ty_item1. include structure yxp_item. types : netpr1 type zexproduct-rate. * TYPES : NETPR1 TYPE BAPICURR-BAPICURR. * TYPES : NETPR1 TYPE KONV-KWERT. types : end of ty_item1. types: begin of ty_docnr, doc_nr type yxp_invpre-doc_nr, kursf type yxp_invpre-kursf, freight type yxp_invpre-freight, end of ty_docnr. types: begin of ty_hdrinv, hdr1 type string, hdr2 type string, hdr3 type string, hdr4 type string, hdr5 type string, hdr6 type string, hdr7 type string, hdr8 type string, hdr9 type string, hdr10 type string, end of ty_hdrinv. types: begin of ty_item.

include structure yxp_contman_itm. types: sealno1 type yxp_contdtl-sealno. types: esealno type yxp_contdtl-esealno. types: buyerseal type yxp_contdtl-buyerseal. types: end of ty_item. types: begin of ty. types : int1 type i. types: end of ty. types: begin of ty1. types : i1 type i. types: end of ty1. data :it_final type table of ty_final, wa_final type ty_final, it_docnr1 type table of ty_docnr, wa_docnr1 type ty_docnr, it_hdrinv type table of ty_hdrinv, wa_hdrinv type ty_hdrinv, it_yxp_item type table of ty_item1, wa_yxp_item type ty_item1, p_sumamt1 type yxp_item-netwr, p_ntwt type yxp_item-ntgew, p_sumamt type yxp_item-netwr, p_sumqty type yxp_item-netpr, p_comamt type yxp_item-netwr, p_lessamt type yxp_item-netwr, p_totalamt type yxp_item-netwr, p_totalamtchat type spell, p_grosswt type yxp_item-brgew, p_ntgew type yxp_item-ntgew, p_sumpckt type yxp_item-no_pack, p_kursf type yxp_invpre-kursf, p_freight type yxp_invpre-freight, p_kursfamt type yxp_item-netwr, p_totfob1 type yxp_item-netwr, it_mvke type table of mvke, wa_mvke type mvke, it_tvm1 type table of tvm1t, wa_tvm1 type tvm1t, it_final1 type table of ty_final, wa_final1 type ty_final, sumq type ty_final-qty, ntwt type ty_final-ntwt, sumr type ty_final-rate, suma type ty_final-amt, p_commission type yxp_invpre-commison, p_discount type yxp_invpre-discount, wa_kna1 type kna1, waerk type vbak-waerk,

nadrc1 type adrc, nadrc2 type adrc, it_ylcelcmst1 type ylcelcmst, string1 type string, string2 type string, "it_yxp_invpre type table of yxp_invpre, w_yxp_invpre type yxp_invpre, p_cenvat type yxp_bonddtl-exbed_dr, mara type mara, mvke type mvke, iylcesadr type ylcesadr, t001 type t001, " VBAK type VBKD, sales type string, sdat type string, tdline type table of tline with header line, it_yxp_contman_itm type table of yxp_contman_itm, wa_yxp_contman_itm type yxp_contman_itm, it_yxp_contman_itm2 type table of yxp_contman_itm, wa_yxp_contman_itm2 type yxp_contman_itm, carton type yxp_contman_itm-carton, it_adrc type adrc, vbrk type vbrk, "LINES type I, flg type c, line2 type i, it_yxp_exptd_lic type table of yxp_exptd_lic, wa_yxp_exptd_lic2 type yxp_exptd_lic, string_n1 type string, string_n2 type string, likp type likp, "yxp_shphd type yxp_shphd, madrc type adrc, cotno type c, lcontno type string, sealno type string, sadrc type adrc, cont1 type t005t-landx, bno type yxp_bonddtl-bno, bdat type yxp_bonddtl-bdat, string3 type string, mara1 type mara, bstkd type string, precarrier type string, i_yxp_contdtl type table of yxp_contdtl, w_yxp_contdtl type yxp_contdtl, srno type i, srno1 type i,

srno2 type i, lines1 type i, totamt type yxp_item-netpr, it_yxp_contman_itm1 type table of yxp_contman_itm, wa_yxp_contman_itm1 type yxp_contman_itm, it_item type table of ty_item, wa_item type ty_item, it_item2 type table of ty_item, wa_item2 type ty_item, wa_item1 type ty_item, carton1 type yxp_contman_itm-carton, int type i value 0, int1 type i value 0, it type table of ty, wa type ty, int2 type i, int3 type i, it1 type table of ty1, wa1 type ty1, it2 type ty1 occurs 0, wa2 type ty1, i type i value 0, i1 type i value 0, i2 type i, i3 type i, flandx type string, line1 type i, p_totfob type yxp_item-netwr, weark type yxp_item-waerk, vessel type string, port_load type string, port_desc type string, p_insu type yxp_invpre-commison, p_dis type yxp_invpre-discount, p_othr type yxp_invpre-other, p_txt type yxp_invpre-othertxt, p_freighttxt type string, p_commisontxt type string, p_discounttxt type string, eadrc type adrc, text1 type string, space1 type c, text2 type string, "SPACE1 type C, "TEXT2 type STRING, const type c, tc type c, exseal type c, lexseal type string,

shseal type c, lshseal type string, contsiz type c, lcontsiz type string, contno type c, gdesc type c, p_licprod type string, wa_yxp_exptd_lic3 type yxp_exptd_lic, exrate type j_1ivtxrat-rate, "cadrc type adrc, bstatus type yxp_bonddtl-br, "wa_yxp_invpre type yxp_invpre, j_1imocomp TYPE j_1imocomp, inco1 type vbkd-inco1, TEXT_B TYPE STRING, TEXT_1 TYPE STRING, TEXT_2 TYPE STRING, DATE1 TYPE STRING, a_vbak type vbak, "p_manid type yxp_contman_itm-manid, amt_word type string, amt_word1 type string. "data: wa_yxp_shphd like yxp_shphd. "=====================================END OF DATA =========================== >>>>>>>>>>>>>myinclude_to>>>>>>end>>>>>>> >>>>>>>>>>>>>INCLUDE myinclude_out. >>>>>>start>>>>>>> module LIST_FILL_1010 output. if it_cont1[] is initial. SELECT contno INTO wa_contno-contno FROM yxp_contman_itm JOIN yxp_invpre ON yxp_contman_itm~delv EQ yxp_invpre~doc_nr WHERE yxp_contman_itm~manid EQ p_manid AND yxp_invpre~auto_id EQ p_autoid. append wa_contno to it_contno. clear : wa_contno. ENDSELECT. sort it_contno by contno. delete adjacent duplicates from it_contno comparing contno. * clear it_cont1[]. loop at it_contno into wa_contno. if wa_contno-contno ne ''. select single lrno lrdate transname truckno t_date t_time from yxp_gate pass into (wa_cont1-lrno, wa_cont1-lrdate, wa_cont1-transname, wa_cont1truckno, wa_cont1-t_date, wa_cont1-t_time) where contno eq wa_contno-contno and cancelstat ne 'X'.

wa_cont1-contno = wa_contno-contno. if wa_cont1-lrno is not initial. wa_cont1-status = 'X'. endif. append wa_cont1 to it_cont1. endif. clear: wa_contno, wa_cont1. endloop. data: v_lines type i. describe table it_cont1 lines v_lines. tbl_01-lines = v_lines. endif. * clear: values[]. * param = 'LSB_01'. * icount = 0. * loop at it_contno into wa_contno. * icount = icount + 1. * value-key = icount. * value-text = wa_contno-contno. * append value to values. * endloop. * * CALL FUNCTION 'VRM_SET_VALUES' * EXPORTING * id = param * values = values. endmodule. module STATUS_1010 output. SET PF-STATUS '1010'. SET TITLEBAR '1010'. endmodule. *&---------------------------------------------------------------------* *& Module INPUT_DATA OUTPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* module INPUT_DATA output. * describe table it_contno lines lines. * tbl_01-lines = lines. loop at screen. if screen-name eq 'IT_CONT1-CONTNO'. screen-input = '0'. modify screen. endif. if it_cont1-mark = 'X'. if screen-name eq 'IT_CONT1-LRNO' and it_cont1-lrno ne ''. screen-input = '0'.

modify screen. endif. if screen-name eq 'IT_CONT1-LRDATE' and it_cont1-lrdate ne '00000000'. screen-input = '0'. modify screen. endif. if screen-name eq 'IT_CONT1-TRANSNAME' and it_cont1-transname ne ''. screen-input = '0'. modify screen. endif. if screen-name eq 'IT_CONT1-TRUCKNO' and it_cont1-truckno ne ''. screen-input = '0'. modify screen. endif. "added by sandip shankariya if screen-name eq 'IT_CONT1-T_DATE' and it_cont1-truckno ne ''. screen-input = '0'. modify screen. endif. if screen-name eq 'IT_CONT1-T_TIME' and it_cont1-truckno ne ''. screen-input = '0'. modify screen. endif. "ended by sandip shankariya else. if screen-name eq 'IT_CONT1-LRNO'. screen-input = '0'. modify screen. endif. if screen-name eq 'IT_CONT1-LRDATE'. screen-input = '0'. modify screen. endif. if screen-name eq 'IT_CONT1-TRANSNAME'. screen-input = '0'. modify screen. endif. if screen-name eq 'IT_CONT1-TRUCKNO'. screen-input = '0'. modify screen. endif. "added by sandip shankariya if screen-name eq 'IT_CONT1-T_DATE' and it_cont1-truckno ne ''. screen-input = '0'. modify screen. endif. if screen-name eq 'IT_CONT1-T_TIME' and it_cont1-truckno ne ''. screen-input = '0'. modify screen.

endif. "ended by sandip shankariya endif. endloop. endmodule. " INPUT_DATA

OUTPUT

>>>>>>>>>>>>>INCLUDE myinclude_out. >>>>>>start>>>>>>>

>>>>>>>>>>>>>INCLUDE MYEXCEL_PRESHP>>>>>>start>>>>>>> *&---------------------------------------------------------------------* *& Include MYEXCEL_PRESHP add by sandip *&---------------------------------------------------------------------* FORM EXCEL_PRESHP. perform GETDATA_INV. data : h type sy-tabix. call function 'SAPGUI_PROGRESS_INDICATOR' exporting text = 'Processing...' exceptions others = 1. create object h_excel 'EXCEL.APPLICATION'. perform err_hdl. set property of h_excel 'DISPLAYALERTS' = 0. set property of h_excel 'VISIBLE' = 0. call method of h_excel 'WORKBOOKS' = h_wrkbookl. perform err_hdl. call method of h_wrkbookl 'ADD' = h_wrkbook. perform err_hdl. call method of h_excel 'ACTIVESHEET' = h_activesheet.

set property of h_activesheet 'NAME' = 'Pre-shipment Invoice'. get property of h_activesheet 'PAGESETUP' = h_pagesetup. set property of h_pagesetup 'TopMargin' = 4. set property of h_pagesetup 'BOTTOMMARGIN' = 2. set property of h_pagesetup 'RIGHTMARGIN' = 4. set property of h_pagesetup 'LEFTMARGIN' = 4. set property of h_pagesetup 'FOOTERMARGIN' = 4. set property of h_pagesetup 'HEADERMARGIN' = 4. set property of h_pagesetup 'ORIENTATION' = 1. set property of h_pagesetup 'RIGHTFOOTER' = 'Page &P of &N'. set property of h_pagesetup 'PrintTitleRows' = '$1:$32'. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'a'.

set property of h_column 'COLUMNWIDTH' = 10. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting set property of h_column 'COLUMNwIDTH' = 11. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting set property of h_column 'COLUMNWIDTH' = 7. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting set property of h_column 'COLUMNWIDTH' = 6. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting set property of h_column 'COLUMNWIDTH' = 13. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting set property of h_column 'COLUMNWIDTH' = 10. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting set property of h_column 'COLUMNWIDTH' = 9. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting set property of h_column 'COLUMNWIDTH' = 9. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting set property of h_column 'COLUMNWIDTH' = 8. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting set property of h_column 'COLUMNWIDTH' = 8. free object h_column.

#1 = 'b'.

#1 = 'c'.

#1 = 'd'.

#1 = 'e'.

#1 = 'f'.

#1 = 'g'.

#1 = 'h'.

#1 = 'i'.

#1 = 'j'.

m = 1. loop at it_yxp_invpre into wa_yxp_invpre. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '3'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 'Retail Invoice' xlleft xlcenter 0.

perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 1 'I N V O I C E' xlcenter xlcenter 0. perform border_range using m 7 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 7 0 'ORIGINAL/DUPLICATE/TRIPLICATE/EXTRA' xlr ight xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Range:' xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. call method of h_excel 'Worksheets' = h_activesheet exporting #1 = 1. call method of h_activesheet 'Activate'. get property of h_activesheet 'Shapes' = shapes. call method of shapes 'AddPicture' exporting #1 = 'C:\Windows\Temp\logo.bmp' "image file name on presentation server #2 = m #3 = '1' #4 = 170 "left #5 = 12 "top #6 = 80 "right #7 = 45. "bottom m = m + 1. clear text3. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Division:' xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'.

perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate exdat1+6(2) exdat1+4(2) exdat1(4) into

text3 separated by '.'.

concatenate 'Date & Time of Removal:' text3 into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Corp.Off.' xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 eadrc-name1 xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate eadrc-name2 eadrc-name3 into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'.

perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 eadrc-name4 xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'I.E.C.No:' ' ' text2 into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate eadrc-city1 eadrc-post_code1 into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'.

perform fill_cell using m 1 1 'Exporter:' xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 it_adrc-name1 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate wa_yxp_invpre-audat+6(2) wa_yxp_invpreaudat+4(2) wa_yxp_invpre-audat(4) into text3 separated by '.'. concatenate 'Invoice No & Date :' wa_yxp_invpreauto_id ' Date :' text3 into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 it_adrc-street xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate wa_yxp_shphd-aredt+6(2) wa_yxp_shphdaredt+4(2) wa_yxp_shphd-aredt(4) into text3 separated by '.'. concatenate 'ARE No. & Date :' wa_yxp_shphdar4_number 'Date :' text3 into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate it_adrc-str_suppl3 it_adrc-

city1 into text3 separated by ','. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Sales Order No :' sales into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate it_adrc-city2 it_adrcpost_code1 into text3 separated by ','. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Supporting Manufacturer:' xlleft xlcente r 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 madrc-name1 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2.

m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 madrc-street xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate madrc-str_suppl3 madrc-city2 into text3 separated by ','. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate madrc-city1 madrc-post_code1 into text3 separated by ','. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Buyer Oreder No.:' bstkd into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 6 m 10. call method of h_cell 'borders' = h_border exporting #1 = '3'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'.

set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Consignee:' xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 1 'Buyer(If other than Consignee)' xlleft x lcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 cadrc-name1 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 sadrc-name1 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. n = m + 1. perform border_range using m 1 n 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate cadrc-name2 cadrc-name3 cadrc-name4 into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. set property of h_cell 'wraptext' = 1. perform border_range using m 6 n 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate sadrc-name2 sadrc-name3 sadrc-name4 into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. set property of h_cell 'wraptext' = 1. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using n 1 '1' '1' 2. perform border_cell using n 10 '2' '1' 2. perform border_cell using n 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5.

call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Notify1: ' nadrc1-name1 nadrc1-name2 nadrc1-name3 nadrc1name4 nadrc1-city1 nadrc1-city2 into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 6 m 10. call method of h_cell 'borders' = h_border exporting #1 = '3'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Notify1: ' nadrc2-name1 nadrc2-name2 nadrc2-name3 nadrc2name4 nadrc2-city1 nadrc2-city2 into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border.

m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 'Pre-carriage By :' xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 'Place of Reciept By Precarrier :' xlleft xlcenter 0. perform border_range using m 6 m 7. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 'Country of Origin of Goods: ' xlleft xlc enter 0. perform border_range using m 8 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 8 0 'Country of Final Destination: ' xlleft x lcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 6 m 10. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate wa_yxp_shphd-vehcl_from wa_yxp_shphd-vehcl_to into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 precarrier xlleft xlcenter 0. perform border_range using m 6 m 7. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 'India' xlleft xlcenter 0. perform border_range using m 8 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'.

perform perform perform perform perform perform

fill_cell using m border_cell using border_cell using border_cell using border_cell using border_cell using

8 m m m m m

0 flandx xlleft xlcenter 0. 1 '1' '1' 2. 2 '2' '1' 2. 7 '2' '1' 2. 10 '2' '1' 2. 5 '2' '1' 2.

perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 'Vessel/Flight #:' xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 'Port of Loading:' xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Terms of Delivery and Payment : ' string1 arated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate vessel wa_yxp_shphd-voy_fly_no into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'.

into text3 sep

perform fill_cell using m 3 0 wa_yxp_shphd-port_load xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'LC No : ' it_ylcelcmst1lc_number into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 'Port Of Discharge:' xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 'Final Destination:' xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Banker: ' wa_yxp_invpre-advbank into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 wa_yxp_shphd-

port_dschr xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 wa_yxp_shphdfin_destin xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 'Insurance Cover No & Date :' enter 0.

xlleft xlc

perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Name of commodity:' P_licprod into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Freight Terms : ' inco1 wa_yxp_shphd-shp_type into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1.

perform border_range using m 1 m 10. call method of h_cell 'SELECT'. set property of h_cell 'wraptext' = 1. set property of h_cell1 'rowheight' = 30 no flush. set property of h_cell2 'rowheight' = 30 no flush. call method of h_cell 'borders' = h_border exporting #1 = '4'. "bottom set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform fill_cell using m 1 0 wa_hdrinv-hdr1 xlcenter xltop 0. perform fill_cell using m 2 0 wa_hdrinv-hdr2 xlcenter xltop 0. perform fill_cell using m 3 0 wa_hdrinv-hdr3 xlcenter xltop 0. perform fill_cell using m 4 0 wa_hdrinv-hdr4 xlcenter xltop 0. perform fill_cell using m 5 0 wa_hdrinv-hdr5 xlcenter xltop 0. perform fill_cell using m 6 0 'Nt.Wt' xlcenter xltop 0. perform fill_cell using m 7 0 wa_hdrinv-hdr7 xlcenter xltop 0. perform fill_cell using m 8 0 wa_hdrinv-hdr8 xlcenter xltop 0. perform fill_cell using m 9 0 wa_hdrinv-hdr9 xlcenter xltop 0. perform fill_cell using m 10 0 wa_hdrinv-hdr10 xlcenter xltop 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 1 '2' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 3 '2' '1' 2. perform border_cell using m 4 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using m 6 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 8 '2' '1' 2. perform border_cell using m 9 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. data tab type i value 0. sel_1 = m + 1. loop at IT_FINAL1 into wa_final1. m = m + 1. tab = tab + 1. perform border_range using m 1 m 10. perform fill_cell using m 1 0 wa_final1-hs_code xlleft xlcenter 0. perform fill_cell using m 2 0 wa_final1-desc_good xlcenter xlcenter 0. perform fill_cell using m 3 0 wa_final1-SIZE xlcenter xlcenter 0. perform fill_cell using m 4 0 wa_final1-gsm xlcenter xlcenter 0. perform fill_cell using m 5 0 wa_final1-typ xlcenter xlcenter 0. perform fill_cell using m 6 0 wa_final1-ntwt xlcenter xlcenter 0. set property of h_cell 'numberformat' = '#0,000.000'. perform fill_cell using m 7 0 wa_final1-tc xlcenter xlcenter 0.

perform fill_cell using m 8 0 wa_final1-qty xlright xlcenter 0. set property of h_cell 'numberformat' = '#0,000'. clear exrate. exrate = wa_final1-rate. perform fill_cell using m 9 0 exrate xlright xlcenter 0. text3 = m. text4 = m. concatenate 'h' text3 into text3. concatenate '(' text3 into text3. concatenate 'i' text4 into text4. concatenate text4 ')' into text4. concatenate text3 text4 into text3 separated by ':'. concatenate '=' text3 into text3 separated by 'product'. perform fill_cell using m 10 0 text3 xlright xlcenter 0. ""wa_final1amt from sap set property of h_cell 'numberformat' = '#0,000.00'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 1 '2' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 3 '2' '1' 2. perform border_cell using m 4 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using m 6 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 8 '2' '1' 2. perform border_cell using m 9 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. endloop. sel_2 = sel_1 + tab - 1. "============================for blank lines=================== if tab le 17. tab = 17 - tab. do tab times. m = m + 1. perform border_range using m 1 m 10. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 1 '2' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 3 '2' '1' 2. perform border_cell using m 4 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using m 6 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 8 '2' '1' 2. perform border_cell using m 9 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. enddo.

endif. "==========================end ================================ m = m + 1. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '3'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text4 = p_grosswt. concatenate 'Gross Weight:' text4 into text3 separated by ' '. set property of h_cell 'numberformat' = '#00,000.000'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 'No&Kind of Pkgs.:' xlleft xlcenter 0. perform border_range using m 5 m 7. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 '' xlleft xlcenter 0. text3 = sel_1. text4 = sel_2. concatenate 'h' text3 into text3. concatenate '(' text3 into text3. concatenate 'h' text4 into text4. concatenate text4 ')' into text4. concatenate text3 text4 into text3 separated by ':'. concatenate '=' text3 into text3 separated by 'sum'.

perform fill_cell using m 8 0 text3 xlleft xlcenter 0. set property of h_cell 'numberformat' = '#0,000'. data tot_qty type string. tot_qty = text3. " for quantity text3 = sel_1. text4 = sel_2. concatenate 'j' text3 into text3. concatenate '(' text3 into text3. concatenate 'j' text4 into text4. concatenate text4 ')' into text4. concatenate text3 text4 into text3 separated by ':'. concatenate '=' text3 into text3 separated by 'sum'.

perform border_range using m 10 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 10 0 text3 xlleft xlcenter 0. set property of h_cell 'numberformat' = '#00,000.00'. data tot_amt type string. tot_amt = text3. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 4 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 8 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text4 = p_ntgew. concatenate 'Net Weight:' text4 into text3 separated by ' '. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. set property of h_cell 'numberformat' = '#00,000.000'. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. if wa_yxp_invpre-pack_type eq ''. concatenate carton ' ' wa_yxp_invprepack_type into text3 separated by ' '. perform fill_cell using m 3 0 text3 xlleft xlcenter 0. else. concatenate WA_YXP_INVPRE-NO_PACK ' ' wa_yxp_invpre-pack_type into text3. perform fill_cell using m 3 0 text3 xlleft xlcenter 0. endif. perform border_range using m 5 m 7. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 'Sum Total' xlleft xlcenter 0. perform fill_cell using m 8 0 '' xlleft xlcenter 0. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 9 0 '' xlleft xlcenter 0. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top

set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 4 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 8 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 7. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 'Total' xlleft xlcenter 0. perform border_range using m 8 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 8 0 tot_qty xlleft xlcenter 0. set property of h_cell 'numberformat' = '#0,000'. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'.

perform fill_cell using m 1 0 'Amount Chargeable (In words)' xlleft xlcenter 0. perform border_range using m 3 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text4 = m - 3. concatenate '=spellcurr(J' text4 ',"US DOLLAR","S","CENTS","S")' into te xt3. perform fill_cell using m 3 0 text3 xlleft xlcenter 0.

perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. if vbrk-vkorg <> 2800 or vbrk-vkorg <> 2000 or vbrk-vkorg <> 2500. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 'Commission :' xlleft xlcenter 0. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 com xlleft xlcenter 0. else. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 'Cenvat Payablen :' xlleft xlcenter 0. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 p_cenvat xlleft xlcenter 0. endif. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 'Exchange Rate' xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = wa_yxp_invpre-kursf . concatenate text3 'INR' into text3 separated by ' '. perform fill_cell using m 7 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 5 m 6.

call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 '(-)Freight' xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 9 0 p_freight xlright xlcenter 0. set property of h_cell 'numberformat' = '#0,000.00'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 '(+)Commission' xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 9 0 p_insu xlright xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 '(-)Discount' xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 9 m 10. call method of h_cell 'SELECT'.

call method of h_cell 'MERGE'. perform fill_cell using m 9 0 p_dis xlright xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 '(-)Other' xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 9 0 p_othr xlright xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 'Total Fob Value :' xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = m - 9. concatenate concatenate text3 = m concatenate concatenate text3 = m 'j' text3 into text4. '(' text4 into text4. 4. '-i' text3 into text3. text4 text3 into text4. 3.

concatenate '+i' text3 into text3. concatenate text4 text3 into text4. text3 = m - 2. concatenate '-i' text3 into text3. concatenate text4 text3 into text4. text3 = m - 1. concatenate '-i' text3 into text3. concatenate text4 text3 into text4. concatenate text4 ')' into text4. " concatenate text3 text4 into text3 separated by ':'. concatenate '=' text4 into text4 separated by 'sum'. perform fill_cell using m 9 0 text4 xlright xlcenter 0. ""p_totfob perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 'Total FOB Value(INR):' xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = m - 1. concatenate 'i' text3 into text3. text4 = wa_yxp_invpre-kursf.. concatenate '=product(' text3 '*' text4 ')' into text3. perform fill_cell using m 9 0 text3 xlright xlcenter 0.""p_totfob1 set property of h_cell 'numberformat' = '#0,00,000.00'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 1.

call method of h_cell 'SELECT'. perform fill_cell using m 1 0 'Marks & No. :' xlleft xlcenter 0. perform fill_cell using m 2 0 'Sr.No' xlleft xlcenter 0. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 lcontno xlleft xlcenter 0. perform fill_cell using m 5 0 lcontsiz xlleft xlcenter 0. concatenate 'No of' wa_yxp_invpre-pack_type into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 7 0 lshseal xlleft xlcenter 0. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 9 0 lexseal xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. n = m. loop at tdline. n = n + 1. perform border_range using n 1 n 1. call method of h_cell 'SELECT'. perform fill_cell using n 1 0 tdline-tdline xlleft xlcenter 0. perform border_cell using n 1 '1' '1' 2. perform border_cell using n 10 '2' '1' 2. endloop. srno2 = 0. loop at IT_ITEM into wa_item. m = m + 1. srno2 = srno2 + 1. perform border_range using m 1 m 1. call method of h_cell 'SELECT'. " perform fill_cell using m 1 0 '' xlleft xlcenter 0. perform fill_cell using m 2 0 srno2 xlleft xlcenter 0. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 wa_item-contno xlleft xlcenter 0. perform fill_cell using m 5 0 wa_item-cont_size xlleft xlcenter 0. perform fill_cell using m 6 0 wa_item-carton xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 7 0 wa_item-sealno1 xlleft xlcenter 0. perform border_range using m 9 m 10.

call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 9 0 wa_item-esealno xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. endloop. if srno2 le 9. srno2 = 9 - srno2. do srno2 times. m = m + 1. perform border_range using m 1 m 10. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. enddo. clear srno2. endif. m = m + 1. perform border_range using m 1 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. text3 = 'We Welspun India Limited, Anjar are hereby declared that we are exporting goods under duty Drawback Scheme and further declared that we have not availed Cenvat '. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. m = m + 1. perform border_range using m 1 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. text3 = 'credit Rule 2004 on the manufacturing of the said goods'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 string_n2 xlleft xlcenter 0.

perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 'For WELSPUN GLOBAL BRANDS LTD.' xlright xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 string3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate bdat+6(2) bdat+4(2) bdat(4) into . concatenate bno text3 into text3 separated by ' '. perform fill_cell using m 1 1 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 string_n1 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'.

text3 separated by '.'

call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = 'I/We,hereby,declare that I/We shall claim the benefits,as admi ssible,'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = 'under chapter 3 of FTP'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = 'We hereby certify that merchandise is of Indian origin .'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1.

clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = 'Declaration: We Declare that this invoice show the actual pric e of the'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = 'goods described and all particulars are True and correct.'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 'Authorised Signatory' xlright xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. "===========================================SAVE EXCEL FILE================== ===== endloop. call method of h_wrkbook 'SAVEAS' exporting #1 = fullpath. call method of h_wrkbook 'CLOSE'. call method of h_excel 'QUIT'. free object h_wrkbook.

free object h_excel. message : 'Downloading completed.' type 'S'. endform. >>>>>>>>>>>>>INCLUDE MYEXCEL_PRESHP >>>>>>start>>>>>>> >>>>>>>>>>>>>INCLUDE MYEXCEL01 >>>>>>start>>>>>>> *&---------------------------------------------------------------------* *& Include MYEXCEL01 add by sandip *&---------------------------------------------------------------------*

form print_excel using p_autoid . if rd_2 <> 'X'. perform get_exeldata using p_autoid . endif. perform img_dwnld. if rd_1 = 'X'. concatenate 'EPSI_' p_autoid into filename. elseif rd_2 = 'X'. concatenate 'ARE-1_' p_autoid into filename. elseif rd_3 = 'X'. concatenate 'EPL_' p_autoid into filename. elseif rd_4 = 'X'. concatenate 'ANNEXURE_' p_autoid into filename. endif. call method cl_gui_frontend_services=>file_save_dialog exporting window_title = 'SAVE FILE AS' default_extension = 'XLS' file_filter = '*.XLS' default_file_name = filename * prompt_on_overwrite = 'x' changing filename = filename path = path fullpath = fullpath. if fullpath is not initial. if rd_1 = 'X'. perform EXCEL_PRESHP in program YPRESHP_INV1 if found . elseif rd_2 = 'X'. perform EXCEL_PRESHP_ARE_1 in program YPRESHP_INV1 if found using p_autoid P_MANID TENB EXDAT1. elseif rd_3 = 'X'.

perform EXCEL_PRESHP_pack in program YPRESHP_INV1 if found . elseif rd_4 = 'X'. perform EXCEL_PRESHP_anex in program YPRESHP_INV1 if found . endif. else. message : 'File name is not entered!' type 'E'. endif. endform. "PRINT_EXCEL FORM get_exeldata USING p_autoid . tables : lips,tvm1t,vbap,t005t, yxp_contdtl,yxp_bonddtl,t001w,tvko,zparameter. clear : cadrc. data : faltu type string. data : lines type i. data : netwr like bapicurr-bapicurr. data: it_item1 type ty_item occurs 0. data : werks type t001w-werks. "DATA : WA_YXP_EXPTD_LIC3 LIKE YXP_EXPTD_LIC. select * into corresponding fields of table it_yxp_invpre from yxp_invpre where yxp_invpre~auto_id = p_autoid.

loop at it_yxp_invpre into wa_yxp_invpre. select single * from lips where vbeln = wa_yxp_invpre-doc_nr. select single * from likp where vbeln = wa_yxp_invpre-doc_nr. select single * from vbak where vbeln = lips-vgbel. select single * from vbap where vbeln = lips-vgbel. if rd_4 = 'X'. select single * from vbak into a_vbak where vbeln = vbak-bname. select single * from j_1imocomp into J_1IMOCOMP where bukrs = a_vbak-vkorg . elseif rd_4 <> 'X'. select single * from j_1imocomp into J_1IMOCOMP where bukrs = vbak-vkorg . endif. select single * from t001 where bukrs = vbak-vkorg. select single * from vbpa where vbeln = lips-vgbel and parvw = 'Z2'. select single * from adrc into nadrc1

where addrnumber = vbpa-adrnr. ********For Cor.Address select single * from tvko where vkorg = vbak-vkorg. select single * from adrc into eadrc where addrnumber = tvko-adrnr. ************* For WGBL IEC No

select single * from zparameter where parakey2 = vbak-vkorg and parakey1 = 'IECNO'. text2 = zparameter-parakey7. select single * from zparameter where parakey2 = vbak-vkorg and parakey1 = 'BIN'. text_B = zparameter-parakey7. "================ADD BY SANDIP========================== select single * from zparameter where parakey2 = vbak-vkorg and parakey5 = 'INMUN1' "wa_yxp_shphd-port_CODE and parakey1 = 'SUFFNO'. ""PORT IN PARAKET5 date1 = '20120522'. * added by chintan 22.05.2012 if wa_YXP_invpre-audat >= date1. if zparameter-parakey5 = 'INMUN1'. text_1 = 'VIII/48-141/FS/MP&SEZ/2012-13 DT:11.05.2012 '. else. text_1 = zparameter-parakey8. endif. text_2 = zparameter-parakey9. else. text_1 = zparameter-parakey8. text_2 = zparameter-parakey9. endif. ******************** * AS PER MAIL CONFIRMATION FROM ALPESH AND AVINASH SIR * CHANGE INCOTERM FORM DELIVERY TO SO select single * from vbkd where vbeln = lips-vgbel.

inco1 = vbkd-inco1.

*Manu clear : vbpa. *BREAK-POINT. select single * from vbrk where vbeln = wa_yxp_invpre-doc_nr. select single * from t001w where werks = wa_yxp_invpre-werks and ekorg = wa_yxp_invpre-vkorg.

select single * from adrc into it_adrc where addrnumber = t001w-adrnr.

************************* select single * from vbak where vbeln eq vbrp-aubel. select single * from vbak where vbeln eq vbak-bname. select single werks into werks from vbap where vbeln = vbak-vbeln. * CHANGE BY AJAY *SELECT SINGLE * FROM T001 WHERE BUKRS EQ VBAK-VKORG. * * BREAK-POINT. select single * from t001w where werks = werks and vkorg = vbak-vkorg. select single * from adrc into madrc where addrnumber eq t001w-adrnr. ********** ICE No OF Plant select single * from zparameter where parakey2 = werks and parakey1 = 'IECNO'. text1 = zparameter-parakey7. ************

* PRE-CARRIER BY *BREAK-POINT. *BREAK-POINT. precarrier = 'ANJAR'. if werks = '2800'. precarrier = 'ANJAR'. elseif werks = '2000' or

werks = '1200'. precarrier = 'MORAI,VAPI'. endif. select single * from kna1 into wa_kna1 where kunnr = vbak-kunnr. select single * from vbpa where vbeln = lips-vgbel and parvw = 'WE'."IN('SH','WE'). select single * from adrc into cadrc where addrnumber = vbpa-adrnr. select single * from vbpa where vbeln = lips-vgbel and parvw = 'AG'."IN('SH','WE'). if vbpa-kunnr ne vbak-kunnr. select single * from adrc into sadrc where addrnumber eq vbpa-adrnr. endif. select single landx from t005t into cont1 where land1 eq sadrc-country and spras eq 'E'. select single * from ylceord where vbeln = lips-vgbel . select single * from ylcelcmst into it_ylcelcmst1 where lc_refnr = ylceord-lc_refnr. if it_ylcelcmst1-usance = 'X'. concatenate 'L/C' it_ylcelcmst1-usance_day 'AT SIGHT' into string1 separated by space . else. concatenate it_ylcelcmst1-inco1 'AT SIGHT' into string1 separated by space. endif. select single * from t005t where land1 = it_ylcelcmst1-cntry_org and spras = 'E'. select single landx into flandx

from t005t where land1 = it_ylcelcmst1-cntry_fin and spras = 'E'. select * from yxp_invpre into table it_yxp_invpre where auto_id = wa_yxp_invpre-auto_id. if t005t-landx is initial. t005t-landx = 'INDIA'. endif. clear :sales,bstkd. *LOOP AT IT_YXP_INVPRE INTO W_YXP_INVPRE. select * from yxp_item into table it_yxp_item for all entries in it_yxp_invpre where doc_nr = it_yxp_invpre-doc_nr. *CARTON select * from yxp_contman_itm into table it_yxp_contman_itm for all entries in it_yxp_item where delv = it_yxp_item-doc_nr and manid = p_manid and id eq 'M'. it_yxp_contman_itm1[] = it_yxp_contman_itm[]. it_yxp_contman_itm2[] = it_yxp_contman_itm[]. sort it_yxp_contman_itm2 by so_vbeln . delete adjacent duplicates from it_yxp_contman_itm2 comparing so_vbeln. loop at it_yxp_contman_itm2 into wa_yxp_contman_itm2. * ON CHANGE OF WA_YXP_CONTMAN_ITM2-VBELN. "SACHIN * CONCATENATE SALES WA_YXP_CONTMAN_ITM2-VBELN * INTO SALES SEPARATED BY ','. * ENDON. concatenate sales wa_yxp_contman_itm2-vbeln into sales separated by ','. concatenate bstkd wa_yxp_contman_itm2-ebeln space "SACHIN into bstkd separated by ','. endloop. shift sales left deleting leading ','. shift sales right deleting trailing ','. shift bstkd left deleting leading ','. shift bstkd right deleting trailing ','. clear :p_ntgew,p_grosswt. loop at it_yxp_contman_itm into wa_yxp_contman_itm. vessel = wa_yxp_contman_itm-vesselname. port_load = wa_yxp_contman_itm-load_desc. port_desc = wa_yxp_contman_itm-dschr_desc.

* *

WA_YXP_INVPRE-NO_PACK = WA_YXP_INVPRE-NO_PACK + WA_YXP_CONTMAN_ITM-CARTON. if wa_yxp_contman_itm-contno is initial. carton = carton + wa_yxp_contman_itm-carton. * TOT_PC = TOT_PC + WA_YXP_CONTMAN_ITM-TOT_PCS. else. on change of wa_yxp_contman_itm-contno. carton = carton + wa_yxp_contman_itm-carton. * TOT_PC = TOT_PC + WA_YXP_CONTMAN_ITM-TOT_PCS. endon. endif. *aJAY CHANGE p_ntgew = p_ntgew + wa_yxp_contman_itm-ntgew_kg. p_grosswt = p_grosswt + wa_yxp_contman_itm-brgew_kg. endloop. *f-POINT. sort it_yxp_invpre by doc_nr. loop at it_yxp_invpre into w_yxp_invpre. if p_freight is initial. p_freight = w_yxp_invpre-freight."added by sachin endif. if p_insu is initial. p_insu = w_yxp_invpre-commison. endif. if p_dis is initial. p_dis = w_yxp_invpre-discount. endif. if p_othr is initial. p_othr = w_yxp_invpre-other. endif. p_freighttxt = w_yxp_invpre-freighttxt. p_commisontxt = w_yxp_invpre-commisontxt. p_discounttxt = w_yxp_invpre-discounttxt. p_txt = w_yxp_invpre-othertxt. if p_freighttxt is initial. p_freighttxt = 'Freight'. endif. if p_commisontxt is initial. p_commisontxt = 'Commission'. endif. if p_discounttxt is initial. p_discounttxt = 'Discount'. endif. if p_txt is initial. p_txt = 'Other'. endif. select single vgbel from lips into lips-vgbel

where vbeln eq w_yxp_invpre-doc_nr. ON CHANGE OF LIPS-VGBEL. "SACHIN CONCATENATE SALES LIPS-VGBEL INTO SALES SEPARATED BY ','. ENDON. SHIFT SALES LEFT DELETING LEADING ','. SHIFT SALES RIGHT DELETING TRAILING ','. on change of w_yxp_invpre-audat. concatenate w_yxp_invpre-audat ' ' into sdat. endon. * P_GROSSWT = WA_YXP_INVPRE-BRGEW. " aJAY CHANGE * P_NTGEW = WA_YXP_INVPRE-NTGEW. * BREAK-POINT. select single * from yxp_shphd where doc_nr = w_yxp_invpre-auto_id and doc_clas = '0009' . * * * * * select single * from vbkd where vbeln = lips-vgbel.

****************Start Hide By Chirag On 09.05.2011 * ON CHANGE OF LIPS-VGBEL. * CONCATENATE BSTKD VBKD-BSTKD SPACE "SACHIN * INTO BSTKD SEPARATED BY ','. * ENDON. * SHIFT BSTKD LEFT DELETING LEADING ','. * SHIFT BSTKD RIGHT DELETING TRAILING ','. ********************* End Of.

endloop. sort it_yxp_item by matnr . *DESCRIBE TABLE IT_YXP_ITEM LINES LINES. *LOOP AT IT_YXP_ITEM INTO WA_YXP_ITEM. *SELECT SINGLE j_1ichid INTO WA_YXP_ITEM-HS_CODE * FROM J_1IMTCHID * WHERE MATNR = WA_YXP_ITEM-MATNR. * *MODIFY IT_YXP_ITEM FROM WA_YXP_ITEM. *ENDLOOP. data: w_lips type lips. data: w_konv type konv. data : w_vbak type vbak. clear: it_final1[],p_sumqty,p_sumamt,sumq,sumr,suma, wa_final1,p_ntwt,ntwt.

loop at it_yxp_item into wa_yxp_item. weark = wa_yxp_item-waerk. select single vgbel vgpos from lips into corresponding fields of w_lips where vbeln = wa_yxp_item-doc_nr and posnr = wa_yxp_item-posnr. select single knumv into corresponding fields of w_vbak from vbak where vbeln = w_lips-vgbel. select single * from konv into w_konv where knumv = w_vbak-knumv and kposn = w_lips-vgpos and kschl = 'PR00'. * WA_YXP_ITEM-NETPR1 = W_KONV-KBETR. p_sumamt1 = wa_yxp_item-netwr + p_sumamt1 . * W_KONV-KBETR = W_KONV-KBETR / 100. call function 'BAPI_CURRENCY_CONV_TO_EXTERNAL' exporting currency = wa_yxp_item-waerk amount_internal = w_konv-kbetr importing amount_external = netwr. wa_yxp_item-netpr1 = netwr . * WA_YXP_ITEM-NETPR1 = W_KONV-KBETR. * WA_YXP_ITEM-NETPR1 = WA_YXP_ITEM-NETPR1 / 100. call function 'BAPI_CURRENCY_CONV_TO_EXTERNAL' exporting currency = wa_yxp_item-waerk amount_internal = wa_yxp_item-netwr importing amount_external = netwr. wa_yxp_item-netwr = netwr. select single * from mara where matnr = wa_yxp_item-matnr. select single maktx into wa_yxp_item-arktx from makt where matnr = wa_yxp_item-matnr and spras = 'E'. * WA_YXP_ITEM-ARKTX = clear wa_final1-hs_code. select single * from mara into mara1 where matnr = mara-bismt.

select single * from mvke where matnr = mara-bismt and vkorg = vbak-vkorg and vtweg = vbak-vtweg. *BREAK-POINT. select single j_1ichid into wa_final1-hs_code from j_1imtchid where matnr = mvke-pmatn. if lines gt 1. * ON CHANGE OF MARA-MATKL. select single * from mvke where matnr = mara-matnr. select single * from tvm1t where mvgr1 = mvke-mvgr1 and spras = 'EN'. data hdr8tmp type string. data hdr9tmp type string. data hdr10tmp type string. concatenate 'Quantity ' wa_yxp_item-vrkme into hdr8tmp separated by ' '. concatenate 'Rate in ' wa_yxp_item-waerk into hdr9tmp separated by ' '. concatenate 'Amount 'wa_yxp_item-waerk into hdr10tmp separated by ' '. if mara-spart = '20'. "TT wa_hdrinv-hdr1 = 'HS Code Customer#s Ref'. wa_hdrinv-hdr2 = 'Description of Goods'. wa_hdrinv-hdr3 = 'Size'. wa_hdrinv-hdr4 = 'GSM'. wa_hdrinv-hdr5 = 'Type'. wa_hdrinv-hdr6 = 'Const'. wa_hdrinv-hdr7 = 'TC'. wa_hdrinv-hdr8 = hdr8tmp. wa_hdrinv-hdr9 = hdr9tmp.

wa_hdrinv-hdr10 = hdr10tmp. wa_final1-desc_good = tvm1t-bezei. BREAK-POINT. split wa_yxp_item-arktx at '/' into wa_final1-size faltu. split faltu at 'GSM' into faltu wa_final1-gsm . WA_FINAL1-TYP. WA_FINAL1-GSM.

* **

split wa_final1-gsm at '/' into wa_final1-gsm faltu. split wa_yxp_item-arktx at '/' into wa_final1-typ faltu. split faltu at '/' into wa_final1-typ faltu. split faltu at '/' into wa_final1-typ faltu. elseif mara-spart = 'BS' or mara-spart = 'DB'. "BS concatenate 'Quantity ' wa_yxp_item-vrkme into hdr8tmp separated by ' '. concatenate 'Rate in' wa_yxp_item-waerk into hdr9tmp separated by ' '. concatenate 'Amount'wa_yxp_item-waerk into hdr10tmp separated by ' '. wa_hdrinv-hdr1 = 'HS Code Customer#s Ref'. wa_hdrinv-hdr2 = 'Description of Goods'. wa_hdrinv-hdr3 = 'Flat'. wa_hdrinv-hdr4 = 'Fitted'. wa_hdrinv-hdr5 = 'Pillow'. wa_hdrinv-hdr6 = 'Const'. wa_hdrinv-hdr7 = 'TC'. wa_hdrinv-hdr8 = hdr8tmp. wa_hdrinv-hdr9 = hdr9tmp. wa_hdrinv-hdr10 = hdr10tmp. split tvm1t-bezei at '(' into wa_final1-desc_good faltu. split faltu at 'FLAT' into wa_final1-size faltu. split faltu at '+FITTED' into wa_final1-gsm faltu. split faltu at '+PILLOWS' into wa_final1-typ faltu. * SPLIT WA_YXP_ITEM-ARKTX AT 'TC' INTO WA_FINAL1-TC FALTU. *** WA_FINAL1-DESC_GOOD = TVM1T-BEZEI. wa_final1-tc = mara1-groes. endif . if sy-tabix <> 1. wa_final1-qty = sumq. wa_final1-ntwt = ntwt. wa_final1-vrkme = wa_yxp_item-vrkme. wa_final1-rate = sumr. wa_final1-amt = suma. wa_final1-vrkme = wa_yxp_item-vrkme. p_sumqty = sumq + p_sumqty . p_sumamt = suma + p_sumamt . * append wa_final1 to it_final1. endif. ENDON.

sumq = wa_yxp_item-kwmeng."+ SUMQ. ntwt = wa_yxp_item-ntgew. sumr = wa_yxp_item-netpr1. " . suma = ( sumr * sumq )."+ SUMA . else. sumq = wa_yxp_item-kwmeng + sumq. ntwt = wa_yxp_item-ntgew + ntwt. sumr = wa_yxp_item-netpr1."+ SUMR . suma = ( sumr * wa_yxp_item-kwmeng ) + suma . wa_final1-qty = sumq. wa_final1-ntwt = ntwt. wa_final1-rate = sumr. wa_final1-amt = suma. * APPEND WA_FINAL1 TO IT_FINAL1. p_sumqty = wa_yxp_item-kwmeng + p_sumqty . p_ntwt = wa_yxp_item-ntgew + p_ntwt. P_SUMAMT = SUMA + P_SUMAMT . select single * from mvke where matnr = mara-matnr. select single * from tvm1t where mvgr1 = mvke-mvgr1 and spras = 'EN'. concatenate 'Quantity ' wa_yxp_item-vrkme into hdr8tmp separated by ' '. concatenate 'Rate in' wa_yxp_item-waerk into hdr9tmp separated by ' '. concatenate 'Amount'wa_yxp_item-waerk into hdr10tmp separated by ' '. if mara-spart = '20'. "TT wa_hdrinv-hdr1 = 'HS Code Customer#s Ref'. wa_hdrinv-hdr2 = 'Description of Goods'. wa_hdrinv-hdr3 = 'Size'. wa_hdrinv-hdr4 = 'GSM'. wa_hdrinv-hdr5 = 'Type'. wa_hdrinv-hdr6 = 'Const'. wa_hdrinv-hdr7 = 'TC'. wa_hdrinv-hdr8 = hdr8tmp. wa_hdrinv-hdr9 = hdr9tmp. wa_hdrinv-hdr10 = hdr10tmp. wa_final1-desc_good = tvm1t-bezei. split wa_yxp_item-arktx at '/' into wa_final1-size faltu. split faltu at 'GSM' into faltu wa_final1-gsm . WA_FINAL1-TYP. WA_FINAL1-GSM.

* **

split wa_final1-gsm at '/' into wa_final1-gsm faltu. split wa_yxp_item-arktx at '/' into wa_final1-typ faltu. split faltu at '/' into wa_final1-typ faltu. split faltu at '/' into wa_final1-typ faltu. elseif mara-spart = 'BS' or mara-spart = 'DB'. "BS concatenate 'Quantity ' wa_yxp_item-vrkme into hdr8tmp separated by ' '. concatenate 'Rate in' wa_yxp_item-waerk into hdr9tmp separated by ' '. concatenate 'Amount'wa_yxp_item-waerk into hdr10tmp separated by ' '. wa_hdrinv-hdr1 = 'HS Code Customer#s Ref'. wa_hdrinv-hdr2 = 'Description of Goods'. wa_hdrinv-hdr3 = 'Flat'. wa_hdrinv-hdr4 = 'Fitted'. wa_hdrinv-hdr5 = 'Pillow'. wa_hdrinv-hdr6 = 'Const'. wa_hdrinv-hdr7 = 'TC'. wa_hdrinv-hdr8 = hdr8tmp. wa_hdrinv-hdr9 = hdr9tmp. wa_hdrinv-hdr10 = hdr10tmp. split tvm1t-bezei at '(' into wa_final1-desc_good faltu. split faltu at '+' into wa_final1-size faltu. split faltu at '+' into wa_final1-gsm faltu. split faltu at '+' into wa_final1-typ faltu. shift wa_final1-typ right deleting trailing ')'. SPLIT WA_YXP_ITEM-ARKTX AT 'TC' INTO WA_FINAL1-TC FALTU. SPLIT WA_FINAL1-TC AT '/' INTO WA_FINAL1-TC FALTU. wa_final1-tc = mara1-groes. SHIFT WA_FINAL1-TC LEFT DELETING LEADING '/'. WA_FINAL1-DESC_GOOD = TVM1T-BEZEI. endif . append wa_final1 to it_final1. APPEND WA_FINAL1 TO IT_FINAL1. ON CHANGE OF WA_FINAL1-SIZE OR WA_FINAL1-GSM OR WA_FINAL1-TYP OR WA_FINAL1-RATE . IF SY-TABIX NE 1.

* *

* ***

* ** ** ** ** **

** ** ** ** **

WA_FINAL1-DOC_NR = WA_YXP_ITEM-DOC_NR. APPEND WA_FINAL1 TO IT_FINAL1. CLEAR : SUMA,SUMQ. ENDIF. ENDON. endif.

p_commission = wa_yxp_invpre-commison. p_discount = wa_yxp_invpre-discount. * Calculate Commission and Less Amount ***** P_COMAMT = P_SUMAMT * COM / 100. ***** P_LESSAMT = P_SUMAMT * DIS / 100. * Calculate Exchange Rate Amount. p_kursfamt = wa_yxp_invpre-kursf * p_sumamt. *CALCULATE TOTAL FOB VALUE p_totfob = p_kursfamt. "+ WA_YXP_INVPRE-FREIGHT. * get cenvat payable select single tot_dr into p_cenvat from yxp_bonddtl where auto_id = wa_yxp_invpre-auto_id. select single bno bdat br from yxp_bonddtl into (bno,bdat,yxp_bonddtl-br) where auto_id = wa_yxp_invpre-auto_id. bstatus = yxp_bonddtl-br.

if yxp_bonddtl-br is initial. if wa_yxp_invpre-bond is initial. string3 = 'EXPORT UNDER REBATE'. else. string3 = 'EXPORT UNDER BOND'. endif. else. if yxp_bonddtl-br eq 'R'. string3 = 'EXPORT UNDER REBATE'. else. string3 = 'EXPORT UNDER BOND'. endif. endif. * WA_YXP_ITEM-WAERK. call function 'Y_XP_SPELL_AMOUNT' exporting currency = wa_yxp_item-waerk amount = p_sumamt importing in_words = amt_word

exceptions error = 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. * BREAK-POINT. on change of wa_yxp_item-doc_nr. select * from yxp_contdtl into w_yxp_contdtl where doc_nr = wa_yxp_item-doc_nr. append w_yxp_contdtl to i_yxp_contdtl . endselect. endon. clear : sumq,sumr,suma,ntwt. * APPEND WA_FINAL1 TO IT_FINAL1. * SELECT SINGLE * FROM YXP_CONTDTL * WHERE DOC_NR = WA_YXP_ITEM-DOC_NR. * * ON CHANGE OF YXP_CONTDTL-CONTNO. * CONCATENATE CONTNO YXP_CONTDTL-CONTNO INTO CONTNO * SEPARATED BY ','. * CONCATENATE SEALNO YXP_CONTDTL-SEALNO INTO SEALNO * SEPARATED BY ','. * ENDON. * SHIFT CONTNO LEFT DELETING LEADING ','. * SHIFT CONTNO RIGHT DELETING TRAILING ','. * SHIFT SEALNO LEFT DELETING LEADING ','. * SHIFT SEALNO RIGHT DELETING TRAILING ','. endloop.

*** clear it_item[]. sort it_yxp_contman_itm1 by cont. loop at it_yxp_contman_itm1 into wa_yxp_contman_itm1. wa_item-contno = wa_yxp_contman_itm1-contno. wa_item-cont_size = wa_yxp_contman_itm1-cont_size. wa_item-carton = wa_yxp_contman_itm1-carton. if carton is initial. carton = carton + wa_item-carton. endif. read table i_yxp_contdtl into w_yxp_contdtl with key doc_nr = wa_yxp_contman_itm1-delv. if sy-subrc = 0.

wa_item-cont_size = w_yxp_contdtl-cont_size. wa_item-contno = w_yxp_contdtl-contno. wa_item-sealno1 = w_yxp_contdtl-sealno. wa_item-esealno = w_yxp_contdtl-esealno. wa_item-buyerseal = w_yxp_contdtl-buyerseal. endif. append wa_item to it_item. endloop. clear : it_item2[],it_item1[]. it_item1[] = it_item[]. it_item2[] = it_item[]. clear it_item[]. sort it_item1 by contno sealno1. delete adjacent duplicates from it_item1 comparing contno sealno1. clear: carton ,wa_item2,wa_item,carton1,wa_item. loop at it_item1 into wa_item1 . wa_item-contno = wa_item1-contno. wa_item-cont_size = wa_item1-cont_size. wa_item-sealno1 = wa_item1-sealno1. wa_item-esealno = wa_item1-esealno. wa_item-buyerseal = wa_item1-buyerseal. if wa_item-contno is not initial. loop at it_item2 into wa_item2 where contno = wa_item-contno. carton1 = carton1 + wa_item2-carton. wa_item-carton = carton1. endloop. endif. if wa_item-contno is initial and wa_item-sealno1 is not initial. loop at it_item2 into wa_item2 where sealno1 = wa_item-sealno1. carton1 = carton1 + wa_item2-carton. wa_item-carton = carton1. endloop. endif. carton = carton + wa_item-carton . clear carton1. append wa_item to it_item. clear wa_item2. endloop. *******READ TABLE IT_FINAL1 INTO WA_FINAL1 WITH KEY ******* DOC_NR = WA_YXP_ITEM-DOC_NR. *******IF SY-SUBRC NE 0. ******* WA_FINAL1-DOC_NR = WA_YXP_ITEM-DOC_NR.

******* APPEND WA_FINAL1 TO IT_FINAL1. ******* CLEAR : SUMA,SUMQ. *******ELSE. ******* WA_FINAL1-DOC_NR = WA_YXP_ITEM-DOC_NR. ******* MODIFY IT_FINAL1 FROM WA_FINAL1 INDEX SY-TABIX TRANSPORTING *DOC_NR . *******ENDIF. sort it_final1 by size gsm typ rate. data : it_repair like it_final1 with header line . data : wa_repair like it_repair. *****CHANGED BY SACHIN *LOOP AT IT_FINAL1 INTO WA_FINAL1. * CLEAR WA_FINAL1-TYP. * MODIFY IT_FINAL1 FROM WA_FINAL1. * ENDLOOP.

loop at it_final1 into wa_final1. "SACHIN on change of wa_final1-size or wa_final1-gsm or wa_final1-typ or wa_final1-rate. if sy-tabix ne 1. wa_repair-qty = sumq. wa_repair-ntwt = ntwt. wa_repair-amt = suma. append wa_repair to it_repair. clear : sumq,suma,ntwt.. endif. endon. move-corresponding wa_final1 to wa_repair. APPEND WA_REPAIR TO IT_REPAIR. sumq = wa_final1-qty + sumq. ntwt = wa_final1-ntwt + ntwt. suma = wa_final1-amt + suma. at last. wa_repair-qty = sumq. wa_repair-ntwt = ntwt. wa_repair-amt = suma. append wa_repair to it_repair. clear : sumq,suma,ntwt. endat. endloop. * read table it_repair into wa_repair with key doc_nr = wa_final1-doc_nr. if sy-subrc ne 0. move-corresponding wa_final1 to wa_repair.

wa_repair-qty = sumq. wa_repair-ntwt = ntwt. wa_repair-amt = suma. append wa_repair to it_repair. clear : sumq,suma,ntwt. endif. clear it_final1[]. it_final1[] = it_repair[]. ****END OF CHANGES *IF LINES GT 1. *WA_FINAL1-QTY = SUMQ. *WA_FINAL1-RATE = SUMR. *WA_FINAL1-AMT = SUMA. * *P_SUMQTY = SUMQ + P_SUMQTY . *P_SUMAMT = SUMA + P_SUMAMT . **BREAK-POINT. *APPEND WA_FINAL1 TO IT_FINAL1. *ENDIF. call function 'Y_XP_SPELL_AMOUNT' exporting currency = wa_yxp_item-waerk amount = p_sumamt1 importing in_words = amt_word exceptions error = 1 others = 2. if sy-subrc <> 0. message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. endif. call function 'BAPI_CURRENCY_CONV_TO_EXTERNAL' exporting currency = wa_yxp_item-waerk amount_internal = p_sumamt importing amount_external = netwr. *BREAK-POINT. p_sumamt = netwr. p_kursfamt = wa_yxp_invpre-kursf * p_sumamt. call function 'BAPI_CURRENCY_CONV_TO_EXTERNAL' exporting currency = wa_yxp_item-waerk

amount_internal = p_kursfamt importing amount_external = netwr. p_kursfamt = netwr. p_totfob = p_kursfamt + wa_yxp_invpre-freight. call function 'BAPI_CURRENCY_CONV_TO_EXTERNAL' exporting currency = wa_yxp_item-waerk amount_internal = p_totfob importing amount_external = netwr. p_totfob = netwr. * becuz freight will be entered in INR. *P_TOTFOB = P_KURSFAMT + WA_YXP_INVPRE-FREIGHT. select single * from ylcesadr into iylcesadr where adrnr = it_ylcelcmst1-adrnr. describe table it_final1 lines lines. *BREAK-POINT. select * from yxp_exptd_lic into table it_yxp_exptd_lic where doc_nr = wa_yxp_invpre-auto_id and doc_clas = '0009'. data : date_inv(10). data : d(2),m(2),y(4). *BREAK-POINT. loop at it_yxp_exptd_lic into wa_yxp_exptd_lic2. clear : y,m,d. y = wa_yxp_exptd_lic2-licencedt+0(4). m = wa_yxp_exptd_lic2-licencedt+4(2). d = wa_yxp_exptd_lic2-licencedt+6(2). concatenate d m y into date_inv separated by '.'. * CONVERT DATE WA_YXP_EXPTD_LIC2-LICENCEDT * INTO INVERTED-DATE DATE_INV. if wa_yxp_exptd_lic2-licensetype = 'DEPB' or wa_yxp_exptd_lic2-licensetype = 'ADVP'. concatenate 'UNDER'' ' wa_yxp_exptd_lic2-licensetype ' ''SCHEME SR. NO.' wa_yxp_exptd_lic2-lic_sion ' ''OF TEXTILE PRODUCT' into string_n1. elseif wa_yxp_exptd_lic2-licensetype = 'DBK1'. string_n1 = 'UNDER DRAWBACK SCHEME AGAINST SR NO 630201.'.

wa_yxp_exptd_lic2-licensetype = 'DBK2'. string_n1 = 'UNDER DRAWBACK SCHEME AGAINST SR NO 630202.'. elseif wa_yxp_exptd_lic2-licensetype = 'DBK3'. string_n1 = 'UNDER DRAWBACK SCHEME AGAINST SR NO 630401.'. elseif wa_yxp_exptd_lic2-licensetype = 'DBK4'. string_n1 = 'UNDER DRAWBACK SCHEME AGAINST SR NO 630402.'. elseif wa_yxp_exptd_lic2-licensetype = 'DBK5'. string_n1 = 'UNDER DRAWBACK SCHEME AGAINST SR NO 5811.'. elseif wa_yxp_exptd_lic2-licensetype = 'DBK6' or wa_yxp_exptd_lic2-licensetype = 'DBK7' or wa_yxp_exptd_lic2-licensetype = 'DBK8' or wa_yxp_exptd_lic2-licensetype = 'DBK9' or wa_yxp_exptd_lic2-licensetype = 'DB10' or wa_yxp_exptd_lic2-licensetype = 'DB11' or wa_yxp_exptd_lic2-licensetype = 'DB12' or wa_yxp_exptd_lic2-licensetype = 'DB13'. string_n1 = 'UNDER DRAWBACK SCHEME AGAINST SR NO 560302.'. elseif wa_yxp_exptd_lic2-licensetype = 'DB14'. string_n1 = 'UNDER DRAWBACK SCHEME AGAINST SR NO 9404.'. elseif wa_yxp_exptd_lic2-licensetype = 'EPCG' or wa_yxp_exptd_lic2licensetype = 'EPC1' or wa_yxp_exptd_lic2-licensetype = 'epc2' or wa_yxp_exptd_lic2licensetype = 'EPC3' or wa_yxp_exptd_lic2-licensetype = 'EPC4' or wa_yxp_exptd_lic2licensetype = 'EPC5'. concatenate 'epcg licence no : 'wa_yxp_exptd_lic2licenceno ' date ' date_inv into string_n2. endif. endloop. loop at it_final1 into wa_final1. totamt = totamt + wa_final1-amt. if gdesc is initial. if wa_final1-desc_good is not initial. gdesc = 'x'. endif. endif. if const is initial. if wa_final1-const is not initial. const = 'x'. endif. endif. if tc is initial. if wa_final1-tc is not initial. tc = 'x'. endif. endif. endloop.

elseif

if const is initial. clear wa_hdrinv-hdr6. endif. if tc is initial. clear wa_hdrinv-hdr7. endif. if gdesc is initial. clear wa_hdrinv-hdr2 . endif. loop at it_item into wa_item. if exseal is initial. if wa_item-esealno is not initial. exseal = 'x'. endif. endif. if shseal is initial. if wa_item-sealno1 is not initial. shseal = 'x'. endif. endif. if cotno is initial. if wa_item-contno is not initial. cotno = 'x'. endif. endif. if contsiz is initial. if wa_item-cont_size is not initial. contsiz = 'x'. endif. endif. if exseal is not initial or shseal is not initial or cotno is not initial or contsiz is not initial. int = int + 1. endif. endloop. if exseal is not initial. lexseal = 'excise seal no'. endif. if shseal is not initial. lshseal = 'shiping seal no'. endif. if cotno is not initial. lcontno = 'container no'. endif. if contsiz is not initial. lcontsiz = 'con size'. endif. clear: const,tc,wa_final1,contsiz,cotno,shseal,exseal.

line1 = int. int2 = 20. int1 = int2 - int. int3 = int. clear int. do int1 times. int = int + 1. wa-int1 = int. append wa to it. enddo. *BREAK-POINT. loop at it_yxp_exptd_lic into wa_yxp_exptd_lic3. if wa_yxp_exptd_lic3-licensetype = 'depb' or wa_yxp_exptd_lic3-licensetype = 'dbk1' or wa_yxp_exptd_lic3-licensetype = 'dbk2' or wa_yxp_exptd_lic3-licensetype = 'dbk3' or wa_yxp_exptd_lic3-licensetype = 'dbk4' or wa_yxp_exptd_lic3-licensetype = 'dbk5' or wa_yxp_exptd_lic3-licensetype = 'dbk6' or wa_yxp_exptd_lic3-licensetype = 'dbk7' or wa_yxp_exptd_lic3-licensetype = 'dbk8' or wa_yxp_exptd_lic3-licensetype = 'dbk9' or wa_yxp_exptd_lic3-licensetype = 'db10' or wa_yxp_exptd_lic3-licensetype = 'db11' or wa_yxp_exptd_lic3-licensetype = 'db12' or wa_yxp_exptd_lic3-licensetype = 'db13' or wa_yxp_exptd_lic3-licensetype = 'db14'. p_licprod = wa_yxp_exptd_lic3-lic_product. endif. endloop. select single landx into flandx from t005t where land1 = wa_yxp_shphd-cntry_dest and spras = 'e'. loop at it_final1 into wa_final1. i = i + 1. endloop. line2 = i. i2 = 20. i1 = i2 - i. i3 = i. clear i. do i1 times. i = i + 1. wa1-i1 = i. append wa1 to it1. enddo.

clear it2[]. loop at it_final1 into wa_final1. i = i + 1. endloop. i = i - 20. i2 = 20. i1 = i2 - i. i3 = i. clear i. do i1 times. i = i + 1. wa2-i1 = i. append wa2 to it2. enddo.

endloop. data tname type THEAD-TDNAME. tname = IT_YLCELCMST1-LC_REFNR. call function 'READ_TEXT' exporting CLIENT = SY-MANDT id = '0007' language = sy-langu name = tname object = 'YLCE' * ARCHIVE_HANDLE = 0 * LOCAL_CAT = ' ' * IMPORTING * HEADER = tables lines = tdline 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.

endform. form img_dwnld. call function 'SAPSCRIPT_GET_GRAPHIC_BDS' exporting i_object = 'GRAPHICS' i_name = 'ZWEL' "'ZPRUEBA' i_id = 'BMAP' i_btype = 'BCOL' importing e_bytecount = l_bytecount tables content = l_content exceptions not_found = 1 bds_get_failed = 2 bds_no_content = 3 others = 4. call function 'SAPSCRIPT_CONVERT_BITMAP' exporting old_format = 'BDS' new_format = 'BMP' bitmap_file_bytecount_in = l_bytecount importing bitmap_file_bytecount = graphic_size tables bds_bitmap_file = l_content bitmap_file = graphic_table exceptions others = 1. call function 'WS_DOWNLOAD' exporting bin_filesize filename filetype mode tables data_tab exceptions invalid_filesize invalid_table_width invalid_type no_batch unknown_error gui_refuse_filetransfer

= = = =

graphic_size 'C:\Windows\Temp\logo.bmp' 'BIN' 'S'

= graphic_table = = = = = = 1 2 3 4 5 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. *&---------------------------------------------------------------------* *& Form export2xls *&---------------------------------------------------------------------* * text *&---------------------------------------------------------------------* *& Form fill_cell *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->I text * -->J text * -->BOLD text * -->VAL text * -->CEL_HALIGN text * -->CEL_VALIGN text * -->RCELL text *----------------------------------------------------------------------* "data line type i value 1. form fill_cell using i j bold val cel_halign cel_valign rcell. call method of h_excel 'CELLS' = h_cell no flush exporting #1 = i #2 = j. set property of h_cell 'VALUE' = val no flush. get property of h_cell 'FONT' = h_font no flush. set property of h_font 'SIZE' = 8 no flush. set property of h_font 'BOLD' = bold no flush. get property of h_cell 'INTERIOR' = h_color. set property of h_color 'COLORiNDEX' = rcell. set property of h_cell 'HORIZONTALaLIGNMENT' = cel_halign. set property of h_cell 'VERTICALaLIGNMENT' = cel_valign. endform. "fill_cell *&---------------------------------------------------------------------* *& Form border_cell *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->R text * -->C text * -->MARGIN text * -->LSTYLE text * -->WIDTH text *----------------------------------------------------------------------*

form border_cell using r c margin lstyle width. call method of h_excel 'CELLS' = h_cell exporting #1 = r #2 = c. call method of h_cell 'borders' = h_border exporting #1 = margin. "left set property of h_border 'LINESTYLE' = lstyle. set property of h_border 'weight' = width. free object h_border. "set property of h_cell 'ROWHEIGHT' = 11 no flush. endform. "border_cell *&---------------------------------------------------------------------* *& Form border_range *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->R1 text * -->C1 text * -->R2 text * -->C2 text *----------------------------------------------------------------------* form border_range using r1 c1 r2 c2. call method of h_excel 'CELLS' = h_cell1 exporting #1 = r1 #2 = c1. set property of h_cell1 'rowheight' = 10. call method of h_excel 'CELLS' = h_cell2 exporting #1 = r2 #2 = c2. set property of h_cell1 'rowheight' = 10. call method of h_excel 'RANGE' = h_cell exporting #1 = h_cell1 #2 = h_cell2. " set property of h_cell1 'rowheight' = 11. endform. "border_range *&---------------------------------------------------------------------* *& Form err_hdl *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* form err_hdl. if sy-subrc <> 0.

call method of h_excel 'quit'. free object h_excel. h_excel-handle = -1. message : 'FAILED TO EXPORT TO EXCEL.' type 'E'. stop. endif. endform. "err_hdl >>>>>>>>>>>>>INCLUDE MYEXCEL01 >>>>>>start>>>>>>>

>>>>>>>>>>>>>INCLUDE MYEXCEL_PRESHP_PACK >>>>>>start>>>>>>> *&---------------------------------------------------------------------* *& Include MYEXCEL_PRESHP_PACK *&---------------------------------------------------------------------*

form excel_preshp_pack. perform getdata_inv. data : h type sy-tabix. call function 'SAPGUI_PROGRESS_INDICATOR' exporting text = 'Processing...' exceptions others = 1. create object h_excel 'EXCEL.APPLICATION'. perform err_hdl. set property of h_excel 'DISPLAYALERTS' = 0. set property of h_excel 'VISIBLE' = 0. call method of h_excel 'WORKBOOKS' = h_wrkbookl. perform err_hdl. call method of h_wrkbookl 'ADD' = h_wrkbook. perform err_hdl. call method of h_excel 'ACTIVESHEET' = h_activesheet.

set property of h_activesheet 'NAME' = 'Pre-shipment Invoice'. get property of h_activesheet 'PAGESETUP' = h_pagesetup. set property of h_pagesetup 'TopMargin' = 4.

set property of h_pagesetup 'BOTTOMMARGIN' = 2. set property of h_pagesetup 'RIGHTMARGIN' = 4. set property of h_pagesetup 'LEFTMARGIN' = 4. set property of h_pagesetup 'FOOTERMARGIN' = 4. set property of h_pagesetup 'HEADERMARGIN' = 4. set property of h_pagesetup 'ORIENTATION' = 1. set property of h_pagesetup 'RIGHTFOOTER' = 'Page &P of &N'. set property of h_pagesetup 'PrintTitleRows' = '$1:$32'. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'a'. set property of h_column 'COLUMNWIDTH' = 10. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'b'. set property of h_column 'COLUMNwIDTH' = 11. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'c'. set property of h_column 'COLUMNWIDTH' = 7. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'd'. set property of h_column 'COLUMNWIDTH' = 6. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'e'. set property of h_column 'COLUMNWIDTH' = 13. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'f'. set property of h_column 'COLUMNWIDTH' = 10. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'g'. set property of h_column 'COLUMNWIDTH' = 9. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'h'. set property of h_column 'COLUMNWIDTH' = 9. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'i'. set property of h_column 'COLUMNWIDTH' = 8. free object h_column. call method of h_excel 'COLUMNS' = h_column exporting #1 = 'j'. set property of h_column 'COLUMNWIDTH' = 8. free object h_column. m = 1. loop at it_yxp_invpre into wa_yxp_invpre. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '3'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. call method of h_cell 'borders' = h_border

exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 '' xlleft xlcenter 0. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 1 'PACKING LIST' xlcenter xlcenter 0. perform border_range using m 7 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 7 0 '' xlright xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Range:' xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. call method of h_excel 'Worksheets' = h_activesheet exporting #1 = 1. call method of h_activesheet 'Activate'. get property of h_activesheet 'Shapes' = shapes. call method of shapes 'AddPicture' exporting #1 = 'C:\Windows\Temp\logo.bmp' "image file name on presentation server #2 = m #3 = '1' #4 = 170 "left #5 = 12 "top #6 = 80 "right #7 = 45. "bottom m = m + 1.

clear text3. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Division:' xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate exdat1+6(2) exdat1+4(2) exdat1(4) into text3 separated by '.'. concatenate 'Date & Time of Removal:' text3 into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Corp.Off.' xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 eadrc-name1 xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3.

perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate eadrc-name2 eadrc-name3 into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 eadrc-name4 xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'I.E.C.No:' ' ' text2 into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 3. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate eadrc-city1 eadrc-post_code1 into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 4 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting

#1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Exporter:' xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 it_adrc-name1 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate wa_yxp_invpre-audat+6(2) wa_yxp_invpreaudat+4(2) wa_yxp_invpre-audat(4) into text3 separated by '.'. concatenate 'Invoice No & Date :' wa_yxp_invpreauto_id ' Date :' text3 into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 it_adrc-street xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate wa_yxp_shphd-aredt+6(2) wa_yxp_shphdaredt+4(2) wa_yxp_shphd-aredt(4) into text3 separated by '.'. concatenate 'ARE No. & Date :' wa_yxp_shphdar4_number 'Date :' text3 into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2.

perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate it_adrc-str_suppl3 it_adrccity1 into text3 separated by ','. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Sales Order No :' sales into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate it_adrc-city2 it_adrcpost_code1 into text3 separated by ','. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Supporting Manufacturer:' xlleft xlcente r 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'.

call method of h_cell 'MERGE'. perform fill_cell using m 1 0 madrc-name1 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 madrc-street xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate madrc-str_suppl3 madrc-city2 into text3 separated by ','. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate madrc-city1 madrc-post_code1 into text3 separated by ','. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Buyer Oreder No.:' bstkd into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 6 m 10. call method of h_cell 'borders' = h_border exporting #1 = '3'. "top

set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 'Consignee:' xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 1 'Buyer(If other than Consignee)' xlleft x lcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 cadrc-name1 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 sadrc-name1 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. n = m + 1. perform border_range using m 1 n 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate cadrc-name2 cadrc-name3 cadrc-name4 into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. set property of h_cell 'wraptext' = 1. perform border_range using m 6 n 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate sadrc-name2 sadrc-name3 sadrc-name4 into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. set property of h_cell 'wraptext' = 1.

perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using n 1 '1' '1' 2. perform border_cell using n 10 '2' '1' 2. perform border_cell using n 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Notify1: ' nadrc1-name1 nadrc1-name2 nadrc1-name3 nadrc1name4 nadrc1-city1 nadrc1-city2 into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 6 m 10. call method of h_cell 'borders' = h_border exporting #1 = '3'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Notify1: ' nadrc2-name1 nadrc2-name2 nadrc2-name3 nadrc2name4 nadrc2-city1 nadrc2-city2 into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2.

perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 'Pre-carriage By :' xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 'Place of Reciept By Precarrier :' xlleft xlcenter 0. perform border_range using m 6 m 7. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 'Country of Origin of Goods: ' xlleft xlc enter 0. perform border_range using m 8 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 8 0 'Country of Final Destination: ' xlleft x lcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 6 m 10. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate wa_yxp_shphd-vehcl_from wa_yxp_shphd-vehcl_to into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'.

perform fill_cell using m 3 0 precarrier xlleft xlcenter 0. perform border_range using m 6 m 7. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 'India' xlleft xlcenter 0. perform border_range using m 8 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 8 0 flandx xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 'Vessel/Flight #:' xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 'Port of Loading:' xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Terms of Delivery and Payment : ' string1 arated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform perform perform perform perform m border_cell border_cell border_cell border_cell border_cell = m + 1. using using using using using m m m m m 1 '1' '1' 2. 2 '2' '1' 2. 7 '2' '1' 2. 10 '2' '1' 2. 5 '2' '1' 2.

into text3 sep

perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate vessel wa_yxp_shphd-voy_fly_no into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 wa_yxp_shphd-port_load xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'LC No : ' it_ylcelcmst1lc_number into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 'Port Of Discharge:' xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 'Final Destination:' xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Banker: ' wa_yxp_invpre-advbank into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2.

perform border_cell using m 2 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 0 wa_yxp_shphdport_dschr xlleft xlcenter 0. perform border_range using m 3 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 wa_yxp_shphdfin_destin xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 'Insurance Cover No & Date :' enter 0.

xlleft xlc

perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Name of commodity:' p_licprod into text3. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate 'Freight Terms : ' inco1 wa_yxp_shphd-shp_type into text3. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2.

perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. perform border_range using m 1 m 10. call method of h_cell 'SELECT'. set property of h_cell 'wraptext' = 1. set property of h_cell1 'rowheight' = 30 no flush. set property of h_cell2 'rowheight' = 30 no flush. call method of h_cell 'borders' = h_border exporting #1 = '4'. "bottom set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform fill_cell using m 1 0 wa_hdrinv-hdr1 xlcenter xltop 0. perform fill_cell using m 2 0 wa_hdrinv-hdr2 xlcenter xltop 0. perform fill_cell using m 3 0 wa_hdrinv-hdr3 xlcenter xltop 0. perform fill_cell using m 4 0 wa_hdrinv-hdr4 xlcenter xltop 0. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. set property of h_cell 'wraptext' = 1. set property of h_cell1 'rowheight' = 30 no flush. set property of h_cell2 'rowheight' = 30 no flush. perform fill_cell using m 5 0 wa_hdrinv-hdr5 xlcenter xltop 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. set property of h_cell 'wraptext' = 1. set property of h_cell1 'rowheight' = 30 no flush. set property of h_cell2 'rowheight' = 30 no flush. perform fill_cell using m 7 0 'Nt.Weight' xlcenter xltop 0. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. set property of h_cell 'wraptext' = 1. set property of h_cell1 'rowheight' = 30 no flush. set property of h_cell2 'rowheight' = 30 no flush. perform fill_cell using m 9 0 wa_hdrinv-hdr8 xlcenter xltop 0. *perform fill_cell using m 8 0 wa_hdrinv-hdr8 xlcenter xltop 0. *perform fill_cell using m 9 0 wa_hdrinv-hdr9 xlcenter xltop 0.

*perform fill_cell using m 10 0 wa_hdrinv-hdr10 xlcenter xltop 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 1 '2' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 3 '2' '1' 2. perform border_cell using m 4 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using m 6 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 8 '2' '1' 2. perform border_cell using m 9 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. data tab type i value 0. sel_1 = m + 1. loop at it_final1 into wa_final1. m = m + 1. tab = tab + 1. perform border_range using m 1 m 10. perform fill_cell using m 1 0 wa_final1-hs_code xlleft xlcenter 0. perform fill_cell using m 2 0 wa_final1-desc_good xlcenter xlcenter 0. perform fill_cell using m 3 0 wa_final1-size xlcenter xlcenter 0. perform fill_cell using m 4 0 wa_final1-gsm xlcenter xlcenter 0. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 wa_final1-typ xlcenter xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 7 0 wa_final1-ntwt xlcenter xlcenter 0. set property of h_cell 'numberformat' = '#0,000.000'. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 9 0 wa_final1-qty xlright xlcenter 0. set property of h_cell 'numberformat' = '#0,000'. *clear exrate. *exrate = wa_final1-rate. *perform fill_cell using m 9 0 exrate xlright xlcenter 0. * text3 = m. * text4 = m. * concatenate 'h' text3 into text3. * concatenate '(' text3 into text3. * concatenate 'i' text4 into text4. * concatenate text4 ')' into text4. * concatenate text3 text4 into text3 separated by ':'. * concatenate '=' text3 into text3 separated by 'product'. * *perform fill_cell using m 10 0 text3 xlright xlcenter 0. ""wa_final1-

amt from sap *set property of h_cell 'numberformat' = '#0,000.00'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 1 '2' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 3 '2' '1' 2. perform border_cell using m 4 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using m 6 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 8 '2' '1' 2. perform border_cell using m 9 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. endloop. sel_2 = sel_1 + tab - 1. "============================for blank lines=================== if tab le 25. tab = 25 - tab. do tab times. m = m + 1. perform border_range using m 1 m 10. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 1 '2' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 3 '2' '1' 2. perform border_cell using m 4 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using m 6 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 8 '2' '1' 2. perform border_cell using m 9 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. enddo. endif. "==========================end ================================ m = m + 1. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '3'. "top

set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text4 = p_grosswt. concatenate 'Gross Weight:' text4 into text3 separated by ' '. set property of h_cell 'numberformat' = '#00,000.000'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 'No&Kind of Pkgs.:' xlleft xlcenter 0. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 '' xlleft xlcenter 0. text3 = sel_1. text4 = sel_2. concatenate 'g' text3 into text3. concatenate '(' text3 into text3. concatenate 'g' text4 into text4. concatenate text4 ')' into text4. concatenate text3 text4 into text3 separated by ':'. concatenate '=' text3 into text3 separated by 'sum'. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 7 0 text3 xlleft xlcenter 0. set property of h_cell 'numberformat' = '#0,000'. data tot_qty type string. tot_qty = text3. " for quantity text3 = sel_1. text4 = sel_2. concatenate 'i' text3 into text3. concatenate '(' text3 into text3. concatenate 'i' text4 into text4. concatenate text4 ')' into text4. concatenate text3 text4 into text3 separated by ':'. concatenate '=' text3 into text3 separated by 'sum'.

perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 9 0 text3 xlleft xlcenter 0.

set property of h_cell 'numberformat' = '#00,000.00'. data tot_amt type string. tot_amt = text3. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 4 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_cell using m 7 '2' '1' 2. perform border_cell using m 8 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. m = m + 1. perform border_range using m 1 m 2. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text4 = p_ntgew. concatenate 'Net Weight:' text4 into text3 separated by ' '. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. set property of h_cell 'numberformat' = '#00,000.000'. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. if wa_yxp_invpre-pack_type eq ''. concatenate carton wa_yxp_invpre-pack_type into text3 separated by ' '. perform fill_cell using m 3 0 text3 xlleft xlcenter 0. else. concatenate wa_yxp_invpre-no_pack ' ' wa_yxp_invpre-pack_type into text3. perform fill_cell using m 3 0 text3 xlleft xlcenter 0. endif. perform border_range using m 5 m 6. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 5 0 'Total' xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 7 0 '' xlleft xlcenter 0. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 2 '2' '1' 2. perform border_cell using m 4 '2' '1' 2. perform border_cell using m 5 '2' '1' 2.

perform border_cell using m 7 '2' '1' 2. perform border_cell using m 8 '2' '1' 2. perform border_cell using m 10 '2' '1' 2. * m = m + 1. * perform border_range using m 1 m 7. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 1 0 'Total' xlleft xlcenter 0. * perform border_range using m 8 m 10. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * *perform fill_cell using m 8 0 tot_qty xlleft xlcenter 0. * set property of h_cell 'numberformat' = '#0,000'. *perform border_range using m 1 m 10. * call method of h_cell 'borders' = h_border * exporting * #1 = '4'. "top * set property of h_border 'LINESTYLE' = '1'. * set property of h_border 'weight' = 2. * free object h_border. * perform border_cell using m 1 '1' '1' 2. * perform border_cell using m 7 '2' '1' 2. * perform border_cell using m 10 '2' '1' 2. * m = m + 1. * perform border_range using m 1 m 2. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * * * *perform fill_cell using m 1 0 'Amount Chargeable (In words)' xlleft xlcenter 0. * perform border_range using m 3 m 10. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * text4 = m - 3. * * concatenate '=spellcurr(J' text4 ',"US DOLLAR","S","CENTS","S")' into t ext3. *perform fill_cell using m 3 0 text3 xlleft xlcenter 0. * perform border_cell using m 1 '1' '1' 2. * perform border_cell using m 10 '2' '1' 2. *perform border_range using m 1 m 10. * call method of h_cell 'borders' = h_border * exporting * #1 = '4'. "top * set property of h_border 'LINESTYLE' = '1'.

* set property of h_border 'weight' = 2. * free object h_border. *m = m + 1. *if vbrk-vkorg = 2800 or vbrk-vkorg = 2000 or vbrk-vkorg = 2500. * perform border_range using m 1 m 2. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 1 0 'Commission :' xlleft xlcenter 0. * perform border_range using m 3 m 4. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 3 0 com xlleft xlcenter 0. * else. * perform border_range using m 1 m 2. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 1 0 'Cenvat Payablen :' xlleft xlcenter 0. * perform border_range using m 3 m 4. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 3 0 p_cenvat xlleft xlcenter 0. *endif. *perform border_range using m 5 m 6. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 5 0 'Exchange Rate' xlleft xlcenter 0. *perform border_range using m 7 m 8. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * text3 = wa_yxp_invpre-kursf . * concatenate text3 'INR' into text3 separated by ' '. *perform fill_cell using m 7 0 text3 xlleft xlcenter 0. * perform border_cell using m 1 '1' '1' 2. * perform border_cell using m 10 '2' '1' 2. *m = m + 1. * perform border_range using m 1 m 2. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * perform border_range using m 3 m 4. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 5 m 6. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 5 0 '(-)Freight' xlleft xlcenter 0. *perform border_range using m 7 m 8. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 9 m 10.

* call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * perform fill_cell using m 9 0 p_freight xlright xlcenter 0. * set property of h_cell 'numberformat' = '#0,000.00'. * perform border_cell using m 1 '1' '1' 2. * perform border_cell using m 10 '2' '1' 2. * m = m + 1. * perform border_range using m 1 m 2. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * perform border_range using m 3 m 4. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 5 m 6. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 5 0 '(+)Commission' xlleft xlcenter 0. *perform border_range using m 7 m 8. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 9 m 10. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * perform fill_cell using m 9 0 p_insu xlright xlcenter 0. * perform border_cell using m 1 '1' '1' 2. * perform border_cell using m 10 '2' '1' 2. * m = m + 1. * perform border_range using m 1 m 2. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * perform border_range using m 3 m 4. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 5 m 6. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 5 0 '(-)Discount' xlleft xlcenter 0. *perform border_range using m 7 m 8. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 9 m 10. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * perform fill_cell using m 9 0 p_dis xlright xlcenter 0. * perform border_cell using m 1 '1' '1' 2. * perform border_cell using m 10 '2' '1' 2. * m = m + 1. * perform border_range using m 1 m 2. * call method of h_cell 'SELECT'.

* call method of h_cell 'MERGE'. * perform border_range using m 3 m 4. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 5 m 6. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 5 0 '(-)Other' xlleft xlcenter 0. *perform border_range using m 7 m 8. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 9 m 10. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * perform fill_cell using m 9 0 p_othr xlright xlcenter 0. * perform border_cell using m 1 '1' '1' 2. * perform border_cell using m 10 '2' '1' 2. * m = m + 1. * perform border_range using m 1 m 2. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * perform border_range using m 3 m 4. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 5 m 6. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 5 0 'Total Fob Value :' xlleft xlcenter 0. *perform border_range using m 7 m 8. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 9 m 10. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * text3 = m - 9. * * concatenate 'j' text3 into text4. * concatenate '(' text4 into text4. * text3 = m - 4. * concatenate '-i' text3 into text3. * concatenate text4 text3 into text4. * text3 = m - 3. * concatenate '+i' text3 into text3. * concatenate text4 text3 into text4. * text3 = m - 2. * concatenate '-i' text3 into text3. * concatenate text4 text3 into text4. * text3 = m - 1. * concatenate '-i' text3 into text3.

* concatenate text4 text3 into text4. * concatenate text4 ')' into text4. * " concatenate text3 text4 into text3 separated by ':'. * concatenate '=' text4 into text4 separated by 'sum'. * * perform fill_cell using m 9 0 text4 xlright xlcenter 0. ""p_totfob * perform border_cell using m 1 '1' '1' 2. * perform border_cell using m 10 '2' '1' 2. * m = m + 1. * perform border_range using m 1 m 2. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * perform border_range using m 3 m 4. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 5 m 6. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform fill_cell using m 5 0 'Total FOB Value(INR):' xlleft xlcenter 0. *perform border_range using m 7 m 8. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. *perform border_range using m 9 m 10. * call method of h_cell 'SELECT'. * call method of h_cell 'MERGE'. * text3 = m - 1. * concatenate 'i' text3 into text3. * text4 = wa_yxp_invpre-kursf.. * concatenate '=product(' text3 '*' text4 ')' into text3. * perform fill_cell using m 9 0 text3 xlright xlcenter 0.""p_totfob1 * set property of h_cell 'numberformat' = '#0,00,000.00'. * perform border_cell using m 1 '1' '1' 2. * perform border_cell using m 10 '2' '1' 2. *perform border_range using m 1 m 10. * call method of h_cell 'borders' = h_border * exporting * #1 = '4'. "top * set property of h_border 'LINESTYLE' = '1'. * set property of h_border 'weight' = 2. * free object h_border. m = m + 1. perform border_range using m 1 m 1. call method of h_cell 'SELECT'. perform fill_cell using m 1 0 'Marks & No. :' xlleft xlcenter 0. perform fill_cell using m 2 0 'Sr.No' xlleft xlcenter 0. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 lcontno xlleft xlcenter 0.

perform fill_cell using m 5 0 lcontsiz xlleft xlcenter 0. concatenate 'No of' wa_yxp_invpre-pack_type into text3 separated by ' '. perform fill_cell using m 6 0 text3 xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 7 0 lshseal xlleft xlcenter 0. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 9 0 lexseal xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. n = m. loop at tdline. n = n + 1. perform border_range using n 1 n 1. call method of h_cell 'SELECT'. perform fill_cell using n 1 0 tdline-tdline xlleft xlcenter 0. perform border_cell using n 1 '1' '1' 2. perform border_cell using n 10 '2' '1' 2. endloop. srno2 = 0. loop at it_item into wa_item. m = m + 1. srno2 = srno2 + 1. perform border_range using m 1 m 1. call method of h_cell 'SELECT'. " perform fill_cell using m 1 0 '' xlleft xlcenter 0. perform fill_cell using m 2 0 srno2 xlleft xlcenter 0. perform border_range using m 3 m 4. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 3 0 wa_item-contno xlleft xlcenter 0. perform fill_cell using m 5 0 wa_item-cont_size xlleft xlcenter 0. perform fill_cell using m 6 0 wa_item-carton xlleft xlcenter 0. perform border_range using m 7 m 8. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 7 0 wa_item-sealno1 xlleft xlcenter 0. perform border_range using m 9 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 9 0 wa_item-esealno xlleft xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. endloop. if srno2 le 10.

srno2 = 10 - srno2. do srno2 times. m = m + 1. perform border_range using m 1 m 10. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. enddo. clear srno2. endif. m = m + 1. perform border_range using m 1 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. text3 = 'We Welspun India Limited, Anjar are hereby declared that we are exporting goods under duty Drawback Scheme and further declared that we have not availed Cenvat '. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. m = m + 1. perform border_range using m 1 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. text3 = 'credit Rule 2004 on the manufacturing of the said goods'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 string_n2 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 'For WELSPUN GLOBAL BRANDS LTD.' xlright xlcenter 0. perform border_cell using m 1 '1' '1' 2.

perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 string3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. concatenate bdat+6(2) bdat+4(2) bdat(4) into '.'. concatenate bno text3 into text3 separated by ' '. perform fill_cell using m 1 1 text3 xlleft xlcenter 0.

text3 separated by

perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 1 1 string_n1 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3.

perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = 'I/We,hereby,declare that I/We shall claim the benefits,as admi ssible,'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = 'under chapter 3 of FTP'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = 'We hereby certify that merchandise is of Indian origin .'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = 'Declaration: We Declare that this invoice show the actual pric e of the'.

perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. m = m + 1. clear text3. perform border_range using m 1 m 5. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. text3 = 'goods described and all particulars are True and correct.'. perform fill_cell using m 1 0 text3 xlleft xlcenter 0. perform border_range using m 6 m 10. call method of h_cell 'SELECT'. call method of h_cell 'MERGE'. perform fill_cell using m 6 0 'Authorised Signatory' xlright xlcenter 0. perform border_cell using m 1 '1' '1' 2. perform border_cell using m 10 '2' '1' 2. perform border_cell using m 5 '2' '1' 2. perform border_range using m 1 m 10. call method of h_cell 'borders' = h_border exporting #1 = '4'. "top set property of h_border 'LINESTYLE' = '1'. set property of h_border 'weight' = 2. free object h_border. "===========================================SAVE EXCEL FILE================== ===== endloop. call method of h_wrkbook 'SAVEAS' exporting #1 = fullpath. call method of h_wrkbook 'CLOSE'. call method of h_excel 'QUIT'. free object h_wrkbook. free object h_excel. message : 'Downloading completed.' type 'S'. endform. >>>>>>>>>>>>>INCLUDE MYEXCEL_PRESHP_PACK>>>>>>start>>>>>>>

You might also like