Error while using the function module..pack_handling_unit_dlvry

Hi all...
while using the function module pack_handling_unit_dlvry,
we need to pass the handling unit number as per the functionality we require.
but the mandatory field for the function module is the handling unit number in the form of bar code..
so how to use this function module..
All the useful answers will be regarded..
Regards,
Saroja.

Have you tried using BAPI BAPI_HU_CREATE. Also view Function Module Documentation on its usage.

Similar Messages

  • Error while using the function module GUI_UPLOAD

    Hi,
    My requirement is to upload the data from .txt file into internal table.
    I have given my code like this
    PARAMETERS: p_fname LIKE rlgrap-filename.
    data: begin of gt_string occurs 0,
           record type char255,
          end of gt_string.
    AT SELECTION-SCREEN ON VALUE-REQUEST for p_fname.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
        PROGRAM_NAME        = SYST-REPID
        DYNPRO_NUMBER       = SYST-DYNNR
        FIELD_NAME          = ' '
         STATIC              = 'X'
        MASK                = ' '
        CHANGING
          file_name           = p_fname
       EXCEPTIONS
         MASK_TOO_LONG       = 1
         OTHERS              = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = p_fname
         FILETYPE                      = 'ASC'
         HAS_FIELD_SEPARATOR           = 'X'
         HEADER_LENGTH                 = 0
        READ_BY_LINE                  = 'X'
        DAT_MODE                      = ' '
        CODEPAGE                      = ' '
        IGNORE_CERR                   = ABAP_TRUE
        REPLACEMENT                   = '#'
        CHECK_BOM                     = ' '
        NO_AUTH_CHECK                 = ' '
      IMPORTING
        FILELENGTH                    =
        HEADER                        =
        tables
          data_tab                      = gt_string
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         FILE_READ_ERROR               = 2
         NO_BATCH                      = 3
         GUI_REFUSE_FILETRANSFER       = 4
         INVALID_TYPE                  = 5
         NO_AUTHORITY                  = 6
         UNKNOWN_ERROR                 = 7
         BAD_DATA_FORMAT               = 8
         HEADER_NOT_ALLOWED            = 9
         SEPARATOR_NOT_ALLOWED         = 10
         HEADER_TOO_LONG               = 11
         UNKNOWN_DP_ERROR              = 12
         ACCESS_DENIED                 = 13
         DP_OUT_OF_MEMORY              = 14
         DISK_FULL                     = 15
         DP_TIMEOUT                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Here I am getting dump error as 'Type conflict when calling a function module.
    The function module interface allows you to specify only fields
    of a particular type under "FILENAME". The field "P_FNAME" specified here has a different field type'.
    What would be the reason for this error?
    Can anyone help me?
    Regards,
    Hema

    see this sample program for F4 help
    *& Report  ZSD_EXCEL_INT_APP
    REPORT  ZSD_EXCEL_INT_APP.
    parameter: file_nm type localfile.
    types : begin of it_tab1,
            f1(20),
            f2(40),
            f3(20),
           end of it_tab1.
    data : it_tab type table of ALSMEX_TABLINE with header line,
           file type rlgrap-filename.
    data : it_tab2 type it_tab1 occurs 1,
           wa_tab2 type it_tab1,
           w_message(100)  TYPE c.
    at selection-screen on value-request for file_nm.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      PROGRAM_NAME        = SYST-REPID
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
       STATIC              = 'X'
      MASK                = ' '
      CHANGING
       file_name           = file_nm
    EXCEPTIONS
       MASK_TOO_LONG       = 1
       OTHERS              = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    refresh it_tab2[].clear wa_tab2.
    file = file_nm.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file
        i_begin_col                   = '1'
        i_begin_row                   =  '1'
        i_end_col                     = '10'
        i_end_row                     = '35'
      tables
        intern                        = it_tab
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 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.
    loop at it_tab.
      case it_tab-col.
       when '002'.
        wa_tab2-f1 = it_tab-value.
       when '004'.
        wa_tab2-f2 = it_tab-value.
      when '008'.
        wa_tab2-f3 = it_tab-value.
    endcase.
    at end of row.
      append wa_tab2 to it_tab2.
    clear wa_tab2.
      endat.
    endloop.
    data : p_file TYPE  rlgrap-filename value 'TEST3.txt'.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *--- Display error messages if any.
      IF sy-subrc NE 0.
        MESSAGE e001(zsd_mes).
        EXIT.
      ELSE.
    *---Data is downloaded to the application server file path
        LOOP AT it_tab2 INTO wa_tab2.
          TRANSFER wa_tab2 TO p_file.
        ENDLOOP.
      ENDIF.
    *--Close the Application server file (Mandatory).
      CLOSE DATASET p_file.
    loop at it_tab2 into wa_tab2.
      write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
    endloop.

  • Error while activating the function module

    hi,
    am getting error while activating the function module i.e. program or report statement is missing.
    thank you in advance
    karthik

    hii vinu,
    hi there....
    make sure that the Processing type in Attributes tab is 'Normal function module'. Also chk the general data, it must be having some name in the Program Name and include name column.try checking the program names in se38, if the program is of type include or not. you can also chk by writting  a program call the function module and test it
    I hope this will solve the query. in my case, SAPLZ123 is the program name and LZ123U28 is the include name.
    or
    Its common prob with Function module.
    Goto SE80->Give Function group name->Right click on it->Activate.
    regards,
    Shweta

  • Dropdown values are missing while using the function module KCD_EXCEL_OLE_TO_INT_CONVERT

    Hi all,
    when i am trying to upload the excel template by using the function module " KCD_EXCEL_OLE_TO_INT_CONVERT" to an internal table some field values are missing.
    i am using the function module " KCD_EXCEL_OLE_TO_INT_CONVERT"  and i am uploading an excel template and downloading that excel data into an internal table but some field values are missing while uploading the excel template and i found that the field which contains the drop down list values those values are missing.
    And also when i am uploading the excel template by using the function module" KCD_EXCEL_OLE_TO_INT_CONVERT"  when i am coming out of this function module one pop up is coming. how can i avoid this popup, can any one please provide me the solution thanks in advance.
    FYI...it is showing the below popup screen ..
    Thanks,
    Koushik

    hi Feiyun,
    below is the code(highlighted in bold)and after coming out of the function module i am getting popup and also the drop down values are missing.
    DATA: ls_control         TYPE zsfi_fiupload_control,
             ls_header          TYPE zsfi_fiupload_header_v13,
             ls_item            TYPE zsfi_fiupload_item_v13,
             ls_trailer         TYPE zsfi_fiupload_control,
             l_line_count       LIKE zsfi_fiupload_control-rec_count,
             l_current_curr     TYPE kcde_cells-value,
             l_current_postdate TYPE kcde_cells-value,
             l_current_compcode TYPE kcde_cells-value,
             l_currentrow       TYPE kcde_cells-row,
             l_filename         LIKE rlgrap-filename.
       DATA: BEGIN OF lt_intern OCCURS 0.
               INCLUDE STRUCTURE  kcde_cells.
       DATA: END OF lt_intern.
       DATA: BEGIN OF lt_items OCCURS 0,
               a TYPE kcde_cells-value,
               b TYPE kcde_cells-value,
               c TYPE kcde_cells-value,
               d TYPE kcde_cells-value,
               e TYPE kcde_cells-value,
               f TYPE kcde_cells-value,
               g TYPE kcde_cells-value,
               h TYPE kcde_cells-value,
               i TYPE kcde_cells-value,
               j TYPE kcde_cells-value,
               k TYPE kcde_cells-value,
               l TYPE kcde_cells-value,
               m TYPE kcde_cells-value,
               n TYPE kcde_cells-value,
               o TYPE kcde_cells-value,
               p TYPE kcde_cells-value,
               q TYPE kcde_cells-value,
               r TYPE kcde_cells-value,
               s TYPE kcde_cells-value,
               t TYPE kcde_cells-value,
               u TYPE kcde_cells-value,
               v TYPE kcde_cells-value,
               w TYPE kcde_cells-value,
               x TYPE kcde_cells-value,
               y TYPE kcde_cells-value,
               z TYPE kcde_cells-value,
               aa TYPE kcde_cells-value,
               ab TYPE kcde_cells-value,
               ac TYPE kcde_cells-value,
               ad TYPE kcde_cells-value,
               ae TYPE kcde_cells-value,
               af TYPE kcde_cells-value,
               ag TYPE kcde_cells-value,
               ah TYPE kcde_cells-value,
               ai TYPE kcde_cells-value,
               AJ TYPE KCDE_CELLS-VALUE,
               AK TYPE KCDE_CELLS-VALUE,
               END OF lt_items.
       l_filename = p_flpath.
    * the file must be an xls file, not xlsx or comma seperated
       IF p_flpath NS '.xls' AND p_flpath NS '.XLS'.
         MESSAGE i261(zfi).
         g_error = 'X'.
         EXIT.
       ENDIF.
    * upload excel file to a generic table
       CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
         EXPORTING
           filename                = l_filename
           i_begin_col             = 1
           i_begin_row             = 1
           i_end_col               = 150
           i_end_row               = 65000
         TABLES
           intern                  = lt_intern
         EXCEPTIONS
           inconsistent_parameters = 1
           upload_ole              = 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.
    * validate that the format is in the restatement format
    *  this is the only template to have the ledger group in cell G-2
    **  READ TABLE lt_intern WITH KEY row = '0002' col = '0007'.
    **  IF sy-subrc <> 0 OR lt_intern-value IS INITIAL.
    **    MESSAGE i260(zfi).
    **    g_error = 'X'.
    **    EXIT.
    **  ENDIF.
    * create control record values
       ls_control-rec_type = 'C'.
       ls_control-global_id = 'GLU-03000'.
       ls_control-local_id = ''.
       ls_control-rec_count = ''.
       CONCATENATE sy-datum sy-uzeit INTO ls_control-date.
       ls_control-version = '12'.
       ls_control-email = ''.
       ls_control-eor = 'X'.
       ls_trailer = ls_control.
    * open output file and add the control record
       OPEN DATASET p_unixfilename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
       TRANSFER ls_control TO p_unixfilename.
    * create header record values, will be transfered to file in the item loop
       ls_header-rec_type = 'H'.
       READ TABLE lt_intern WITH KEY row = '0017' col = '0003'.
       IF sy-subrc = 0.
         ls_header-header_txt = lt_intern-value.
       ENDIF.
       READ TABLE lt_intern WITH key row = '0020' col = '0002'.
       IF sy-subrc = 0.
         ls_header-comp_code = lt_intern-value.
       ENDIF.
    ************doc date
       READ TABLE lt_intern WITH KEY row = '0011' col = '0003'.
       IF sy-subrc = 0.
         ls_header-pstng_date = lt_intern-value.
       ENDIF.
    ************posting date
         ls_header-doc_date = sy-datum.
       READ TABLE lt_intern WITH KEY row = '0009' col = '0003'.
       IF sy-subrc = 0.
         ls_header-doc_type = lt_intern-value.
       ENDIF.
       READ TABLE lt_intern WITH KEY row = '0014' col = '0003'.
       IF sy-subrc = 0.
         ls_header-ref_doc_no = lt_intern-value.
       ENDIF.
    ************currency moved to line items
         READ TABLE lt_intern WITH KEY row = '0020' col = '0001'.
       IF sy-subrc = 0.
       ls_header-currency = lt_intern-value.
       ENDIF.
       ls_header-trans_date = ''.
       READ TABLE lt_intern WITH KEY row = '0010' col = '0003'.
       IF sy-subrc = 0.
         ls_header-period = lt_intern-value.
       ENDIF.
       READ TABLE lt_intern WITH KEY row = '0006' col = '0003'.
       IF sy-subrc = 0.
         ls_header-reason_rev = lt_intern-value.
       ENDIF.
       READ TABLE lt_intern WITH KEY row = '0007' col = '0003'.
       IF sy-subrc = 0.
         ls_header-rev_date = lt_intern-value.
       ENDIF.
    *  READ TABLE lt_intern WITH KEY row = '0002' col = '0007'.
    *  IF sy-subrc = 0.
         ls_header-ledger_grp = ''.
    *  ENDIF.
    *  READ TABLE lt_intern WITH KEY row = '0013' col = '0013'.
    *  IF sy-subrc = 0.
         ls_header-exch_rate = ''.
    *  ENDIF.
       READ TABLE lt_intern WITH KEY row = '0008' col = '0003'.
       IF sy-subrc = 0.
         ls_header-calc_tax = lt_intern-value.
       ENDIF.
       ls_header-eor = 'X'.
    * loop at the line items and append them to a table with multiple columns
       LOOP AT lt_intern WHERE row GE 20.
         IF l_currentrow <> lt_intern-row AND l_currentrow IS NOT INITIAL.
           APPEND lt_items.
           CLEAR lt_items.
         ENDIF.
         l_currentrow = lt_intern-row.
         CASE lt_intern-col.
           WHEN '0001'. lt_items-a = lt_intern-value.
           WHEN '0002'. lt_items-b = lt_intern-value.
           WHEN '0003'. lt_items-c = lt_intern-value.
           WHEN '0004'. lt_items-d = lt_intern-value.
           WHEN '0005'. lt_items-e = lt_intern-value.
           WHEN '0006'. lt_items-f = lt_intern-value.
           WHEN '0007'. lt_items-g = lt_intern-value.
           WHEN '0008'. lt_items-h = lt_intern-value.
           WHEN '0009'. lt_items-i = lt_intern-value.
           WHEN '0010'. lt_items-j = lt_intern-value.
           WHEN '0011'. lt_items-k = lt_intern-value.
           WHEN '0012'. lt_items-l = lt_intern-value.
           WHEN '0013'. lt_items-m = lt_intern-value.
           WHEN '0014'. lt_items-n = lt_intern-value.
           WHEN '0015'. lt_items-o = lt_intern-value.
           WHEN '0016'. lt_items-p = lt_intern-value.
           WHEN '0017'. lt_items-q = lt_intern-value.
           WHEN '0018'. lt_items-r = lt_intern-value.
           WHEN '0019'. lt_items-s = lt_intern-value.
           WHEN '0020'. lt_items-t = lt_intern-value.
           WHEN '0021'. lt_items-u = lt_intern-value.
           WHEN '0022'. lt_items-v = lt_intern-value.
           WHEN '0023'. lt_items-w = lt_intern-value.
           WHEN '0024'. lt_items-x = lt_intern-value.
           WHEN '0025'. lt_items-y = lt_intern-value.
           WHEN '0026'. lt_items-z = lt_intern-value.
           WHEN '0027'. lt_items-aa = lt_intern-value.
           WHEN '0028'. lt_items-ab = lt_intern-value.
           WHEN '0029'. lt_items-ac = lt_intern-value.
           WHEN '0030'. lt_items-ad = lt_intern-value.
           WHEN '0031'. lt_items-ae = lt_intern-value.
           WHEN '0032'. lt_items-af = lt_intern-value.
           WHEN '0033'. lt_items-ag = lt_intern-value.
           WHEN '0034'. lt_items-ah = lt_intern-value.
           WHEN '0035'. lt_items-ai = lt_intern-value.
           when '0036'. lt_items-aj = lt_intern-value.
           when '0037'. lt_items-ak = lt_intern-value.
         ENDCASE.
       ENDLOOP.
       APPEND lt_items.
    * sort rows by the post date, comp code, curr.
    *  SORT lt_items BY ah a ai.
    * loop at the items, creating a header record if the comp code, curr. or post date changes
       LOOP AT lt_items.
         ls_item-rec_type = 'I'.
         ls_item-post_key = lt_items-c.   "lt_items-b.
         IF lt_items-c GE '20' AND lt_items-c LE '39'.
           ls_item-vendor_no = lt_items-d.
         ELSEIF lt_items-c GE '0' AND lt_items-c LE '19'.
           ls_item-customer = lt_items-d.
         ELSEIF lt_items-c EQ '70' AND lt_items-c EQ '75'.
           ls_item-asset = lt_items-d.
         ELSE.
           ls_item-gl_account = lt_items-d.
         ENDIF.
         ls_item-asset_type = lt_items-m. "lt_items-l.
         ls_item-trans_type = lt_items-n. "lt_items-m.
         ls_item-print_flag = ''.
         ls_item-item_text = lt_items-j. "lt_items-i.
         ls_item-comp_code = lt_items-b. "lt_items-a.
         ls_item-bus_area = ''.
         ls_item-alloc_nmbr = lt_items-l. "lt_items-k.
         ls_item-tax_code = lt_items-q. "lt_items-p.
         ls_item-taxjurcode = lt_items-r. "lt_items-q.
         ls_item-profit_ctr = lt_items-g. "lt_items-f.
         ls_item-costcenter = lt_items-h. "lt_items-g.
         ls_item-orderid = lt_items-ac. "lt_items-ab.
         ls_item-wbs = lt_items-i. "lt_items-h.
         ls_item-trade_id = lt_items-o. "lt_items-n.
         ls_item-part_prctr = lt_items-p. "lt_items-o.
         ls_item-material = lt_items-t. "lt_items-s.
         ls_item-salesorg = lt_items-aa. "lt_items-z.
         ls_item-distr_chan = lt_items-ab. "lt_items-aa.
         ls_item-pmnttrms = ''.
         ls_item-pmtmthd = ''.
         ls_item-pmtmthsupl = ''.
         ls_item-alt_payee = ''.
         REPLACE ALL OCCURRENCES OF '(' IN lt_items-e WITH ''.
         REPLACE ALL OCCURRENCES OF ')' IN lt_items-e WITH ''.
         ls_item-amt_doccur = lt_items-e. "lt_items-d
         REPLACE ALL OCCURRENCES OF '(' IN lt_items-f WITH ''.
         REPLACE ALL OCCURRENCES OF ')' IN lt_items-f WITH ''.
         ls_item-loc_amt = lt_items-f. "lt_items-e
         ls_item-loc  = lt_items-k. "lt_items-j.
         ls_item-sas_revtype = lt_items-s. "lt_items-r.
         ls_item-rev_type = lt_items-u. "lt_items-t.
         ls_item-rev_chnl = lt_items-v. "lt_items-u.
         ls_item-bill_to = lt_items-x. "lt_items-w.
         ls_item-payer = lt_items-z. "lt_items-y.
         ls_item-ship_to = lt_items-y.
         ls_item-tax_amnt = lt_items-x.
         ls_item-func_area = ''.
         ls_item-expend_date = lt_items-ae. "lt_items-ad.
         ls_item-wtax_code = lt_items-af. "lt_items-ae.
         ls_item-wtax_base = lt_items-ag. "lt_items-af.
         ls_item-wtax_amount = lt_items-ah. "lt_items-ag.
         ls_item-payment_block = ''.
         ls_item-grp_amt = ''.
         ls_item-anc_amt = ''.
         ls_item-permit_payee = ''.
         ls_item-value_date = ''.
         ls_item-pernr   = ''.
         ls_item-legacy1 = ''.
         ls_item-legacy2 = ''.
         ls_item-legacy3 = ''.
         ls_item-legacy4 = ''.
         ls_item-legacy5 = ''.
         ls_item-legacy6 = ''.
         ls_item-legacy7 = ''.
         ls_item-legacy8 = ''.
         ls_item-legacy9 = ''.
         ls_item-legacy10 = ''.
         ls_item-eor = 'X'.
         TRANSLATE lt_items-ai TO UPPER CASE.
         TRANSLATE lt_items-b TO UPPER CASE.
         TRANSLATE lt_items-a TO UPPER CASE.
         TRANSLATE lt_items-aj TO UPPER CASE.
         IF l_current_curr <> lt_items-a "lt_items-ai
           OR l_current_postdate <> ls_header-pstng_date "lt_items-aj
           OR l_current_compcode <> lt_items-b.
           l_current_curr = lt_items-a.
           l_current_postdate = ls_header-pstng_date. "lt_items-aj.
           l_current_compcode = lt_items-b.
           ls_header-comp_code = l_current_compcode.
           ls_header-currency = l_current_curr.
           ls_header-pstng_date = l_current_postdate.
           ls_header-doc_date = l_current_postdate.
           TRANSFER ls_header TO p_unixfilename.
           l_line_count = l_line_count + 1.
         ENDIF.
         TRANSFER ls_item TO p_unixfilename.
         l_line_count = l_line_count + 1.
       ENDLOOP.
       ls_trailer-rec_type = 'T'.
       ls_trailer-rec_count = l_line_count.
       TRANSFER ls_trailer TO p_unixfilename.
       CLOSE DATASET p_unixfilename.
    * change the format to fixed format for the remainder of the load program
       p_fixed = 'X'.
       p_rstmnt = ''.
    Thanks,
    Koushik

  • Drop down values are missing while using the function module KCD_EXCEL_OLE_TO_INT_CONVERT

    Hi all,
    I am using the function module "KCD_EXCEL_OLE_TO_INT_CONVERT"  to upload the excel template to an internal table but i am not getting the complete excel data into the table the fields which contains the drop down list values those values are not coming in to the table.
    Is there any other function module which can read even the drop down list values? can any one please provide me the solution.
    Thanks in advance
    ** FYI...i am using the below code:
    * upload excel file to a generic table
       CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
         EXPORTING
           filename                = l_filename
           i_begin_col             = 1
           i_begin_row             = 1
           i_end_col               = 150
           i_end_row               = 65000
         TABLES
           intern                  = lt_intern
         EXCEPTIONS
           inconsistent_parameters = 1
           upload_ole              = 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.
    Thanks,
    Koushik

    Hi all,
    I am using the function module "KCD_EXCEL_OLE_TO_INT_CONVERT"  to upload the excel template to an internal table but i am not getting the complete excel data into the table the fields which contains the drop down list values those values are not coming in to the table.
    Is there any other function module which can read even the drop down list values? can any one please provide me the solution.
    Thanks in advance
    ** FYI...i am using the below code:
    * upload excel file to a generic table
       CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
         EXPORTING
           filename                = l_filename
           i_begin_col             = 1
           i_begin_row             = 1
           i_end_col               = 150
           i_end_row               = 65000
         TABLES
           intern                  = lt_intern
         EXCEPTIONS
           inconsistent_parameters = 1
           upload_ole              = 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.
    Thanks,
    Koushik

  • Error while executing the function module BAPI_RE_CN_CREATE

    Dear All
    I was using the the function module BAPI_RE_CN_CREATE.  When I am trying to execute the function module I am getting the error message u201CBusiness transaction RECN doest existu201D. While inputting the parameters for the function module I have given RECN   In the input field TRANS. Requesting you to please kindly suggest.
    Regards.
    Varaprasad

    Hi Varaprasad,
    please try the following.
    1. Create a contract manually in the system
    2. Use BAPI_RE_CN_GET_DETAIL to show how the fields and structures are filled.
    3. Check and change the parameters for BAPI_RE_CN_CREATE accordingly.
    Hope that helps.
    Regards, Franz

  • Create generic component to handle errors after using the function modules

    Hi,
    Please provide steps to create a generic component to handle the BAPI Return structure meesages after the function calls..
    Please let me know how to pass the structure or internal table from one component to other.
    Thanks in Advance,
    SV
    Moderator Message: No Step-by-steps will be provided here. Either take a classroom course or search for SAP Documentation
    Edited by: kishan P on Dec 10, 2010 3:14 PM

    Hi Hari,
    Plz give me ur mail id.. i will forward some documents regarding Generic Extraction using FM  and query...
    For function module means.. you have to  create function module. in RSAX..in R/3 side
    and you want to extract data using Query means...you have to create Infoset query in (SQ01,SQ02,SQO3) IN r/3 Side
      you can refer this blog also..
    to Function module "RSAX_BIW_GET_DATA_SIMPLE" and there is very good weblog . Search "generic extraction" for weblog. /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    thanks
    @jay

  • Error while copy the function module

    Hi,
    When am copying the some standard FM into my z function module and when am checking the syntex error it throwing the error "REPORT/PROGRAM statement missing, or program type is I (INCLUDE).".
    Can you suggest.

    Hi All,
    Thanks for your help.
    Finally i did by my own.
    the problem is we need to activate their mail program and all include which we can see in goto>main program.
    Amit.

  • How to use the function module /IRM/IPBB_AGREEMENT_CREATE.

    Hi all,
    Please help me how to use the function module /IRM/IPBB_AGREEMENT_CREATE.
    It is a Vistex fuction module which is used to create Sales contract in SAP-Vistex. If anyone has use the function module and do have the sample code please share it.
    Thanks.

    FORM create_agreement TABLES pt_agreement
                                           CHANGING po_agreement .
      CONSTANTS: c_strt_knumh TYPE knumh VALUE '0000000000'.
      DATA: lc_kona  TYPE /irm/s_gkona,
            lc_cbasp TYPE /irm/s_ipcbasp,
          lt_cbapr TYPE /irm/t_ipcbapr,         "Partners
          lc_cbapr TYPE /irm/s_ipcbapr,
          lt_cbadt TYPE  /irm/t_ipcbadt,        "Dates
          lc_cbadt TYPE  /irm/s_ipcbadt,
          lt_cbafs TYPE  /irm/t_ipcbafs,
          lc_cbafs TYPE  /irm/s_ipcbafs,
          lt_cbacn TYPE  /irm/t_ipcbacn,
          lc_cbacn TYPE  /irm/s_ipcbacn,
          lt_cbacl TYPE  /irm/t_ipcbacl,
          lc_cbacl TYPE  /irm/s_ipcbacl,
          lt_cbtpv TYPE  /irm/t_ipagtpv,
          lc_cbtpv TYPE  /irm/s_ipagtpv,
          lt_texts TYPE  text_lh,
          lc_texts TYPE  itclh,
          lt_cbasd TYPE  /irm/t_ipcbasd,
          lc_cbasd TYPE  /irm/s_ipcbasd,
          lc_agreement    TYPE  /irm/s_ipcbasp_doc,
          lc_e_log_number TYPE  balognr,
          lt_messages     TYPE  /irm/t_gprolog.
      DATA: lt_vake      TYPE  cond_vakevb_t,
            lc_vake      TYPE LINE OF cond_vakevb_t,
            lt_konh      TYPE  /irm/t_gkonh,
            lc_konh      TYPE LINE OF /irm/t_gkonh,
            lt_konp      TYPE  /irm/t_gkonp,
            lc_konp      TYPE LINE OF /irm/t_gkonp,
            lt_konw      TYPE  /irm/t_gkonwu,
            lc_konw      TYPE LINE OF /irm/t_gkonwu,
            lt_konm      TYPE  /irm/t_gkonmu,
            lc_konm      TYPE LINE OF  /irm/t_gkonmu,
            lt_komg      TYPE  /irm/t_gkomg_index,
            lc_komg      TYPE LINE OF /irm/t_gkomg_index,
            lt_user_data TYPE  /irm/t_gpraxfu_index,
            lc_user_data TYPE LINE OF /irm/t_gpraxfu_index.
      DATA: lc_updt(1) TYPE c.
      DATA: lc_knumh TYPE knumh.
      DATA: BEGIN OF lc_str_knumh,
             hd(2) TYPE c VALUE '$$',
             inc_num(8) TYPE c,
            END OF lc_str_knumh.
      DATA: blank_agree_key TYPE knuma VALUE '~~~~~~~~~~'.
      FIELD-SYMBOLS <konh_line> LIKE LINE OF lt_konh.
      FIELD-SYMBOLS <konp_line> LIKE LINE OF lt_konp.
      DATA: lc_rule TYPE type_key_rule.
      READ TABLE pt_agreement INTO lc_rule INDEX 1.
    SELECT SINGLE * FROM  kona
            WHERE  vkorg   = lc_rule-vkorg
            AND    vtweg   = '10'
            AND    spart   = '10'
            AND    boart   = 'ZPS1'
            AND    botext  = lc_rule-sap_agkey.
    IF sy-subrc = 0.
       lc_updt = 'U'.
    ELSE.
      lc_updt = 'I'.
    ENDIF.
      LOOP AT pt_agreement INTO lc_rule.
        MOVE sy-tabix TO lc_str_knumh-inc_num.
        CONDENSE lc_str_knumh-inc_num NO-GAPS.
        WHILE lc_str_knumh-inc_num+7(1) = ' '.
          CONCATENATE '0' lc_str_knumh-inc_num INTO lc_str_knumh-inc_num.
          CONDENSE lc_str_knumh-inc_num NO-GAPS.
        ENDWHILE.
        CONCATENATE '$$' lc_knumh INTO lc_knumh.
        MOVE lc_str_knumh TO lc_knumh.
       MOVE c_strt_knumh TO lc_knumh.
        CLEAR: lc_konh, lc_konp, lc_komg.
        MOVE: lc_rule-vkorg    TO lc_komg-komg-vkorg,
              '10'             TO lc_komg-komg-vtweg,
              '10'             TO lc_komg-komg-spart,
              p_waers          TO lc_komg-komg-waerk,
              '1300'           TO lc_komg-komg-bukrs,
              lc_rule-lifnr    TO lc_komg-komg-lifnr,
              lc_knumh         TO lc_komg-knumh,
              lc_knumh         TO lc_konh-knumh,
              lc_knumh         TO lc_konp-knumh,
              lc_rule-datab    TO lc_konh-datab,
              lc_rule-datbi    TO lc_konh-datbi.
        CASE lc_rule-tablnam.
          WHEN 'A701'.                   "Every Agreement will have a A701 rule -
            "Therefore we acn setup the header using A701
            MOVE: 'New       '  TO lc_kona-knuma,
                  lc_rule-vkorg TO lc_kona-vkorg,
                  '10'          TO lc_kona-vtweg,
                  '10'          TO lc_kona-spart,
                  'ZPS1'        TO lc_kona-boart,
                  'C'           TO lc_kona-abtyp,
                  'V'           TO lc_kona-kappl,
                  p_waers       TO lc_kona-waers,
                  lc_rule-knuma_ag TO lc_kona-abrex,
                  'ZPS2'        TO lc_kona-kobog,
                  lc_rule-datab TO lc_kona-datab,
                  lc_rule-datbi TO lc_kona-datbi,
                  lc_rule-sap_agkey TO lc_kona-botext,
                  '1300'        TO lc_kona-bukrs,
                  'I'           TO lc_kona-updkz.
            MOVE: 'New       '  TO lc_cbasp-knuma_ag,
                  'ZPS1'        TO lc_cbasp-boart_ag,
                  p_waers       TO lc_cbasp-waers,
                  'A'           TO lc_cbasp-setl_mth,
                  'B'           TO lc_cbasp-setl_typ,
                  'A2'          TO lc_cbasp-ident,
                  'E'           TO lc_cbasp-setlm,
                  'ZPDA'        TO lc_cbasp-pargr,
                  'X'           TO lc_cbasp-npric,
                  'LF'          TO lc_cbasp-stprl,
                  lc_rule-lifnr TO lc_cbasp-stpar,
                  lc_rule-contract_rev  TO lc_cbasp-rvnum,
                  'I'           TO lc_cbasp-updkz.
            CONCATENATE: blank_agree_key
                   lc_rule-lifnr        INTO lc_konh-vakey.
            MOVE: lc_rule-lifnr TO lc_konp-lifnr.
          WHEN 'A703'.
            CONCATENATE: blank_agree_key
                         lc_rule-kunnr      INTO lc_konh-vakey.
            MOVE lc_rule-kunnr TO lc_komg-komg-kunnr.
          WHEN 'A709'.
            CONCATENATE: blank_agree_key
            lc_rule-zzprodh1  lc_rule-zzprodh2  lc_rule-zzprodh3
                   lc_rule-zzprodh4  lc_rule-zzprodh5 INTO lc_konh-vakey.
            CONCATENATE: lc_rule-zzprodh1  lc_rule-zzprodh2  lc_rule-zzprodh3
                   lc_rule-zzprodh4  lc_rule-zzprodh5 INTO lc_komg-komg-prodh.
          WHEN 'A710'.
            CONCATENATE: blank_agree_key
                lc_rule-matkl   INTO lc_konh-vakey.
            MOVE lc_rule-matkl TO lc_komg-komg-matkl.
          WHEN 'A711'.
            CONCATENATE: blank_agree_key
                 lc_rule-matnr   INTO lc_konh-vakey.
            MOVE lc_rule-matnr TO lc_komg-komg-matnr.
            IF lc_rule-kschl = 'ZPPL'.
              MOVE: 'C'              TO lc_konp-krech,
                    'CAD'              TO lc_konp-konwa.
              lc_konp-kbetr = lc_rule-net_po_price * 1.
            ENDIF.
          WHEN 'A717'.
          WHEN 'A718'.
            CONCATENATE: blank_agree_key
                 lc_rule-zzextwg INTO lc_konh-vakey.
            MOVE lc_rule-zzextwg TO lc_komg-komg-zzextwg.
         WHEN 'A719'.
           CONCATENATE: blank_agree_key
                lc_rule-werks INTO lc_konh-vakey.
           MOVE lc_rule-werks TO lc_komg-komg-werks.
         WHEN 'A721'.
           CONCATENATE: blank_agree_key
                 lc_rule-kunnr lc_rule-werks INTO lc_konh-vakey.
           MOVE: lc_rule-kunnr TO lc_konp-kunnr,
                 lc_rule-kunnr TO lc_komg-komg-kunnr.
          WHEN 'A722'.
            CONCATENATE: blank_agree_key
                         lc_rule-vkbur INTO lc_konh-vakey.
            MOVE lc_rule-vkbur TO lc_komg-komg-vkbur.
          WHEN 'A724'.
            CONCATENATE: blank_agree_key
                          lc_rule-kunnr lc_rule-vkbur INTO lc_konh-vakey.
            MOVE: lc_rule-kunnr TO lc_konp-kunnr,
                  lc_rule-kunnr TO lc_komg-komg-kunnr,
                  lc_rule-vkbur TO lc_komg-komg-vkbur.
        ENDCASE.
        MOVE: 'A'                  TO lc_konh-kvewe,
              lc_rule-tablnam+1(3) TO lc_konh-kotabnr,
              lc_rule-kappl        TO lc_konh-kappl,
              lc_rule-kschl        TO lc_konh-kschl.
        REPLACE ALL OCCURRENCES OF '~' IN lc_konh-vakey WITH ' '.
        APPEND lc_konh TO lt_konh.
        CLEAR lc_konh.
    *--- Add in the KONP.Do we need to add
        MOVE: lc_rule-kappl        TO lc_konp-kappl,
              lc_rule-kschl        TO lc_konp-kschl,
              'G'                  TO lc_konp-krech.
        IF lc_rule-kschl+3(1) = '%'.
          MOVE: 'A'              TO lc_konp-krech,
                '%'              TO lc_konp-konwa.
          lc_konp-kbetr = lc_rule-rebate_perc * 1.
        ENDIF.
        APPEND lc_konp TO lt_konp. CLEAR lc_konp.
        APPEND lc_komg TO lt_komg. CLEAR lc_komg.
      ENDLOOP.
      IF  lc_updt = 'I'.
        CALL FUNCTION '/IRM/IPCB_AGREEMENT_CREATE'
          EXPORTING
          I_MESSAGES_DISPLAY        = ' '
          I_SAVE_MESSAGES           = ' '
          I_COMMIT_WORK             = 'X'
          I_CALL_FROM_WS            = ' '
            is_kona                   = lc_kona
            is_cbasp                  = lc_cbasp
            it_cbapr                  = lt_cbapr
            it_cbadt                  = lt_cbadt
            it_cbafs                  = lt_cbafs
            it_cbacn                  = lt_cbacn
            it_cbacl                  = lt_cbacl
            it_cbtpv                  = lt_cbtpv
            it_texts                  = lt_texts
            it_cbasd                  = lt_cbasd
          IMPORTING
            es_agreement              = lc_agreement
            e_log_number              = lc_e_log_number
          TABLES
            t_messages                = lt_messages
         CHANGING
          CT_VAKE                   = lt_vake
          ct_konh                   = lt_konh
          ct_konp                   = lt_konp
          CT_KONW                   = lt_konw
          CT_KONM                   = lt_konm
           ct_komg                   = lt_komg
          CT_USER_DATA              = lt_usr_data
          EXCEPTIONS
            no_documents_to_process   = 1
            no_authorization          = 2
            creation_failed           = 3
            new_pricing_not_maitained = 4
            OTHERS                    = 5.
        IF sy-subrc <> 0.
    Implement suitable error handling here
        ELSE.
          MOVE: lc_agreement-knuma_ag TO po_agreement,
                lc_agreement-knuma_ag TO lc_kona-knuma.
        ENDIF.
        APPEND LINES OF lt_messages TO gt_messages.
      ELSE.
        MOVE-CORRESPONDING kona TO lc_kona.
      ENDIF.
      LOOP AT lt_konh ASSIGNING <konh_line>.
        MOVE lc_kona-knuma TO <konh_line>-vakey+0(10).
       move '&'           to <konh_line>-knumh+0(1).
      ENDLOOP.
      LOOP AT lt_konp ASSIGNING <konp_line>.
       MOVE lc_kona-knuma TO <konp_line>-vakey+0(10).
        move '&'           to <konh_line>-knumh+0(1).
      ENDLOOP.
      lc_kona-updkz = 'U'.
      lc_cbasp-updkz = 'U'.
      CLEAR lt_messages.
      CALL FUNCTION '/IRM/IPCB_AGREEMENT_CHANGE'
        EXPORTING
        I_MESSAGES_DISPLAY      = ' '
        I_SAVE_MESSAGES         = ' '
        I_COMMIT_WORK           = 'X'
        I_INIT_DATA             = 'X'
          is_kona                 = lc_kona
          is_cbasp                = lc_cbasp
         it_cbapr                = lt_cbapr
         it_cbadt                = lt_cbadt
         it_cbafs                = lt_cbafs
         it_cbacl                = lt_cbacl
         it_cbacn                = lt_cbacn
        IT_FIELDS               =
         it_texts                = lt_texts
       IMPORTING
         e_log_number            = lc_e_log_number
         TABLES
           t_messages              = lt_messages
        CHANGING
          cs_agreement            = lc_agreement
        CT_VAKE                 = lt_vake
          ct_konh                 = lt_konh
          ct_konp                 = lt_konp
        CT_KONW                 = lt_konw
        CT_KONM                 = lt_konm
          ct_komg                 = lt_komg
        CT_USER_DATA            = lt_usr_data
        EXCEPTIONS
          no_documents_to_process = 1
          no_authorization        = 2
          change_failed           = 3
          agreement_locked        = 4
          OTHERS                  = 5.
    IF sy-subrc <> 0.
    Implement suitable error handling here
    ENDIF.
      APPEND LINES OF lt_messages TO gt_messages.
    ENDFORM.                    " CREATE_AGREEMENT

  • Error While uploading the Function and Function_BP

    Hello,
    I am getting the following error while uploading the Functions and Funtions_BP using the Rule Upload functions.
    com.virsa.cc.comp.Function_upload.onActionUploadFunc(Function_upload.java:302) com.virsa.cc.comp.wdp.InternalFunction_upload.wdInvokeEventHandler(InternalFunction_upload.java:150) com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87) com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67) com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420) com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132) com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321) com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713) com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666) com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250) com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62) com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53) javax.servlet.http.HttpServlet.service(HttpServlet.java:760) javax.servlet.http.HttpServlet.service(HttpServlet.java:853) com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401) com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266) com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386) com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364) com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039) com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265) com.sap.engine.services.httpserver.server.Client.handle(Client.java:95) com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175) com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) java.security.AccessController.doPrivileged(Native Method) com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104) com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
    The files which i am uploading the file from the Best practises only.
    What is the reason for this error?
    Did any one get this error?
    Regards,
    Kumar Rayudu
    Edited by: Kumar Rayudu on Aug 4, 2009 12:32 PM

    Hello Kumar,
    Have you uploaded the SAP text and object files? Upload them first and then try to upload functions.
    Harleen
    SAP GRC RIG

  • How to use the function module ....

    hi
    how to use the function module ssf_function_module_name in smartforms

    Hi..
    If you are using this Function module, you can get the generated function module name of smartform dynamically. It is good progrmaming practice to get the fucntion module name dynamically because there might be some problems if you are hard coding in program.
    This will return the name of the function module and then from the exporting parameters you can use the fucntion module name to pass parameters to Smartforms.
    Check this link.I am expalining here how to use this function module.
    https://wiki.sdn.sap.com/wiki/pages/pointstab/viewpageversion.action?pageId=36109&version=2
    Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    <b>Reward points if useful</b>
    Regards
    Ashu

  • How to use the function module ADDRESS_INTO_PRINTFORM?

    Hi there,
    i need to use the function module ADDRESS_INTO_PRINTFORM. While doing so, I found out that the output parameter ADDRESS_PRINTFORM_TABLE has the District after the City, which is not at all acceptable. I am using the following import parameters only.
    ADDRESS_TYPE           
    ADDRESS_NUMBER      
    SENDER_COUNTRY       
    NUMBER_OF_LINES       
    IV_NATION                      
    Kindly help me to find out what's missing to have the district before the city in the output.

    Hi
    I think, It is because of wrong data maintained in ADRC table.
    Check ADRC table. CITY2 is district and CITY1 is city.
    In the output of ADDRESS, CITY2(District) has to come first.

  • Error when using CONVERT_OTF function module

    Dear Friends,
    In many of our reports we are using the function module CONVERT_OTF to send the output as a mail the users.
    But after the latest patch update we have came across a new problem. Mail is getting triggered and we can also see the icon or
    the file in mail. But when we are opening the file we are getting the message that "THERE WAS AN ERROR OPENING THIS
    DOCUMENT. THE FILE IS DAMAGED AND COULD NOT BE REPAIRED.
    Earlier this program has been working fine from last 2 years but after updating the patch in the of August 2009. This problem we are
    facing. All our mails are not working.
    Thanks
    Vamshi
    Edited by: Rob Burbank on Sep 7, 2009 3:12 PM

    Dear Clemens,
    Thank you for the immediate response. I have checked the program in Debug Mode. When we are passing the data to the CONVERT_OTF the output table of the function module is showing the data in some Unicode format in the tables OTF and LINES.
    Out of the FM is in completely special characters and this is after updating the latest patch.
    We are using Release 700 Level 19 and Service Package SAPKA70019.
    Thanks and Regards
    Vamshi Sreerangam
    Edited by: vamshi sreerangam on Sep 8, 2009 5:54 AM

  • ORA-00902: invalid datatype comile error while using CAST function

    Hi everyone,
    I'm getting ORA-00902: invalid datatype compilation error while using CAST function.
    open ref_cursor_list for select empName from TABLE(CAST(part_t AS partnumberlist));
    The partnumberlist and ref_cursor_list is declared in the Package spec as given below.
    TYPE ref_cursor_list IS REF CURSOR;
    TYPE partnumberlist IS TABLE OF emp.empName%TYPE;
    The error points the partnumberlist as invalid datatype in TOAD because of this i'm unable to compile the package.
    Any suggestion
    Thanks and regards
    Sathish Gopal

    Here is my code for
    package Spec
    CREATE OR REPLACE PACKAGE "HISTORICAL_COMMENTZ" AS
    TYPE prior_part_data_record IS RECORD (
    prior_part_row_id PGM_RPLCMNT_PART.PR_PART_ROW_S_ID%TYPE,
    prior_pgm_chng_s_id PGM_RPLCMNT_PART.PR_PGM_CHNG_S_ID%TYPE
    TYPE parts_list IS TABLE OF prior_part_data_record;
    --TYPE parts_list IS TABLE OF NUMBER;
    TYPE partnumberlist IS TABLE OF PGM_RPLCMNT_PART.PR_PART_ROW_S_ID%TYPE;
    TYPE partnumber_cursor IS REF CURSOR;
    TYPE comment_record IS RECORD (
    pgm_s_id                     PGM_PART_CMNT.PGM_S_ID%TYPE,
    part_row_s_id                PGM_PART_CMNT.PART_ROW_S_ID%TYPE,
    pgm_chng_s_id                PGM_PART_CMNT.PGM_CHNG_S_ID%TYPE,
    cmnt_txt                     PGM_PART_CMNT.CMNT_TXT%TYPE,
    cmnt_dt                     PGM_PART_CMNT.CMNT_DT%TYPE,
    updt_rsrc_id                PGM_PART_CMNT.UPDT_RSRC_ID%TYPE
    TYPE comment_list IS TABLE OF comment_record;
    global_pgm_s_id INTEGER := 0;
    global_part_row_s_id INTEGER := 0;
    err_num NUMBER := 999999;
    err_msg VARCHAR2 (250);
    PROCEDURE getComments (
    pgm_s_id IN NUMBER,
    part_row_s_id IN NUMBER,
    partnumber_cursorlist out partnumber_cursor);
    END;
    Package Body
    CREATE OR REPLACE PACKAGE BODY HISTORICAL_COMMENTZ
    AS
    FUNCTION getPriorPart
    (param_prior_pgm_chng_s_id IN PGM_RPLCMNT_PART.PR_PGM_CHNG_S_ID%TYPE,
    return_prior_part_data_record IN OUT prior_part_data_record
    RETURN INTEGER
    IS
    retVal INTEGER;
    prior_part_row_id INTEGER;
    prior_pgm_chng_s_id INTEGER;
    local_prior_part_data_record prior_part_data_record;
    BEGIN
    SELECT PR_PART_ROW_S_ID AS prior_part_row_id, PR_PGM_CHNG_S_ID AS prior_pgm_chng_s_id
    INTO local_prior_part_data_record
    --SELECT PR_PART_ROW_S_ID INTO retVal
    FROM PGM_RPLCMNT_PART
    WHERE PGM_S_ID = global_pgm_s_id AND CUR_PGM_CHNG_S_ID = param_prior_pgm_chng_s_id;
    return_prior_part_data_record := local_prior_part_data_record;
    retVal := 0;
    RETURN retVal;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    err_num := SQLCODE;
    err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
    DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
    retVal := -1;
    RETURN retVal;
    WHEN OTHERS
    THEN
    err_num := SQLCODE;
    err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
    DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
    retVal := -1;
    RETURN retVal;
    END getPriorPart;
    FUNCTION getComment (found_parts_list IN parts_list, comments OUT comment_list)
    RETURN INTEGER
    IS
    CURSOR init_cursor
    IS
    SELECT PGM_S_ID,PART_ROW_S_ID,PGM_CHNG_S_ID,CMNT_TXT,CMNT_DT,UPDT_RSRC_ID
    FROM PGM_PART_CMNT WHERE 1 = 2;
    retVal INTEGER;
    indexNum PLS_INTEGER;
    local_part_record prior_part_data_record;
    local_comment_record comment_record;
    local_part_row_s_id NUMBER;
    i PLS_INTEGER;
    BEGIN
    OPEN init_cursor;
    FETCH init_cursor
    BULK COLLECT INTO comments;
    i := 0;
    indexNum := found_parts_list.FIRST;
    WHILE indexNum IS NOT NULL
    LOOP
    local_part_record := found_parts_list(indexnum);
    local_part_row_s_id := local_part_record.prior_part_row_id;
    SELECT PGM_S_ID,PART_ROW_S_ID,PGM_CHNG_S_ID,CMNT_TXT,CMNT_DT,UPDT_RSRC_ID
    INTO local_comment_record FROM PGM_PART_CMNT
    WHERE PGM_S_ID = global_pgm_s_id
    AND PART_ROW_S_ID = local_part_row_s_id;
    comments(i) := local_comment_record;
    i := i + 1;
    END LOOP;
    RETURN retval;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    err_num := SQLCODE;
    err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
    DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
    RETURN retval;
    WHEN OTHERS
    THEN
    err_num := SQLCODE;
    err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
    DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
    RETURN retval;
    END getComment;
    PROCEDURE getComments
    pgm_s_id IN NUMBER,
    part_row_s_id IN NUMBER,
    partnumber_cursorlist OUT partnumber_cursor)
    IS
    comment_recordlist comment_record;
    retPartnumberlist partnumberlist;
    found_parts_list parts_list;
    local_part_record prior_part_data_record;
    is_more_parts BOOLEAN;
    driver_chng_s_id NUMBER;
    num_parts NUMBER;
    retVal NUMBER;
    comments comment_list;
    returnPartnumberlist partnumberlist;
    iloopCounter PLS_INTEGER;
    inx1 PLS_INTEGER;
    part_t partnumberlist :=partnumberlist(100,200,300);
    CURSOR part_list_init_cursor
    IS
    SELECT PR_PART_ROW_S_ID,PR_PGM_CHNG_S_ID FROM PGM_RPLCMNT_PART WHERE 1 = 2;
    CURSOR inIt_cursor
    IS
    SELECT 0 FROM DUAL WHERE 1 = 2;
    BEGIN
    DBMS_OUTPUT.ENABLE (5000000);
    global_pgm_s_id := pgm_s_id;
    global_part_row_s_id := part_row_s_id;
    SELECT PART_ROW_S_ID AS prior_part_row_id, PR_PGM_CHNG_S_ID AS prior_pgm_chng_s_id
    INTO local_part_record
    FROM PGM_RPLCMNT_PART
    WHERE PGM_S_ID = global_pgm_s_id AND PART_ROW_S_ID = global_part_row_s_id AND
    CUR_PGM_CHNG_S_ID IN (SELECT MAX(CUR_PGM_CHNG_S_ID) FROM PGM_RPLCMNT_PART WHERE
    PGM_S_ID = global_pgm_s_id AND PART_ROW_S_ID = global_part_row_s_id
    GROUP BY PART_ROW_S_ID);
    OPEN part_list_init_cursor;
    FETCH part_list_init_cursor
    BULK COLLECT INTO found_parts_list;
    -- Add the existing part to the found list
    found_parts_list.EXTEND;
    found_parts_list(1) := local_part_record;
    driver_chng_s_id := local_part_record.prior_pgm_chng_s_id;
    num_parts := 1;
    is_more_parts := TRUE;
    WHILE (is_more_parts) LOOP
    retVal := getPriorPart(driver_chng_s_id,local_part_record);
    IF (retVal != -1) THEN
    found_parts_list.EXTEND;
    num_parts := num_parts + 1;
    found_parts_list(num_parts) := local_part_record;
    driver_chng_s_id := local_part_record.prior_pgm_chng_s_id;
    ELSE
    is_more_parts := FALSE;
    END IF;
    END LOOP;
    --num_parts := getComment(found_parts_list,comments);
    OPEN init_cursor;
    FETCH init_cursor
    BULK COLLECT INTO returnPartnumberlist;
    num_parts := found_parts_list.COUNT;
    FOR iloopCounter IN 1 .. num_parts
    LOOP
    returnPartnumberlist.EXTEND;
    returnPartnumberlist(iloopCounter) := found_parts_list(iloopCounter).prior_part_row_id;
    END LOOP;
    retPartnumberlist := returnPartnumberlist;
    open
    *          partnumber_cursorlist for select PR_PART_ROW_S_ID from TABLE(CAST(retPartnumberlist AS historical_commentz.partnumberlist));*                              
    DBMS_OUTPUT.put_line('Done....!');
    EXCEPTION
    some code..............................
    END getComments;
    END HISTORICAL_COMMENTZ;
    /

  • Error while using the export utility

    Dear all of
    I am getting the following error while using the export utility in the Oracle database 9i
    I have run the catexp.sql and catrm.sql suggested by the experts in this forum. But it did not help me. Kindly help me in solving this issue.
    FOLLOWING ARE THE ERROR ----------------------------
    EXP-00008: ORACLE error 942 encountered
    ORA-00942: table or view does not exist
    EXP-00024: Export views not installed, please notify your DBA
    EXP-00000: Export terminated unsuccessfully
    -----------------------------------------------------------------------------------------------------------------------------------

    Can you go to this discussion please.
    Re: Getting a strange error for Exp
    -aijaz

Maybe you are looking for

  • IChat server will not start

    For reasons unknown, our server kernel panicked and had to be restarted. This machine is an OD replica. Since that time, we have not been able to restart iChat server. All other services appear to be working correctly. iChat was working without any p

  • Webi Reports - Stale data when saved a pdf/xls

    Hi Webi Guru's - we have a peculiar issue in our BOBJ Production system. To give you a bit of background on our production system - is hosted on O/S - EL 2.6 Database - Oracle 11g IE version - 9 2 Tomcat 6 servers, load balanced using F5 load balance

  • Problems with uploading application

    Hi, I have recently uploaded application into InMarket, but suddenly I'm unable to binary packages after recent changes. It was not submitted to any shop yet, as it is still in testing phase. My application was created with Flex 3.5 and was intended

  • Tableview Header Footer

    Hi, I'm trying to figure out why my tableview has been showing up with the column headers in gray color. The spot when you see the column name show me up in gray while in the another application it is came up in blue. I've seen in the interator that

  • Download error -50 what is iit

    I get a download error -50 on a movie download   Help