Hi,
i am working on bdc for the deletion of the operations of a material i.e. 11,21,15,25,35,45,55. i had posted a post before and i got some awnser but itried it and it didn't work. i wan to delete the operations but it is deleting only those which are recorded. i had tried to modify the code but it is not selecting the specified liens in the file. plz provide me guidelines to solve this problem.
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(010),
end of record.
PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME default'C:\Users\Administrator\Desktop\CA02(UPLOAD).txt'.
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_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(record-FLG_SEL_003)'
'X'.
perform bdc_field using 'RC27X-FLG_SEL(record-FLG_SEL_003)'
'X'.
perform bdc_field using 'RC27X-FLG_SEL(record-FLG_SEL_003)'
'X'.
perform bdc_field using 'RC27X-FLG_SEL(record-FLG_SEL_003)'
'X'.
perform bdc_field using 'RC27X-FLG_SEL(record-FLG_SEL_003)'
'X'.
perform bdc_field using 'RC27X-FLG_SEL(record-FLG_SEL_003)'
'X'.
perform bdc_field using 'RC27X-FLG_SEL(record-FLG_SEL_003)'
'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.