Filename disappears on selection screen -BDC

Hi all,
I have an issue with my BDC,the seleection screen for picking up the file using parameters doesnt comes up in my parameter box. following is the code i'm using :
DATA: g_filename TYPE string.
**************FILE UPLOADING/DOWNLOADING**************************************
SELECTION-SCREEN BEGIN OF  BLOCK block WITH FRAME TITLE text-001.
PARAMETERS : in_file LIKE rlgrap-filename OBLIGATORY.
            SUC_FILE LIKE RLGRAP-FILENAME OBLIGATORY,
            SUCI_FIL LIKE RLGRAP-FILENAME OBLIGATORY,
            ERR_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK block.
For Browsing the Input File Name on the Presentation Server         *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR in_file.
CALL FUNCTION 'C13G0_GET_FILENAME_F4'
    CHANGING
      x_filename    = in_file
    EXCEPTIONS
      mask_too_long = 1.
PERFORM get_filename USING in_file.
Using call function for uploading a file                             *
START-OF-SELECTION.
g_filename = in_file.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename            = g_filename
      filetype            = 'ASC'
      has_field_separator = 'X'
    TABLES
      data_tab            = it_bdc.
END-OF-SELECTION.
NEED HELP GURUS !
EAGERLY WAITIN FOR REPLIES,
SACHIN

i guess the FM u had used should contain one more exporting parameter,
but use his
AT SELECTION-SCREEN ON VALUE-REQUEST FOR in_file.
  CALL FUNCTION 'F4_FILENAME'
       EXPORTING
            program_name  = v_repid
            dynpro_number = syst-dynnr
            field_name    = 'IN_FILE'
       IMPORTING
            file_name     = in_file.

Similar Messages

  • Compare the input filename in the selection screen

    In the selection screen input field
    there is an option of selecting the directory and file name and not the extension .
    This is used to download the datas
    Extension can be selected by using the option button
    rtf
    csv.
    the user has to give only  the filename and not the extension.
    suppose if the user input is C:\temp\file1.rtf.
    Either i should take only the filename
    or i should display the message give only the filename and not the extension . its already been selected!!!!
    I want to compare the input string contains  .doc
    how to do the comparison and to get the above results mentiond
    Thanks in advance

    Because the requirment is there are two option buttion for selecting the download file format
    But unknowingly if the user gives the filename along with the extension. I need to handle that error
    giving some error message or information message
    By comparing the last 4 letters of the filename.. either.doc or rtf or csv or watever
    so how to do that
    then after comparing that i should give the user a msg doc type is already selected give only the filename
    I hope u understand my req

  • Bdc: selection screen error

    HI,
    In the bdc program, after uploading a file in the selection screen using parameter selection, the screen gets refrehed and returns to the selection screen with no further action. How do I solve this error?

    *& Report  ZSALES2
    REPORT  ZSALES2.
    tables:VBAK,
           vbkd,
           kuagv,
           rv45a,
           vbap.
    types :begin of t_records,
           AUART type VBAK-AUART,
           BSTKD type VBKD-BSTKD,
           BSTDK type VBKD-BSTDK,
           KUNNR type KUAGV-KUNNR,
           KETDAT type RV45A-KETDAT,
           KPRGBZ type RV45A-KPRGBZ,
           PRSDT type VBKD-PRSDT,
           ZTERM type VBKD-ZTERM,
           MABNR type RV45A-MABNR,
           KWMENG type RV45A-KWMENG,
           POSNR type VBAP-POSNR,
           end of t_records.
    data: it_records type table of t_records,
            wa_records type t_records.
    DATA : BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE.
    PARAMETERS : P_FILE LIKE RLGRAP-FILENAME.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    PERFORM GET_FILE.
    start-of-selection.
    PERFORM GET_DATA.
    PERFORM BDCDATA.
    *&      Form  GET_FILE
          text
    form GET_FILE .
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    PROGRAM_NAME        = SYST-CPROG
    DYNPRO_NUMBER       = SYST-DYNNR
                            FIELD_NAME          = ' '
    IMPORTING
    FILE_NAME           = P_FILE.
    endform.                    " GET_FILE
    form GET_DATA.
    DATA:V_FILE TYPE STRING.
    V_FILE = P_FILE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = V_FILE
       FILETYPE                      = 'DAT'
       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_records
    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.
    endform.    " GET_DATA.
    form BDCDATA.
    loop at it_records into wa_records.
    *CALL TRANSCATION  "VA01" USING BDCDATA.
    perform bdc_dynpro      using 'SAPMV45A' '0101'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'VBAK-SPART'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'VBAK-AUART'
                                  'OR'.
    perform bdc_field       using 'VBAK-VKORG'
    perform bdc_field       using 'VBAK-VTWEG'
    perform bdc_field       using 'VBAK-SPART'
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  '07/12'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PICK'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'VBKD-BSTKD'.
    perform bdc_field       using 'VBKD-BSTKD'
                                  '123'.
    perform bdc_field       using 'VBKD-BSTDK'
                                  '08.10.2008'.
    perform bdc_field       using 'KUAGV-KUNNR'
                                  '31970063'.
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  '04/21'.
    perform bdc_field       using 'BDC_OKCODE'
                                  'PICK'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'RV45A-KETDAT'
                                  '08.10.2008'.
    perform bdc_field       using 'RV45A-KPRGBZ'
                                  'D'.
    perform bdc_field       using 'VBKD-PRSDT'
                                  '08.10.2008'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'VBKD-ZTERM'
                                  '0001'.
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  '06/11'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PICK'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'VBKD-BSTKD'
                                  '123'.
    perform bdc_field       using 'VBKD-BSTDK'
                                  '08.10.2008'.
    perform bdc_field       using 'KUAGV-KUNNR'
                                  '31970063'.
    perform bdc_field       using 'KUWEV-KUNNR'
                                  '31970063'.
    perform bdc_field       using 'RV45A-KETDAT'
                                  '08.10.2008'.
    perform bdc_field       using 'RV45A-KPRGBZ'
                                  'D'.
    perform bdc_field       using 'VBKD-PRSDT'
                                  '08.10.2008'.
    perform bdc_field       using 'VBKD-ZTERM'
                                  '0001'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RV45A-KWMENG(01)'.
    perform bdc_field       using 'RV45A-MABNR(01)'
                                  '102'.
    perform bdc_field       using 'RV45A-KWMENG(01)'
                                  '                  5'.
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  '05/08'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PICK'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'RV45A-MABNR(01)'
                                  '83'.
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  '16/04'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PICK'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'RV45A-MABNR(01)'
                                  '121'.
    perform bdc_field       using 'VBAP-POSNR(01)'
                                  '     1'.
    perform bdc_dynpro      using 'SAPMV45A' '4001'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EBAC1'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RV45A-MABNR(01)'.
    perform bdc_transaction using 'VA01' .
    CALL TRANSCATION 'VA01' USING BDCDATA.
    ENDLOOP.
    endform.   "BDCDATA
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
    IF FVAL <> NODATA.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
    ENDIF.
    ENDFORM.
    *&      Form  BDC_TRANSACTION
          text
         -->P_0428   text
    form BDC_TRANSACTION  using    value(p_0428).
    endform.                    " BDC_TRANSACTION

  • How to display my input history values on Filename filed (selection screen)

    Hi All,
    Please let me know how to display my input history values under the field of selection screen.
    I created Zprogram as below.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
      PARAMETERS: P_FILE  TYPE RLGRAP-FILENAME OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    I displayed a selection screen of my Zprogram, my cursor put on P_FILE field, and enter BACKSPACE key,
    so it doesn't display my input history values.
    Of course I've selected Local Data History 'ON' of my GUI option,
    so it's displayed my input history values on any other fields.
    If you know why, please let me know.
    Regards,
    Rie.

    In the GUI options, there is also a setting for the maximum length of fields for storing the history, maybe it is set to small, as your selection field is length 128.
    Alternatively you can switch to a STRING, I have observed that the history is displayed after the first letter is being entered (maybe dependent on GUI version, who knows...)
    Thomas

  • How to get the file name dialog on the selection screen

    Hi All
    I have a selection screen in which there is a parameter where I need to enter file name. Instead of typing filename in the parameter I would like to give a path from presentation server ( I am downloading Data to presentation server ).
    How to achive this functionality in case of a parameter on the selection screen. I need to have File open Dialog box like Windows here and then it should show the filename and it's path in this parameter after selectiong from the dialog box.
    Amol

    Hi..,
    Use the function module <b>F4_FILENAME</b> or <b>WS_FILENAME_GET</b> in the event
    <b>AT SELECTION-SCREEN ON VALUE REQUEST FOR P_FILE.</b>
    Parameters p_file type rlgrap-filename.
                AT SELECTION-SCREEN ON VALUE REQUEST EVENT            
    at selection-screen on value-request for p_file.
      perform value_request.
    *&      Form  value_request
          This subroutine proposes the possible input values             *
    There are no interface parameters to be passed to this subroutine.  *
    form value_request.
      call function 'WS_FILENAME_GET'
       importing
         filename               = p_file
       exceptions
         inv_winsys             = 1
         no_batch               = 2
         selection_cancel       = 3
         selection_error        = 4
         others                 = 5.
      check sy-subrc eq 0.
    endform.              
    Reward all helpful answers !!
    sai ramesh

  • SELECTION-SCREEN problem

    [Background:]
    (1)There are two parameters in a radio button group.
        One is P_SCREEN,it means display report on screen
       and another is P_FILE,it means output report into a file.
    (2)There is a parameter P_NTFILE, use it to indicate output file path.
    [Target:]
    (1)After the selection-screen built,
       If the P_FILE is checked,P_NTFILE should be enable.
       If the P_SCREEN is checked,P_NTFILE should be disable.
    [Code:]
    Parameter in Block2
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: P_SCREEN RADIOBUTTON GROUP R1. " Screen output
    SELECTION-SCREEN COMMENT 04(21) TEXT-001.
    SELECTION-SCREEN POSITION 32.
    PARAMETERS: P_FILE RADIOBUTTON GROUP R1. " NTFILE output
    SELECTION-SCREEN COMMENT 35(17) TEXT-002.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    Parameter in Block3
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME.
    PARAMETERS: P_NTFILE(45) TYPE C LOWER CASE OBLIGATORY MODIF ID SC1.
    P_PCFILE      LIKE RLGRAP-FILENAME OBLIGATORY.
    SELECTION-SCREEN END   OF BLOCK B3.
    *&      AT SELECTION-SCREE
    AT SELECTION-SCREEN.
      IF P_SCREEN = 'X'.
        FLAG = 0.
      ENDIF.
      IF P_FILE = 'X'.
        FLAG = 1.
      ENDIF.
    *&      AT SELECTION-SCREE ON <FIELD>
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP R1.
      IF P_SCREEN = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'SC1'.
            SCREEN-INPUT = FLAG.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
      IF P_FILE = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'SC1'.
            SCREEN-INPUT = FLAG.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    [Problem:]
    P_NTFILE can not refresh between enable and disable status.
    Anyone can help me?

    *& Report  Z_JAGANOBJECT                                               *
    REPORT  Z_JAGANOBJECT line-count 0(1)                          .
    Tables sscrfields.
    *--parameters--
            SELECTION-SCREEN BEGIN OF BLOCK RB1 WITH FRAME TITLE new.
            selection-screen :skip 2.
                PARAMETERS : cmp_name(10) type c,
                             imp_code(5) type n,
                             exp_cmp(10) TYPE c,
                             Exp_mtrl(10) TYPE c.
    ------------------------radi button---------------------
               SELECTION-SCREEN BEGIN OF BLOCK RB WITH FRAME TITLE text.
               selection-screen: skip 1.
                 PARAMETERS : Import RADIOBUTTON GROUP RB user-command usr,
                              Export RADIOBUTTON GROUP RB DEFAULT 'X'.
               SELECTION-SCREEN END OF BLOCK RB.
               SELECTION-SCREEN END OF BLOCK RB1.
    *--push button--
    SELECTION-SCREEN PUSHBUTTON /40(20) SAVE USER-COMMAND STORE.
    DATA : FLAG TYPE I.
    *--internal tables--
    data :    begin of itab occurs 0,
                 cmp_name(10) type c,
                 imp_code(5) type n,
              end of itab.
    data :    begin of itab1 occurs 0,
                 exp_cmp(10) TYPE c,
                 Exp_mtrl(10) TYPE c,
              end of itab1.
    *--initalisaton--
    INITIALIZATION.
    save = 'store'.
    text = ' Type '.
    new = ' Import- Export details'.
    *--selection screen--
    AT SELECTION-SCREEN.
          case SSCRFIELDS-ucomm.
               when 'STORE'.
               FLAG = '1'.
                    if import = 'X'.
                       itab-cmp_name = cmp_name.
                       itab-imp_code = imp_code.
                append itab.
                clear itab.
                endif.
                    if export = 'X'.
                       itab1-exp_cmp = exp_cmp.
                       itab1-Exp_mtrl = Exp_mtrl.
               append itab1.
               clear itab1.
               endif.
               ENDcase.
    *--selection screen output--
    AT SELECTION-SCREEN OUTPUT.
      IF export = 'X'.
       LOOP AT SCREEN.
          IF SCREEN-NAME = 'CMP_NAME' OR  SCREEN-NAME = 'IMP_CODE'.
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
       elseIF import  = 'X'.
        LOOP AT SCREEN.
          IF SCREEN-NAME = 'EXP_CMP' OR SCREEN-NAME = 'EXP_MTRL'.
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    end-of-selection.
    LOOP AT ITAB.
    WRITE : /10 itab-cmp_name, 30 itab-imp_code.
    ENDLOOP.
    LOOP AT ITAB1.
    WRITE : /10 itab1-exp_cmp,50 itab1-exp_mtrl.
    ENDLOOP.
    hope its useful,
    reward points if its useful
    regards
    vijay

  • Selection screen field value

    Hi All,
    I am facing a problem with selection screen parameter.
    I have one file parameter p_fname TYPE rlgrap-filename OBLIGATORY.When I enter some file path and excute I will get the result and once again when I start to execute the program I expect the previous value(file path) should be available for this file parameter that has entered on the selection screen but I am not getting that.
    I dont find any parameter id for this field data element.
    Please let me know how to do this?
    Best Regards
    Ramesh

    Hi,
    You should have..
    DATA: FLNAME TYPE STRING.
    PARAMETERS: FILENAME TYPE RLGRAP-FILENAME.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
      CALL FUNCTION 'F4_FILENAME'
       IMPORTING
         FILE_NAME           = FILENAME.
    Find the demo code below, it uses the file :
    report ZDS_BDC_MM01_2
           no standard page heading line-size 255.
    *include bdcrecx1.
    *parameters: dataset(132) lower case.
    ***    DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
    *   If it is nessesary to change the data section use the rules:
    *   1.) Each definition of a field exists of two lines
    *   2.) The first line shows exactly the comment
    *       '* data element: ' followed with the data element
    *       which describes the field.
    *       If you don't have a data element use the
    *       comment without a data element name
    *   3.) The second line shows the fieldname of the
    *       structure, the fieldname must consist of
    *       a fieldname and optional the character '_' and
    *       three numbers and the field length in brackets
    *   4.) Each field must be type C.
    *** Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of record OCCURS 0,
    * data element: MATNR
            MATNR_001(018),
    * data element: MBRSH
            MBRSH_002(001),
    * data element: MTART
            MTART_003(004),
    * data element: XFELD
            KZSEL_01_004(001),
    * data element: MAKTX
            MAKTX_005(040),
    * data element: MEINS
            MEINS_006(003),
    * data element: MTPOS_MARA
            MTPOS_MARA_007(004),
          end of record.
    DATA: FLNAME TYPE STRING.
    *** End generated data section ***
    DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
    *** MESSAGE******
    DATA: BEGIN OF MESSTAB OCCURS 0.
            INCLUDE STRUCTURE BDCMSGCOLL.
            DATA: MATNR TYPE MARA-MATNR,
          END OF MESSTAB.
    ****END OF MESSAGE****
    PARAMETERS: FILENAME TYPE RLGRAP-FILENAME.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
      CALL FUNCTION 'F4_FILENAME'
       IMPORTING
         FILE_NAME           = FILENAME.
    start-of-selection.
    *perform open_dataset using dataset.
    perform open_group.
    FLNAME = FILENAME.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FLNAME
        FILETYPE                      = 'DAT'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   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                      = record
    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.
    LOOP AT record.
      DATA:
        CNT TYPE I.
        CNT = CNT + 1.
        REFRESH BDCDATA.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MTART'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  record-MATNR_001.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  record-MBRSH_002.
    perform bdc_field       using 'RMMG1-MTART'
                                  record-MTART_003.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                  record-KZSEL_01_004.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-MAKTX_005.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-MEINS_006.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                  record-MTPOS_MARA_007.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    *perform bdc_transaction using 'MM01'.
    CALL TRANSACTION 'MM01' USING BDCDATA
                            MODE 'N'
                            UPDATE 'A'
                            MESSAGES INTO MESSTAB.
    READ TABLE MESSTAB INTO MESSTAB INDEX CNT.
       IF MESSTAB-MSGTYP = 'E'.
         MESSTAB-MATNR = RECORD-MATNR_001.
         MODIFY MESSTAB INDEX CNT FROM MESSTAB. " TRANSPORTING MATNR.
       ENDIF.
    ENDLOOP.
    FORM OPEN_GROUP.
      CALL FUNCTION 'BDC_OPEN_GROUP'
             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = 'MM01'
                        USER     = SY-UNAME
                        KEEP     = 'X'.
    ENDFORM.
    FORM BDC_INSERT.
      CALL FUNCTION 'BDC_INSERT'
       EXPORTING
         TCODE                  = 'MM01'
    *     POST_LOCAL             = NOVBLOCAL
    *     PRINTING               = NOPRINT
    *     SIMUBATCH              = ' '
    *     CTUPARAMS              = ' '
        TABLES
          DYNPROTAB              = BDCDATA
       EXCEPTIONS
         INTERNAL_ERROR         = 1
         NOT_OPEN               = 2
         QUEUE_ERROR            = 3
         TCODE_INVALID          = 4
         PRINTING_INVALID       = 5
         POSTING_INVALID        = 6
         OTHERS                 = 7
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.
    END-OF-SELECTION.
    LOOP AT MESSTAB.
        IF MESSTAB-MSGTYP = 'E'.
          WRITE:/ 'ERROR OCCURED ON MATNR = ',MESSTAB-MATNR , 'MESSAGE : MATNR ALREADY EXISTS IN MARA!!!'.
        ENDIF.
      ENDLOOP.
    perform close_group.
    *perform close_dataset using dataset.
    *&      Form  close_group
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM close_group .
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
       NOT_OPEN          = 1
       QUEUE_ERROR       = 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.
    ENDFORM.                    " close_group
    *&      Form  bdc_dynpro
    *       text
    *      -->P_0270   text
    *      -->P_0271   text
    FORM bdc_dynpro  USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
    *       text
    *      -->P_0275   text
    *      -->P_0276   text
    FORM bdc_field  USING  FNAM FVAL.
      IF FVAL <> ' '.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.                    " bdc_field
    HTH
    Regards,
    Dhruv Shah

  • Hiding a block in selection screen

    Hi everybody,
             My requirement is to hide the entire block of a particular selection screen, find the below selection screen code.  with my piece of code,iindividual fields are getting hidden, please let me know how to hide the entire block.
              If I select rb_det then the block b2 should hide.
    Selection screen :
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t02.
    PARAMETER: rb_sum RADIOBUTTON GROUP rtyp DEFAULT 'X' USER-COMMAND DISP,
    rb_det RADIOBUTTON GROUP rtyp.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t04.
    PARAMETER: cb_asco AS CHECKBOX DEFAULT 'X' modif id SEL,
    cb_divi AS CHECKBOX modif id SEL,
    cb_buen AS CHECKBOX modif id SEL,
    cb_prod AS CHECKBOX modif id SEL,
    cb_bupa AS CHECKBOX modif id SEL,
    cb_inob AS CHECKBOX modif id SEL.
    SELECTION-SCREEN END OF BLOCK b2.
    Existing code :
    A T S E L E C T I O N - S C R E E N *
    at selection-screen output.
    loop at screen.
    if screen-group1 = 'SEL'.
    if rb_det = 'X'.
    if screen-name = 'CB_ASCO' or
    screen-name = 'CB_DIVI' or
    screen-name = 'CB_BUEN' or
    screen-name = 'CB_PROD' or
    screen-name = 'CB_BUPA' or
    screen-name = 'CB_INOB' .
    screen-active = 0.
    modify screen.
    endif.
    endif.
    endif.
    endloop.
    Thanks in advance...
    Regards,
    Ravi

    Hi,
    A block will be made invisible if everything inside it is inactive. If you give all of them a MODIF ID, too, the block will disappear.
    SELECTION-SCREEN BEGIN OF BLOCK processing WITH FRAME TITLE text-030.
      SELECTION-SCREEN BEGIN OF LINE.
      PARAMETERS pa_xmanu LIKE rm08mrbr-manu DEFAULT 'X'
      RADIOBUTTON GROUP val MODIF ID id1.
      SELECTION-SCREEN COMMENT 3(30) text-040 FOR FIELD pa_xmanu MODIF ID
    id1.
      SELECTION-SCREEN POSITION 40.
      PARAMETERS pa_xauto LIKE rm08mrbr-auto
      RADIOBUTTON GROUP val MODIF ID id1.
      SELECTION-SCREEN COMMENT 43(30) text-050 FOR FIELD pa_xauto MODIF ID
    id1.
      SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN BEGIN OF LINE.
      PARAMETERS: pa_xskto LIKE rm08mrbr-skto AS CHECKBOX MODIF ID id1.
      SELECTION-SCREEN COMMENT 3(30) text-055
      FOR FIELD pa_xskto MODIF ID id1.
      SELECTION-SCREEN END OF LINE.
      SELECTION-SCREEN END OF BLOCK processing.
      AT SELECTION-SCREEN OUTPUT.
        LOOP AT SCREEN.
          IF screen-group1 = 'ID1'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
    Regards,
    Priyanka.

  • Path for Directory in Selection Screen

    I have one field in selection screen Error log.
    I have to pick path for dirctory in that parameter, so that I can save my error log there on that path.
    how i can do it ?
    F4 for the path is needed. how i will define that parameter in selection screen?

    Hi
    Check the below logic:
    DATA :G_DIR1 TYPE STRING.
    DATA : G_T_FILENAMES TYPE SETST_TYPE_STANDARD_TABLE,
           G_WA_FILES LIKE LINE OF G_T_FILENAMES.
    PARAMETERS: P_FOLDER TYPE RLGRAP-FILENAME OBLIGATORY
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FOLDER.
      PERFORM F1000_GET_DIR.
    START-OF-SELECTION.
      IF G_DIR IS INITIAL.
        G_DIR = P_FOLDER.
      ENDIF.
    PERFORM F1100_GET_FILENAMES USING G_DIR.
    FORM F1000_GET_DIR .
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
        EXPORTING
          WINDOW_TITLE         = 'Folder for ADP Files'
          INITIAL_FOLDER       = G_DIR1
        CHANGING
          SELECTED_FOLDER      = G_DIR1
        EXCEPTIONS
          CNTL_ERROR           = 1
          ERROR_NO_GUI         = 2
          NOT_SUPPORTED_BY_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.
      ELSE.
        P_FOLDER = G_DIR1.
      ENDIF.
    ENDFORM.
    FORM F1100_GET_FILENAMES  USING    P_DIR.
      DATA : L_DIR TYPE STRING,
                L_COUNT TYPE I,
                L_COUNT1 TYPE I.
      DATA : L_T_FILES TYPE SETST_TYPE_STANDARD_TABLE,
             WA_FILES LIKE LINE OF L_T_FILES.
      L_DIR = P_DIR.
      CLEAR : G_T_FILENAMES[], G_T_FILENAMES.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
        EXPORTING
          DIRECTORY                   = L_DIR
       FILTER                      = '.'
       FILES_ONLY                  =
       DIRECTORIES_ONLY            =
        CHANGING
          FILE_TABLE                  = L_T_FILES
          COUNT                       = L_COUNT
        EXCEPTIONS
          CNTL_ERROR                  = 1
          DIRECTORY_LIST_FILES_FAILED = 2
          WRONG_PARAMETER             = 3
          ERROR_NO_GUI                = 4
          NOT_SUPPORTED_BY_GUI        = 5
          OTHERS                      = 6
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      G_T_FILENAMES[] = L_T_FILES[].
      LOOP AT G_T_FILENAMES INTO G_WA_FILES.
        IF G_WA_FILES CS SY-DATUM.
          G_WA_FILES1 = G_WA_FILES.
          APPEND G_WA_FILES1 TO G_T_FILENAMES1.
        ENDIF.
      ENDLOOP.
    Regards,
    Ravinder

  • How do I add a selection screen parameter to get a application server file

    Hi All..
    Can you please suggest how can we add a selection screen parameter to get a application server file ?
    Thanx in Advance...
    Regards,
    Deepak

    <b>Parameter def :</b>
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 02(30) text-005 FOR FIELD p_xlfil.
    PARAMETERS: p_xlfil LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    <b>Browse</b>
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_xlfil.
      PERFORM ws_get_filename USING p_xlfil.
    FORM ws_get_filename USING p_xlfil.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_path         = 'C:'
                mask             = ',Excel,*.xls,All,*.*.'(100)
                mode             = 'O'
                title            = 'Title'(101)
           IMPORTING
                filename         = p_xlfil
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
      IF sy-subrc NE 0.
        CLEAR p_xlfil.
      ENDIF.
    ENDFORM. " WS_GET_FILENAME
    Regards
    <b>Oops i did not read "application server"</b>
    Use FM F4_FILENAME_SERVER and not F4_FILENAME/WS_GET_FILENAME.
    Message was edited by:
            Raymond Giuseppi

  • Issue with MB25 BDC for Dynamic Selection Screen

    Hi Experts,
    I recorded one BDC for MB25 Tcode regarding to determine Open Reservation(s) in E Mode (Display Mode). I am passing 3 parameters.
    1. Plant,
    2. Requirement Date
    3. Multiple Reservation Numbers i.e. RSNUM from Dynamic Selection i.e. 2nd Button -> Header Data for Reservation -> Reservation -> Multiple Selection Icon.
    But while executing that BDC, I need to manually click every time on 'Header Data for Reservation' Tree and then Multiple Selection for Reservation Icon.
    I want below steps automatically while executing:
    - Open 'Header Data for Reservation' Tree
    - Click Reservation
    - Open Popup for 'Multiple Selection'.
    So no need to click every time on Dynamic Selection Screen i.e. Header Data for Reservation -> Reservation -> Multiple Selection Icon.
    Please find attached screen shot for your reference.
    Please guide.
    Thanks and Regards,
    Emon Master

    Hello Jainam,
    submit (sy-repid) with selection-table v_sp
                             with free selections EXPRESSIONS
                             via selection-screen.
    Without going through the details, dont you think this will cause an inifinite loop as the calling & the called programs are the same.
    Please enlighten me !!
    BR,
    Suhas

  • F4 help for a selection screen parameter with filename created dynamically

    Hi All,
              I have a requirement where in an F4 help should be present for a selection screen parameter. After selecting the filepath and clicking OK button on the Dialog, the filename should be dynamically get created in the selection screen parameter field. For example:
    if the path is D:\DOCS then at the end of DOCS the filename should automatically get populated.
    Like below string:
    D:\DOCS\new.txt
    Is there any function module or method which does this kind of activity.
    Thanks in advance,
    Deepak

    this code will help:
    FORM get_filename  CHANGING p_filename.
      DATA      : lv_filename  TYPE string,
                  lv_rc TYPE i,
                  li_filetable TYPE filetable.
      CONSTANTS : lc_fname TYPE string VALUE 'ZRPP4000.XLS',
                  lc_fpath TYPE string VALUE 'C:\',
                  lc_extn TYPE string VALUE 'XLS'.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          default_filename        = lc_fname
          initial_directory       = lc_fpath
          default_extension       = lc_extn
        CHANGING
          file_table              = li_filetable
          rc                      = lv_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 .
        READ TABLE li_filetable INTO lv_filename INDEX 1.
        IF sy-subrc = 0.
          p_filename = lv_filename.
        ENDIF.
      ENDIF.
      REFRESH li_filetable.
      CLEAR:lv_filename.
    ENDFORM.                    "get_filename
    " p_filename is selection screen parameter

  • I have mapped the fields on the selection-screen  to the BDC on transaction

    I have mapped the fields on the selection-screen  to the BDC on transaction F110.
    When I am selecting a particular any value in select-option on the selection screen, it is giving some default value and the value given by me,for example:
    Payment methods:C
    but in BDC recording for F110 Payment methods:IEQC when the programs is running in foreground mode.
    how can I rectify it?

    This is because payment methods may be a table and what you see IEQC is actually, I for include, EQ for equal and C as your payment method. This is standard structure for ranges or select-options. You can use variable-low which will give you only C.

  • BDC on Selection Screen report

    Hi Experts,
    Is there any norm of NOT using BDC for selection screen reports? Please share your experience if someone had used it and faced issues later.
    Thanks,
    Chirantan

    Hi Chirantan ,
    I would advice you to use submit report option instead of BDC.
    First capture your selection screen parameters into a selection_table and fill it with suitable data .
    Use submit report and there you go......... report is executed.
    ALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
                EXPORTING
                  CURR_REPORT               = 'ZREPORT'
    *         IMPORTING
    *           SP                        =
                TABLES
                  SELECTION_TABLE           = LT_SELSCREEN
    *           SELECTION_TABLE_255       =
    *         EXCEPTIONS
    *           NOT_FOUND                 = 1
    *           NO_REPORT                 = 2
    *           OTHERS                    = 3
              IF SY-SUBRC <> 0.
    * Implement suitable error handling here
              ENDIF.
    * Fill LT_SELSCREEN
              LOOP AT LT_SELSCREEN INTO LW_SELSCREEN.
                CASE LW_SELSCREEN-SELNAME.
    *           WHEN OTHERS.
                ENDCASE.
              ENDLOOP.
                SUBMIT ZREPORT
                      USING SELECTION-SCREEN 1000
                WITH SELECTION-TABLE LT_SELSCREEN
                AND RETURN .
    Regards ,
    Yogendra Bhaskar

  • After taking a pix with my iPhone, it shows up in my Album.  But when I select it to look at it or forward it, it disappears and the screen is blank.  How do I fix this?

    After taking a pix with my iPhone, it shows up in my Album.  But when I select it to look at it or forward it, it disappears and the screen is blank.  This doesn't happen with all of my pictures.  I have the camera set on photo, with HDR off.  How do I keep this from happening?

    Not sure if this helps you, but I had the same issue. I inadvertently must have chosen a filter instead of none. Once I went and fixed this, my pictures were in my roll and I could see them. Hope this helps. I think you should be able to pick a filter and take a picture, but it worked for my phone.

Maybe you are looking for