Exporting parameter of type table in Method of a Class

Hi Experts,
I want to pass an internal table from my method in ABAP class to a workflow.
For thi spurpose i have cretaed a parameter of type table in the method.
My problem is that i am not able to bind this to a workflow/task  container.
I can see all the other parameters of the method in thw workflow while binding except for the parameter of type table ( i.e internal table ).
Any idea ?
Thanks,
Radhika.

Assuming that you are trying to export the internal table from class method to task conatiner.
I have cretaed a Structure 'zemails' in se11
Already you have created a Structure in the SE11 , why don't you just create one Table Type of ZEMAILS in SE11. Once you hvae created in DDIC then in the class signature declare the ltmails of type the tabale type that you create. and then in the task conatiner also try to declare the container element with the same name and same table type.
In the class method declare the lt_mails as Exporting. save and actiavte. And one more thing if that element is not present in the Task conatiner then as soon as you try to open in the change mode and click on the binding button of the task it will prompt you asking whether you want to trnasfer the mssing elements if you clcik Yes then the same element which you have declared in the class will created with the same type. but make sure in the task conatiner you delcare the lt_mails as IMport export element.

Similar Messages

  • Dump while executing class method whose exporting parameter  of type table

    hi,
    i am getting dump after executing a method in which i want to export an internal table which will hold all the states name along with its code on the basis of the country name which is my importing parameter.
    for the above i am using importing parameter named as country of type too5u-land1 and the exporting parameter named as itab of type table and below is my code for the requirement.
    method PROCESS.
      select BLAND BEZEI from T005U
             INTO TABLE ITAB WHERE
             LAND1 = COUNTRY.
    endmethod.

    Hi,
      Please check the below code
    parameters country type land1.
    *Refer the class which we are using like below
    data: a type ref to ZCL_TX_SERVICE_01.
    data itab type ycountry.
    *ycountry is a table type defined in dictionary with fields BLAND and BEZEI
    data wa like line of itab.
    *If we are using instance method we need  to create the instance like below
    create object a.
    *In the method process define exporting parameter itab as type ycountry which is a table type already defined
    CALL METHOD a->PROCESS
      EXPORTING
        COUNTRY = country
      IMPORTING
        ITAB    = itab.
    loop at itab into wa.
    write:/ wa-bland.
    endloop.
    Regards
    Dande

  • ABAP for Super Dumps: Import- & Export-Parameter for a Table in a FM

    Hello ABAP Profs,
    sorry I am BW.
    <b>Import- & Export-Parameter for a Table in and out of an Function Modul.</b>
    I want to import a table into a Function Module, change it and export it again.
    How do I have to define the Import- and Export- Parameters in the FM ?
    The table looks looks this:
    DATA: zvpshub_tab TYPE SORTED TABLE OF /bic/pzvpshub WITH UNIQUE KEY
    /bic/zvpshub objvers /bic/zvpsoursy INITIAL SIZE 0.
    Thanks a lot
    Martin Sautter

    Hi Clemens,
    <u>in SE11</u> I defined a datatype of Type Structure: ZVPSHUB_ROW.
    <u>in SE11</u> I defiend a datatype of Type Tabletype: ZVPSHUB_TAB,
    bases on Rowtype ZVPSHUB_ROW.
    <u>in SE 80</u> I creates an FM with a CHANGEING Parameter referencing ZVPSHUB_TAB:
    FUNCTION ZVP_SHUB_TAB_LOAD.
    ""Lokale Schnittstelle:
    *"  CHANGING
    *"     VALUE(SHUB_TAB) TYPE  ZVPSHUB_TAB
    <u>in RSA1</u> in BW in the Startroutine of the Upload Rules in defined the table:
    DATA:shub_tab          TYPE zvpshub_tab.
    <u>in RSA1</u> in BW in the Startroutine of the Upload Rules in defined the table:
    DATA:shub_tab          TYPE zvpshub_tab.
    <u>in RSA1</u> in BW in the Startroutine i called the FM
    CALL FUNCTION 'ZVP_SHUB_TAB_LOAD'
        CHANGING
          shub_tab = shub_tab.
    and it works ..
    Thank You
    Martin Sautter

  • How could Ecatt support a FM which has export parameter data type as any

    Hi,
    I have created a FM which has export parameter data type as 'Type ref to data'.
    The actual paremeter value for this export parameter is a dynamically generated internal table, which does not have a abap dictionary data type.
    Could I use the 'FUN' ecatt command to test this FM?  How could I get this reference export parameter?
    Thanks a lot in advance!

    Hi,
    Wouldn't it be enough if you define parameter in test data container as reference to table type with structure of type c(1000)  (or more/less characters depending on how much data you need to pass)?
    I'm not 100% sure if filling this table with data will work (this is reference after all) but if this is an issue than create 2 parameters: 1 of table type and second of reference type. Then inside your script before FUN use ABAP...ENDABAP to assign your table parameter to reference parameter and use second one as input for FUN command.
    I think that either first or second solution should work.
    Best regards
    Marcin Cholewczuk

  • Exporting Parameter of type 'INDEX TABLE'

    Hi Experts,
    there is a standard method CL_CRM_MKTPL_OL_TRADE->GET_TRADESPENDS in CRM which has an exporting parameter ET_TRADESPENDS of type INDEX TABLE. Could somebody give me a hint on how to call this method and work with the data that is returned? I am assuming that I will need field symbols for this, correct? Coding examples would be greatly appreciated.
    Thanks,
    Jens

    Hi Jens,
    INDEX TABLE is a generic type. The data object expected depends on configuration and/or context. As we don't have any CRM system I can check CL_CRM_MKTPL_OL_TRADE->GET_TRADESPENDS I can't give you the details.
    I have some experience with comparable methods in SAP Transportation Managament which uses the BOPF framework. In program context, we know what type of table structure will be expected, so we defined a local table accordingly and passed it to the ET parameter.
    If you don't have any idea on how to find out, just declare any internal table, i.e-lt_test  type table of string. Then call the method with parameter ET_TRADESPENDS = lt_test. This will dump for sure. Enter debugger and check what kind of data are returned. From the field names you may get a clue what structure it could be. Dump analysis may also provide some info.
    Regards,
    Clemens

  • WRONG VALUE OF THE parameter file type(bdc-session method)

    Hi experts,
    when iam uploading vendor details,,,
    it is giving above error.
    chk the code once.....
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       FILENAME                      = 'C:/VENDOR1.TXT'
       FILETYPE                      = 'DAT'
      TABLES
        DATA_TAB                      = IT_UPLOAD.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
       CLIENT                    = SY-MANDT
       GROUP                     = 'SRR'
       USER                      = SY-UNAME.

    Hi here  iam sending the whole code once to you. just chk it once and same error(WRONG VALUE OF THE parameter file type) is coming after the changes.
    if i use asc it is giving that no file exists.
    Table Declaration
    tables :rf02k,    "Maintain vendor master record screen and work fields
            lfa1,     "Vendor Master(general)
            lfbk,     "Vendor Master (Bank Details)
            lfb1,     "Vendor Master (Company Code)
            lfm1,     "Vendor master record purchasing organization data
            lfb5.     "Vendor master (dunning data)
    Data Declaration
    data : begin of it_UPLOAD occurs 0,
           LIFNR like rf02k-lifnr,     "vendor no
           BUKRS like rf02k-bukrs,     "company code
           EKorg like rf02k-ekorg,     "purchasing org
           KTOKK like rf02k-ktokk,     "account group
           anred like lfa1-anred,     "initial
           name1 like lfa1-name1,     "name of vendor
           sortl like lfa1-sortl,     "search term
           land1 like lfa1-land1,     "country
           akont like lfb1-akont,     "reconcillation a/c.
           fdgrv like lfb1-fdgrv,     "planning group
           zterm like lfb1-zterm,     "terms of payment key
           mahna like LFB5-MAHNA,     "dunning procedure
           waers like lfm1-waers,     "Purchase order currency
           END OF IT_UPLOAD.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    include bdcrecx1.
    start-of-selection.
    UPLOADING THE DATA TO IT_UPLOAD
    call function 'GUI_UPLOAD'
    exporting
    filename = 'C:\DASRR\VENDOR1.TXT'
    filetype = 'DAT'
    has_field_separator = 'X'
    HEADER_LENGTH = 0
    READ_BY_LINE = 'X'
    DAT_MODE = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    CHECK_BOM = ' '
    IMPORTING
    FILELENGTH =
    HEADER =
    tables
    data_tab = IT_UPLOAD
    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.
    *CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      FILENAME                      = 'C:/VENDOR1.TXT'
      FILETYPE                      = 'DAT'
    TABLES
       DATA_TAB                      = IT_UPLOAD.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
       CLIENT                    = SY-MANDT
       GROUP                     = 'SRR'
       USER                      = SY-UNAME.
      POPULATE INTERNAL TABL
    LOOP AT IT_UPLOAD.
    CLEAR IT_BDCDATA.
    REFRESH IT_BDCDATA.
    PERFORM POPULATE_DATA.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
        TCODE                  = 'XK01'
       TABLES
        DYNPROTAB              = IT_BDCDATA.
    ENDLOOP.
    *&      Form  POPULATE_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_DATA .
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0100'.
    perform getdata using ' ' RF02K-LIFNR 'IT_UPLOAD-LIFNR'.
    perform getdata using ' ' RF02K-bukrs 'IT_UPLOAD-bukrs'.
    perform getdata using ' ' RF02K-EKORG 'IT_UPLOAD-EKORG'.
    perform getdata using ' ' RF02K-KTOKK 'IT_UPLOAD-KTOKK'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0110'.
    perform getdata using ' ' LFA1-ANRED 'IT_UPLOAD-ANRED'.
    perform getdata using ' ' LFA1-NAME1 'IT_UPLOAD-NAME1'.
    perform getdata using ' ' LFA1-SORTL 'IT_UPLOAD-SORTL'.
    perform getdata using ' ' LFA1-LAND1 'IT_UPLOAD-LAND1'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0210'.
    perform getdata using ' ' LFB1-AKONT 'IT_UPLOAD-AKONT'.
    perform getdata using ' ' LFB1-FDGRV 'IT_UPLOAD-FDGRV'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0215'.
    perform getdata using ' ' LFB1-ZTERM 'IT_UPLOAD-ZTERM'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0220'.
    perform getdata using ' ' LFB5-MAHNA 'IT_UPLOAD-MAHNA'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0310'.
    perform getdata using ' ' LFM1-WAERS 'IT_UPLOAD-WAERS'.
    ENDFORM.                    " POPULATE_DATA
    *&      Form  GETDATA
          text
         -->P_0213   text
         -->P_0214   text
         -->P_0215   text
    FORM GETDATA  USING    VALUE(P_0213)
                           VALUE(P_0214)
                           VALUE(P_0215).
                        IF P_0213  = 'X'.
                        IT_BDCDATA-PROGRAM = P_0213.
                        IT_BDCDATA-DYNPRO = P_0214.
                        IT_BDCDATA-DYNBEGIN = P_0215.
                        ELSE.
                        IT_BDCDATA-FNAM = P_0214.
                        IT_BDCDATA-FVAL = P_0215.
                        ENDIF.
    ****************any error in coding just chk it*****************

  • Howto check whether the input parameter of type table is NULL

    hi i have a procedure where the input parameters are of type collection (nested table ) the first line of my proc should check whether the input is null how to do that .
    i have defined the collection this way.
    CREATE OR REPLACE TYPE acct_tab as table of varchar2(40);
    my procedure is as follows
    create or replace procedure account_proc ( in_acct_array acct_tab) is
    begin
    ----> I want to check whether the input is null how to do this?
    end

    Raj,
    SQL> CREATE OR REPLACE TYPE acct_tab as table of varchar2(40);
      2  /
    Type created.
    SQL>
    SQL> create or replace procedure account_proc ( in_acct_array acct_tab) is
      2  begin
      3  if in_acct_array IS EMPTY
      4  then
      5   dbms_output.put_line('empty') ;
      6  else
      7   dbms_output.put_line(' NOT empty') ;
      8  end if ;
      9  end;
    10  /
    Procedure created.
    SQL>
    SQL> declare
      2    v acct_tab:=acct_tab();
      3  begin
      4          account_proc( v ) ;
      5  end ;
      6  /
    empty
    PL/SQL procedure successfully completed.SS

  • How to wite message into export parameter on fm

    Hi experts
    I have some code that will return sy-subrc = 5. when this occurs  i have a message to show. My question is how to write that on export parameter,
    CASE l_subrc.
    WHEN 0.
    WHEN 5.
          MESSAGE e034(lr) WITH pernr profile date.
    ENDCASE.
    For example:
    e_message = MESSAGE e034(lr) WITH pernr profile date.(message that is in it.)
    Thanks in advance.

    Hi,
    Declare the a parameter name of 'o_message'  in Export paramters of type 'Table type' that has  a structure of fields Message Type, Message id, message number and message text.
    Then in your program write like this:
    CASE l_subrc.
    WHEN 0.
    WHEN 5.
            wa_message-type = 'E'.
            wa_message-id = 'XXX.
            wa_message-mess_num = '034'.      
            MESSAGE ID wa_message-id TYPE wa_message-type
                NUMBER wa_message-mess_num WITH pernr profile date INTO wa_message-message.
            APPEND wa_message TO o_message.
    ENDCASE.
    So any no of messages can be appended to o_message table in the FM and you can loop through this o_message table to display the error messages from the FM.
    Hope this helps.
    Thanks & Regards,
    Priya

  • Type table

    Dear All,
    ET_SUBLIST has type table and it hasn't a header line.
    How can create the workarea now.
    Because I cant say:
    data workrea type table or
    data workrea like line of ET_SUBLIST ...
    all that is not working. Is there a workaround ?
    EXPORTING
       REFERENCE(ET_SUBLIST) TYPE TABLE
    LOOP AT et_sublist INTO workarea.
    ENDLOOP.
    Regards
    ertas

    > IF <fs_sublist> IS ASSIGNED. 
    " This statement NOT required, as the loop can only be here if <fs_sublist> is assigned.
    Sometimes it's necessary to do a loop at into.  Or you might want to do a read.  In this case, use:
    DATA: lp_data TYPE REF TO DATA.
    CREATE DATA LIKE LINE OF <the_table>.
    ASSIGN lp_data->* TO <the_work_area>.
    READ TABLE <the_table> INTO <the_work_area> WITH KEY ('FIELDNAME') = some_value.
    or
    DATA: lp_data TYPE REF TO DATA.
    CREATE DATA LIKE LINE OF <the_table>.
    ASSIGN lp_data->* TO <the_work_area>.
    ASSIGN FIELD 'FIELDNAME' OF STRUCTURE <the_work_area> TO <some_field>.
    LOOP AT <the_table> INTO <the_work_area>.
    *  Do stuff with <some_field>.
    which is more efficient than:
    LOOP AT <the_table> INTO <the_work_area>.
      ASSIGN FIELD 'FIELDNAME' OF STRUCTURE <the_work_area> TO <some_field>.
    *  Do stuff with <some_field>.
    matt
    Edited by: Matt on Jun 22, 2009 7:52 AM

  • How to use internal table in Exporting Parameter of method.

    Hi Friends,
    I am new to abap oops and using the following code to read a select-option and pass the data in an internal table but on defining
    internal table of a standard  type it is giving me following error :
    ITAB is not an internal table - the OCCURS n specification is missing.
    code
    ====
      class lcl_get_details DEFINITION.
        PUBLIC SECTION.
          types : r_carrid type RANGE OF sflight-carrid.
          data  : itab type STANDARD TABLE OF sflight.
          METHODS : get_data IMPORTING s_carrid type R_carrid
                             EXPORTING itab type sflight.
      ENDCLASS.   
    class lcl_get_details IMPLEMENTATION.
      METHOD get_data.
        select *
        from sflight
        into table itab
        where carrid in s_carrid.
        if sy-subrc eq 0.
          sort itab by carrid.
        endif.
      endmethod.   
    ERROR : ITAB is not an internal table - the OCCURS n specification is missing.
    Kindly help.

    Hi,
    I think your problem is, because you use 2 variables named ITAB in method get_data.
    Instance-variable ITAB is defined as STANDARD TABLE OF sflight.
    Exporting-parameter ITAB is defined as sflight.
    It seems like in implementation of get_data exporting-parameter ITAB is used.
    Try this implementation:
    METHOD get_data.
      select * from sflight into table me->itab
       where carrid in s_carrid.
      if sy-subrc eq 0.
      sort me->itab by carrid.
      endif.
    ENDMETHOD.
    This should solve your compiler error.
    Nether the less, get_data will yield an empty structure as result.
    Regards, Hubert
    Edited by: Hubert Heitzer on Feb 24, 2010 10:22 AM

  • Exporting table from methode

    Hi experts,
    how can I handle it to exporting a table from a structure from a methode?
    At the moment I export the structure in the methode but I need to export a table.
    At the moment:
    Parameter    Type           Typing Methode  Associated Type
    param_1      Exporting    Type                    structure
    I need something like that:
    Parameter    Type           Typing Methode  Associated Type
    param_1      Exporting    Type Table of      structure
    ... but that is not possible

    I think he meant something like this
    CLASS lcl_test DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS: get_tab EXPORTING gen_table TYPE table.
    ENDCLASS.                  
    CLASS lcl_test IMPLEMENTATION.
      METHOD get_tab.
        SELECT * FROM sflight INTO TABLE gen_table UP TO 10 ROWS.
      ENDMETHOD.                   
    ENDCLASS.                   
    START-OF-SELECTION.
      DATA: it_sflight TYPE TABLE OF sflight.
      lcl_test=>get_tab( IMPORTING gen_table = it_sflight ).
      "here IT_SFLIGHT holds what you want
    Of course you could make it more generic, meaning query dynamic DB table inside get_tab and create dynamic table outside the method call to get returned data to that table. But basically it shows the idea.
    Regards
    Marcin

  • Exporting Internal Table from Methods

    Hi Experts,
    I wanted to export an internal table from Methods and I am using below syntax and its not working.
    METHODS get_data IMPORTING value(s_matnr) type mara-matnr
                     exporting it_tab TYPE STANDARD TABLE itab.
    Please let me know what is the proper syntax.
    Thanks
    Basanagouda

    Hi,
    Define itab as a 'table type' of standard table.
    Example: TYPES: t_sflight TYPE STANDARD TABLE OF sflight.
    METHODS : get_data IMPORTING s_carrid type sel_carrid
    EXPORTING e_tab type t_sflight.
    ENDCLASS

  • Receiver Type Function Module in SWE2 use of export parameter.

    i am trying to understand the underlying concept in following things:(neednot to say i have searched alot and read sap documentation already).
    In event type linkage table say i have an entry for BOR -> AFVC_PM.
    As per sap Documentation says all these FM will trigger in following way.
    1 Check Function Module (to place any validations/checks)
    2 Receiver Type Function Module ()
    3 Receiver Function Module.
    Thats fine.
    This is what documentation says about Receiver Type FM(2nd FM) not Receiver FM(3rd FM).
    This FM has 1 export paramter
    Export parameters
    RECTYPE type SWETYPECOU-RECTYPE Receiver type( Result of the evaluation by the receiver type function module.)
    if i am understanding this right, in this FM receiver type will be decided .
    i have placed BREAK-POINT in this FM  and passing value WS90000024 (Workflow with simple mail step) in export parameter RECTYPE.
    after everything executed successfully why i can't see that mail in my inbox.
    Please correct me if i had misunderstood the concept .

    ok,indeed i was missing this thing.
    i got the mails in inbox.
    but why i can't see this value WS90000024 of this workflow ()which is going to be triggered ) in parameter RECTYPE.(its empty).
    it is empty after the receiver type function module execution is complete.
    below is workflow template,

  • How to pass a value to the export parameter for a method (public instance)?

    Hello,
      I am trying ABAP OO newly. How to pass a value to the export parameter for a method (public instance) called in a report? This *export parameter has a reference type of structure.
    Thanks in advance,
    Ranjini

    Hi,
    "class definition
    class lcl... definition.
      public section.
        method m1 imporitng par type ref to data.  "now you can pass any reference to the method, but this way you have to maintain this reference dynamically inside the method (you can't be sure what that reference is really "pointing" at)
    endclass.
    "in program
    data: r_lcl type ref to lcl...
    create object r_lcl.
    call method r_lcl
      exporting
         par    =  "pass any reference variable here
    Regards
    Marcin

  • SESSION METHOD( WRONG VALUE OF THE parameter file type)

    Hi here iam sending the whole code once to you. just chk it once and same error(WRONG VALUE OF THE parameter file type) is coming after the changes.
    if i use asc it is giving that no file exists.
    Table Declaration
    tables :rf02k, "Maintain vendor master record screen and work fields
    lfa1, "Vendor Master(general)
    lfbk, "Vendor Master (Bank Details)
    lfb1, "Vendor Master (Company Code)
    lfm1, "Vendor master record purchasing organization data
    lfb5. "Vendor master (dunning data)
    Data Declaration
    data : begin of it_UPLOAD occurs 0,
    LIFNR like rf02k-lifnr, "vendor no
    BUKRS like rf02k-bukrs, "company code
    EKorg like rf02k-ekorg, "purchasing org
    KTOKK like rf02k-ktokk, "account group
    anred like lfa1-anred, "initial
    name1 like lfa1-name1, "name of vendor
    sortl like lfa1-sortl, "search term
    land1 like lfa1-land1, "country
    akont like lfb1-akont, "reconcillation a/c.
    fdgrv like lfb1-fdgrv, "planning group
    zterm like lfb1-zterm, "terms of payment key
    mahna like LFB5-MAHNA, "dunning procedure
    waers like lfm1-waers, "Purchase order currency
    END OF IT_UPLOAD.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    include bdcrecx1.
    start-of-selection.
    UPLOADING THE DATA TO IT_UPLOAD
    call function 'GUI_UPLOAD'
    exporting
    filename = 'C:\DASRR\VENDOR1.TXT'
    filetype = 'DAT'
    has_field_separator = 'X'
    HEADER_LENGTH = 0
    READ_BY_LINE = 'X'
    DAT_MODE = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    CHECK_BOM = ' '
    IMPORTING
    FILELENGTH =
    HEADER =
    tables
    data_tab = IT_UPLOAD
    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.
    *CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = 'C:/VENDOR1.TXT'
    FILETYPE = 'DAT'
    TABLES
    DATA_TAB = IT_UPLOAD.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    GROUP = 'SRR'
    USER = SY-UNAME.
    POPULATE INTERNAL TABL
    LOOP AT IT_UPLOAD.
    CLEAR IT_BDCDATA.
    REFRESH IT_BDCDATA.
    PERFORM POPULATE_DATA.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = 'XK01'
    TABLES
    DYNPROTAB = IT_BDCDATA.
    ENDLOOP.
    *& Form POPULATE_DATA
    text
    --> p1 text
    <-- p2 text
    FORM POPULATE_DATA .
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0100'.
    perform getdata using ' ' RF02K-LIFNR 'IT_UPLOAD-LIFNR'.
    perform getdata using ' ' RF02K-bukrs 'IT_UPLOAD-bukrs'.
    perform getdata using ' ' RF02K-EKORG 'IT_UPLOAD-EKORG'.
    perform getdata using ' ' RF02K-KTOKK 'IT_UPLOAD-KTOKK'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0110'.
    perform getdata using ' ' LFA1-ANRED 'IT_UPLOAD-ANRED'.
    perform getdata using ' ' LFA1-NAME1 'IT_UPLOAD-NAME1'.
    perform getdata using ' ' LFA1-SORTL 'IT_UPLOAD-SORTL'.
    perform getdata using ' ' LFA1-LAND1 'IT_UPLOAD-LAND1'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0210'.
    perform getdata using ' ' LFB1-AKONT 'IT_UPLOAD-AKONT'.
    perform getdata using ' ' LFB1-FDGRV 'IT_UPLOAD-FDGRV'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0215'.
    perform getdata using ' ' LFB1-ZTERM 'IT_UPLOAD-ZTERM'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0220'.
    perform getdata using ' ' LFB5-MAHNA 'IT_UPLOAD-MAHNA'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0310'.
    perform getdata using ' ' LFM1-WAERS 'IT_UPLOAD-WAERS'.
    ENDFORM. " POPULATE_DATA
    *& Form GETDATA
    text
    -->P_0213 text
    -->P_0214 text
    -->P_0215 text
    FORM GETDATA USING VALUE(P_0213)
    VALUE(P_0214)
    VALUE(P_0215).
    IF P_0213 = 'X'.
    IT_BDCDATA-PROGRAM = P_0213.
    IT_BDCDATA-DYNPRO = P_0214.
    IT_BDCDATA-DYNBEGIN = P_0215.
    ELSE.
    IT_BDCDATA-FNAM = P_0214.
    IT_BDCDATA-FVAL = P_0215.
    ENDIF.

    When u use GUI_UPLOAD, U can not assign file type as 'dat'. This must be either ASC or BIN.
    Make sure  ur flat file path should correct..
    This well help u...

Maybe you are looking for