Upgradtion doubt in calling cl_gui_frontend_services= file_open_dialog

hi,
    Im upgrading from 4.5b to ecc 6.0 in the following code the export parameter  Default extn parameter in the call method
cl_gui_frontend_services=>file_open_dialog does not get displayed
i,e *.xls should be there bydefault it is not there in 6.0 how to get it. check the code once
ws_filename get fm is in comments
CALL FUNCTION 'WS_FILENAME_GET'
      EXPORTING
           DEF_FILENAME     =  C_DEFFILE
           DEF_PATH         = L_LOCFILE
           MASK              = C_MASK
           MODE             = C_MODE
      IMPORTING
           FILENAME         = L_FILE
      EXCEPTIONS
           INV_WINSYS       = 1
           NO_BATCH         = 2
           SELECTION_CANCEL = 3
           SELECTION_ERROR  = 4
           OTHERS           = 5.
IF SY-SUBRC EQ 3.
   MESSAGE I999 WITH 'Action Cancelled by user'(044).
   EXIT.
ENDIF.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
  EXPORTING
    DEFAULT_EXTENSION        = '*.xls,'
    FILE_FILTER              = '.'
  CHANGING
    file_table               = W_FILENAME
    rc                       = w_rc
  EXCEPTIONS
    FILE_OPEN_DIALOG_FAILED = 1
    CNTL_ERROR              = 2
    ERROR_NO_GUI            = 3
    NOT_SUPPORTED_BY_GUI    = 4
    others                  = 5.
IF W_RC IS NOT INITIAL.
   READ TABLE W_FILENAME INTO W_AREA INDEX 1.
IF SY-SUBRC = 0.
   L_FILE = W_AREA-FILENAME.
ENDIF.
ENDIF.

  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title            = 'File Selection'
      default_filename        = '*.xls'
      file_filter             = '(*.xls)|*.XLS|'
    CHANGING
      file_table              = lt_filetable
      rc                      = lv_filecount
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      OTHERS                  = 5.

Similar Messages

  • Error when using the method cl_gui_frontend_services= file_open_dialog

    Hello Experts,
    I am currently practicing BDC and I think the first step is to locate where my text file is. Now based on my code below, after selecting my text file nothing happens.
    Also, what will be my next after getting the file from a specific location? Thanks guys!
    REPORT  z_aris_practice_bdc_0
            NO STANDARD PAGE HEADING
            LINE-SIZE 255
            LINE-COUNT 64
            MESSAGE-ID zz.
    *BDC Data
    DATA: BEGIN OF bdc_tab OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdc_tab.
    *Internal Table
    DATA: BEGIN OF it_input OCCURS 0,
             user     TYPE usr02-bname,
             title    TYPE sza5_d0700-title_medi,
             lname    TYPE addr3_data-name_last,
             fname    TYPE addr3_data-name_first,
             initials TYPE addr3_data-initials,
             nickname TYPE addr3_data-nickname,
             function TYPE addr3_data-function,
          END OF it_input.
    DATA: gt_lines TYPE sy-tabix,
          gt_file  TYPE filetable,
          wa_file  TYPE filetable,
          gt_subrc TYPE i.
    *CONSTANTS
    CONSTANTS: c_mask(60) TYPE c  VALUE ',..'.
    *Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_input LIKE rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_input.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
       WINDOW_TITLE            =
       DEFAULT_EXTENSION       =
       DEFAULT_FILENAME        =
       FILE_FILTER             =
          initial_directory       = 'C:\Temp\'
          multiselection          = 'X'
        CHANGING
          file_table              = gt_file[]
          rc                      = gt_subrc
       USER_ACTION             =
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          OTHERS                  = 4.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM put_in_itab.
      PERFORM process_records.
    *&      Form  get_files
          text
    FORM put_in_itab.
      DATA: lv_file TYPE string.
      lv_file = p_input.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = lv_file
        FILETYPE                      = 'ASC'
         has_field_separator           = 'X'
        HEADER_LENGTH                 = 0
        READ_BY_LINE                  = 'X'
        DAT_MODE                      = ' '
        CODEPAGE                      = ' '
        IGNORE_CERR                   = ABAP_TRUE
        REPLACEMENT                   = '#'
        CHECK_BOM                     = ' '
        VIRUS_SCAN_PROFILE            =
        NO_AUTH_CHECK                 = ' '
      IMPORTING
        FILELENGTH                    =
        HEADER                        =
        TABLES
          data_tab                      = it_input
       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.
      ELSE.
        DESCRIBE TABLE it_input LINES gt_lines.
      ENDIF.
    ENDFORM.                    "get_files
    *&      Form  process_records
          text
    FORM process_records.
      LOOP AT it_input.
      ENDLOOP.
    ENDFORM.                    "process_records

    Hii viraylab,
    go throgh this link..This sample code solves ur problem....
    /people/milind.upasani/blog/2007/03/07/step-by-step-approach-to-ceate-simple-bdc-session-program-using-reusable-template
        U are new to BDC it seems...
        first u read the sap help ... then u will come know what to do after wards....
        http://help.sap.com/saphelp_47x200/helpdata/en/fa/097720543b11d1898e0000e8322d00/frameset.htm
    Be familiar with the structure BDCDATA.
    <b>Data transfers</b>  In this page..
    Next u need to know about the <b>transaction RECORDER the tcode is SHDB.</b>
    Nothing is difficult in this ..
    For example When u r creating a data element in SE11 u go through some screens in a flow, by clicking some pushbuttons and by generating some function codes manually, and entering values manually...
    But here u wont do it manually, these values will be populated from file into an internal table...
    Before calling a transaction into which u r going to populate the data is to be filled into a table with structure <b>BDCDATA.</b>
    <b>U need to use CALL TRANSACTION 'SE11' using BDCDATA or
    the session method..</b>
    Reward points for helpful answers...
    sai ramesh

  • Exit CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG once I get the file name

    Hi
    I have where I have a selection screen that finds the file, you can say where to get the file. After that I need to close that window. How do I close it???
    Below is an example of my program. After I choose the file and execute the program, I have a <b>write</b> statement. I don't see that statement on the screen. How do i terminate the input screen and display text.
    Parameters :  AUSZFILE      LIKE RFPDO1-FEBUMSF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR AUSZFILE.          "mo271101
      DATA: L_FILES TYPE FILETABLE,                            
            H_FILES TYPE FILE_TABLE,                           
            L_RC LIKE SY-SUBRC.                                
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG        CHANGING                                               
          FILE_TABLE              = L_FILES                    
          RC                      = L_RC                       
        EXCEPTIONS                                             
          FILE_OPEN_DIALOG_FAILED = 1                          
          CNTL_ERROR              = 2                          
          ERROR_NO_GUI            = 3                          
          NOT_SUPPORTED_BY_GUI    = 4                          
          OTHERS                  = 5.                         
      IF SY-SUBRC <> 0 OR L_RC < 0.                            
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO       "mo271101
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.   
      ELSE.                                                     "mo271101
        READ TABLE L_FILES INDEX 1 INTO H_FILES.              
        AUSZFILE = H_FILES-FILENAME.                           
      ENDIF.
    Write AUSZFILE.
    Thanks in advance

    You must remember the START-OF-SELECTION event here,  after you select the file name and click F8, the START-OF-SELECTION event is triggered, but if it is not there, nothing will happen.
      if sy-subrc <> 0 or l_rc < 0.
        message id sy-msgid type sy-msgty number sy-msgno       "mo271101
        with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.                                                     "mo271101
        read table l_files index 1 into h_files.
        auszfile = h_files-filename.
      endif.
    start-of-selection.            "<--  Add this
      write:/ auszfile.
    Regards,
    RIch Heilman

  • Pop up coming twice while using CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG

    Hello All,
      I am calling the method FILE_OPEN_DIALOG of the class CL_GUI_FRONTEND_SERVICES to display the pop up to select the file from the desktop.After i select the file and execute the program it displays the report and when i clcik the back button it gives me the pop up again.I have used  CALL METHOD CL_GUI_CFW=>FLUSH.Inspite of this it is not working properly.
    Thanks,
    Rakesh.

    Try This.....
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR F_PATH.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      CHANGING
        file_table              = file
        rc                      = rtrncode
      EXCEPTIONS
        file_open_dialog_failed = 1
        cntl_error                   = 2
        error_no_gui               = 3
        not_supported_by_gui = 4
        others                        = 5

  • Server path not drive CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG

    Hi folks
    When using the CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG or WS_FILENAME_GET we some times have the server path returned.
    And sometimes the drive letter returned.
    See two examples:
    1: \\blrx1\os390out\id1\test.txt
    2: R:\os390out\id1\test.txt
    What to do when we ALWAYS want the server path returned??
    Best regards
    Carsten

    I have used this several times in my own coding and I always get the \\
    in my end result
    method import_the_file_locn.
      data:
        lv_wintitle type string value 'Select Upload File',
        lv_deffile type string value 'asset_data',
        lv_dir type string value 'c\:',
        ls_file type line of filetable,
        lv_rc type i,
        lv_user_action type i.
      free gv_sdir.
      call method cl_gui_frontend_services=>file_open_dialog
        exporting
          window_title            = lv_wintitle
          default_filename        = lv_deffile
          initial_directory       = lv_dir
        changing
          file_table              = gt_file
          rc                      = lv_rc
          user_action             = lv_user_action
        exceptions
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          others                  = 4.
      check lv_user_action is initial.
      read table gt_file into ls_file index 1.
      translate ls_file to lower case.
      gv_sdir = ls_file.
    endmethod.
    I don't know whether it is perhaps a mapping issue / windows setting that results in the path returned with the mapped drive?
    I just debugged one of methods above and I cant recreate the same issue when I pick up a file in a mapped directory, sorry.
    I guess there is also the option for you to do some substring manipulation and path mapping in a look up table - but if you have hundreds of servers rather than a few maybe not the best workaround.

  • Exceptions in  cl_gui_frontend_services= file_open_dialog

    hi when upgrading from 4.5 to 6.o Im getting the following exception
    When the pop up box is cancelled during the download option, a success message is displayed in 6.0 whereas an error message is displayed in 4.5.
    here is the code
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
      EXPORTING
        DEFAULT_EXTENSION        = '*.xls,'
        DEFAULT_FILENAME         = '*.xls,'
        FILE_FILTER              = '.'
      CHANGING
        file_table               = W_FILENAME
        rc                       = w_rc
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5.
    IF W_RC IS NOT INITIAL.
       READ TABLE W_FILENAME INTO W_AREA INDEX 1.
    IF SY-SUBRC = 0.
       L_FILE = W_AREA-FILENAME.
    ENDIF.
    ENDIF.
      IF SY-SUBRC EQ 3.
        MESSAGE I999 WITH 'Action Cancelled by user'(044).
        EXIT.
      ENDIF.
    plz tell me where is the eror

    chk the data declearsation data type.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = 'Import from a local file'
          default_extension       = 'DAT'
         DEFAULT_FILENAME        =
          file_filter             = l_file_filter
          initial_directory       = 'C:\'
         MULTISELECTION          =
         WITH_ENCODING           =
        CHANGING
          file_table              = l_file_table
          rc                      = l_rc
         USER_ACTION             =
         FILE_ENCODING           =
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          not_supported_by_gui    = 4
          OTHERS                  = 5
          CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
            EXPORTING
              FILENAME                = V_FILE
              FILETYPE                = 'ASC'
              WRITE_FIELD_SEPARATOR   = 'X'
            CHANGING
              DATA_TAB                = IT_MAIN[]
            EXCEPTIONS
              FILE_WRITE_ERROR        = 1
              NO_BATCH                = 2
              GUI_REFUSE_FILETRANSFER = 3
              INVALID_TYPE            = 4
              NO_AUTHORITY            = 5
              UNKNOWN_ERROR           = 6
              HEADER_NOT_ALLOWED      = 7
              SEPARATOR_NOT_ALLOWED   = 8
              FILESIZE_NOT_ALLOWED    = 9
              HEADER_TOO_LONG         = 10
              DP_ERROR_CREATE         = 11
              DP_ERROR_SEND           = 12
              DP_ERROR_WRITE          = 13
              UNKNOWN_DP_ERROR        = 14
              ACCESS_DENIED           = 15
              DP_OUT_OF_MEMORY        = 16
              DISK_FULL               = 17
              DP_TIMEOUT              = 18
              FILE_NOT_FOUND          = 19
              DATAPROVIDER_EXCEPTION  = 20
              CONTROL_FLUSH_ERROR     = 21
              NOT_SUPPORTED_BY_GUI    = 22
              OTHERS                  = 23.
          IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.

  • File extension for: cl_gui_frontend_services= file_open_dialog

    Hello,
    I would like to set the file extension for cl_gui_frontend_services=>file_open_dialog such that my default extension in the file open dialogue is the .csv (comma-separated value) file. May I know how can I do that?
    Thanks!
    Regards,
    Anyi

    Hello,
    Thanks for the quick reply.
    Howeer, I tried to use the extension of CSV and the file dialogue opened up with .RTF (which is the default extension) instead.
    Any comment on that?
    Thanks!
    Anyi
    > HI,
    >
    > Here is the code
    >
      DATA:  l_title TYPE string,
    >          l_dfext TYPE string,
    > l_dfinm TYPE string,
    >          l_file  TYPE string,
    > l_path  TYPE string,
    >          l_fpath TYPE string.
    > le = 'SAVE FILE PATH'.
    >   l_dfext = 'csv'.
    > l_dfinm = 'Error_Idoc'.
    >
    > CONCATENATE l_dfinm sy-datum sy-uzeit INTO l_dfinm
    >  SEPARATED BY '_'.
    >
    > CONCATENATE  l_dfinm l_dfext INTO l_dfinm SEPARATED
    >  BY '.'.
    >
    > CALL METHOD
    >  cl_gui_frontend_services=>file_save_dialog
    >    EXPORTING
    >    window_title      = l_title
    >    default_extension = l_dfext
    >    default_file_name = l_dfinm
    >     INITIAL_DIRECTORY = L_DIR
    > CHANGING
    >       filename          =  l_file
    > path              =  l_path
    >       fullpath          =  l_fpath
    > CEPTIONS
    >       cntl_error        = 1
    > error_no_gui      = 2
    >       OTHERS            = 3.
    > s,
    > Richa

  • CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG

    Hi Experts,
    I have a customized program with BDC. first My program will convert a .dbf file into .xls file. My second program executes the .xls file.
    The .xls file that I get from my first program will be transferred into a textbox in my second program.
    But my second program is using CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG to execute a command. If you just enter the directory/path in the textbox it wont execute but if you use f4 the program will successfully be executed.
    I have put my method in AT SELECTION-SCREEN. so that when I use the bdc it will automatically read the path BUT the dialogbox still appear.
    How can I make the dialog box disappear but still it will execute the method ?
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
        exporting
          default_filename        = cv_fname "'C:\USERS\Asd\DESKTOP\RATRA.XLS'
        CHANGING
          FILE_TABLE              = t_files
          RC                      = v_rcode
        EXCEPTIONS
             file_open_dialog_failed = 1
             cntl_error              = 2
             error_no_gui            = 3
             OTHERS                  = 4.

    Hi Jepoy,
    You can set the result of the save button which is action_ok in a variable. So when u execute the same code again, just pass this below method call.
    IF lv_result = cl_gui_frontend_services=>action_OK.
             RETURN.
           ENDIF.
    Regards,
    Sivaganesh

  • CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG causes SAPGUI to crash

    Hi,
    When I try to select a file to download or upload an LSMW project my SAP GUI freezes completely, and the only way out is to kill it via Windows task manager.
    After quite some research I found out that:
    - This happens only on some PC's (but all PC's have the same SAP GUI version, i.e . 7.10)
    - When I debug this I see that the issue happens somewhere within CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    - The default folder passed to that method is C:\. If I change it to something else (in debug change mode), everything goes well
    Anybody experienced this before?
    Thanks
    Patrick

    Hi Jepoy,
    You can set the result of the save button which is action_ok in a variable. So when u execute the same code again, just pass this below method call.
    IF lv_result = cl_gui_frontend_services=>action_OK.
             RETURN.
           ENDIF.
    Regards,
    Sivaganesh

  • Regarding CL_GUI_FRONTEND_SERVICES= FILE_OPEN_DIALOG

    I'm using CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG to replace WS_FILENAME_GET which is an obsolete function module in ECC6.
    WS_FILENAME_GET was making use of the file mask -
    ',.csv  ,.csv ,.txt ,.txt.'
    When I use the same string in the file_filter parameter of FILE_OPEN_DIALOG, it doesn't work.
    Can somebody tell me the correct string format? I would like *.csv & *.txt as the file mask in the open dialog.
    Thanks!

    Hi
    U can give like this |.csv| ,|.csv |,|.txt |,|.txt.|'
    i think it will work.
    Thanks

  • Error :  while calling CL_GUI_FRONTEND_SERVICES= EXECUTE

    HI Expert,
    I am calling CL_GUI_FRONTEND_SERVICES=>EXECUTE in a RFC for running a Java program.This Java program converts a GIF image to Bitmap.
    When i execute this RFC (containing method) manually then there is no problem and it works perfectly but when the same RFC  is called through outside means from Java code then it gives error - "Access via NULL Object reference".
    How to resolve the error.
    Regards,
    Abhishek

    Methods of class CL_GUI_FRONTEND_SERVICES would only work if you try to execute them form the SAP GUI. That's why your RFC works good when you are running manually.
    You can let your JAVA program handle the functionality which you are trying to achieve by running the EXECUTE method.
    Regards,
    Naimesh Patel

  • ABAP OO Doubt - validate call method.

    Hi experts
    I'm beginer in ABAP OO and i created this code :
    output-cep = ch_adrc_struc-post_code1.
                 TRY.
                     CREATE OBJECT lr_cep.
                   CATCH cx_ai_system_fault .
                 ENDTRY.
                 TRY.
                     CALL METHOD lr_cep->si_servico_cep_out
                       EXPORTING
                         output = output
                       IMPORTING
                         input  = input.
                   CATCH cx_ai_system_fault .
                 ENDTRY.
    My doubt is : How to know the call method worked?
    In call function i use = if sy-subrc = 0 for check the return but can i use it after call method ?
    thanks a lot.

    there is an importing which is used to get back data.
    once you process input then you can decide whether method worked or not.

  • Doubt in call method program

    hi,
    I am getting error as i marked BOLD in this program...can u give solutions for that..
    REPORT  YSBDC6.
    TABLES:LFA1.
    DATA:BEGIN OF ITAB OCCURS 0,
         LIFNR LIKE LFA1-LIFNR,
         LAND1 LIKE LFA1-LAND1,
         NAME1 LIKE LFA1-NAME1,
         END OF ITAB.
    DATA:BEGIN OF JTAB OCCURS 0.
         INCLUDE STRUCTURE BDCDATA.
    DATA:END OF JTAB.
    DATA:BEGIN OF KTAB OCCURS 0.
         INCLUDE STRUCTURE BDCMSGCOLL.
    DATA:END OF KTAB.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
      FILENAME = 'C:\PRABA.TXT'
      FILETYPE = 'ASC'
      HAS_FIELD_SEPARATOR = 'X'
      CHANGING
        DATA_TAB = ITAB[].
       LOOP AT ITAB[] INTO ITAB.
        REFRESH JTAB.
        PERFORM SUB USING 'YVTRANS' '100'.
        PERFORM SUB1 USING:'LFA1-LIFNR' ITAB-LIFNR,
                           'LFA1-LAND1' ITAB-LAND1,
                           'LFA1-NAME1' ITAB-NAME1.
        PERFORM SUB1 USING 'BDC_OKCODE' 'INSERT'.
        CALL TRANSACTION 'YVTRANS' USING JTAB MODE 'A' MESSAGES INTO KTAB.
        LOOP AT KTAB.
        IF KTAB-MSGTYP = 'I' OR KTAB-MSGNR = 000.
          WRITE: /1 'vendor', 15 ITAB-LIFNR, 25 'INSERTED'.
          ELSEIF
            KTAB-MSGTYP ='E' OR KTAB-MSGNR = 001.
            WRITE: /1 'vendor', 15 ITAB-LIFNR, 25 'NOT INSERTED'.
            ENDIF.
            <b>REFRESH KTAB."ERROR IN THIS LINE 'YOU MAY NOT
            "Delete or overwrite table 'ktab' with in a loop through itself</b>
          ENDLOOP. 
       ENDLOOP.
            FORM SUB USING A B.
            CLEAR JTAB.
            JTAB-PROGRAM = A.
            JTAB-DYNPRO = B.
            JTAB-DYNBEGIN = 'X'.
            APPEND JTAB.
            ENDFORM.
        FORM SUB1 USING C D.
          CLEAR JTAB.
          JTAB-FNAM = C.
          JTAB-FVAL = D.
          APPEND JTAB.
          ENDFORM.

    HI,
    thanks for both..for immediate response..my PC got struck up that why i could not
    after editing this program i got error like YVTRANS not found..that means i have written seperate code for YVTRANS like below..is it correct..can u give solution for this..
    REPORT  YVTRANS.
    TABLES:LFA1.
    *DATA: WA TYPE LFA1.
    *ITAB TYPE TABLE OF LFA1.
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'INSERT'.
          INSERT LFA1.
          IF SY-SUBRC = 0.
            MESSAGE I000(0) WITH 'RECORD INSERTED'.
            ELSE.
              MESSAGE E001(0) WITH 'NOT INSERTED'.
              ENDIF.
              WHEN 'EXIT'.
                LEAVE PROGRAM.
                ENDCASE.
                ENDMODULE.
    orginal program
    REPORT  YSBDC6.
    TABLES:LFA1.
    DATA:BEGIN OF ITAB OCCURS 0,
         LIFNR LIKE LFA1-LIFNR,
         LAND1 LIKE LFA1-LAND1,
         NAME1 LIKE LFA1-NAME1,
         END OF ITAB.
    DATA:BEGIN OF JTAB OCCURS 0.
         INCLUDE STRUCTURE BDCDATA.
    DATA:END OF JTAB.
    DATA:BEGIN OF KTAB OCCURS 0.
         INCLUDE STRUCTURE BDCMSGCOLL.
    DATA:END OF KTAB.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
      FILENAME = 'C:\PRABA.TXT'
      FILETYPE = 'ASC'
      HAS_FIELD_SEPARATOR = 'X'
      CHANGING
        DATA_TAB = ITAB[].
       LOOP AT ITAB[] INTO ITAB.
        REFRESH JTAB.
        PERFORM SUB USING 'YVTRANS' '100'.
        PERFORM SUB1 USING:'LFA1-LIFNR' ITAB-LIFNR,
                           'LFA1-LAND1' ITAB-LAND1,
                           'LFA1-NAME1' ITAB-NAME1.
        PERFORM SUB1 USING 'BDC_OKCODE' 'INSERT'.
        CALL TRANSACTION 'YVTRANS' USING JTAB MODE 'A' MESSAGES INTO KTAB.
        LOOP AT KTAB.
        IF KTAB-MSGTYP = 'I' OR KTAB-MSGNR = 000.
          WRITE: /1 'vendor', 15 ITAB-LIFNR, 25 'INSERTED'.
          ELSEIF
            KTAB-MSGTYP ='E' OR KTAB-MSGNR = 001.
            WRITE: /1 'vendor', 15 ITAB-LIFNR, 25 'NOT INSERTED'.
            ENDIF.
            ENDLOOP.
          REFRESH KTAB.
       ENDLOOP.
            FORM SUB USING A B.
            CLEAR JTAB.
            JTAB-PROGRAM = A.
            JTAB-DYNPRO = B.
            JTAB-DYNBEGIN = 'X'.
            APPEND JTAB.
            ENDFORM.
        FORM SUB1 USING C D.
          CLEAR JTAB.
          JTAB-FNAM = C.
          JTAB-FVAL = D.
          APPEND JTAB.
          ENDFORM.

  • Screen designing - doubt in call transaction

    Hi Experts
    I have created the screen with 5 pushbuttons.
    If i click the pushbutton program calling the T.code.
    for example :
    one push button is for T.code 'MM03'. Byaccessing this i have created the material. Once the material is saved  how to go back to the main screen.
    Hope it is clear for you.
    pls help me.
    Thanks
    Kumar

    hi,
    Use like this
    MODULE user_command_0200 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE  save_ok.
        WHEN 'BACK'.
          LEAVE TO SCREEN 100 . "use your screen no
    Edited by: Aeda N on Nov 20, 2009 12:25 PM
    Edited by: Aeda N on Nov 20, 2009 12:25 PM

  • Doubt in Call Transaction

    Hi All,
    CALL FUNCTION 'GUI_UPLOAD '
    EXPORTING
    FILENAME = 'C:\Documents and Setting\shri\Desktop\Order.txt'
    FILETYPE = 'ASC'
    HAS_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = ITAB.
    When i use this function module to create a sales order VA01, It showing error for the first record,that is the first line in the text file,but when i give the same line in any other row in the text file it is taking properly.So I want to know in the generated text field what should be the first line? Whether the first line should have only the field names or what?
    Thanks .

    hi Shri,
    the problem may be the conversion exit.
    After uploading the text file into your internal table . Please use the conversion exit for all the mandatory fields.
    Thanks
    Sekhar

Maybe you are looking for