For this program i could send the smart form thru mail but in the inbox ..

*& Report  ZSFOO
REPORT  ZSFOO.
*& Report  ZSFINV
TABLES : KNA1,         " General Data In Customer Master
         KNB1,         " Customer Master(Company Code)
         BSID,         " Accounting: Secondary Index for Customers
         ZSMARTFORM,   " Custom table for Storing Bank Details
         zsf_exp_inv,  " Structure that stores required fields from all tables used
         KNVK.         " Customer Master Contact Partner
data : Begin of it_struct occurs 0.
        include structure zsf_exp_inv01.
data : End of it_struct.
types : begin of ty_bsid,
        kunnr like bsid-kunnr,
        WAERS like bsid-WAERS,
        XBLNR LIKE BSID-XBLNR,
        BUDAT LIKE BSID-BUDAT,
        WRBTR LIKE BSID-WRBTR,
        BUKRS LIKE BSID-BUKRS,
        end of ty_bsid.
types : begin of ty_kna1,
        kunnr like kna1-kunnr,
        NAME1 LIKE KNA1-NAME1,
        STRAS LIKE KNA1-STRAS,
        MCOD3 LIKE KNA1-MCOD3,
        LAND1 LIKE KNA1-LAND1,
        SORTL LIKE KNA1-SORTL,
        end of ty_kna1.
types : begin of ty_knb1,
        kunnr like knb1-kunnr,
        ZTERM LIKE KNB1-ZTERM,
        end of ty_knb1.
types : begin of ty_knVK,
        kunnr like kNVK-kunnr,
        NAME1 LIKE KNVK-NAME1,
        end of ty_knVK.
types : begin of ty_ZSMARTFORM,
        SNO      LIKE ZSMARTFORM-SNO,
        CURRENCY LIKE zsmartform-currency,
        BANKNAME LIKE zsmartform-bankname,
        ADDRESS1 LIKE ZSMARTFORM-ADDRESS1,
        ADDRESS2 LIKE ZSMARTFORM-ADDRESS2,
        ADDRESS3 LIKE ZSMARTFORM-ADDRESS3,
        ADDRESS4 LIKE ZSMARTFORM-ADDRESS4,
        ADDRESS5 LIKE ZSMARTFORM-ADDRESS5,
        ADDRESS6 LIKE ZSMARTFORM-ADDRESS6,
        VALIDFROM LIKE ZSMARTFORM-VALIDFROM,
        VALIDTO   LIKE ZSMARTFORM-VALIDTO,
        end of ty_ZSMARTFORM.
data : it_bsid type table of ty_bsid,
       it_kna1 type table of ty_kna1,
       it_knb1 type table of ty_knb1,
       it_zsmartform type table of ty_zsmartform,
       it_knVK type table of ty_kNVK.
data : wa_bsid like line of it_bsid,
       wa_kna1 like line of it_kna1,
       wa_knb1 like line of it_knb1,
       wa_zsmartform like line of it_zsmartform,
       wa_knVK like line of it_knVK.
*****************Selection Screen**********************************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
SELECT-OPTIONS : S_KUNNR FOR KNA1-KUNNR,
                 S_belnr FOR BSID-belnr,
                 S_BUKRS FOR BSID-BUKRS,
                 S_CURR FOR ZSMARTFORM-CURRENCY.
SELECTION-SCREEN END OF BLOCK B1.
DATA : BEGIN OF IT_PARAM OCCURS 0.
        INCLUDE STRUCTURE ZPARAMETERS.
DATA :  END OF IT_PARAM.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
SKIP 1.
Parameters : OPTION1 AS CHECKBOX,
             P_POINF(300) type c,
             OPTION2 AS CHECKBOX,
             P_DESC(300) TYPE C,
             OPTION3 AS CHECKBOX,
             P_MONTH(200) TYPE C,
             OPTION4 AS CHECKBOX,
             P_RATE(100)  TYPE C.
SELECTION-SCREEN END OF BLOCK B2.
**********************PARAMETERS***********************************
data :  l type i,
        Y(300) type c,
        j type i,
        k type i value 1,
        s type i,
        m(300) type c,
        p type i,
        z type i.
data :  l1 type i,
        Y1(300) type c,
        j1 type i,
        k1 type i value 1,
        s1 type i,
        m1(300) type c,
        p1 type i,
        z1 type i.
data :  l2 type i,
        Y2(300) type c,
        j2 type i,
        k2 type i value 1,
        s2 type i,
        m2(300) type c,
        p2 type i,
        z2 type i.
data :  l3 type i,
        Y3(300) type c,
        j3 type i,
        k3 type i value 1,
        s3 type i,
        m3(300) type c,
        p3 type i,
        z3 type i.
IF OPTION1 = 'X'.
  concatenate  P_POINF  ',' into P_POINF.
  l = strlen( P_POINF ).
  do l times.
    Y = P_POINF+j(k).
    case Y.
      when ','.
        m = P_POINF+s(z).
        s = j + 1.
        z = -1.
        p = p + 1.
        if p = 1.
          IT_PARAM-LINE1 = m.
        endif.
        if p = 2.
          IT_PARAM-LINE2 = m.
        endif.
        if p = 3.
          IT_PARAM-LINE3 = m.
        endif.
     when '.'.
        if p = 4.
          IT_PARAM-LINE4 = m.
        endif.
    endcase.
    j = j + 1.
    z = z + 1.
  enddo.
ENDIF.
IF OPTION2 = 'X'.
  concatenate  P_DESC  ',' into P_DESC.
  l1 = strlen( P_DESC ).
  do l1 times.
    Y1 = P_DESC+j1(k1).
    case Y1.
      when ','.
        m1 = P_DESC+s1(z1).
        s1 = j1 + 1.
        z1 = -1.
        p1 = p1 + 1.
        if p1 = 1.
          IT_PARAM-LINE5 = m1.
        endif.
        if p1 = 2.
          IT_PARAM-LINE6 = m1.
        endif.
        if p1 = 3.
          IT_PARAM-LINE7 = m1.
        endif.
     when '.'.
        if p1 = 4.
          IT_PARAM-LINE8 = m1.
        endif.
    endcase.
    j1 = j1 + 1.
    z1 = z1 + 1.
  enddo.
ENDIF.
IF OPTION3 = 'X'.
  concatenate  P_MONTH  ',' into P_MONTH.
  l2 = strlen( P_MONTH ).
  do l2 times.
    Y2 = P_MONTH+j2(k2).
    case Y2.
      when ','.
        m2 = P_MONTH+s2(z2).
        s2 = j2 + 1.
        z2 = -1.
        p2 = p2 + 1.
        if p2 = 1.
          IT_PARAM-LINE9 = m2.
        endif.
        if p2 = 2.
          IT_PARAM-LINE10 = m2.
        endif.
        if p2 = 3.
          IT_PARAM-LINE11 = m2.
        endif.
     when '.'.
        if p2 = 4.
          IT_PARAM-LINe12 = m2.
        endif.
    endcase.
    j2 = j2 + 1.
    z2 = z2 + 1.
  enddo.
ENDIF.
IF OPTION4 = 'X'.
  concatenate  P_RATE  ',' into P_RATE.
  l3 = strlen( P_RATE ).
  do l3 times.
    Y3 = P_RATE+j3(k3).
    case Y3.
      when ','.
        m3 = P_RATE+s3(z3).
        s3 = j3 + 1.
        z3 = -1.
        p3 = p3 + 1.
        if p3 = 1.
          IT_PARAM-LINE13 = m3.
        endif.
        if p3 = 2.
          IT_PARAM-LINE14 = m3.
        endif.
        if p3 = 3.
          IT_PARAM-LINE15 = m3.
        endif.
        if p3 = 4.
          IT_PARAM-LINe16 = m3.
        endif.
    endcase.
    j3 = j3 + 1.
    z3 = z3 + 1.
  enddo.
ENDIF.
APPEND IT_PARAM.
select * from kna1 into corresponding fields of table it_kna1 where kunnr in s_kunnr.
select * from knb1 into corresponding fields of table it_knb1 for all entries in it_kna1 where kunnr = it_kna1-kunnr.
select * from bsid into corresponding fields of table it_bsid for all entries in it_kna1 where kunnr = it_kna1-kunnr and belnr in s_belnr and bukrs in s_bukrs..
SELECT * FROM KNVK INTO CORRESPONDING FIELDS OF TABLE IT_KNVK FOR ALL ENTRIES IN IT_KNA1 WHERE KUNNR = IT_KNA1-KUNNR.
select * from zsmartform into corresponding fields of table it_zsmartform .
DATA :  AMT LIKE SPELL.
loop at it_bsid into wa_bsid.
  read table it_kna1 into wa_kna1 with key kunnr = wa_bsid-kunnr.
  read table it_knb1 into wa_knb1 with key kunnr = wa_bsid-kunnr.
  read table it_zsmartform into wa_zsmartform with key  CURRENCY =  wa_bsid-WAERS.
  READ TABLE IT_KNVK INTO WA_KNVK WITH KEY KUNNR = WA_BSID-KUNNR.
  it_struct-name1 = wa_kna1-name1.
  it_struct-stras = wa_kna1-stras.
  it_struct-mcod3 = wa_kna1-mcod3.
  it_struct-land1 = wa_kna1-land1.
  it_struct-sortl = wa_kna1-sortl.
  it_struct-zterm = wa_knb1-zterm.
  it_struct-xblnr = wa_bsid-xblnr.
it_struct-currency = wa_zsmartform-currency.
  it_struct-currency = wa_bsid-waers.
  it_struct-budat = wa_bsid-budat.
  it_struct-BANKNAME = wa_zsmartform-BANKNAME.
  it_struct-ADDRESS1 = wa_zsmartform-ADDRESS1.
  it_struct-ADDRESS2 = wa_zsmartform-ADDRESS2.
  it_struct-ADDRESS3 = wa_zsmartform-ADDRESS3.
  it_struct-ADDRESS4 = wa_zsmartform-ADDRESS4.
  it_struct-ADDRESS5 = wa_zsmartform-ADDRESS5.
  it_struct-ADDRESS6 = wa_zsmartform-ADDRESS6.
  it_struct-CURR = WA_BSID-WRBTR.
  IT_STRUCT-NAME = WA_KNVK-NAME1.
IT_STRUCT-AMOUNT = IT_SPELL-AMT.
  append it_struct.
endloop.
data : x type i,
       x1 type i,
       a type string.
loop at it_struct.
  x = strlen( it_struct-curr ).
  x1 = x - 3.
  a = it_struct-curr+0(x1).
  CALL FUNCTION 'SPELL_AMOUNT'
      EXPORTING
        AMOUNT          = a
  CURRENCY        = ' '
  FILLER          = ' '
  LANGUAGE        = SY-LANGU
      IMPORTING
        IN_WORDS        = AMT.
EXCEPTIONS
  NOT_FOUND       = 1
  TOO_LARGE       = 2
  OTHERS          = 3
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
endloop.
DATA: ws_ucomm LIKE sy-ucomm.
DATA: form_name TYPE rs38l_fnam.
DATA: wa_ctrlop TYPE ssfctrlop,
wa_outopt TYPE ssfcompop.
data : i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
      i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: t_otfdata TYPE ssfcrescl,
t_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
      i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
  data : wa_objhead TYPE soli_tab,
  wa_doc_chng typE sodocchgi1,
      w_data TYPE sodocchgi1,
      wa_buffer TYPE string,
      v_len_in LIKE sood-objlen,
      v_len_out LIKE sood-objlen,
      v_len_outn TYPE i,
      v_lines_txt TYPE i,
      v_lines_bin TYPE i.
DATA: t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE.
DATA: w_filesize TYPE string.
DATA: w_bin_filesize TYPE i.
wa_ctrlop-getotf = 'X'.
CALL FUNCTION '/1BCDWB/SF00000001'
EXPORTING
control_parameters = wa_ctrlop
output_options = wa_outopt
user_settings = 'X'
IN_WORDS = amt
importing
job_output_info = t_otfdata
TABLES
I_ZSF_EXP_INV = it_struct
I_ZPARAMETERS = it_param.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
t_otf[] = t_otfdata-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = w_bin_filesize
TABLES
otf = t_otf
lines = t_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4
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 'WS_DOWNLOAD'
EXPORTING
bin_filesize = w_bin_filesize
CODEPAGE = ' '
filename = 'c:     est59.PDF'
filetype = 'BIN'
IMPORTING
filelength = w_filesize
TABLES
data_tab = t_pdf_tab
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10
IF sy-subrc <> 0.
*You should include message-id in the report heading
WRITE : sy-subrc.
ELSE.
WRITE : 'File Test.pdf downloaded succesfully'.
ENDIF.
loop at t_pdf_tab.
    translate t_pdf_tab using '~'.
    concatenate wa_buffer t_pdf_tab into wa_buffer.
  endloop.
  translate wa_buffer using '~'.
  do.
    i_record = wa_buffer.
    append i_record.
    shift wa_buffer left by 255 places.
    if wa_buffer is initial.
      exit.
    endif.
  enddo.
Attachment
  refresh:
    i_reclist,
    i_objtxt,
    i_objbin,
    i_objpack.
  clear wa_objhead.
  i_objbin[] = i_record[].
Create Message Body
Title and Description
  i_objtxt = 'test with pdf-Attachment!'.
  append i_objtxt.
  describe table i_objtxt lines v_lines_txt.
  read table i_objtxt index v_lines_txt.
  wa_doc_chng-obj_name = 'smartform'.
  wa_doc_chng-expiry_dat = sy-datum + 10.
  wa_doc_chng-obj_descr = 'smartform'.
  wa_doc_chng-sensitivty = 'O'.
  wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
  clear i_objpack-transf_bin.
  i_objpack-head_start = 1.
  i_objpack-head_num = 0.
  i_objpack-body_start = 1.
  i_objpack-body_num = v_lines_txt.
  i_objpack-doc_type = 'RAW'.
  append i_objpack.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
CONCATENATE 'Hazard report-' p_load '.pdf' INTO i_objpack-obj_descr.
describe table i_objbin lines v_lines_bin.
read table i_objbin index v_lines_bin.
i_objpack-doc_size =  v_lines_bin * 255 .
i_objpack-obj_descr = 'test'.
i_objpack-doc_size = v_lines_bin * 255.
APPEND i_objpack.
Attachment
(pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
Länge des Attachment ermitteln
describe table i_objbin lines v_lines_bin.
read table i_objbin index v_lines_bin.
i_objpack-doc_size =  v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
append i_objpack.
  clear i_reclist.
  i_reclist-receiver = '[email protected]'.
     i_reclist-express = 'X'.
  i_reclist-rec_type = 'U'.
  append i_reclist.
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
         EXPORTING
              document_data              = wa_doc_chng
              COMMIT_WORK = 'X'
              put_in_outbox              = 'X'
         TABLES
              packing_list               = i_objpack
              object_header              = wa_objhead
              CONTENTS_BIN               = i_objbin
              contents_txt               = i_objtxt
              receivers                  = i_reclist
         EXCEPTIONS
              too_many_receivers         = 1
              document_not_sent          = 2
              document_type_not_exist    = 3
              operation_no_authorization = 4
              parameter_error            = 5
              x_error                    = 6
              enqueue_error              = 7
              others                     = 8.
for this program i could send the smart form thru mail but in the inbox i could not
download it it says needed to be decoded properly.file not starting with pdf....
   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 'POPUP_TO_INFORM'
       EXPORTING
         titel = 'Mail sent'(003)
         txt1  = 'The report is sent via e-mail.'(004)
         txt2  = '  '.
     LEAVE PROGRAM.
   ENDIF.

hi krishna,
u r right. there is no error  in sending the mail and the file but the problem is that file created and converted to pdf is not done properly.jst verify whether the file is created properly or not .thats the only problem that can occurs else ur program is absolutely right.

Similar Messages

  • Getting error while activating the smart form

    hi guys,
    i am getting the following run time error while activating the smart-form.
    'SQL error in the database when accessing a table'.
    can anyone tell why this error is coming

    Refer to the below link, it may help you to close the thread.
    [SQL error in the database when accessing a table|SQL error in the database when accessing a table.;
    Regards,
    saiRam

  • Driver program for the Smart form

    Hi all.
    I have an issue in smart forms.
    we are implementing RE(Real Estate) module with the version ECC 6.0.
    In the RE ,for printing the forms.I know the name of the SMART form only.
    how can i know the corresponding Driver program.
    Plaese help me to solve this issue.
    Thanks on advance,
    Regards,
    Eswar

    Hi,
    You can get your driver program name from tnapr table but some are also configured from others way also.
    Try this will work in any case.
    Open your Smartform then execute.
    Then function module name is displayed
    Open function module and put a break point on first executable statement.
    May be break point on statement like
    CLEAR DOCUMENT_OUTPUT_INFO.
    After giving breakpoint trigger your Smartform for printing in fresh session then it will stop in debug mode then in call tab you can see your driver program name.

  • Severa years ago I purchased online Adobe Creative Suite, I recently had to change computers, and lost the program, when i attempted to restore from a cd i received a notice that my serial number was incorrect??? I paid a lot of money for this program I w

    severa years ago I purchased online Adobe Creative Suite, I recently had to change computers, and lost the program, when i attempted to restore from a cd i received a notice that my serial number was incorrect??? I paid a lot of money for this program I want this corrected.@

    Hi gutturnio,
    Kindly provide the below mentioned details in a "Private Message" so that we can assist you appropriately.
    Product your are trying to install:
    OS version:
    Order #:
    Serial #:
    Email Id on which you have registered the serial number:
    There could also be an issue with the compatibility of the software and operating system you are using.
    Kindly check system requirements:
    CS 6: System requirements | Adobe Creative Suite 6
    System requirements | Photoshop 
    Meanwhile, try:
    Error "The serial number is not valid for this product" | Creative Suite 
    Invalid serial number error
    Thanks,
    Atul Saini

  • How to get the PO no in the smart form and in the print program from ME23N

    hello all,
                     I am new to smart form printing.I want to make a smartform along with print program that will show PO Details.It has to be created as an o/p type in ME23N. I have created an o/p type ZPO using NACE ..Can some one tell me how to get the PO number in the smart form and in the print program  from ME23N ,so that I can then program the necessary calculations?plz help me with the code.Thanks in advance.
    Subhabrata.

    Hello Everyone,
    I am new to the forum and also to abap.
    Excuse me if it is a basic question.
    I am taking care of the output types.
    This is 1st time SAP will be implemented .
    For purchase order , I go to NACE ---EF----NEU---Processing routines
    print output---SAPFM06P---ENTRY_NEU----MEDRUCK
    FAX-----------SAPFM06P---ENTRY_NEU----MEDRUCK
    EDI------------RANASTED--EDI_PROCESSING
    DISTRIBUTION(ALE)---RANASTED---ALE_PROCESSING
    Are the above settings fine ?
    What are the standard programs for the PO outputs . I am looking for the smartforms and the driver program .
    I searched and found that IN ECC 6 , we have to install OSS notes .
    Gurus, please help  me . Let me know what all oss notes be implemented and how to proceed from here .
    Any help will be greatly appreciated ,
    Monalisa

  • Payment method(s) are not allowed for this program / Program RFFOAVIS_FPAYM

    Dear Friends,
    In Se38  abap editor, I entered the program RFFOM100, i entered the details program run date,identification future,paying company code,payment methods T, House bank, Account Id and executed the program. I am getting the error 'Payment method(s) are not allowed for this program'.
    Payment method S is not used in F110, It was not mentioned in vendor master or vendor invoice.It is not mentioned in fbzp in bank determination. When i tried to delete payment method 'S' the system shows a message Payment Method S is being used in the company code.
    In  the program RFFOAVIS_FPAYM, i entered the details program run date,identification future,paying company code,payment methods T, House bank, Account Id and executed the program. I am getting the error  'Program RFFOAVIS_FPAYM: No records selected'. But there open items or invoices.
    Please suggest how to resolve the errors.
    Regards
    Sridhar

    Hello,
    Why are you directly executing these programs?
    You will not expect these program to execute directly by going to SE38.
    I would have configured the relevant payment methods in the country with DME structure or classical RFFO* programs, which in turn pick up the inherent programs at the time of running F110.
    For example, if you need to generate BACS file for country GB, either you copy the GB_BACS to ZGB_BACS or use GB_BACS directly in FBZP settings.
    Make sure that you have maintained OBPM1 / OBPM2 / OBPM3 and OBPM4 settings properly.
    The system automatically gives the access to system RFFOAVIS_FPAYM. Prepare a variant against this program in F110. Relevant file gets generated to folder path mentioned in OBPM4 will get generated. The file get generated can be seen in AL11.
    Hope this is informative and solves your issue.
    Regards,
    Ravi

  • How to improve performace for this program

    Hi,
    I want to improve performance for this program.Pls help me.Here is the code.
    Thanks
    kumar
    --# SCCS: @(#)nscdprpt_rpt_fam_fweq_detail_aggr_dml.sql     2.1 08/17/05 12:16:11
    --# Location: /appl/dpdm/src/sql/SCCS/s.nscdprpt_rpt_fam_fweq_detail_aggr_dml.sql
    -- =============================================================================
    -- Purpose:
    -- DML Script to calculate aggregate rows from table NSCDPRPT.RPT_FAM_FWEQ_DETAIL
    -- inserts one (1) monthly total row for each comparison type (6 of them)
    -- Modification History
    -- Date Version Who What
    -- 28-Jun-05 V1.00 J. Myers Initial Version
    -- 17-Aug-05 gzuerc Replaced UNION ALL code with INSERT's to avoid
    -- Oracle error out of undo tablespace.
    -- ============================================================================
    -- NOTES:
    -- This process pulls data from RPT_FAM_FWEQ_DETAIL table.
    -- The target table RPT_FAM_FWEQ_DETAIL_AGGR is truncated by plan_ctry and loaded daily;
    -- it is the data used in the Forecast Accuracy Measurements Report.
    -- The input data is 'wide' (6 quantities), and this script outputs a single
    -- row for each quantity as a 'thin' table (single column F1_QTY and F2_QTY shared by all quantities), and
    -- with a ROW_TYPE = 'TOTAL'
    -- Two (2) other scripts add additional rows to this table as follows:
    -- 1) nscdprpt_rpt_fam_FWEQ_detail_aggr_sesn_avg_dml.sql => calculates the
    -- total quantities F1_QTY, F2_QTY and AE for each LEVEL_VALUE
    -- 2) nscdprpt_rpt_fam_FWEQ_detail_aggr_pct_swg_dml.sql => calculates the
    -- percent swing in quantities between DISP_EVENTS for each grouping
    -- of PLAN_CTRY, DIVISION, SEASON and TRG_EVENT_NUM for only LEVEL_TYPE = 'SUB_CAT'
    -- =============================================================================
    -- The result set from joining RPT_FAM_FWEQ_DETAIL rows with comparison types
    -- is inserted into the table RPT_FAM_FWEQ_DETAIL_AGGR
    INSERT INTO rpt_fam_FWEQ_detail_aggr
    SELECT plan_ctry,
    division,
    season,
    monthly_seq,
         bucket_month_date,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    compare_name,
    first_display_event_num,
    level_type,
    level_value,
    'TOTAL' AS row_type,
    material,
    key_material,
    sap_cat_cd,
    sap_cat_desc,
    sap_sub_cat_cd,
    sap_sub_cat_desc,
    sty_colr_sdesc,
    sty_grp_nbr,
    sty_grp_desc,
    matl_typ,
    sap_prod_typ_grp, -- 'Type Group' in Brio
    typ_grp_desc, -- 'Type Group' in Brio
    curr_prod_i2_life_cyc_cd,
    NULL AS promo_ind, -- for future use
    -- Each RPT_FAM_FWEQ_DETAIL row's eight (8) quantity columns are broken down
    -- into F1_QTY from DISP_aaaa_QTY, F2_QTY from TRG_aaaa_QTY and
         -- AE from aaaa_AE where 'aaaa' is equal to one of the COMPARE_TYPEs below:
    -- F1_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    disp_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    disp_net_qty
    WHEN compare_type = 'NET_AO' THEN
    disp_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    disp_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    disp_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    disp_auth_futr_qty
    END as f1_qty,
    -- F2_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    trg_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    trg_net_qty
    WHEN compare_type = 'NET_AO' THEN
    trg_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    trg_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    trg_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    trg_auth_futures_qty
    END as f2_qty,
    -- AE
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    abs(disp_dlvry_plan_qty - trg_dlvry_plan_qty)
    WHEN compare_type = 'NET' THEN
    abs(disp_net_qty - trg_net_qty)
    WHEN compare_type = 'NET_AO' THEN
    abs(disp_ao_qty - trg_ao_qty)
    WHEN compare_type = 'NET_FTRS' THEN
    abs(disp_futr_qty - trg_futr_qty)
    WHEN compare_type = 'NET_REPLENS' THEN
    abs(disp_replen_qty - trg_replen_qty)
    WHEN compare_type = 'AUTH_FTRS' THEN
    abs(disp_auth_futr_qty - trg_auth_futures_qty)
    END as ae,
    SYSDATE AS zz_insert_tmst
    FROM
    -- The following in-line view provides three (3) result sets from the RPT_FAM_FWEQ_DETAIL table
         -- This in-line view returns only LEVEL_NUM = 1 or LEVEL_TYPE = 'SUB_CAT' data
         SELECT plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         -- The following NULL'd columns' values cannot be saved due to aggregation
         NULL AS material,
         NULL AS key_material,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         NULL AS sty_colr_sdesc,
         NULL AS sty_grp_nbr,
         NULL AS sty_grp_desc,
         NULL AS matl_typ,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc, -- 'Type Group' in Brio
         NULL AS curr_prod_i2_life_cyc_cd,
         sum(disp_net_qty) AS disp_net_qty,
              sum(trg_net_qty) AS trg_net_qty,
         -- ABS(sum(trg_net_qty) - sum(disp_net_qty)) AS net_AE,
         sum(disp_dlvry_plan_qty) AS disp_dlvry_plan_qty,
              sum(trg_dlvry_plan_qty) AS trg_dlvry_plan_qty,
         -- ABS(sum(trg_dlvry_plan_qty) - sum(disp_dlvry_plan_qty)) AS dlvry_plan_AE,
         sum(disp_futr_qty) AS disp_futr_qty,
              sum(trg_futr_qty) AS trg_futr_qty,
         -- ABS(sum(trg_futr_qty) - sum(disp_futr_qty)) AS futr_AE,
         sum(disp_ao_qty) AS disp_ao_qty,
              sum(trg_ao_qty) AS trg_ao_qty,
         -- ABS(sum(trg_ao_qty) - sum(disp_ao_qty)) AS ao_AE,
         sum(disp_replen_qty) AS disp_replen_qty,
              sum(trg_replen_qty) AS trg_replen_qty,
         -- ABS(sum(trg_replen_qty) - sum(disp_replen_qty)) AS replen_AE,
         sum(disp_futr_qty) AS disp_auth_futr_qty,
              sum(trg_auth_futures_qty) AS trg_auth_futures_qty --,
         -- ABS(sum(trg_auth_futures_qty) - sum(disp_futr_qty)) AS auth_futures_AE
         FROM rpt_fam_FWEQ_detail
         WHERE plan_ctry &where_plan_ctry
         and level_num = 1 -- 'SUB-CAT'
         -- AND (promo_ind <> 'Y' OR promo_ind IS null)
         GROUP BY plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc -- 'Type Group' in Brio
         ) dtl,
         -- The following in-line view returns all of the different combinations
         -- of comparison types in the RPT_FAM_FWEQ_DETAIL table
         -- This select returns the pairing of all forecast types
         SELECT event_type, compare_type, compare_name
         from
         (SELECT event_type, compare_type, compare_type_description || ' to ' || compare_type_description AS compare_name
         FROM rpt_fam_compare_types
         WHERE event_type = 'FCST'
         UNION
         -- This select returns the pairing of all bookings types with forecast types
         SELECT bkng.event_type, fcst.compare_type, bkng.compare_type_description || ' to ' || fcst.compare_type_description AS compare_name
         FROM rpt_fam_compare_types fcst,
         rpt_fam_compare_types bkng
         WHERE fcst.event_type = 'FCST'
         AND bkng.event_type = 'BKNG'
         AND fcst.compare_type = bkng.compare_type
         WHERE event_type || ' ' || compare_type <> 'FCST AUTH_FTRS'
         AND compare_type NOT IN ('NET_SHIP', 'SHIP_NET_FTRS', 'NET_ETS', 'GROSS_FTRS')
         ) cmpr
    -- The two (2) in-line views are joined by EVENT_TYPE (i.e. 'FCST' and 'BKNG')
    -- to form a product of all RPT_FAM_FWEQ_DETAIL rows with comparison types
    WHERE dtl.trg_event_type = cmpr.event_type
    ORDER BY plan_ctry,
    division,
    season,
    monthly_seq,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    first_display_event_num,
    level_type,
    level_value
    COMMIT
    INSERT INTO rpt_fam_FWEQ_detail_aggr
    SELECT plan_ctry,
    division,
    season,
    monthly_seq,
         bucket_month_date,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    compare_name,
    first_display_event_num,
    level_type,
    level_value,
    'TOTAL' AS row_type,
    material,
    key_material,
    sap_cat_cd,
    sap_cat_desc,
    sap_sub_cat_cd,
    sap_sub_cat_desc,
    sty_colr_sdesc,
    sty_grp_nbr,
    sty_grp_desc,
    matl_typ,
    sap_prod_typ_grp, -- 'Type Group' in Brio
    typ_grp_desc, -- 'Type Group' in Brio
    curr_prod_i2_life_cyc_cd,
    NULL AS promo_ind, -- for future use
    -- Each RPT_FAM_FWEQ_DETAIL row's eight (8) quantity columns are broken down
    -- into F1_QTY from DISP_aaaa_QTY, F2_QTY from TRG_aaaa_QTY and
         -- AE from aaaa_AE where 'aaaa' is equal to one of the COMPARE_TYPEs below:
    -- F1_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    disp_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    disp_net_qty
    WHEN compare_type = 'NET_AO' THEN
    disp_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    disp_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    disp_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    disp_auth_futr_qty
    END as f1_qty,
    -- F2_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    trg_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    trg_net_qty
    WHEN compare_type = 'NET_AO' THEN
    trg_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    trg_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    trg_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    trg_auth_futures_qty
    END as f2_qty,
    -- AE
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    abs(disp_dlvry_plan_qty - trg_dlvry_plan_qty)
    WHEN compare_type = 'NET' THEN
    abs(disp_net_qty - trg_net_qty)
    WHEN compare_type = 'NET_AO' THEN
    abs(disp_ao_qty - trg_ao_qty)
    WHEN compare_type = 'NET_FTRS' THEN
    abs(disp_futr_qty - trg_futr_qty)
    WHEN compare_type = 'NET_REPLENS' THEN
    abs(disp_replen_qty - trg_replen_qty)
    WHEN compare_type = 'AUTH_FTRS' THEN
    abs(disp_auth_futr_qty - trg_auth_futures_qty)
    END as ae,
    SYSDATE AS zz_insert_tmst
    FROM
         -- This in-line view returns only LEVEL_NUM = 2 or LEVEL_TYPE = 'STYLE_GROUP' data
         (SELECT plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         -- The following NULL'd columns' values cannot be saved due to aggregation
         NULL AS material,
         NULL AS key_material,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         NULL AS sty_colr_sdesc,
         sty_grp_nbr,
         sty_grp_desc,
         NULL AS matl_typ,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc, -- 'Type Group' in Brio
         NULL AS curr_prod_i2_life_cyc_cd,
         sum(disp_net_qty) AS disp_net_qty,
              sum(trg_net_qty) AS trg_net_qty,
         -- ABS(sum(trg_net_qty) - sum(disp_net_qty)) AS net_AE,
         sum(disp_dlvry_plan_qty) AS disp_dlvry_plan_qty,
              sum(trg_dlvry_plan_qty) AS trg_dlvry_plan_qty,
         -- ABS(sum(trg_dlvry_plan_qty) - sum(disp_dlvry_plan_qty)) AS dlvry_plan_AE,
         sum(disp_futr_qty) AS disp_futr_qty,
              sum(trg_futr_qty) AS trg_futr_qty,
         -- ABS(sum(trg_futr_qty) - sum(disp_futr_qty)) AS futr_AE,
         sum(disp_ao_qty) AS disp_ao_qty,
              sum(trg_ao_qty) AS trg_ao_qty,
         -- ABS(sum(trg_ao_qty) - sum(disp_ao_qty)) AS ao_AE,
         sum(disp_replen_qty) AS disp_replen_qty,
              sum(trg_replen_qty) AS trg_replen_qty,
         -- ABS(sum(trg_replen_qty) - sum(disp_replen_qty)) AS replen_AE,
         sum(disp_futr_qty) AS disp_auth_futr_qty,
              sum(trg_auth_futures_qty) AS trg_auth_futures_qty --,
         -- ABS(sum(trg_auth_futures_qty) - sum(disp_futr_qty)) AS auth_futures_AE
         FROM rpt_fam_FWEQ_detail
         WHERE plan_ctry &where_plan_ctry
         and level_num = 2 -- 'STYLE-GRP' or 'STYLE'
         -- AND (promo_ind <> 'Y' OR promo_ind IS null)
         GROUP BY plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         sty_grp_nbr,
         sty_grp_desc,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc -- 'Type Group' in Brio
         ) dtl,
         -- The following in-line view returns all of the different combinations
         -- of comparison types in the RPT_FAM_FWEQ_DETAIL table
         -- This select returns the pairing of all forecast types
         SELECT event_type, compare_type, compare_name
         from
         (SELECT event_type, compare_type, compare_type_description || ' to ' || compare_type_description AS compare_name
         FROM rpt_fam_compare_types
         WHERE event_type = 'FCST'
         UNION
         -- This select returns the pairing of all bookings types with forecast types
         SELECT bkng.event_type, fcst.compare_type, bkng.compare_type_description || ' to ' || fcst.compare_type_description AS compare_name
         FROM rpt_fam_compare_types fcst,
         rpt_fam_compare_types bkng
         WHERE fcst.event_type = 'FCST'
         AND bkng.event_type = 'BKNG'
         AND fcst.compare_type = bkng.compare_type
         WHERE event_type || ' ' || compare_type <> 'FCST AUTH_FTRS'
         AND compare_type NOT IN ('NET_SHIP', 'SHIP_NET_FTRS', 'NET_ETS', 'GROSS_FTRS')
         ) cmpr
    -- The two (2) in-line views are joined by EVENT_TYPE (i.e. 'FCST' and 'BKNG')
    -- to form a product of all RPT_FAM_FWEQ_DETAIL rows with comparison types
    WHERE dtl.trg_event_type = cmpr.event_type
    ORDER BY plan_ctry,
    division,
    season,
    monthly_seq,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    first_display_event_num,
    level_type,
    level_value
    COMMIT
    INSERT INTO rpt_fam_FWEQ_detail_aggr
    SELECT plan_ctry,
    division,
    season,
    monthly_seq,
         bucket_month_date,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    compare_name,
    first_display_event_num,
    level_type,
    level_value,
    'TOTAL' AS row_type,
    material,
    key_material,
    sap_cat_cd,
    sap_cat_desc,
    sap_sub_cat_cd,
    sap_sub_cat_desc,
    sty_colr_sdesc,
    sty_grp_nbr,
    sty_grp_desc,
    matl_typ,
    sap_prod_typ_grp, -- 'Type Group' in Brio
    typ_grp_desc, -- 'Type Group' in Brio
    curr_prod_i2_life_cyc_cd,
    NULL AS promo_ind, -- for future use
    -- Each RPT_FAM_FWEQ_DETAIL row's eight (8) quantity columns are broken down
    -- into F1_QTY from DISP_aaaa_QTY, F2_QTY from TRG_aaaa_QTY and
         -- AE from aaaa_AE where 'aaaa' is equal to one of the COMPARE_TYPEs below:
    -- F1_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    disp_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    disp_net_qty
    WHEN compare_type = 'NET_AO' THEN
    disp_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    disp_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    disp_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    disp_auth_futr_qty
    END as f1_qty,
    -- F2_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    trg_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    trg_net_qty
    WHEN compare_type = 'NET_AO' THEN
    trg_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    trg_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    trg_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    trg_auth_futures_qty
    END as f2_qty,
    -- AE
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    abs(disp_dlvry_plan_qty - trg_dlvry_plan_qty)
    WHEN compare_type = 'NET' THEN
    abs(disp_net_qty - trg_net_qty)
    WHEN compare_type = 'NET_AO' THEN
    abs(disp_ao_qty - trg_ao_qty)
    WHEN compare_type = 'NET_FTRS' THEN
    abs(disp_futr_qty - trg_futr_qty)
    WHEN compare_type = 'NET_REPLENS' THEN
    abs(disp_replen_qty - trg_replen_qty)
    WHEN compare_type = 'AUTH_FTRS' THEN
    abs(disp_auth_futr_qty - trg_auth_futures_qty)
    END as ae,
    SYSDATE AS zz_insert_tmst
    FROM
         -- This in-line view returns only LEVEL_NUM = 3 or LEVEL_TYPE = 'MATL' data
         (SELECT plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         material,
         key_material,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         sty_colr_sdesc,
         sty_grp_nbr,
         sty_grp_desc,
         matl_typ,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc, -- 'Type Group' in Brio
         curr_prod_i2_life_cyc_cd,
         sum(disp_net_qty) AS disp_net_qty,
              sum(trg_net_qty) AS trg_net_qty,
         -- ABS(sum(trg_net_qty) - sum(disp_net_qty)) AS net_AE,
         sum(disp_dlvry_plan_qty) AS disp_dlvry_plan_qty,
              sum(trg_dlvry_plan_qty) AS trg_dlvry_plan_qty,
         -- ABS(sum(trg_dlvry_plan_qty) - sum(disp_dlvry_plan_qty)) AS dlvry_plan_AE,
         sum(disp_futr_qty) AS disp_futr_qty,
              sum(trg_futr_qty) AS trg_futr_qty,
         -- ABS(sum(trg_futr_qty) - sum(disp_futr_qty)) AS futr_AE,
         sum(disp_ao_qty) AS disp_ao_qty,
              sum(trg_ao_qty) AS trg_ao_qty,
         -- ABS(sum(trg_ao_qty) - sum(disp_ao_qty)) AS ao_AE,
         sum(disp_replen_qty) AS disp_replen_qty,
              sum(trg_replen_qty) AS trg_replen_qty,
         -- ABS(sum(trg_replen_qty) - sum(disp_replen_qty)) AS replen_AE,
         sum(disp_futr_qty) AS disp_auth_futr_qty,
              sum(trg_auth_futures_qty) AS trg_auth_futures_qty --,
         -- ABS(sum(trg_auth_futures_qty) - sum(disp_futr_qty)) AS auth_futures_AE
         FROM rpt_fam_FWEQ_detail
         WHERE plan_ctry &where_plan_ctry
         and level_num = 3 -- 'MATERIAL'
         -- AND promo_ind <> 'Y'
         GROUP BY plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         material,
         key_material,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         sty_colr_sdesc,
         sty_grp_nbr,
         sty_grp_desc,
         matl_typ,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc, -- 'Type Group' in Brio
         curr_prod_i2_life_cyc_cd
         ) dtl,
         -- The following in-line view returns all of the different combinations
         -- of comparison types in the RPT_FAM_FWEQ_DETAIL table
         -- This select returns the pairing of all forecast types
         SELECT event_type, compare_type, compare_name
         from
         (SELECT event_type, compare_type, compare_type_description || ' to ' || compare_type_description AS compare_name
         FROM rpt_fam_compare_types
         WHERE event_type = 'FCST'
         UNION
         -- This select returns the pairing of all bookings types with forecast types
         SELECT bkng.event_type, fcst.compare_type, bkng.compare_type_description || ' to ' || fcst.compare_type_description AS compare_name
         FROM rpt_fam_compare_types fcst,
         rpt_fam_compare_types bkng
         WHERE fcst.event_type = 'FCST'
         AND bkng.event_type = 'BKNG'
         AND fcst.compare_type = bkng.compare_type
         WHERE event_type || ' ' || compare_type <> 'FCST AUTH_FTRS'
         AND compare_type NOT IN ('NET_SHIP', 'SHIP_NET_FTRS', 'NET_ETS', 'GROSS_FTRS')
         ) cmpr
    -- The two (2) in-line views are joined by EVENT_TYPE (i.e. 'FCST' and 'BKNG')
    -- to form a product of all RPT_FAM_FWEQ_DETAIL rows with comparison types
    WHERE dtl.trg_event_type = cmpr.event_type
    ORDER BY plan_ctry,
    division,
    season,
    monthly_seq,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    first_display_event_num,
    level_type,
    level_value
    COMMIT
    /

    I agree.
    SELECT ticket_no,name_of_the_passenger..
    FROM ticket_master
    WHERE ticket_no NOT IN
    (SELECT Ticket_no
    FROM ticket_cancellations
    WHERE trip_id = my_trip_id);
    This involves creating a little temp table for each record in ticket_no. Then full scanning it.
    Change it to
    SELECT ticket_no,name_of_the_passenger..
    FROM ticket_master B
    WHERE ticket_no NOT EXISTS
    (SELECT null
    FROM ticket_cancellations A
    WHERE A.ticket_no = B.ticket_no
    AND trip_id = my_trip_id);
    Then you get an index hit in both cases.

  • Reg msg "Payment method(s) are not allowed for this program".

    Hi...
    I am copying a standard program RFFOES_T (Print program for bank transfer) into a custom program. When i try to execute the custom program it gives me a msg saying
    "Payment method(s) are not allowed for this program".
    Can you please Provide a solution for this problem.
    Regards,
    Indira.

    Indira,
    1.RFFOES_T is using Logical database PYF.Seems you have copied it as it is without changing the attributes of the program.
    2.As it is using logical database PYF  it needs to be tagged to the respective payment methods in FBZP settings as below
    FBZP
    >>Payment methods in Country
    >> in the next screen click on position and give the company code and payment method
    >> in the next screen select the corresponding payment method and click on the details(ctrlshiftf2) ie magnifying glass icon
    >>in the next screen  within  Payment Medium you will get to see two radio buttons as Payment medium workbench(uses DMEE tree structure)  and payment medium programs (uses the standard prog).Here in Payment medium Program either the standard prog or your zprogram should be tagged otherwise you will get the error message as you mentioned.
    3.Once you tag the program in the FBZP setting to the respective payment methods,after the payment run you will be able to run the program.
    4.If you don't want the program to be linked to FBZP settings then as far as my knowledge is concerned you need to avoid using logical database PYF and change the entire code using the regular database tables like reguh,regup,bkpf,bseg etc.(I think this should be the best approach)
    Thanks,
    K.Kiran.

  • I lost my serial number for photoshop elements11 and premiere elements 11 combo.  how can I obtain a serial number for this program?

    I lost my serial number for photoshop elements11 and premiere elements 11 combo.  how can I obtain a serial number for this program?

    If you registered the software you should be able to find the serial number thru your Adobe account online.
    To locate the serial number:
    http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • Bypass check for this program only

    Hi FI Masters,
    i have a zprint prog ex : ZRFFOZA_H2H. i copied this prog and given a transaction(ZRFFOZA_H2H_FI   tcode : ZFI_H2H ) and run to see the results where it works fine.
    but....
    payment method can be linked to only one print program and in this test case payment method M is linked to ZRFFOZA_H2H, so now the problem is that the new transaction code ZFI_H2H is built on program ZRFFOZA_H2H_FI and the system refuses to run. 
    when i see the message it shows like this...
    The list of payment methods (M) may only be processed by other payment medium programs.
    now how can i bypass this check for this program only?
    can i have some info please....
    Thanks,
    pasala.

    hi FI masters,
    to be more clear to the above quetion,
    i have 2 zprog for the Payment run
    for the Payment method 'M' i have z prog ZRFFOZA_H2H which is configued
    again i have made a copy of above prog to ZRFFOZA_H2H_FI  and run the payment run for the Payemnt method 'M'.
    Now it gives me a message : Payment method(s) are not allowed for this program.
    since below copy prog not configed we get this message.
    NOW : What can i do to bypass this check for this program only
    can i have some info pls?
    thanks again,
    pasala.

  • "The software required for this iPhone is not installed correctly. Please reinstall iTunes to install the required software." I get the same error on my iPad.

    I upgraded my itunes to 10.6 and now I get the error "The software required for this iPhone is not installed correctly. Please reinstall iTunes to install the required software." I get the same error on my iPad. I've tried uninstalling and reinstalling. Please help!!

    Edit: 10.6.3. I have uninstalled using the uninstall programs on itunes and then I downloaded again from the itunes website multiple times. This is not resolving the issue. The phone shows up in My Computer.

  • I have forgotten my answers to the questions which are asked to identify me, and I am trying to press "send instructions to my e-mail", but this does not work, what should I do?

    I have forgotten my answers to the questions which are asked to identify me, and I am trying to press "send instructions to my e-mail", but this does not work, what should I do?

    If the email hasn't arrived after a few hours and isn't in a spam filter, you need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (113969)

  • Installed cs6 master collection but creative cloud keeps asking for renewal of subscription... I just paid $1500 for this program i don't need a subscription

    installed cs6 master collection but creative cloud keeps asking for renewal of subscription... I just paid $1500 for this program i don't need a subscription.. How can i stop this from happening so i can use my CS6 Master Collection

    See if the following helps:
    How do I prevent Creative Cloud from taking over my CS6 perpetual license?
    https://forums.adobe.com/thread/1584746

  • Program has been bought City Guide Ukraine navigator. Wanted her to be reinstalled, but there is an inscription "there is a billing problem with a previous purchase". I already paid for this program.

    Program has been bought City Guide Ukraine navigator. Wanted her to be reinstalled, but there is an inscription "there is a billing problem with a previous purchase". I already paid for this program.

    Click "Account" under Quick Links at the top right of the iTunes store. Next to payment information click "Edit" and then select "None" under payment method.
    On an iOS device go to Settings>Store>Apple ID>View Apple ID>Payment Information>None.
    If "None" is not an option, you may want to contact iTunes support and request assistance:
    http://www.apple.com/support/itunes/contact/

  • I have just recently bought a MacBook Air. I am looking for an email which I put into a folder on my Mac Pro. The smart folders have come across to the Air, but not the 'On my Mac' folders. Are they lost?

    I have just recently bought a MacBook Air. I am looking for an email which I put into a folder on my Mac Pro. The smart folders have come across to the Air, but not the 'On my Mac' folders. Are they lost?

    Are you sure that the "On My Mac" folders weren't empty? If all your mail accounts are IMAP, they may have been.

Maybe you are looking for

  • Can no longer connect to Wi-Fi

    A repair was done on my ADSL network at my local exchange 2 days ago. Since then, I cannot connect to my wireless network. iPod says: "The error was "Operation could not be completed: Invalid argument". Other devices (cell phone) can connect fine. Im

  • What is best practice for using a SAN with ASM in an 11gR2 RAC installation

    I'm setting up a RAC environment. Planning on using Oracle 11g release 2 for RAC & ASM, although the db will initially be 10g r2. OS: RedHat. I have a SAN available to me and want to know the best way to utilise that via ASM. I've chosen ASM as it al

  • Custome Ringtone in Lumia 800

    I dont know whether this is already addressed as I couldnt find any news about this in previous messages where it says only on how to create a custome ringtone. but this is not the problem for me My problem we have the set of default ringtones from b

  • PRE9 - cannot activate next button when trying to share directly to YouTube.  What have I not done?

    When I am trying to share  a clip directly to YouTube the 'next' buttton is grayed out  and nothing happens.  Cannot find a location to link the account to PRE9.  Any help?

  • Chinese compatibility.

    I am looking to change my language to Mandarin only on Pages. Is that possible? I am a student enrolled in a high level Chinese class. I am not fluent and unable to navigate OSX completely in Mandarin but I would like to take notes in Pages in Mandar