Skip to Content
0
Former Member
Mar 30, 2009 at 04:14 AM

bdc for deletion of operation CA02

196 Views

Hi,

I am working on bdc for the tcode CA02 in which i want to delete the operations such as 10,20,11,21,25,35,45 and 45. the problem is this when i execute it it selects all the operations which were there in the recording (mentioned above) and i want to select only thoes operations(among the above metioned ) which are present for the material routing.

plzz provide me guidelines for it.

here's d code:-

report ZNEW02

no standard page heading line-size 255.

include bdcrecx1.

DATA: BEGIN OF RECORD OCCURS 0,

MATNR_001(018),

WERKS_002(004),

FLG_SEL_003(10),

END OF RECORD.

PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME.

initialization.

CTUMODE = 'A'.

CUPDATE = 'A'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILNAM.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

MASK = ',. '

MODE = 'O'

IMPORTING

FILENAME = P_FILNAM

EXCEPTIONS

INV_WINSYS = 1

NO_BATCH = 2

SELECTION_CANCEL = 3

SELECTION_ERROR = 4

OTHERS = 5

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

start-of-selection.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

FILENAME = P_FILNAM

FILETYPE = 'DAT'

TABLES

DATA_TAB = RECORD

EXCEPTIONS

CONVERSION_ERROR = 1

FILE_OPEN_ERROR = 2

FILE_READ_ERROR = 3

INVALID_TYPE = 4

NO_BATCH = 5

UNKNOWN_ERROR = 6

INVALID_TABLE_WIDTH = 7

GUI_REFUSE_FILETRANSFER = 8

CUSTOMER_ERROR = 9

NO_AUTHORITY = 10

OTHERS = 11

.

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 RECORD.

ON CHANGE OF RECORD-MATNR_001.

perform bdc_dynpro using 'SAPLCPDI' '1010'.

perform bdc_field using 'BDC_CURSOR'

'RC271-PLNNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RC27M-MATNR'

record-MATNR_001.

perform bdc_field using 'RC27M-WERKS'

record-WERKS_002.

perform bdc_field using 'RC271-PLNNR'.

perform bdc_dynpro using 'SAPLCPDI' '1400'.

perform bdc_field using 'BDC_CURSOR'

'PLPOD-VORNR(12)'.

perform bdc_field using 'BDC_OKCODE'

'=LOE'.

perform bdc_field using 'RC27X-ENTRY_ACT'

'1'.

perform bdc_field using 'RC27X-FLG_SEL(02)'

'X'.

perform bdc_field using 'RC27X-FLG_SEL(03)'

'X'.

perform bdc_field using 'RC27X-FLG_SEL(05)'

'X'.

perform bdc_field using 'RC27X-FLG_SEL(06)'

'X'.

perform bdc_field using 'RC27X-FLG_SEL(08)'

'X'.

perform bdc_field using 'RC27X-FLG_SEL(10)'

'X'.

perform bdc_field using 'RC27X-FLG_SEL(12)'

'X'.

perform bdc_dynpro using 'SAPLSPO1' '0100'.

perform bdc_field using 'BDC_OKCODE'

'=YES'.

perform bdc_dynpro using 'SAPLCPDI' '1400'.

perform bdc_field using 'BDC_CURSOR'

'RC27X-ENTRY_ACT'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'RC27X-ENTRY_ACT'

'1'.

perform bdc_transaction using 'CA02'.

ENDON.

ENDLOOP.