Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
jazib_tariq
Active Participant
767

*&---------------------------------------------------------------------*
*& 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

2 Comments
Labels in this area