1099 Issues in ECC6 -Urgen)

This is a new ECC6 implementation and first time 1099 reporting from SAP
We are facing two issues with 1099-MISC reporting. I guess these are not unique problems and you might have faced in other projects as well.
1. We have multiple vendor records/numbers for a vendor with same name and tax id but with different addresses. Invoices have also been paid to these different vendor ids. When generating a 1099 report how can we club these Vendor IDs based on Tax ID so that report is generated for only one vendor id. Please note that we are not using an alternative payee feature in this project.
2. This is quite absurd but when we are taking a printout of the 1099-MISC SAPSCRIPT form for 2008 (which was uploaded from SAP Note 1279366), Box no.11 and 12 are not coming proper. These boxes are greyed out or disabled in actual sample IRS copies but in the printout they are almost blank with few small dots here and there as if some text was printed in it and some one tried to erase it. I think IRS may reject these forms. Please revert if anyone else also faced same issue? If yes, what is the solution?

Hi,
the Form which SAP supplied is not good and it is not properly scanned. Hence, we had a same kind of issue and we have scanned the bitmap form and corrected the form using our ABAP team.
hope this will help
Vara

Similar Messages

  • 1099-MISC issue in ECC6

    This is a new ECC6 implementation and first time 1099 reporting from SAP
    We are facing two issues with 1099-MISC reporting. I guess these are not unique problems and you might have faced in other projects as well.
    1. We have multiple vendor records/numbers for a vendor with same name and tax id but with different addresses. Invoices have also been paid to these different vendor ids. When generating a 1099 report how can we club these Vendor IDs based on Tax ID so that report is generated for only one vendor id. Please note that we are not using an alternative payee feature in this project.
    2. This is quite absurd but when we are taking a printout of the 1099-MISC SAPSCRIPT form for 2008 (which was uploaded from SAP Note 1279366), Box no.11 and 12 are not coming proper. These boxes are greyed out or disabled in actual sample IRS copies but in the printout they are almost blank with few small dots here and there as if some text was printed in it and some one tried to erase it. I think IRS may reject these forms. Please revert if anyone else also faced same issue? If yes, what is the solution?

    Hi Chandru,
    I am still not convinced with your need. You may want to ask your client to check with their tax department. Though I worked on this config few years back but I clearly remember that client need was to club payments of multiple vendor IDs into one vendor ID for 1099 reporting purpose.
    However, I am providing configuration path for 1099 Misc report where Fiscal Adress relating settings are to be made. Same place you can make your own settings. Let me know if it helped.
    I am copying text from my word doc as I could not attach it. My original docs has screen shots too,
    1099 Report Configs:
    Field fiscal address in Vendor Master can be used in report configuration. The field that needs to be checked is Group Items according to fiscal address. The path is SAP Customizing Implementation Guide > Financial Accounting (New) > Financial Accounting Global Settings (New) > Withholding Tax >  Withholding Tax > Generic Withholding Tax Reporting > Define Output Groups
    In there go to the settings for US_1099 US1. This is available when you double click that line.
    Configs for Reporting
    Proposed Changes in Report Configuration:
    Group Items according to Fiscal Address Ticker Clubs all the items into one vendor
    For Type Adobe- Gives us flexibility to create our own forms in Abobe Forms format. This needs help of ABAP team
    DME File- This option allows us to save file in the Unix Directory. By This option we can also run the 1099 report job in the background
    Fiscal address can be defined in vendor master under Control where you can attach a central vendor to all other related Vendors
    Related Vendors-
    Vendors in which actual transactions are carried out. Maintain Central Vendor Number in the Fiscal Address Field.
    Central Vendor – This Vendor may or may not be extended to Company Codes. Will propose for better control purpose to not to extend to company code and create a new vendor group. As we only need address and Tax ID. (This is maintained in Fiscal Address)

  • PDF Attachment Email Opening issue in ECC6

    Hello,
    We are having problem with below report. I'm able to send emails(invoice) as PDF attachments , but the attached PDF file wont open. I'm getting a message "Adobe reader could not open attachement the file has been damaged".This report works in our old version 4.6c but we just upgrade to ecc6. Please Please help.
    Thanks,
    Jose
    REPORT zrfi_customer_statement_new
    NO STANDARD PAGE HEADING
    MESSAGE-ID zm_load
    LINE-SIZE 325
    LINE-COUNT 65(3).
    Tables *
    TABLES:
    bsid, bsad, knb1, kna1, knkk, t001, t014, t179t,
    t052, fplt, vbap, veda, vbrk, vbpa, vbkd, knvk,
    cepct, tvzbt, vbak, bsik, tsp01, usr21,adr6, tsp03l.
    Internal tables *
    DATA: i_bsid LIKE bsid OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF i_bukrs OCCURS 0,
    bukrs LIKE bsid-bukrs,
    waers LIKE bsid-waers,
    END OF i_bukrs.
    DATA:
    BEGIN OF i_temp_data OCCURS 0,
    bukrs LIKE bsid-bukrs, " Company code
    kunnr LIKE bsid-kunnr, " Customer
    belnr LIKE bsid-belnr, " Invoice
    gjahr LIKE bsid-gjahr, " Fiscal year
    waers LIKE bsid-waers, " Currency
    rebzg LIKE bsid-rebzg,
    bldat LIKE bsid-bldat, " Posting date
    shkzg LIKE bsid-shkzg, " Debit/Credit
    zfbdt LIKE bsid-zfbdt, " Baseline date
    zterm LIKE bsid-zterm, " Terms of payment key
    dmbtr LIKE bsid-dmbtr, " company currency
    dmbe2 LIKE bsid-dmbe2, " Amount in Group Currency
    days LIKE rfposxext-verzn, " No of Arrear Days
    kidno LIKE bsid-kidno, " Payment reference number
    kunnr_c LIKE vbak-kunnr, " Partner Number
    name_c(50), " Partner Last name
    matnr LIKE vbap-matnr, " Material no
    arktx LIKE vbap-arktx, " material description
    vbeln LIKE vbap-vbeln, " Contract/Order no
    inv_date LIKE vbrk-fkdat,
    xblnr LIKE bsid-xblnr,
    xblnr LIKE bsid-zuonr,
    vtext LIKE vbap-arktx, "material description
    sgtxt LIKE bsid-sgtxt,
    plant LIKE t001w-name1,
    zzihrez_e LIKE vbap-zzihrez_e,
    vvtext LIKE tvzbt-vtext,
    blart LIKE bsid-blart,
    zuonr LIKE bsid-zuonr,
    END OF i_temp_data.
    DATA:
    BEGIN OF itab OCCURS 0,
    kunnr LIKE bsid-kunnr, " Customer
    bukrs LIKE bsid-bukrs, " Company code
    kunnr_c LIKE vbak-kunnr, " Partner Number
    name_c(50), " Partner Last name
    matnr LIKE vbap-matnr, " Material no
    kidno LIKE bseg-kidno, " Payment reference
    name1 LIKE kna1-name1, " Customer name
    belnr LIKE bsid-belnr, " Invoice
    waers LIKE bsid-waers, " Currency ( Document )
    gjahr LIKE bsid-gjahr, " Fiscal year
    zfbdt LIKE bsid-zfbdt, " Baseline date
    zterm LIKE bsid-zterm, " Terms of payment key
    amt00_30 TYPE netwr_ak, " 000 - 030 Days
    amt31_60 TYPE netwr_ak, " 031 - 060 Days
    amt61_90 TYPE netwr_ak, " 061 - 090 Days
    amt91_120 TYPE netwr_ak, " 090 - 120 Days
    amt120pls TYPE netwr_ak, " 120+ Days
    total TYPE netwr_ak, " Row Total
    inv_date LIKE vbrk-fkdat,
    rebzg LIKE bsid-rebzg,
    xblnr LIKE bsid-xblnr,
    xblnr LIKE bsid-zuonr,
    sgtxt LIKE bsid-sgtxt,
    days(5) , " No of Arrear Days
    inv_chk LIKE bsid-xblnr, " invoice/check/wire transfer no
    vtext LIKE t179t-vtext,
    zzihrez_e LIKE vbap-zzihrez_e,
    plant LIKE t001w-name1,
    vvtext LIKE tvzbt-vtext,
    bldat LIKE bsid-bldat,
    blart LIKE bsid-blart,
    zuonr LIKE bsid-zuonr,
    END OF itab.
    DATA: BEGIN OF i_final OCCURS 0,
    inv_chk LIKE bsid-xblnr, " invoice/check/wire transfer no
    bldat LIKE bsid-bldat,
    xblnr LIKE bsid-xblnr,
    inv_date LIKE vbrk-fkdat,
    name_c(50), " Partner Last name
    vtext LIKE t179t-vtext,
    zzihrez_e LIKE vbap-zzihrez_e,
    plant LIKE t001w-name1,
    vvtext LIKE tvzbt-vtext,
    total TYPE netwr_ak, " Row Total
    days(5) , " No of Arrear Days
    waers LIKE bsid-waers,
    blart LIKE bsid-blart,
    zuonr LIKE bsid-zuonr,
    END OF i_final.
    DATA: BEGIN OF i_last OCCURS 0,
    kunnr LIKE vbak-kunnr,
    inv_chk LIKE bsid-xblnr, " invoice/check/wire transfer no
    bldat LIKE bsid-bldat,
    xblnr LIKE bsid-xblnr,
    inv_date LIKE vbrk-fkdat,
    name_c(50), " Partner Last name
    vtext LIKE t179t-vtext,
    zzihrez_e LIKE vbap-zzihrez_e,
    plant LIKE t001w-name1,
    vvtext LIKE tvzbt-vtext,
    total TYPE netwr_ak, " Row Total
    days(5) , " No of Arrear Days
    waers LIKE bsid-waers,
    blart LIKE bsid-blart,
    zuonr LIKE bsid-zuonr,
    END OF i_last.
    DATA: i_bsik LIKE bsik OCCURS 0 WITH HEADER LINE.
    DATA: itab_temp LIKE itab OCCURS 100 WITH HEADER LINE.
    DATA:
    BEGIN OF itab_details OCCURS 0,
    bukrs LIKE bsid-bukrs, " Company code
    xblnr LIKE bsid-xblnr,
    gjahr LIKE bsid-gjahr,
    belnr LIKE bsid-belnr,
    kunnr LIKE bsid-kunnr,
    END OF itab_details.
    DATA: BEGIN OF x_kna1 OCCURS 0,
    kunnr LIKE kna1-kunnr,
    name1 LIKE kna1-name1,
    name2 LIKE kna1-name2,
    ptext LIKE tpfkt-vtext,
    street LIKE adrc-street,
    ort01 LIKE kna1-ort01,
    regio LIKE kna1-regio,
    pstlz LIKE kna1-pstlz,
    landx LIKE t005t-landx,
    agdate LIKE sy-datum, " aging date
    END OF x_kna1.
    DATA: BEGIN OF i_total OCCURS 0,
    waers LIKE bsid-waers,
    00_30 TYPE netwr_ak,
    31_60 TYPE netwr_ak,
    61_90 TYPE netwr_ak,
    91_120 TYPE netwr_ak,
    120pls TYPE netwr_ak,
    total TYPE netwr_ak,
    END OF i_total.
    DATA: i_ssfcrescl TYPE ssfcrescl.
    DATA: i_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE.
    DATA: i_ssfctrlop LIKE ssfctrlop OCCURS 0 WITH HEADER LINE.
    DATA: v_itcpo LIKE itcpo.
    DATA: BEGIN OF itab_vender OCCURS 0,
    vender LIKE kna1-kunnr,
    END OF itab_vender.
    DATA: BEGIN OF ioutput OCCURS 0,
    kunnr LIKE vbrk-kunrg,
    kname(50),
    email(50),
    error(1),
    END OF ioutput.
    DATA: vv_text(90).
    Structures *
    DATA: x_item LIKE rfposxext.
    DATA: x_t001 LIKE t001.
    DATA: x_bsegp LIKE bsegp.
    Variables *
    DATA: v_count TYPE i.
    DATA: v_dialog TYPE c VALUE 'X'.
    DATA: v_name1 LIKE kna1-name1,
    v_name2 LIKE kna1-name2,
    v_print LIKE tsp03l-padest,
    v_formname(20),
    v_flag.
    DATA: f_recap_report(1) TYPE c. " Flag for recap report
    DATA:
    BEGIN OF x_amt,
    amt00_ls LIKE bsid-wrbtr,
    00_30 LIKE bsid-wrbtr,
    31_60 LIKE bsid-wrbtr,
    61_90 LIKE bsid-wrbtr,
    91_120 LIKE bsid-wrbtr,
    120pls LIKE bsid-wrbtr,
    END OF x_amt.
    DATA: BEGIN OF itab_bill OCCURS 0,
    vbeln LIKE vbfa-vbeln,
    fplnr LIKE vbfa-fplnr,
    fpltr LIKE vbfa-fpltr,
    END OF itab_bill.
    DATA: v_sdate LIKE vbrk-fkdat,
    v_edate LIKE vbrk-fkdat,
    v_order(10) TYPE n.
    DATA: v_eddate(10), v_stdate(10).
    DATA: v_num TYPE i,
    v_stat,
    v_bill_prd(24),
    v_counter TYPE c.
    DATA: v_matnr LIKE vbrp-matnr,
    v_arktx LIKE vbrp-arktx,
    v_vbeln LIKE vbrp-vbeln,
    v_vvtext LIKE t176t-vtext,
    v_posnr LIKE vbap-posnr,
    v_kunnr_c LIKE vbak-kunnr,
    v_name_c(50),
    v_inv_date LIKE vbrk-fkdat,
    v_vdatu LIKE vbak-vdatu,
    v_auart LIKE vbak-auart,
    v_prctr LIKE vbap-prctr,
    v_zzihrez LIKE vbap-zzihrez_e,
    v_plant LIKE t001w-name1,
    p_form TYPE tdsfname,
    fm_name TYPE rs38l_fnam.
    DATA: i_ssfcompop TYPE ssfcompop OCCURS 0." WITH HEADER LINE.
    DATA: addr_no LIKE kna1-adrnr,
    last_name LIKE kna1-name1,
    first_name LIKE kna1-name1,
    pafkt LIKE knvk-pafkt,
    lang LIKE knvk-parla,
    v_land LIKE adrc-country,
    v_lines TYPE i.
    DATA: v_tabix LIKE sy-tabix, v_gjahr LIKE bsid-gjahr,
    v_kunnr LIKE vbak-kunnr, v_prodh LIKE vbap-prodh,
    v_vtext LIKE t179t-vtext.
    DATA: spno LIKE tsp01-rqident,
    mi_bytecount TYPE i,
    mstr_print_parms LIKE pri_params,
    downfile(128) VALUE 'c:\customer.pdf',
    mtab_pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA: packing_list TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
    contents_txt TYPE TABLE OF solisti1 WITH HEADER LINE,
    v_email LIKE adr6-smtp_addr,
    v_returncode,
    contents_hex TYPE TABLE OF solix," WITH HEADER LINE,
    w_contents_hex TYPE solix ,
    receivers TYPE TABLE OF somlreci1 WITH HEADER LINE.
    DATA: att_pos TYPE i.
    DATA: document_data LIKE sodocchgi1.
    DATA: esubject LIKE sood1-objdes. "subject line
    DATA: emsgs TYPE TABLE OF solisti1 WITH HEADER LINE.
    DATA: pdf TYPE TABLE OF tline WITH HEADER LINE.
    DATA: BEGIN OF itext OCCURS 200,
    text(132),
    END OF itext.
    DATA: i_fields LIKE sval OCCURS 0 WITH HEADER LINE.
    DATA: v_ccemail LIKE adr6-smtp_addr,
    v_check,
    v_kname(50).
    DATA: otf_data1 LIKE itcoo OCCURS 0 WITH HEADER LINE,
    i_itcpp LIKE itcpp.
    *FIELD-GROUPS: HEADER, ...
    FIELD-GROUPS: header,
    details.
    Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK a10 WITH FRAME TITLE text-sa1.
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-sa1.
    PARAMETERS : p_ex_ic AS CHECKBOX DEFAULT 'X'. "R3DK906903
    SELECTION-SCREEN END OF BLOCK a1.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-s01.
    SELECT-OPTIONS : s_kunnr FOR bsid-kunnr,
    s_bukrs FOR t001-bukrs OBLIGATORY.
    PARAMETERS : p_bdate LIKE sy-datum OBLIGATORY.
    PARAMETERS: p_vender AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-s11.
    PARAMETERS : r_group RADIOBUTTON GROUP r1,
    r_comp RADIOBUTTON GROUP r1.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-s13.
    PARAMETERS: p_print LIKE tsp03l-lname MATCHCODE OBJECT prin
    OBLIGATORY DEFAULT 'locl'.
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-s14.
    PARAMETERS: v_immed AS CHECKBOX DEFAULT 'X',
    v_dele AS CHECKBOX DEFAULT 'X',
    ch_email AS CHECKBOX.
    *PARAMETERS:ch_down AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK b4.
    SELECTION-SCREEN END OF BLOCK a10.
    AT SELECTION-SCREEN.
    Selection Screen Validation.
    PERFORM validate_selection_screen.
    INITIALIZATION.
    INITIALIZATION.
    IF sy-sysid NE 'R3P'.
    v_email = .
    ENDIF.
    START-OF-SELECTION.
    START-OF-SELECTION.
    IF p_vender = 'X'.
    Fetch data from BSIK .
    PERFORM fetch_data_vender.
    Get Arrear Days
    PERFORM get_arrear_days_vender.
    ENDIF.
    Fetch data from BSID and BSAD.
    PERFORM fetch_data_from_bsid.
    Get Arrear Days
    PERFORM get_arrear_days.
    Format Data as per selection.
    PERFORM format_final_data.
    Print sapscript
    SORT i_last BY kunnr days DESCENDING.
    LOOP AT i_last.
    AT NEW kunnr.
    CLEAR: i_final, x_kna1.
    REFRESH: i_final, x_kna1.
    PERFORM get_address.
    PERFORM get_total.
    ENDAT.
    MOVE-CORRESPONDING i_last TO i_final.
    i_final-xblnr = i_final-zuonr.
    APPEND i_final.
    CLEAR i_final.
    AT END OF kunnr.
    SORT i_final BY days DESCENDING inv_chk total DESCENDING.
    PERFORM smart_from.
    ENDAT.
    ENDLOOP.
    END-OF-SELECTION.
    END-OF-SELECTION.
    *& Form FETCH_DATA_FROM_BSID
    text
    FORM fetch_data_from_bsid.
    fetch data from BSID into Internal table I_BSID.
    SELECT *
    FROM bsid
    INTO TABLE i_bsid
    WHERE bukrs IN s_bukrs AND
    kunnr IN s_kunnr AND
    budat LE p_bdate ."AND
    BELNR in ('0090000231','1400000131').
    Fetch data from BSAD into Internal table I_BSID.
    SELECT *
    FROM bsad
    APPENDING TABLE i_bsid
    WHERE bukrs IN s_bukrs AND
    kunnr IN s_kunnr AND
    budat LE p_bdate AND
    augdt GT p_bdate." AND
    DELETE i_bsid WHERE ( bukrs = '1500' OR bukrs = '3000' OR
    bukrs = '1400' ) AND
    ( umsks = 'E' OR umskz = 'E' ).
    *Exclude intercompany customers
    IF p_ex_ic = 'X'.
    DELETE i_bsid WHERE kunnr+0(2) EQ 'IC'.
    ENDIF.
    CLEAR sy-tfill.
    DESCRIBE TABLE i_bsid LINES sy-tfill.
    IF sy-tfill = 0.
    MESSAGE i999 WITH ' No data selected for the selection Condition'.
    STOP.
    ENDIF.
    ENDFORM. " FETCH_DATA_FROM_BSID
    *& Form Get_Arrear_Days
    text
    FORM get_arrear_days.
    SORT i_bsid BY bukrs belnr.
    LOOP AT i_bsid.
    for company code 1500 and 3000
    IF i_bsid-bukrs EQ '1500' OR i_bsid-bukrs EQ '3000'.
    MOVE i_bsid-xblnr TO i_bsid-belnr.
    ENDIF.
    MOVE i_bsid-bukrs TO itab_details-bukrs.
    MOVE i_bsid-xblnr TO itab_details-xblnr.
    MOVE i_bsid-belnr TO itab_details-belnr.
    MOVE i_bsid-gjahr TO itab_details-gjahr.
    MOVE i_bsid-kunnr TO itab_details-kunnr.
    APPEND itab_details.
    CLEAR itab_details.
    CLEAR x_item.
    AT NEW bukrs.
    READ TABLE i_bsid INDEX sy-tabix.
    CLEAR x_t001.
    SELECT SINGLE * FROM t001
    INTO x_t001
    WHERE bukrs = i_bsid-bukrs.
    ENDAT.
    for company code 1500 and 3000 .
    IF i_bsid-bukrs EQ '1500' OR i_bsid-bukrs EQ '3000'.
    MOVE i_bsid-xblnr TO i_bsid-belnr.
    ENDIF.
    MOVE-CORRESPONDING i_bsid TO x_item.
    x_item-koart = 'D'. " Debitor - Customer Indicator
    x_item-konto = bsid-kunnr. " Debitor - Customer Number
    x_item-dmshb = bsid-dmbtr.
    x_item-wrshb = bsid-wrbtr.
    Function module to get ARREAR days.
    CALL FUNCTION 'ITEM_DERIVE_FIELDS'
    EXPORTING
    s_t001 = x_t001
    s_bsegp = x_bsegp
    key_date = p_bdate
    CHANGING
    s_item = x_item
    EXCEPTIONS
    bad_input = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    Populate I_TEMP_DATA for further processing.
    i_temp_data-bukrs = i_bsid-bukrs.
    i_temp_data-kunnr = i_bsid-kunnr.
    i_temp_data-belnr = i_bsid-belnr.
    i_temp_data-bldat = i_bsid-bldat.
    i_temp_data-shkzg = i_bsid-shkzg.
    i_temp_data-zfbdt = i_bsid-zfbdt.
    i_temp_data-zterm = i_bsid-zterm.
    i_temp_data-vbeln = i_bsid-vbeln.
    i_temp_data-waers = i_bsid-waers.
    IF x_item-verzn < 0.
    x_item-verzn = 0.
    ENDIF.
    i_temp_data-zuonr = i_bsid-zuonr.
    i_temp_data-days = x_item-verzn.
    i_temp_data-gjahr = i_bsid-gjahr.
    i_temp_data-kidno = i_bsid-kidno.
    i_temp_data-rebzg = i_bsid-rebzg.
    i_temp_data-xblnr = i_bsid-xblnr.
    i_temp_data-sgtxt = i_bsid-sgtxt.
    Changing the Sign
    IF i_bsid-shkzg = 'H'.
    i_temp_data-dmbe2 = i_temp_data-dmbe2 + ( -1 * i_bsid-dmbe2 ).
    i_temp_data-dmbtr = i_temp_data-dmbtr + ( -1 * i_bsid-dmbtr ).
    ELSE.
    i_temp_data-dmbe2 = i_temp_data-dmbe2 + i_bsid-dmbe2.
    i_temp_data-dmbtr = i_temp_data-dmbtr + i_bsid-dmbtr.
    ENDIF.
    i_temp_data-blart = i_bsid-blart.
    *for doc type DR
    IF i_bsid-blart = 'DR' AND i_bsid-bschl = '01'.
    IF i_bsid-sgtxt IS INITIAL.
    *Changed our phone number to
    MOVE 'Contact Flightsafety' TO i_temp_data-vtext.
    ELSE.
    MOVE i_bsid-sgtxt TO i_temp_data-vtext.
    MOVE 'Financial Invoice' TO i_temp_data-vvtext.
    ENDIF.
    ENDIF.
    *for doc type AB
    IF i_bsid-blart = 'AB' AND
    ( i_bsid-bschl GE '01' AND i_bsid-bschl LE '19' ).
    i_temp_data-bldat = i_bsid-zfbdt.
    i_temp_data-xblnr = i_bsid-vbeln.
    IF NOT i_bsid-sgtxt IS INITIAL.
    *Changed our phone nuber to
    MOVE 'Contact Flightsafety' TO i_temp_data-vtext.
    MOVE i_bsid-sgtxt TO i_temp_data-vtext.
    MOVE 'Financial Doc' TO i_temp_data-vvtext.
    ELSE.
    MOVE i_bsid-sgtxt TO i_temp_data-vtext.
    MOVE 'Financial Doc' TO i_temp_data-vvtext.
    ENDIF.
    ENDIF.
    *for doc type DG
    IF i_bsid-blart = 'DG' AND
    ( i_bsid-bschl GE '01' AND i_bsid-bschl LE '19' ).
    i_temp_data-bldat = i_bsid-zfbdt.
    i_temp_data-xblnr = i_bsid-vbeln.
    IF i_bsid-sgtxt IS INITIAL.
    *Changed our phone nuber to
    MOVE 'Contact Flightsafety' TO i_temp_data-vtext.
    ELSE.
    MOVE i_bsid-sgtxt TO i_temp_data-vtext.
    MOVE 'Financial Doc' TO i_temp_data-vvtext.
    ENDIF.
    ENDIF.
    *To display Debit memo and credit memo.
    IF i_bsid-blart = 'DG'.
    IF ( i_bsid-bschl GE '11' AND i_bsid-bschl LE '19' ).
    MOVE 'Credit Memo' TO i_temp_data-vvtext.
    ELSEIF ( i_bsid-bschl GE '01' AND i_bsid-bschl LE '09' ).
    MOVE 'Debit Memo' TO i_temp_data-vvtext.
    ENDIF.
    ENDIF.
    *for doc type DZ
    IF i_bsid-blart = 'DZ' AND
    ( i_bsid-bschl GE '01' AND i_bsid-bschl LE '19' ).
    IF i_bsid-sgtxt IS INITIAL.
    *changed our phone number to
    MOVE 'Contact Flightsafety' TO i_temp_data-vtext.
    ELSE.
    MOVE i_bsid-sgtxt TO i_temp_data-vtext.
    MOVE 'Cust Pmt' TO i_temp_data-vvtext.
    ENDIF.
    ENDIF.
    *Document type DZ and posting key 15
    IF i_bsid-blart = 'DZ' AND
    i_bsid-bschl EQ '15'.
    MOVE 'Cust Pmt' TO i_temp_data-vvtext.
    ENDIF.
    *Document type DZ and posting key 06.
    IF i_bsid-blart = 'DZ' AND
    i_bsid-bschl EQ '06'.
    MOVE 'Debit' TO i_temp_data-vvtext.
    ENDIF.
    *Document type DA and posting key 04, 14.
    IF i_bsid-blart = 'DA' AND
    i_bsid-bschl EQ '04' OR
    i_bsid-bschl EQ '14'.
    MOVE 'Cust Pmt' TO i_temp_data-vvtext.
    MOVE i_bsid-sgtxt TO i_temp_data-vtext.
    IF i_bsid-sgtxt IS INITIAL.
    MOVE 'Contact Flightsafety' TO i_temp_data-vtext.
    ENDIF.
    ENDIF.
    ENDIF.
    *billing period
    IF i_bsid-blart = 'RV' AND i_bsid-bschl = '01'.
    PERFORM billing_period USING i_temp_data-belnr
    i_temp_data-vbeln.
    ENDIF.
    AT END OF belnr.
    at end of zuonr.
    APPEND i_temp_data.
    CLEAR i_temp_data.
    ENDAT.
    ENDLOOP.
    PERFORM material_details.
    ENDFORM. " Get_Arrear_Days
    *& Form FORMAT_FINAL_DATA
    text
    FORM format_final_data.
    PERFORM pop_format_grp_curr_detail.
    CLEAR: itab_temp, i_total.
    REFRESH: itab_temp, i_total.
    itab_temp] = itab[.
    CLEAR itab.
    REFRESH itab.
    LOOP AT itab_temp.
    CLEAR itab.
    itab = itab_temp.
    CLEAR: itab-matnr.
    IF itab-belnr+0(2) = '14'.
    *Adding two 00 for the left alignment.
    CONCATENATE '00' itab-xblnr
    INTO itab-inv_chk.
    CONDENSE itab-inv_chk NO-GAPS.
    itab-inv_chk = itab-xblnr.
    itab-xblnr = itab-belnr.
    ELSE.
    itab-inv_chk = itab-belnr.
    ENDIF.
    COLLECT itab.
    ENDLOOP.
    CLEAR v_stat.
    SORT itab BY days inv_chk total DESCENDING.
    LOOP AT itab.
    *To display Aging totals in usd (if v_stat ne f) for
    *company code 1100,1300,2000.
    IF itab-bukrs NE '1100' AND
    itab-bukrs NE '1300' AND
    itab-bukrs NE '2000'.
    v_stat = 'F'.
    ENDIF.
    CLEAR: i_last-vvtext, tvzbt.
    MOVE-CORRESPONDING itab TO i_last.
    APPEND i_last.
    CLEAR i_last.
    ENDLOOP.
    ENDFORM. " FORMAT_FINAL_DATA
    *& Form POP_FORMAT_grp_CURR_DETAIL
    text
    FORM pop_format_grp_curr_detail.
    Populating the Final Internal table for report by Group Currency.
    CLEAR x_amt.
    SORT i_temp_data.
    LOOP AT i_temp_data.
    CLEAR: v_count.
    IF i_temp_data-sgtxt+0(10) = 'Spcfy in p'.
    i_temp_data-sgtxt = i_temp_data-sgtxt+32(18).
    MOVE i_temp_data-sgtxt TO i_temp_data-vtext.
    MODIFY i_temp_data.
    ENDIF.
    IF r_comp = 'X'.
    IF i_temp_data-days LT 0.
    x_amt-amt00_ls = x_amt-amt00_ls + i_temp_data-dmbtr.
    If between 1 and 30 Days.
    ELSEIF i_temp_data-days GE 0 AND i_temp_data-days LE 30.
    x_amt-00_30 = x_amt-00_30 + i_temp_data-dmbtr.
    If between 31 and 60 Days.
    ELSEIF i_temp_data-days GE 31 AND i_temp_data-days LE 60.
    x_amt-31_60 = x_amt-31_60 + i_temp_data-dmbtr.
    if between 61 and 90
    ELSEIF i_temp_data-days GE 61 AND i_temp_data-days LE 90.
    x_amt-61_90 = x_amt-61_90 + i_temp_data-dmbtr.
    if between 91 and 120
    ELSEIF i_temp_data-days GE 91 AND i_temp_data-days LE 120.
    x_amt-91_120 = x_amt-91_120 + i_temp_data-dmbtr.
    if > 120
    ELSEIF i_temp_data-days GT 120.
    x_amt-120pls = x_amt-120pls + i_temp_data-dmbtr.
    ENDIF.
    ELSE.
    if the group currency is selected
    IF i_temp_data-days LT 0.
    x_amt-amt00_ls = x_amt-amt00_ls + i_temp_data-dmbe2.
    If between 1 and 30 Days.
    ELSEIF i_temp_data-days GE 0 AND i_temp_data-days LE 30.
    x_amt-00_30 = x_amt-00_30 + i_temp_data-dmbe2.
    If between 31 and 60 Days.
    ELSEIF i_temp_data-days GE 31 AND i_temp_data-days LE 60.
    x_amt-31_60 = x_amt-31_60 + i_temp_data-dmbe2.
    if between 61 and 90
    ELSEIF i_temp_data-days GE 61 AND i_temp_data-days LE 90.
    x_amt-61_90 = x_amt-61_90 + i_temp_data-dmbe2.
    if between 91 and 120
    ELSEIF i_temp_data-days GE 91 AND i_temp_data-days LE 120.
    x_amt-91_120 = x_amt-91_120 + i_temp_data-dmbe2.
    if > 120
    ELSEIF i_temp_data-days GT 120.
    x_amt-120pls = x_amt-120pls + i_temp_data-dmbe2.
    ENDIF.
    ENDIF.
    Get Customer Name.
    SELECT SINGLE name1
    INTO itab-name1
    FROM kna1
    WHERE kunnr = i_temp_data-kunnr.
    Invoice and year
    AT END OF rebzg.
    READ TABLE i_temp_data INDEX sy-tabix.
    itab-zuonr = i_temp_data-zuonr.
    itab-bukrs = i_temp_data-bukrs.
    itab-kunnr = i_temp_data-kunnr.
    itab-belnr = i_temp_data-belnr.
    itab-gjahr = i_temp_data-gjahr.
    IF r_comp EQ 'X'.
    itab-waers = i_temp_data-waers.
    ELSE.
    itab-waers = 'USD'.
    ENDIF.
    itab-zfbdt = i_temp_data-zfbdt.
    itab-zterm = i_temp_data-zterm.
    itab-amt00_30 = x_amt-amt00_ls + x_amt-00_30.
    itab-amt31_60 = x_amt-31_60.
    itab-amt61_90 = x_amt-61_90.
    itab-amt91_120 = x_amt-91_120.
    itab-amt120pls = x_amt-120pls.
    itab-total = x_amt-amt00_ls + x_amt-00_30 +
    x_amt-31_60 + x_amt-61_90 +
    x_amt-91_120 + x_amt-120pls.
    itab-kunnr_c = i_temp_data-kunnr_c.
    itab-name_c = i_temp_data-name_c.
    itab-kidno = i_temp_data-kidno.
    itab-matnr = i_temp_data-matnr.
    itab-inv_date = i_temp_data-inv_date.
    itab-rebzg = i_temp_data-rebzg.
    itab-xblnr = i_temp_data-xblnr.
    itab-vtext = i_temp_data-vtext.
    itab-sgtxt = i_temp_data-sgtxt.
    itab-days = i_temp_data-days.
    itab-bldat = i_temp_data-bldat.
    itab-vvtext = i_temp_data-vvtext.
    itab-zzihrez_e = i_temp_data-zzihrez_e.
    itab-blart = i_temp_data-blart.
    itab-plant = i_temp_data-plant.
    Populating table.
    APPEND: itab.
    CLEAR : itab,
    x_amt.
    v_count = 1.
    ENDAT.
    IF v_count NE 1.
    itab-zuonr = i_temp_data-zuonr.
    itab-bukrs = i_temp_data-bukrs.
    itab-kunnr = i_temp_data-kunnr.
    itab-belnr = i_temp_data-belnr.
    itab-gjahr = i_temp_data-gjahr.
    itab-bldat = i_temp_data-bldat.
    IF r_comp EQ 'X'.
    itab-waers = i_temp_data-waers.
    ELSE.
    itab-waers = 'USD'.
    ENDIF.
    itab-zfbdt = i_temp_data-zfbdt.
    itab-zterm = i_temp_data-zterm.
    itab-kunnr_c = i_temp_data-kunnr_c.
    itab-name_c = i_temp_data-name_c.
    itab-kidno = i_temp_data-kidno.
    itab-matnr = i_temp_data-matnr.
    itab-inv_date = i_temp_data-inv_date.
    itab-rebzg = i_temp_data-rebzg.
    itab-xblnr = i_temp_data-xblnr.
    itab-vtext = i_temp_data-vtext.
    itab-sgtxt = i_temp_data-sgtxt.
    itab-days = i_temp_data-days.
    itab-zzihrez_e = i_temp_data-zzihrez_e.
    itab-plant = i_temp_data-plant.
    itab-vvtext = i_temp_data-vvtext.
    itab-blart = i_temp_data-blart.
    IF itab-matnr NE space.
    APPEND itab.
    CLEAR itab-plant.
    ELSE.
    ON CHANGE OF i_temp_data-kidno.
    READ TABLE i_temp_data INDEX sy-tabix.
    itab-zuonr = i_temp_data-zuonr.
    itab-bukrs = i_temp_data-bukrs.
    itab-kunnr = i_temp_data-kunnr.
    itab-belnr = i_temp_data-belnr.
    itab-gjahr = i_temp_data-gjahr.
    itab-bldat = i_temp_data-bldat.
    IF r_comp EQ 'X'.
    itab-waers = i_temp_data-waers.
    ELSE.
    itab-waers = 'USD'.
    ENDIF.
    itab-zfbdt = i_temp_data-zfbdt.
    itab-zterm = i_temp_data-zterm.
    itab-amt00_30 = x_amt-amt00_ls + x_amt-00_30.
    itab-amt31_60 = x_amt-31_60.
    itab-amt61_90 = x_amt-61_90.
    itab-amt91_120 = x_amt-91_120.
    itab-amt120pls = x_amt-120pls.
    itab-total = x_amt-amt00_ls + x_amt-00_30 +
    x_amt-31_60 + x_amt-61_90 +
    x_amt-91_120 + x_amt-120pls.
    itab-kunnr_c = i_temp_data-kunnr_c.
    itab-name_c = i_temp_data-name_c.
    itab-kidno = i_temp_data-kidno.
    itab-matnr = i_temp_data-matnr.
    itab-inv_date = i_temp_data-inv_date.
    itab-rebzg = i_temp_data-rebzg.
    itab-xblnr = i_temp_data-xblnr.
    itab-vtext = i_temp_data-vtext.
    itab-sgtxt = i_temp_data-sgtxt.
    itab-days = i_temp_data-days.
    itab-zzihrez_e = i_temp_data-zzihrez_e.
    itab-vvtext = i_temp_data-vvtext.
    itab-plant = i_temp_data-plant.
    APPEND itab.
    CLEAR: x_amt-amt00_ls, x_amt-00_30, x_amt-31_60,
    x_amt-61_90, x_amt-91_120 , x_amt-120pls.
    ENDON.
    ENDIF.
    CLEAR: itab.
    ENDIF.
    ENDLOOP.
    ENDFORM. " POP_FORMAT_grp_CURR_DETAIL
    *& Form material_details
    text
    --> p1 text
    <-- p2 text
    FORM material_details.
    SORT itab_details.
    DELETE ADJACENT DUPLICATES FROM itab_details.
    LOOP AT itab_details.
    CLEAR: v_counter, v_gjahr, v_kunnr, v_prodh, v_vbeln,
    v_vvtext, v_vtext.
    v_gjahr = itab_details-gjahr.
    v_kunnr = itab_details-kunnr.
    *Invoice Date/Billing date
    SELECT SINGLE fkdat FROM vbrk INTO v_inv_date
    WHERE vbeln = itab_details-xblnr.
    *material number, description and product hierarchy
    SELECT matnr arktx prodh FROM vbrp
    INTO (v_matnr, v_arktx, v_prodh)
    WHERE vbeln = itab_details-xblnr AND
    uepos = '00000'.
    CLEAR: v_vdatu, v_posnr, v_auart, v_prctr, v_zzihrez,
    v_kunnr_c, v_name1, v_name2, v_vtext, v_vvtext.
    *Find the contract/order no
    SELECT SINGLE vbelv posnv FROM vbfa INTO (v_vbeln, v_posnr)
    WHERE vbeln = itab_details-xblnr
    AND vbtyp_v IN ('C','G').
    *delivery date, document type, plant and reservation no
    SELECT SINGLE vbakvdatu vbakauart vbapprctr vbapzzihrez_e
    INTO (v_vdatu, v_auart, v_prctr, v_zzihrez)
    FROM vbak INNER JOIN vbap ON vbakvbeln = vbapvbeln
    WHERE vbap~vbeln = v_vbeln AND
    vbap~posnr = v_posnr AND
    vbap~abgru = space.
    *billing type
    SELECT SINGLE * FROM vbkd WHERE vbeln = v_vbeln.
    IF vbkd-bsark NE 'ZG01' OR vbkd-bsark NE 'ZO02'.
    SELECT SINGLE vtext FROM t176t INTO v_vvtext
    WHERE bsark = vbkd-bsark
    AND spras EQ sy-langu.
    ELSE.
    MOVE 'One Time' TO v_vvtext.
    ENDIF.
    *getting only the reservation number (no text)
    IF vbkd-ihrez_e+0(11) CO
    '0123456789'.
    ELSE.
    v_zzihrez = space.
    ENDIF.
    *location
    CONCATENATE '000000' v_zzihrez+0(4) INTO v_prctr.
    *plant name
    CLEAR v_plant.
    SELECT SINGLE ktext FROM cepct INTO v_plant WHERE
    prctr = v_prctr AND
    spras = sy-langu.
    *client no and name
    SELECT SINGLE vbpakunnr kna1name1 kna1~name2
    INTO (v_kunnr_c, v_name1, v_name2)
    FROM vbpa INNER JOIN kna1 ON
    vbpakunnr = kna1kunnr
    WHERE vbpa~vbeln = v_vbeln AND
    vbpa~parvw = 'Z3'.
    CONCATENATE v_name1 v_name2 INTO v_name_c
    SEPARATED BY space.
    READ TABLE i_temp_data WITH KEY bukrs = itab_details-bukrs
    belnr = itab_details-belnr
    gjahr = itab_details-gjahr.
    IF sy-subrc = 0.
    CLEAR: v_tabix.
    v_tabix = sy-tabix.
    IF v_counter IS INITIAL.
    MOVE v_plant TO i_temp_data-plant.
    MOVE v_zzihrez TO i_temp_data-zzihrez_e.
    MOVE v_kunnr_c TO i_temp_data-kunnr_c.
    MOVE v_name_c TO i_temp_data-name_c.
    MOVE v_gjahr TO i_temp_data-gjahr.
    MOVE v_kunnr TO i_temp_data-kunnr.
    IF v_auart EQ 'ZOTO' AND i_temp_data-inv_date IS INITIAL.
    MOVE v_inv_date TO i_temp_data-inv_date.
    ELSEIF i_temp_data-inv_date IS INITIAL.
    MOVE v_vdatu TO i_temp_data-inv_date.
    ENDIF.
    IF i_temp_data-vtext IS INITIAL.
    MOVE v_arktx TO i_temp_data-vtext.
    ENDIF.
    IF i_temp_data-vvtext IS INITIAL.
    MOVE v_vvtext TO i_temp_data-vvtext.
    ENDIF.
    MODIFY i_temp_data INDEX v_tabix.
    CLEAR i_temp_data.
    v_counter = 'T'.
    CLEAR: v_matnr,v_arktx,v_vbeln,v_name_c,v_vtext, v_prodh,
    v_kunnr_c, v_name1,v_name2, v_vdatu, v_vvtext.
    ELSE.
    CLEAR:i_temp_data-dmbe2, i_temp_data-dmbtr. " i_temp_data-wrbtr
    MOVE v_matnr TO i_temp_data-matnr.
    MOVE v_plant TO i_temp_data-plant.
    MOVE v_zzihrez TO i_temp_data-zzihrez_e.
    MOVE v_kunnr_c TO i_temp_data-kunnr_c.
    MOVE v_name_c TO i_temp_data-name_c.
    MOVE v_gjahr TO i_temp_data-gjahr.
    MOVE v_kunnr TO i_temp_data-kunnr.
    IF v_auart EQ 'ZOTO' AND i_temp_data-inv_date IS INITIAL.
    MOVE v_inv_date TO i_temp_data-inv_date.
    ELSEIF i_temp_data-inv_date IS INITIAL.
    MOVE v_vdatu TO i_temp_data-inv_date.
    ENDIF.
    MOVE v_arktx TO i_temp_data-vtext.
    APPEND i_temp_data.
    CLEAR i_temp_data.
    ENDIF.
    ENDIF.
    ENDSELECT.
    CLEAR:
    i_temp_data-kunnr_c,
    i_temp_data-name_c,i_temp_data-inv_date,
    i_temp_data-vtext.
    CLEAR: v_matnr,v_arktx,v_vbeln,v_name_c,
    v_kunnr_c, v_name1,v_name2,v_inv_date, v_vdatu,
    v_vtext, v_prodh.
    ENDLOOP.
    ENDFORM. " material_details
    *& Form get_address
    text
    FORM get_address.
    Get Address
    CLEAR: kna1, x_kna1, first_name, last_name,pafkt, lang, v_land.
    SELECT SINGLE * FROM kna1 INTO kna1 WHERE kunnr = i_last-kunnr.
    SELECT SINGLE name1 namev pafkt parla FROM knvk
    INTO (last_name, first_name, pafkt, lang)
    WHERE kunnr = i_last-kunnr
    AND abtnr = '0003'. "financial department
    IF sy-subrc NE 0.
    SELECT SINGLE name1 namev pafkt parla FROM knvk
    INTO (last_name, first_name, pafkt, lang)
    WHERE kunnr = i_last-kunnr.
    ENDIF.
    IF lang = ' '.
    lang = 'E'.
    ENDIF.
    SELECT SINGLE vtext FROM tpfkt INTO x_kna1-ptext
    WHERE pafkt = pafkt
    AND spras = lang.
    SELECT SINGLE name1 name2 street country FROM
    adrc INTO (x_kna1-name1, x_kna1-name2,
    x_kna1-street, v_land)
    WHERE addrnumber = kna1-adrnr.
    SELECT SINGLE landx FROM t005t INTO x_kna1-landx WHERE land1 = v_land
    AND spras = lang.
    TRANSLATE x_kna1-landx TO UPPER CASE. "#EC SYNTCHAR added by sony
    MOVE kna1-kunnr TO x_kna1-kunnr.
    MOVE kna1-ort01 TO x_kna1-ort01.
    MOVE kna1-regio TO x_kna1-regio.
    MOVE kna1-pstlz TO x_kna1-pstlz.
    MOVE p_bdate TO x_kna1-agdate.
    APPEND x_kna1.
    CLEAR: x_kna1.
    ENDFORM. " get_addres
    *& Form fetch_data_vender
    text
    --> p1 text
    <-- p2 text
    FORM fetch_data_vender.
    SELECT lifnr FROM kna1 INTO TABLE itab_vender
    WHERE kunnr IN s_kunnr.
    LOOP AT itab_vender.
    Fetch data from BSIK into Internal table I_BSIK.
    SELECT *
    FROM bsik
    APPENDING TABLE i_bsik
    WHERE bukrs IN s_bukrs AND
    lifnr EQ itab_vender-vender AND
    budat LE p_bdate AND
    blart IN ('KA', 'KG', 'KR', 'KZ', 'KF').
    Fetch data from BSAK into Internal table I_BSAK.
    SELECT *
    FROM bsak "#EC ENHOK "added by sony 06/05/08
    APPENDING TABLE i_bsik
    WHERE bukrs IN s_bukrs AND
    lifnr EQ itab_vender-vender AND
    budat LE p_bdate AND
    augdt GT p_bdate AND
    blart IN ('KA', 'KG', 'KR', 'KZ', 'KF').
    ENDLOOP.
    DELETE i_bsik WHERE ( bukrs = '1500' OR bukrs = '3000' ) AND
    ( umsks = 'E' OR umskz = 'E' ).
    ENDFORM. " fetch_data_vender
    *& Form GET_ARREAR_DAYS_vender
    text
    --> p1 text
    <-- p2 text
    FORM get_arrear_days_vender.
    SORT i_bsik BY mandt bukrs belnr.
    CLEAR: v_tabix.
    LOOP AT i_bsik.
    v_tabix = sy-tabix.
    SELECT SINGLE * FROM kna1 WHERE lifnr = i_bsik-lifnr.
    MOVE i_bsik-bukrs TO itab_details-bukrs.
    MOVE i_bsik-xblnr TO itab_details-xblnr.
    MOVE i_bsik-belnr TO itab_details-belnr.
    MOVE i_bsik-gjahr TO itab_details-gjahr.
    MOVE kna1-kunnr TO itab_details-kunnr.
    APPEND itab_details.
    CLEAR itab_details.
    CLEAR x_item.
    AT NEW bukrs.
    *company code details
    READ TABLE i_bsik INDEX sy-tabix.
    CLEAR x_t001.
    SELECT SINGLE * FROM t001
    INTO x_t001
    WHERE bukrs = i_bsik-bukrs.
    ENDAT.
    MOVE-CORRESPONDING i_bsik TO x_item.
    x_item-koart = 'D'. " Debitor - Customer Indicator
    x_item-konto = kna1-kunnr. " Debitor - Customer Number
    x_item-dmshb = bsik-dmbtr.
    x_item-wrshb = bsik-wrbtr.
    Function module to get ARREAR days.
    CALL FUNCTION 'ITEM_DERIVE_FIELDS'
    EXPORTING
    s_t001 = x_t001
    s_bsegp = x_bsegp
    key_date = p_bdate
    CHANGING
    s_item = x_item
    EXCEPTIONS
    bad_input = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    Populate I_TEMP_DATA for further processing.
    i_temp_data-bukrs = i_bsik-bukrs.
    i_temp_data-kunnr = kna1-kunnr.
    i_temp_data-belnr = i_bsik-belnr.
    i_temp_data-bldat = i_bsik-bldat. "Document date in document
    i_temp_data-shkzg = i_bsik-shkzg.
    i_temp_data-zfbdt = i_bsik-zfbdt. " Base line date
    i_temp_data-zterm = i_bsik-zterm. "Terms of payment key
    i_temp_data-waers = i_bsik-waers.
    i_temp_data-days = x_item-verzn. " days in arrs
    i_temp_data-gjahr = i_bsik-gjahr. " year
    i_temp_data-kidno = i_bsik-kidno. " Payment Reference
    i_temp_data-rebzg = i_bsik-rebzg. " Number of the Invoice the
    "Transaction Belongs to
    i_temp_data-xblnr = i_bsik-xblnr.
    i_temp_data-sgtxt = i_bsik-sgtxt. " Item Text
    Changing the Sign
    IF i_bsik-shkzg = 'H'.
    i_temp_data-dmbe2 = -1 * i_bsik-dmbe2.
    i_temp_data-dmbtr = -1 * i_bsik-dmbtr.
    ELSE.
    i_temp_data-dmbe2 = i_bsik-dmbe2.
    i_temp_data-dmbtr = i_bsik-dmbtr.
    ENDIF.
    ENDIF.
    APPEND i_temp_data.
    CLEAR i_temp_data.
    ENDLOOP.
    PERFORM material_details.
    ENDFORM. " Get_Arrear_DaysENDFORM.
    " GET_ARREAR_DAYS_vender
    *& Form convert_pdf
    text
    --> p1 text
    <-- p2 text
    FORM convert_pdf.
    CLEAR: tsp01.
    CLEAR: mtab_pdf, mi_bytecount.
    REFRESH mtab_pdf.
    FREE mtab_pdf.
    ***convert to PDF format
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    IMPORTING
    bin_filesize = mi_bytecount
    TABLES
    otf = i_otf_final
    lines = mtab_pdf
    EXCEPTIONS
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    OTHERS = 4.
    IF sy-subrc 0.
    ENDIF.
    CONDENSE itab-kunnr NO-GAPS.
    CONCATENATE 'C:\' itab-kunnr '_' sy-datum '.pdf' INTO downfile.
    IF ch_down = 'X'.
    PERFORM download_pdf.
    ENDIF.
    IF ch_email = 'X'.
    PERFORM send_email.
    ENDIF.
    ENDFORM. " convert_pdf
    *& Form download_pdf
    text
    --> p1 text
    <-- p2 text
    FORM download_pdf.
    DATA: i_downfile TYPE string.
    i_downfile = downfile.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = mi_bytecount
    filename = i_downfile
    filetype = 'BIN'
    IMPORTING
    FILELENGTH =
    TABLES
    data_tab = mtab_pdf[]
    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.
    ENDIF.
    ENDFORM. " download_pdf
    *& Form send_email
    text
    --> p1 text
    <-- p2 text
    FORM send_email.
    CLEAR: packing_list[],
    pdf[],
    contents_txt[],
    contents_hex[],
    receivers[],
    att_pos,
    document_data,
    esubject,emsgs[],
    w_contents_hex.
    PERFORM packing_list.
    PERFORM set_data.
    IF v_check NE 'X'.
    PERFORM send_email_message.
    ENDIF.
    ENDFORM. " send_email
    *& Form packing_list
    text
    --> p1 text
    <-- p2 text
    FORM packing_list.
    Concatenate the PDF material into the attachments table.
    PERFORM append_pdf_to_attachments USING mi_bytecount.
    Describe the attachment
    CLEAR packing_list.
    REFRESH packing_list.
    packing_list-transf_bin = 'X'.
    ADD 1 TO att_pos.
    packing_list-body_start = att_pos.
    DESCRIBE TABLE contents_hex LINES att_pos.
    packing_list-body_num = att_pos.
    packing_list-doc_type = 'PDF'.
    CONCATENATE 'Statement Date'
    sy-datum4(2) '/' sy-datum6(2) '/'
    sy-datum+2(2) '-' 'Customer no -' itab-kunnr
    INTO packing_list-obj_descr.
    packing_list-obj_langu = 'E'.
    packing_list-doc_size = mi_bytecount.
    APPEND packing_list.
    ENDFORM. " packing_list
    *& Form set_data
    text
    --> p1 text
    <-- p2 text
    FORM set_data.
    CLEAR: sy-tfill.
    DESCRIBE TABLE contents_hex LINES sy-tfill.
    IF sy-tfill GT 0.
    DATA: lines TYPE TABLE OF tline WITH HEADER LINE.
    By this point, the attachments have been created. Now we supply body
    text and set up the recipients.
    CONCATENATE 'Customer Statement for Customer - '
    itab-kunnr esubject INTO esubject.
    The message header information
    CLEAR document_data.
    document_data-obj_name = 'ZWRAPPER'.
    document_data-obj_descr = esubject.
    document_data-obj_langu = 'E'.
    document_data-obj_prio = '1'.
    CLEAR: contents_txt, contents_txt], itext[, itext.
    IF sy-sysid NE 'R3P'.
    CONCATENATE 'Please ignore this mail. This is part of testing from '
    sy-sysid INTO contents_txt SEPARATED BY space.
    APPEND contents_txt.
    CLEAR: contents_txt.
    APPEND contents_txt.
    ENDIF.
    CLEAR vv_text.
    CONCATENATE 'Enter Body of the Email and SAVE it for customer '
    itab-kunnr itab-name1 INTO vv_text SEPARATED BY space.
    EDITOR-CALL FOR itext TITLE vv_text.
    LOOP AT itext.
    contents_txt = itext-text.
    APPEND contents_txt.
    ENDLOOP.
    Describe the body data. This descriptor has to be the first, in front
    of all the attachments.
    CLEAR packing_list.
    packing_list-transf_bin = space.
    packing_list-body_start = 1.
    DESCRIBE TABLE contents_txt LINES packing_list-body_num.
    packing_list-doc_type = 'RAW'.
    packing_list-obj_langu = 'E'.
    INSERT packing_list INDEX 1.
    Set up the recipients.
    CLEAR: receivers, receivers[], sy-tfill.
    CLEAR: usr21, adr6.
    *find email address.
    IF sy-sysid = 'R3P'.
    SELECT prsnr FROM knvk INTO knvk-prsnr WHERE kunnr = itab-kunnr.
    SELECT SINGLE adrnr name1 name2 FROM kna1 INTO
    (kna1-adrnr, kna1-name1, kna1-name2)
    WHERE kunnr = itab-kunnr.
    SELECT SINGLE smtp_addr INTO v_email FROM adr6
    WHERE addrnumber EQ kna1-adrnr.
    IF sy-subrc NE 0.
    CLEAR: v_email.
    ELSE.
    EXIT.
    ENDIF.
    ENDSELECT.
    ENDIF.
    *find the user email address.
    CLEAR: usr21, adr6.
    SELECT SINGLE * FROM usr21 WHERE bname = sy-uname.
    CLEAR adr6.
    SELECT SINGLE * FROM adr6 WHERE addrnumber = usr21-addrnumber AND
    persnumber = usr21-persnumber.
    v_ccemail = adr6-smtp_addr.
    CLEAR:i_fields.
    REFRESH:i_fields.
    i_fields-tabname = 'COMPMSG'.
    i_fields-fieldname = 'TEXT'.
    i_fields-fieldtext = 'Email'.
    i_fields-value = v_email.
    APPEND i_fields.
    CLEAR i_fields.
    i_fields-tabname = 'T100'.
    i_fields-fieldname = 'TEXT'.
    i_fields-fieldtext = 'CC to'.
    i_fields-value = v_ccemail.
    APPEND i_fields.
    CLEAR i_fields.
    CLEAR v_returncode.
    CALL FUNCTION 'POPUP_GET_VALUES'
    EXPORTING
    popup_title = 'Email Address.'
    start_column = '25'
    start_row = '2'
    IMPORTING
    returncode = v_returncode
    TABLES
    fields = i_fields
    EXCEPTIONS
    error_in_fields = 1
    OTHERS = 2.
    IF sy-subrc 0.
    ENDIF.
    IF v_returncode NE 'A'.
    *find the new condition value (table name and filed name took itfor char
    LOOP AT i_fields WHERE tabname = 'COMPMSG' AND fieldname = 'TEXT'.
    v_email = i_fields-value.
    ENDLOOP.
    LOOP AT i_fields WHERE tabname = 'T100'
    AND fieldname = 'TEXT'.
    v_ccemail = i_fields-value.
    ENDLOOP.
    ENDIF.
    receivers-receiver = v_email.
    receivers-rec_type = 'U'. "..assume it's an internet address
    APPEND receivers.
    receivers-receiver = v_ccemail.
    receivers-rec_type = 'U'.
    receivers-copy = 'X'.
    APPEND receivers.
    SORT receivers BY receiver.
    DELETE ADJACENT DUPLICATES FROM receivers COMPARING receiver.
    ENDIF.
    CLEAR: v_check.
    IF v_email = space.
    v_check = 'X'.
    MOVE itab-kunnr TO ioutput-kunnr.
    MOVE v_kname TO ioutput-kname.
    MOVE v_email TO ioutput-email.
    MOVE 'X' TO ioutput-error.

    Hi
    Looks like BASIS issue.
    Pls check the OSS Note - Note 787418 - Sent documents are not readable after upgrade
    Pls contact your BASIS person
    Regards
    MD

  • RFBIBL00 Performance issues Post ECC6

    Hi Folks,
    Have just completed ECC6 upgrade am seeing terrible performance issues when using RFBIBL00 for loading. All loads seem to stick reading table TBIZU. DB Is oracle and table is quite small. Stats are valid and when checking explain plan in oracle the query seems to be fine.
    Anybody seen anything similar.
    ta

    hi,
    Please check this link
    [Re: rfbibl00;
    regards,
    suhas

  • Upgrade issue in ECC6.0 for include structure

    Hi All,
    I have the following issue while upgrading to ecc6.0.
    data:begin of it_cats,
            include structure cosp,
          end of it_cats.
    I am geeting syntax error as include structure is not allowed in ecc6.0.What is the replacement for this?
    Thanks.
    Ramya.

    Hallo There,
    I read some of the already available posts on this topic but did not find any relevant answers so please excuse of the information already exists out there.
    Here is the question:
    Please consider the code (from above posts):
    data:begin of it_cats.
           include structure cosp.
    data: end of it_cats.
    I read some where that this can  be replaced by  :
    DATA it_cats type cosp.
    Is this correct ?
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/includ02.htm
    Regards
    SG

  • Authorisation issues in ECC6.0

    I am getting an authorisation error for some  transaction. I never faced any such issues before the upgrade. Pls resolve
    Thanks
    Manoj

    Hi,
    You would need to perform a security upgrade after your upgrade to ECC6.0. There are differences in the transaction codes from 4.7 and ECC 6.0 Untill you perform the upgrade, you will face such issues.
    Please follow SAP handbook second edition by Jose Hernandez for procedure of upgrade.
    If you have performed the security upgrade, then please specify the when are you getting such issues.
    Regards,
    Imran

  • Ff67 batch file creation issue in ECC6

    hi guru,
    Recently our system has been updated from version ECC 5 to ECC6 7.4
    we are using z program to upload data in  FF67 to create manual bank statement after uploading data
    system create batch session in sm35 , program is working fine in ECC5 ,but in ECC6  program is not able to
    create batch session ,we are not getting any error after running BDC program,we have check the setting in
    specification tab it is set to 2. we have also check the authorization ,there is no authorization problem.

    Hi,
    Were you able to solve your problem. If so please could you post your solution here as this may assist others who have the same error.

  • Printing issue in ECC6.0

    Hi experts,
    We are facing problem in production server.
    When users are giving print it is under waiting status.
    So we have checked the spool request, it is 19500 (50%).
    But users are facing the problems since yesterday.
    Now we have removed spool of last 25 days.
    Now this issue is resolved but i think this is temporary solution.
    Can anyone help me regarding this.
    Regards
    Hemant G

    When users are giving print it is under waiting status.
    It could be N number of reason for the wait status for e.g network problem, Gui problem, Spool request not generated properly, so you should have check all these things.
    Regards,
    Subhash

  • Performance issue of ecc6.0

    HI,
    We  have ECC6.0 server(prdserver) Oracle 10g (Database) O/s windows 2003 Enterprise 32 bit RAM 12Gb.we are facing performence problem.how to improve performence. iam  attaching existing parameters.please help me out.
    abap/buffersize                             2000000  
    SAPSYSTEM                                   00                                 
    login/system_client                         090                                
    INSTANCE_NAME                               DVEBMGS00                          
    DIR_CT_RUN                                  $(DIR_EXE_ROOT)\$(OS_UNICODE)\NTI386
    DIR_EXECUTABLE                              $(DIR_INSTANCE)\exe                
    PHYS_MEMSIZE                                512                                
    rdisp/wp_no_dia                             20                                 
    rdisp/wp_no_btc                             4                                  
    icm/server_port_0                           PROT=HTTP,PORT=80$$                
    ms/server_port_0                            PROT=HTTP,PORT=81$$                
    rdisp/wp_no_enq                             1                                  
    rdisp/wp_no_vb                              3                                  
    rdisp/wp_no_vb2                             3                                  
    rdisp/wp_no_spo                             4                                  
    DIR_CLIENT_ORAHOME                          $(DIR_EXECUTABLE)                  
    rdisp/max_wprun_time                        60000                              
    zcsa/system_language                        E                                  
    zcsa/installed_languages                    DE                                 
    rdisp/appc_ca_blk_no                        100                                
    rdisp/wp_ca_blk_no                          600                                
    login/create_sso2_ticket                    2                                  
    login/accept_sso2_ticket                    1                                  
    ms/server_port_0                            PROT=HTTP,PORT=81$$                
    icm/server_port_0                           PROT=HTTP,PORT=8000                
    icm/host_name_full                          prdserver.growel.com               
    DIR_ROLL                                    ap/buffersizeD:\usr\sap\GPS\DVEBMGS0
    DIR_PAGING                                  D:\usr\sap\GPS\DVEBMGS00\data      
    DIR_DATA                                    D:\usr\sap\GPS\DVEBMGS00\data      
    DIR_REORG                                   D:\usr\sap\GPS\DVEBMGS00\data      
    DIR_TRANS                                  
    prdserver\sapmnt\trans           
    ztta/parameter_area                         16000 
         icm/host_name_full                          prdserver.growel.com                       
    DIR_ROLL                                    ap/buffersizeD:\usr\sap\GPS\DVEBMGS00\data 
    DIR_PAGING                                  D:\usr\sap\GPS\DVEBMGS00\data              
    DIR_DATA                                    D:\usr\sap\GPS\DVEBMGS00\data              
    DIR_REORG                                   D:\usr\sap\GPS\DVEBMGS00\data              
    DIR_TRANS                                  
    prdserver\sapmnt\trans                   
    ztta/parameter_area                         16000                                      
    DIR_TEMP                                    .                                          
    DIR_SORTTMP                                 D:\usr\sap\GPS\DVEBMGS00\data              
    install/codepage/appl_server                1100                                       
    abap/use_paging                             0                                          
    ztta/roll_first                             1024                                       
    ztta/roll_area                              2550896                                    
    rdisp/ROLL_SHM                              32768                                      
    rdisp/ROLL_MAXFS                            32768                                      
    rdisp/PG_SHM                                16384                                      
    rdisp/PG_MAXFS                              32768                                      
    abap/heap_area_dia                          4000000000                                 
    abap/heap_area_nondia                       4000000000                                 
    abap/heap_area_total                        4050733008                                 
    abap/heaplimit                              60894464                                   
    abap/swap_reserve                           20971520                                   
    ztta/roll_extension                         2500733008                                 
    em/initial_size_MB                          1068                                       
    em/blocksize_KB                             1024                                       
    em/stat_log_size_MB                         20                                         
    em/stat_log_timeout                         6000                                       
    rdisp/wp_no_spo_Fro_max                     3                                          
    em/address_space_MB                         200                                        
    ztta/roll_first                             1                                          
    em/max_size_MB                              20000                                      
    rdisp/PG_MAXFS                              32768                                      
    rdisp/ROLL_SHM                              20000                                      
    Regards,
    madhan
    Edited by: Sakhalkar Swamy on Aug 28, 2009 7:25 AM
    Edited by: Sakhalkar Swamy on Aug 28, 2009 7:26 AM
    Edited by: Sakhalkar Swamy on Aug 28, 2009 7:27 AM

    Hi,
    for getting a clear picture it is very useful that you provide more informations from transaction ST03N. Therefore it would be a good idea to provide performance data.
    Have a look at this link:
    Link: [https://wiki.sdn.sap.com/wiki/display/MaxDB/WorkloadMonitor(ST03orST03N)]
    Here you can find a table with performance data. It shows which process type needs how much response time. Could you be so kind to offer such table from your troubled system?
    Kindly,
    Andreas
    Edited by: Andreas Tacke on Sep 4, 2009 10:57 AM

  • RFC Error Issue From ECC6 to BI 7.

    Before it is working fine.. from last 2 days it is not working.
    i dont have Basis Team with me right know. plz let me know how to solve.
    i checked in SM59 , it seems every thing is fine...
    Test Connection Report ( SM59 in R/3 )
    Connection Error
    Error when opening an RFC connection
    ERROR: service 'sapgw01' unknown
    LOCATION: SAP-Gateway on host sapgrp / sapgw00
    DETAIL: NiPGetServByName: service 'sapgw01' not found
    CALL: getservbyname
    COMPONENT: NI (network interface)
    COUNTER: 879
    MODULE: ninti.c
    LINE: 489
    RETURN CODE: -3
    SUBRC: 0
    RELEASE: 700
    TIME: Sun Mar 09 20:27:56 2008
    VERSION: 38
    From BI to R/3 it is working fine...
    Regards,
    SHAIK.

    Hi Shaik,
    Check did u followed this procedure :
         RFC CONNECTIONS
    &#61656;     First log on to SAP R/3 server connections Go to SCC4 in R/3 & in Scc4 BW server. A screen opens in that logical name of the system would be opened in both (R/3 & BW).
    &#61656;     Take notepad in it save .R/3 & BW logical names go to R/3 & click SM59 to create R/3 connections click then a screen opens gives BW logical name in RFC Destination option & give connection. type 3 & give some description & then press enter.
    &#61656;     You will get another screen under it then at target host gives BW server name we will get it from BW logon change ID, IP address option & give the system no. The system no go to logon pad just drag it then you will see the name.
    &#61656;     Then click on log on securities go to log on give BW server details like No, client user Password. Then save it then click test connection tab if there are errors then it gives yellow color if they are no error the whole thing come as white.
    &#61656;     Then click on the Remote Logon then we go to BW server give RFC – SM59 & click create. Then give the server name which is at the bottom right corner give it then give the no, name, password in logon Security save it & test connection & then remote logon.
    &#61656;     R/3 &#61664; B W &#61664; R/3
    &#61656;     Logical connection source system connection is used to transfer the data from R/3 to BW. Go to BW system& click RSA1 go to source system option go to top to the source systems right click on it. Then click create then a screens opens then.
    &#61656;     PC &#61664;Flat file ,  DB &#61664; Database
    &#61656;     Select the option manual then a screen appears RFC Destination, Logical source name then click OK  then it goes to opens other screen save it test connection then remote login then it go back to the then a screen opens then click only activate.
    &#61656;     BW &#61664; RS1 &#61664; SOURCE SYSTEM &#61664; CREATE MANUAL AUTOMATIC CELL
    &#61656;     R/3 &#61664; Test connections login &#61664; back &#61664; replicate method &#61664; active data R/3 Source system you will able to.
    &#61656;     Firstly go to R/3 Server give LBWE 7 click then a screen opens work on SD scales click on maintenance structure.
    &#61656;     Then a screen opens & click continue then another screen opens in that the left side extract structure right side is communication structure.
    &#61656;     Select a table & drag to the other side. It comes & add in the bottom of the list of the extract & click continue then a screen opens click yes then it gives errors in the system.
    &#61656;     Then go to the maintenance structure & make inactive by licking active. In real time if the new system it would be inactive in sand box. Then a new screen opens & give request Id then click continue go to maintenance & opens the table then click RSA3.
    &#61656;     Then go extract checker then give data source. Then click extraction then click continue then go to LBWG to delete the data. Then new screens opens then give the application then click execute.
    &#61656;     Then a screen opens click continue then it gives in the bottom set up table empty. Go to RSA3 & check it then go to LBWE then go to sales click on maintenance drag a fields from communication to extract structure.
    &#61656;     Then click continue then it won’t gie errors then a screen opens give the screen extract structure generated then go to maintenance & find the fields.
    &#61656;     Now the data source in that the file name which is side by to maintance then screen opens then click ok then a new screen opens of data source. In that selection, hide field, Inversion & field only.
    &#61656;     SELECTION: By selecting the option. In BW at Info Package data Selection/ External data
    &#61656;     Selection option is used to have a range of specific values to be extracted in your BW system. In real time we use selection option a lot.
    &#61656;     HIDE ONLY: by selection Hide only. Then C password can hide only then we can’t see the password hide field is used to hide the header.
    &#61656;     INVERSION: Multiply the data with the –ve value.
    &#61656;     FIELD ONLY; you want to have calculation based on particular field only. We rarely go with this options.
    &#61656;     Then save it & come back to the main screen LO Data extraction to active just click on inactive then a new screen opens then click continue. Then it is activate.
    &#61656;     Then go to Job Control in SD sales then a new screen opens click start date then a new screen opens click Immediate & save it. Then go to Direct delta double click on it then a screen opens click option direct delta ok.
    &#61656;     SBIW Enter it & click itt then a new screen opens then select the option. Setting to application specific data &#61664; Logistics then managing extract structure then initialization then filling in the set up table then application then specific set up of statistics data then SD sales option.
    &#61656;     Then a screen opens in control of the set up run then give name of the run &#61664; termination date automatically in &#61664; termination time &#61664; execute it.
    &#61656;     Then a screen opens click continue then a screen opens. Then RSA3 then a screen opens give the data source name then you can find the no of records.
    &#61656;     Come back to BW serer come to source system there you can see the server id name. Then another screen opens there through find symbol find the technical name find the table name.
    &#61656;     If is not found then go to materials right click then a pop up screen opens new replica(dump it to R/3  system)  -> in addition to that Communication structure and Extract structure will be added
    &#61656;Then at the file + could be seen. 3 types of version 
    1)active2)modify 3) Delivery
    &#61656;     On the dat source the file could be seen a right click on it. Then apop up screen opens & select the option Replica data source after this. Take the file right click on it. Then a pop up screen opens then select the option Assign Info Source.
    &#61656;     Then a screen opens then select the option content & click Continue.
    &#61656;     Non SAP systems are known as Legacy System.
    &#61656;     The place which is hard to extract is business content 
    Regards
    Ashwin

  • ECC6.0 - PDF issue - Junk Character output after Upgrade from 4.7c

    Hi All,
    I am working in Uprgade project(from 4.7c Non-unicode system to ECC6.0 unicode system).
    We are facing PDF output issue in ECC6.0 that means we are getting junk character output(screenshot is attached for your reference).
    In 4.7c , we have stroed the OTF data in table after generated from smartform as we should not get different output in future. Whenever we need output of the same then we are getting the OTF data from that table and we will generate pdf through "Convert_otf" function module.This logic is working fine in 4.7c.
    In ECC6.0 ,the same logic is not working as system is unicode sytem and we are getting junk character output.
    As per my old upgrade project experience , i have used the below piece of code for solve this junk character issue but still I am facing the same issue.
    Kindly note that in my old upgrade project i have regenerated the OTF data in ECC6.0 and used the below piece of code then I got correct output but here I have to use the old OTF data (from table) which was generated in 4.7c.
    Please any one can give solution for this issue.
    Regards
    Anandakumar.K
    +91 9486963561.
    REPORT  z_display_notification_tst.
    Local Vairable Declaration
    TYPES: lt_pdf_table(1000) TYPE x.
    Local Vairable Declaration
    DATA :
      lv_otf_data         TYPE STRING,            " OTD data in string format
      lv_length           TYPE i,                                   " OTF Length
      lv_lines            TYPE i,                                   " No of lines
      lv_no_of_recs       TYPE int4,                                " No of OTF Lines
      lv_offset           TYPE int4,                                " Offset
      pdf_fsize           TYPE  i,
      lv_binfile          TYPE xstring,
      gv_reportsize       TYPE i,
      l_url(80) TYPE c,
      l_pdf_data TYPE STANDARD TABLE OF lt_pdf_table ,
      l_pdf_line TYPE lt_pdf_table,
      l_offset TYPE i,
      l_len TYPE i,
      lt_pdf_table        TYPE rcl_bag_tline,
      lt_otfdata          TYPE tsfotf,
      ls_otfdata          TYPE itcoo.                               " Line type of OTF data
    DATA:
        g_html_container TYPE REF TO cl_gui_custom_container,
        g_html_control   TYPE REF TO cl_gui_html_viewer.
    ******************GET OTF data from Table ******************************
    Primary Keys used for selection : BUSKEY,
                                      NTFTYP,
                                      TRNTYP,
    SELECT SINGLE otf_data FROM znotif_otf
                           INTO lv_otf_data
                          WHERE buskey EQ 'LS_000000000010001470'
                            AND ntftyp EQ '0037'
                            AND trntyp EQ 'ACT'.
    Get the length of the OTF data stored as stream of string************
      l_len = STRLEN( lv_otf_data ).
    Compute the OTF lines
      lv_lines = l_len / 72.
      lv_no_of_recs = lv_lines + 1.
    Set the offset to initial
      lv_offset = 0.
    *Reconstruct the OTF data from the string
      DO  lv_no_of_recs TIMES.
        IF sy-index NE lv_no_of_recs .
    Get OFT format: command ID
          ls_otfdata-tdprintcom  = lv_otf_data+lv_offset(2).
          lv_offset = lv_offset + 2.
    Get OTF format: command parameters
          ls_otfdata-tdprintpar  = lv_otf_data+lv_offset(70).
          lv_offset = lv_offset + 70.
        ELSE.
    Last line contains only the OFT format: command ID  "//" (End of file)
          ls_otfdata-tdprintcom  = lv_otf_data+lv_offset(2).
          lv_offset = lv_offset + 2.
        ENDIF.
    Append the OTF data to Export OTF table
        APPEND ls_otfdata TO lt_otfdata.
        CLEAR ls_otfdata.
      ENDDO.
    *************************Convert OTF to PDF**************************
    IF lt_otfdata IS NOT INITIAL.
      clear: lv_binfile,
             pdf_fsize.
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
        IMPORTING
          bin_filesize          = pdf_fsize
          bin_file              = lv_binfile
        TABLES
          OTF                   = lt_otfdata
          lines                 = lt_pdf_table
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          OTHERS                = 4.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDIF.
    Call screen***********************************
    Call screen
    CALL SCREEN 100.
    RETURN.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
    SET PF-STATUS '100'.
    SET TITLEBAR '100'.
    Convert bin file
      clear :l_len,
             l_offset.
      free l_pdf_data[].
    l_len = XSTRLEN( lv_binfile ).
    WHILE l_len >= 1000.
      l_pdf_line = lv_binfile+l_offset(1000).
      APPEND l_pdf_line TO l_pdf_data.
      ADD 1000 TO l_offset.
      SUBTRACT 1000 FROM l_len.
    ENDWHILE.
    IF l_len > 0.
      l_pdf_line = lv_binfile+l_offset(l_len).
      APPEND l_pdf_line TO l_pdf_data.
    ENDIF.
    Initialise and create the HTML container
      IF NOT g_html_container IS INITIAL.
        CALL METHOD g_html_container->free
          EXCEPTIONS
            OTHERS = 0.
        CLEAR g_html_container.
      ENDIF.
      CREATE OBJECT g_html_container
        EXPORTING
          container_name = 'HTML_CONTAINER'.
    Initialise and create the HTML control that will display the
    PDF output as URL
      IF NOT g_html_control IS INITIAL.
        CALL METHOD g_html_control->free
          EXCEPTIONS
            OTHERS = 0.
        CLEAR g_html_control.
      ENDIF.
      CREATE OBJECT g_html_control
        EXPORTING
          parent   = g_html_container
          saphtmlp = 'X'.
    Load the pdf data and obtain the URL
      CALL METHOD g_html_control->load_data
        EXPORTING
          size         = pdf_fsize
          type         = 'application'
          subtype      = 'pdf'
         IMPORTING
          assigned_url = l_url
        CHANGING
        data_table    = l_pdf_data
       EXCEPTIONS
          OTHERS = 1.
      IF sy-subrc NE 0.
       raise cntl_error.
      ENDIF.
      CALL METHOD cl_gui_cfw=>flush.
    Show the URL
      CALL METHOD g_html_control->show_url
        EXPORTING
          url      = l_url.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    Edited by: Anandakumar.K on Oct 25, 2011 12:47 PM
    Edited by: Anandakumar.K on Oct 25, 2011 12:54 PM

    Hi,
    as you can see in SAP notes 842767 and 1349413, spool data cannot be converted properly for all types in a Unicode conversion.
    This might be possible if you have English (US7ASCII) characters only, but with Chinese characters I do not think that a small piece of code can do it ...
    Hence I think you need to recreate the data on the Unicode system ...
    Best regards,
    Nils Buerckel
    Edited by: Nils Buerckel on Nov 3, 2011 1:51 PM

  • Issue in wm during posting differences in li21

    Hi
    i have an issue in ecc6 R/3 sap LE-WM, when i am doing confirmation in LT12 and haveing some differences that are posted to the 999 storage type. When i am clearing differences in LI21 i am getting error NO MATERIAL DOCUMENT WAS CREATED, ERRORS OCCURED DURING POSTING, THERE IS NO ITEM CATEGORY ASSIGNED TO ACCOUNT 233000/INT. hOW TO SOLVE THIS PROBLEM
    Narendra kumar

    Hello Narendra,
    When you clear the inventory difference with LI21 at that time system is trying to create material document and to post the difference in this g/l account "233000" for CoA INT and it finds problem.
    Please copy the detailed message or contact FI expert.
    Regards
    Arif Mansuri

  • GL account and cost center field appearing for Goods issue movt type 201

    Hi SAP Gurus
    We are trying to post goods issue in ecc6 . The problem is that the GL Account and cost center fields are available fields .The cost center field is logical but why the GL account field is avaiable .
    How we can grey out the same field as it is going to be picked up from the valuation class setting in GBB - VBR ? Any ideas
    Regards
    Hitesh

    Hi Ravi
    You think that its ok we have to input the cost center .
    But if you allow the users to input the GL then you are overriding the whole purpose of defining the valuation class and offsetting entries ? What is your opinion ?When you input the material in the goods issue screen the offsetting entry needs to be picked from the GBB -VBR .Although even if you do not enter the GL the system posts the Godds issue document .But from the control perspective this needs to be suppressed .
    What do you think ?
    I have also posted the same in Logistics forum .
    Once  again many thanks for your help .In case you find some solution this would be of great help
    Regards

  • ECC6 - ALV Grid Output Conversion Exit

    Hi,
    I'm creating a program in ECC6 to display the report in ALV grid by called FM: REUSE_ALV_GRID_DISPLAY.
    EG: Select field (TPLNR) from table IFLOT. Value retrieved are: ?0100000000000000029. However, the output doesnt do the conversion exit to change the TPLNR value to format MY.FO.001.
    I did the same in 4.6C system, the ALV report able to display the correct value of TPLNR. Eg: MY.FO.001 instead of
    ?0100000000000000029.
    If anyone encountered the same issues in ECC6 system which In an ALV grid, it doesnt to display data that is based on a domain with a conversion exit?

    Hi Simone,
    Check this NO_CONVEXT in the Structure LVC_S_FCAT. Populate with SPACE in the FCAT Build.
    If you have conversion Exit to that field then use the CONVEXIT in the same structure while building Field Catalog. sometimes you have Z converions so you need to check this.
    If you a Table field in the FCAT then you dont need all these things. because conversion exits are automatically done. Also COL_OPT = 'X' this will align the ALV in the correct format for output. hope this helps.

  • During PGI for inbound delivery it is giving an error message in ECC6.0

    I am getting an error message  during processing a serialized production order through one custom transaction. In that program FM BAPI_GOODSMVT_CREATE is used to create inbound delivery . After the inbound delivery is created it is giving  error messages
    'System status ESTO is Active (EQUXXXXXX)'
    'Check the status of the Serial Number XXXXXXX'
    'Serial Number cannot be used here'
    'Termination of goods issue posting of delivery item XXXXX'
    and it does not create the PGI for the delivery.
    I have done the same steps in 4.7 system but did not get any error and posting of goods issue has also done successfully but in ECC6.0 system I am getting this error from BAPI_GOODSMVT_CREATE.
    If anyone have faced this issue in ECC6.0 then please help.....

    ESTO means "in the warehouse".  Looks like you may be trying to receive a serial no. you already have received?

Maybe you are looking for