0% found this document useful (0 votes)
229 views4 pages

Gui Upload and Download

This document defines a report that details purchase order information. It contains data types and tables to store purchase document numbers, organization codes, material numbers, company codes, and text descriptions. It selects data from database tables into an internal table and writes the data to a text file or reads from a text file depending on the selected radio button option.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
229 views4 pages

Gui Upload and Download

This document defines a report that details purchase order information. It contains data types and tables to store purchase document numbers, organization codes, material numbers, company codes, and text descriptions. It selects data from database tables into an internal table and writes the data to a text file or reads from a text file depending on the selected radio button option.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

*&---------------------------------------------------------------------* *& Report ZKHAN_PO_DETAILS *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT zkhan_po_details NO STANDARD PAGE HEADING LINE-COUNT

25(3). TABLES: ekko,ekpo. TYPES: BEGIN OF ty_final, ebeln TYPE ebeln, ekorg TYPE ekorg, matnr TYPE matnr, bukrs TYPE bukrs, END OF ty_final. types: begin of ty_text, line(60) type c, end of ty_text. data:it_text type table of ty_text, wa_text TYPE ty_text.

types: begin of ty_khan, aa(60) type c, bb(60) type c, cc(60) type c, dd(60) type c, end of ty_khan.

data: it_khan type table of ty_khan, wa_khan type ty_khan. DATA: it_final TYPE TABLE OF ty_final, wa_final TYPE ty_final. SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. PARAMETERS: rb1 RADIOBUTTON GROUP g1 DEFAULT 'X', rb2 RADIOBUTTON GROUP g1, rb3 radiobutton group g1. SELECTION-SCREEN END OF BLOCK b1. SELECT ekko~ebeln ekko~ekorg ekpo~matnr ekpo~bukrs INTO TABLE it_final

FROM ekko LEFT OUTER JOIN ekpo ON ekko~ebeln = ekpo~ebeln. wa_text-line+0(15) = 'Pur Doc Num'. wa_text-line+16(10) = 'Pur Org'. wa_text-line+26(10) = 'Mtr Num'. wa_text-line+46(10) = 'cmp code'. uline. append wa_text to it_text. * uline. IF rb1 = 'X'. LOOP AT it_final INTO wa_final. WRITE:/ wa_final-ebeln, wa_final-ekorg, wa_final-matnr, wa_final-bukrs. ENDLOOP. ELSEif rb2 = 'X'. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING BIN_FILESIZE filename filetype APPEND write_field_separator HEADER TRUNC_TRAILING_BLANKS WRITE_LF COL_SELECT COL_SELECT_MASK DAT_MODE CONFIRM_OVERWRITE NO_AUTH_CHECK CODEPAGE IGNORE_CERR REPLACEMENT WRITE_BOM TRUNC_TRAILING_BLANKS_EOL WK1_N_FORMAT WK1_N_SIZE WK1_T_FORMAT WK1_T_SIZE WRITE_LF_AFTER_LAST_LINE SHOW_TRANSFER_STATUS IMPORTING FILELENGTH TABLES data_tab FIELDNAMES

* * * * * * * * * * * * * * * * * * * * * *

= = 'C:\Users\Reliance\Desktop\rehan.txt' = 'ASC' = ' ' = 'X' = '00' = ' ' = 'X' = ' ' = ' ' = ' ' = ' ' = ' ' = ' ' = ABAP_TRUE = '#' = ' ' = 'X' = ' ' = ' ' = ' ' = ' ' = ABAP_TRUE = ABAP_TRUE = = it_final it_text

* * * * * * * * * * * * * * * * * * * * * * *

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. WRITE:/'no data found for this selection'. ENDIF. ELSE.

CALL FUNCTION 'GUI_UPLOAD' EXPORTING filename FILETYPE HAS_FIELD_SEPARATOR * HEADER_LENGTH * READ_BY_LINE * DAT_MODE * CODEPAGE * IGNORE_CERR * REPLACEMENT * CHECK_BOM * VIRUS_SCAN_PROFILE * NO_AUTH_CHECK * IMPORTING * FILELENGTH * HEADER tables data_tab * EXCEPTIONS

= 'C:\Users\Reliance\Desktop\gkhan.txt' = 'ASC' = 'X' = 0 = 'X' = ' ' = ' ' = ABAP_TRUE = '#' = ' ' = = ' ' = = = it_khan

* * * * * * * * * * * * * * * * *

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 it_khan into wa_khan. WRITE:/ wa_khan-aa, wa_khan-bb, wa_khan-cc, wa_khan-dd. ENDLOOP.

*loop at it_khan into wa_khan. *write:/ wa_khan-aa, * wa_khan-bb, * wa_khan-cc, * wa_khan-dd. *endloop. endif.

You might also like