Error while using the function module GUI_UPLOAD

10-11  Source: Network gathering  Views:1 

Advertisement
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.
Related articles
  • Error while using the function module GUI_UPLOAD 10-11

    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-

  • Error while using the function module..pack_handling_unit_dlvry 10-11

    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

  • Error while activating the function module 10-11

    hi, am getting error while activating the function module i.e. program or report statement is missing. thank you in advance karthikhii vinu, hi there.... make sure that the Processing type in Attributes tab is 'Normal function module'. Also chk the g

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

    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

  • Error while executing the function module BAPI_RE_CN_CREATE 10-11

    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

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

    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

  • Issue with use of Function Module GUI_UPLOAD 10-11

    Hi Experts, I have an issue in using the Function Module GUI_UPLOAD for uploading the contents of an Excel file on the Presentation Server to an internal table in an ABAP Program. My file consists of around 300 records but the FM succeeds in uploadin

  • How to use the function module /IRM/IPBB_AGREEMENT_CREATE. 11-30

    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. T

  • Error While uploading the Function and Function_BP 10-11

    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.wdInvo

  • How to use the function module .... 11-30

    hi how to use the function module ssf_function_module_name in smartformsHi.. 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 na

  • How to use the function module ADDRESS_INTO_PRINTFORM? 11-30

    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 paramet

  • Error while using the export utility 10-11

    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. FOLLOW

  • ARM approval error after upgrading to SP14: Database error while using the secure store. 10-11

    Dear GRC experts, After upgrading GRC 10 to SP14, assigning manual passwords during the approval of a request, the approval process is failing. Here is the scenario; your advice will be appreciated. Task: Manually assign passwords to multiple systems

  • How to use the function module 'HR_ES_FEATURE_BACKFIELD' 10-11

    Hi, How to use the function module 'HR_ES_FEATURE_BACKFIELD'? I need the usage from both technical as well as functional point of view. What is the use of this function module and technically how it is to be used to retrieve a feature for a particula

  • How to use the Function Module RH_READ_INFTY_1001... 11-30

    Hi, Can any one Tell me .. How to do the same functionality .. given below (select). Using the Function Module RH_READ_INFTY_1001... *reads CP (Central Person) based on BP (Business Partner) Select single objid (Object ID)        from hrp1001       

  • How to use the function module CONVERSION_FACTOR_GET? 11-30

    Hi Experts, I have to use convert the value of a field from units 'HL' to 'HHL'. According to me, we can use the function module CONVERSION_FACTOR_GET. However, i am not able to know how to use it? Can anyone explain how to use the FM, i mean what sh

  • Regarding how to use the function module *control_form* in scripts 11-30

    HI friends, Can any one tell why and where do we use the function module control_form in scripts. Can you give me a small scenario how to use in scripts.hi satish, by using this function module we can pass the control commands to FORM THROUGH ABAP/4

  • How to Use the Function Module 'BAPI_BUSPROCESSND_CHANGEMULTI' 11-30

    Dear Experts,          Can anyone Explain me how to Use the Function Module 'BAPI_BUSPROCESSND_CHANGEMULTI'.My Requirement is i want to change the Partners of the Service Order.It is Very Urgent Requirement Please Help me. Thanks & Regards, Ashok.Hi,

  • How to find Job relationship using the Function Module  RH_STRUC_GET 11-30

    Hi Experts, I am getting O-S-P relation ship using for an org unit using the function module RH_STRUC_GET. Further If I want the job relation ship, how it can be found out. Thanks in Advance, IrfanHello Irfan, Have a look at the table T778A for evalu

  • Could i use the function module in my BAPI 11-30

    Hi, guys i am confused, can i use the standard function module which has not been released, in my BAPI. BAPI is used for cross applications. regards, chintaHi Chinta It is not advisable to use a not released Function Module for any business purpose,