REPORT ZVA_CUST_BANK_MENU.

tablesknbk.

TYPESBEGIN OF st_knbk,

         KUNNR type kunnr,
         BANKS type banks,
         BANKL type bankl,
         BANKN type bankn,
       end of st_knbk.

 datait_knbk type STANDARD TABLE OF st_knbk,
       wa_knbk type st_knbk.

 select-optionss_kunnr for knbk-kunnr.

 select KUNNR
BANKS
BANKL
BANKN from knbk into table it_knbk
where kunnr in s_kunnr.

loop at it_knbk into wa_knbk.
    write/ wa_knbk-kunnr,
             wa_knbk-banks,
             wa_knbk-bankl,
             wa_knbk-bankn.
endloop.

SET PF-STATUS 'LEKHA'.

AT USER-COMMAND.
    CASE SY-UCOMM.
      WHEN 'DDIC'.
         call TRANSACTION 'SE11'.
      when 'SE30'.
         call transaction 'SE30'.
      when 'DOWN'.
         CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
*            BIN_FILESIZE                    =
             filename                        'D:\New folder\bhanu.txt'
            FILETYPE                        'ASC'
*            APPEND                          = ' '
            WRITE_FIELD_SEPARATOR           '#'
*            HEADER                          = '00'
*            TRUNC_TRAILING_BLANKS           = ' '
*            WRITE_LF                        = 'X'
*            COL_SELECT                      = ' '
*            COL_SELECT_MASK                 = ' '
*            DAT_MODE                        = ' '
*            CONFIRM_OVERWRITE               = ' '
*            NO_AUTH_CHECK                   = ' '
*            CODEPAGE                        = ' '
*            IGNORE_CERR                     = ABAP_TRUE
*            REPLACEMENT                     = '#'
*            WRITE_BOM                       = ' '
*            TRUNC_TRAILING_BLANKS_EOL       = 'X'
*            WK1_N_FORMAT                    = ' '
*            WK1_N_SIZE                      = ' '
*            WK1_T_FORMAT                    = ' '
*            WK1_T_SIZE                      = ' '
*            WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
*            SHOW_TRANSFER_STATUS            = ABAP_TRUE
*            VIRUS_SCAN_PROFILE              = '/SCET/GUI_DOWNLOAD'
*          IMPORTING
*            FILELENGTH                      =
           tables
             data_tab                        IT_KNBK
*            FIELDNAMES                      =
*          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
*            OTHERS                          = 22
                   .
         IF sy-subrc <> 0.
* Implement suitable error handling here
         ENDIF.

    ENDCASE.



Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP S/4 HANA Logistics Team Lead
Contact : serkurumsal@yandex.com