Vous êtes sur la page 1sur 3

*&---------------------------------------------------------------------*

*& Report ZABHI_SAMPLE_REPORT


*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZABHI_SAMPLE_REPORT.
TYPES : BEGIN OF TY_VBAK,
VBELN TYPE VBELN_VA,
ERDAT TYPE ERDAT,
END OF TY_VBAK,
BEGIN OF TY_VBAP,
VBELN TYPE VBELN_VA,
MATNR TYPE MATNR,
END OF TY_VBAP.
DATA : IT_VBAK TYPE TABLE OF TY_VBAK,
IT_VBAP TYPE TABLE OF TY_VBAP,
WA_VBAK TYPE TY_VBAK,
WA_VBAP TYPE TY_VBAP.
SELECT VBELN ERDAT FROM VBAK INTO TABLE IT_VBAK UP TO 100 ROWS.
LOOP AT IT_VBAK INTO WA_VBAK.
WRITE : / WA_VBAK-VBELN,WA_VBAK-ERDAT.
ENDLOOP.
DATA : V_FNAM TYPE STRING,
V_FVAL TYPE VBELN.
AT LINE-SELECTION.
GET CURSOR FIELD V_FNAM VALUE v_fval.
IF V_FNAM = 'WA_VBAK-VBELN'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = V_FVAL
IMPORTING
OUTPUT = V_FVAL
.
SELECT VBELN MATNR FROM VBAP INTO TABLE IT_VBAP WHERE VBELN = V_FVAL.
IF IT_VBAP IS NOT INITIAL.
LOOP AT IT_VBAP INTO WA_VBAP.
WRITE : / WA_VBAP-VBELN,WA_VBAP-MATNR.
ENDLOOP.
ELSE.
WRITE : / 'NO DATA '.
ENDIF.
ENDIF.
*SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
*
*SELECTION-SCREEN BEGIN OF LINE.
* PARAMETER CB_DISP AS CHECKBOX DEFAULT 'X'.
*SELECTION-SCREEN COMMENT 5(10) TEXT-003.
*SELECTION-SCREEN POSITION 20.
* PARAMETER CB_FILE AS CHECKBOX.
*SELECTION-SCREEN COMMENT 22(12) TEXT-004.
*SELECTION-SCREEN POSITION 35.
* PARAMETER CB_NAME AS CHECKBOX .
* SELECTION-SCREEN COMMENT 37(10) TEXT-007.
*SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN END OF BLOCK B1.
*SELECTION-SCREEN SKIP 2.
*
*SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
*SELECTION-SCREEN BEGIN OF LINE.
* PARAMETER RB_SALE RADIOBUTTON GROUP G1.
*SELECTION-SCREEN COMMENT 5(10) TEXT-005.
*SELECTION-SCREEN POSITION 25.
* PARAMETER RB_DELI RADIOBUTTON GROUP G1.
*SELECTION-SCREEN COMMENT 28(15) TEXT-006.
*SELECTION-SCREEN END OF LINE.
*
*SELECTION-SCREEN END OF BLOCK B2.
*
*
*
*
*
*SELECT * from kna1 into table it_kna1 up to 200 rows.
*
*if CB_DISP = 'X'.
* loop at it_kna1 into wa_kna1.
* WRITE : / wa_kna1-kunnr,wa_kna1-name1,wa_kna1-land1.
* endloop.
*ENDIF.
*IF CB_FILE = 'X'.
* CALL FUNCTION 'GUI_DOWNLOAD'
* EXPORTING
** BIN_FILESIZE =
* FILENAME = 'F:\ABHI.TXT'
** FILETYPE = 'ASC'
** APPEND = ' '
* WRITE_FIELD_SEPARATOR = 'X'
** 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
** IMPORTING
** FILELENGTH =
* TABLES
* DATA_TAB = IT_KNA1
** 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.
* WRITE : / 'FILE DOWNLOADED'.
* ELSE.
* WRITE : / ' ERROR IN DOWNLOAD'.
* ENDIF.
* ENDIF.