*&---------------------------------------------------------------------*
*& Report ZAM_Asset_Deletion
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZAM_Asset_Deletion.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF record OCCURS 10,
ANLN1 TYPE ANLA-ANLN1,
ANLN2 TYPE ANLA-ANLN2,
END OF record.
SELECTION-SCREEN BEGIN OF BLOCK abc WITH FRAME TITLE text-001.
PARAMETERS: file(128).
SELECTION-SCREEN END OF BLOCK abc.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
mask = ',TXT FILE,*.txt,All Files,*.*. '
mode = 'o '
IMPORTING
filename = file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
***************************************************
*Transfer data from external file to internal table
***************************************************
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = file
filetype = 'DAT'
TABLES
data_tab = record.
*******************************************
*Run Transaction Upload
*******************************************
START-OF-SELECTION.
LOOP AT record.
PERFORM bdc_dynpro USING 'SAPLAIST' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'ANLA-BUKRS' .
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTEDEL' .
PERFORM bdc_field USING 'ANLA-ANLN1'
record-ANLN1 .
PERFORM bdc_field USING 'ANLA-ANLN2'
record-ANLN2 .
PERFORM bdc_field USING ' ANLA-BUKRS'
'1000'.
*******************************************
PERFORM bdc_dynpro USING 'SAPLAIST' '0210'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RA02S-XPHYS' .
PERFORM bdc_field USING 'BDC_OKCODE'
'=BUCH' .
PERFORM bdc_field USING 'RA02S-XPHYS'
'X' .
*******************************************
PERFORM bdc_dynpro USING ' SAPLSPO1' '0100'.
PERFORM bdc_field USING 'BDC_OKCODE'
' =YES' .
*******************************************
CALL TRANSACTION 'AS06' USING bdcdata MODE 'E'.
REFRESH bdcdata.
ENDLOOP.
*<>******************************************************************************<>*
FORM bdc_field USING fnam fval.
* IF FVAL <> NODATA.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
* ENDIF.
ENDFORM. "BDC_FIELD
* Form BDC_DYNPRO
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "BDC_DYNPRO
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |