Skip to Content
0
Former Member
Mar 14, 2007 at 04:15 AM

BDC-RECORDING

18 Views

report ZRECPRG1 no standard page heading line-size 255.

TABLES : RF02K,LFA1,LFBK,LFB1,LFM1.

DATA : BEGIN OF ITAB OCCURS 0,

LIFNR LIKE RF02K-LIFNR,

BUKRS LIKE RF02K-BUKRS,

EKORG LIKE RF02K-EKORG,

KTOKK LIKE RF02K-KTOKK,

ANRED LIKE LFA1-ANRED,

NAME1 LIKE LFA1-NAME1,

SORTL LIKE LFA1-SORTL,

ORT01 LIKE LFA1-ORT01,

PSTLZ LIKE LFA1-PSTLZ,

LAND1 LIKE LFA1-LAND1,

SPRAS LIKE LFA1-SPRAS,

BANKS(50) TYPE C,

BANKL(50) TYPE C,

BANKN(50) TYPE C,

AKONT LIKE LFB1-AKONT,

FDGRV LIKE LFB1-FDGRV,

WAERS LIKE LFM1-WAERS,

END OF ITAB.

DATA : BEGIN OF BANKS OCCURS 0,

BANKS LIKE LFBK-BANKS,

END OF BANKS.

DATA : BEGIN OF BANKL OCCURS 0,

BANKL LIKE LFBK-BANKN,

END OF BANKL.

DATA : BEGIN OF BANKN OCCURS 0,

BANKN LIKE LFBK-BANKN,

END OF BANKN.

DATA : FLD(20) TYPE C,

CNT(2) TYPE N.

include bdcrecx1.

start-of-selection.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = 'C:\SPLIT.TXT'

FILETYPE = 'DAT'

  • HEADLEN = ' '

  • LINE_EXIT = ' '

  • TRUNCLEN = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • DAT_D_FORMAT = ' '

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB = ITAB.

  • 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

  • OTHERS = 10

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

perform open_group.

LOOP AT ITAB.

REFRESH BDCDATA.

REFRESH : BANKS,BANKL,BANKN.

SPLIT ITAB-BANKS AT ',' INTO TABLE LFBK-BANKS.

SPLIT ITAB-BANKL AT ',' INTO TABLE BANKL-BANKL.

SPLIT ITAB-BANKN AT ',' INTO TABLE BANKN-BANKN.

perform bdc_dynpro using 'SAPMF02K' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RF02K-KTOKK'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RF02K-LIFNR'

'ITAB-LIFNR'.

perform bdc_field using 'RF02K-BUKRS'

'0001'.

perform bdc_field using 'RF02K-EKORG'

'0001'.

perform bdc_field using 'RF02K-KTOKK'

'ITAB-KTOKK'.

perform bdc_dynpro using 'SAPMF02K' '0110'.

perform bdc_field using 'BDC_CURSOR'

'LFA1-PSTLZ'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'LFA1-ANRED'

'ITAB-ANRED'.

perform bdc_field using 'LFA1-NAME1'

'LAKSHMI'.

perform bdc_field using 'LFA1-SORTL'

'ITAB-SORTL'.

perform bdc_field using 'LFA1-ORT01'

'ITAB-ORT01'.

perform bdc_field using 'LFA1-PSTLZ'

'ITAB-PSTLZ'.

perform bdc_field using 'LFA1-LAND1'

'ITAB-LAND1'.

perform bdc_dynpro using 'SAPMF02K' '0120'.

perform bdc_field using 'BDC_CURSOR'

'LFA1-KUNNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMF02K' '0130'.

perform bdc_field using 'BDC_CURSOR'

'LFBK-BANKN(02)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'LFBK-BANKS(01)'

'DE'.

perform bdc_field using 'LFBK-BANKS(02)'

'DE'.

perform bdc_field using 'LFBK-BANKL(01)'

'10020030'.

perform bdc_field using 'LFBK-BANKL(02)'

'10020031'.

perform bdc_field using 'LFBK-BANKN(01)'

'1111'.

perform bdc_field using 'LFBK-BANKN(02)'

'2222'.

perform bdc_dynpro using 'SAPLBANK' '0100'.

perform bdc_field using 'BDC_OKCODE'

'ENTR'.

perform bdc_field using 'BDC_CURSOR'

'BNKA-BANKA'.

perform bdc_dynpro using 'SAPLBANK' '0100'.

perform bdc_field using 'BDC_OKCODE'

'/E'.

perform bdc_field using 'BDC_CURSOR'

'BNKA-BANKA'.

perform bdc_dynpro using 'SAPLBANK' '0100'.

perform bdc_field using 'BNKA-BANKA'

'ABABA'.

perform bdc_dynpro using 'SAPMF02K' '0130'.

perform bdc_field using 'BDC_CURSOR'

'LFBK-BANKS(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_dynpro using 'SAPMF02K' '0210'.

perform bdc_field using 'BDC_CURSOR'

'LFB1-FDGRV'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'LFB1-AKONT'

'31000'.

perform bdc_field using 'LFB1-FDGRV'

'A1'.

perform bdc_dynpro using 'SAPMF02K' '0215'.

perform bdc_field using 'BDC_CURSOR'

'LFB1-ZTERM'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMF02K' '0220'.

perform bdc_field using 'BDC_CURSOR'

'LFB5-MAHNA'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMF02K' '0310'.

perform bdc_field using 'BDC_CURSOR'

'LFM1-WAERS'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'LFM1-WAERS'

'INR'.

perform bdc_dynpro using 'SAPMF02K' '0320'.

perform bdc_field using 'BDC_CURSOR'

'WYT3-PARVW(01)'.

perform bdc_field using 'BDC_OKCODE'

'=UPDA'.

perform bdc_transaction using 'XK01'.

perform close_group.

MOVE 1 TO CNT.

LOOP AT BANKS.

CONCATENATE 'LFBK-BANKS('CNT')' INTO FLD.

PERFORM BDC_FIELD USING FLD BANKS-BANKS.

CNT = CNT + 1.

ENDLOOP.

MOVE 1 TO CNT.

LOOP AT BANKS.

CONCATENATE 'LFBK-BANKL('CNT')' INTO FLD.

PERFORM BDC_FIELD USING FLD BANKL-BANKL.

CNT = CNT + 1.

ENDLOOP.

MOVE 1 TO CNT.

LOOP AT BANKS.

CONCATENATE 'LFBK-BANKN('CNT')' INTO FLD .

PERFORM BDC_FIELD USING FLD BANKN-BANKN.

CNT = CNT + 1.

ENDLOOP.

ENDLOOP.

***********************************************************************************************

ERROR: SPLIT ITAB-BANKS AT ',' INTO TABLE BANKS-BANKS.

BANKS-BANKS IS NOT A INTERNAL TABLE

can u explain the perform statements & split statement.

SPLIT ITAB-BANKS AT ',' INTO TABLE BANKS-BANKS.

how to assign perform statements.

explain:-

MOVE 1 TO CNT.

LOOP AT BANKS.

CONCATENATE 'LFBK-BANKL('CNT')' INTO FLD.

PERFORM BDC_FIELD USING FLD BANKL-BANKL.

CNT = CNT + 1.

ENDLOOP.

my emailid is lakshmisap@yahoo.com.

i am new to abap just learning ,i will be thankful to u if u clear my doubts.

error :-

if i remove table banks-banks to lfbk-banks.

then it gives error

statement concluding with "....lfbk-banks" ended unexpected.

& field spilt is unknown. it is neither in one of the specified tables nor defined by "data" statements.