Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

bdc

Former Member
0 Likes
615

Hi,

i have given below the code.say i have to upload 3 records from the flat file.When i execute it the first record is uploaded 3 times.The next 2 records are not uploaded.Correct me plz.

report YMK_MM01BDC no standard page heading line-size 255.

data : i_bdcdata like bdcdata occurs 99 with header line,

mtab like bdcmsgcoll occurs 0 with header line.

data : begin of itab occurs 0,

maktx_001(040),

meins_002(003),

end of itab.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = 'c:/mat.txt'

FILETYPE = 'DAT'

TABLES

DATA_TAB = itab

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

*include bdcrecx1.

start-of-selection.

*perform open_group.

loop at itab.

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-MTART'.

perform bdc_field using 'BDC_OKCODE'

'=AUSW'.

perform bdc_field using 'RMMG1-MBRSH'

'M'.

perform bdc_field using 'RMMG1-MTART'

'ROH'.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'MSICHTAUSW-KZSEL(01)'

'X'.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'MAKT-MAKTX'

itab-maktx_001.

perform bdc_field using 'BDC_CURSOR'

'MARA-MEINS'.

perform bdc_field using 'MARA-MEINS'

itab-meins_002.

perform bdc_transaction using 'MM01'.

endloop.

*perform close_group.

form bdc_dynpro using PROGRAM DYNPRO.

clear i_bdcdata.

i_bdcdata-program = PROGRAM.

i_bdcdata-dynpro = DYNPRO.

i_bdcdata-dynbegin = 'X'.

append i_bdcdata.

endform.

form bdc_field using FNAM FVAL.

clear i_bdcdata.

i_bdcdata-fnam = FNAM.

i_bdcdata-fval = FVAL.

append i_bdcdata.

endform.

form bdc_transaction using TCODE.

CALL TRANSACTION tcode USING I_BDCDATA MODE 'A' UPDATE 'S'.

endform.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
590

Hi,

Try this:

loop at itab.

update BDC_data.

endloop.
perform call_transaction.

5 REPLIES 5
Read only

Former Member
0 Likes
590

hi,

use loop at itab.

performs...

call trnasaction 'MM01' using i_bdcdata mode 'A' update 's' messages into mtab.

endloop.

just remove perform regarding call transaction and use direct logic.

Read only

Former Member
0 Likes
590

use CLEAR ITAB before endloop

loop at itab.

<b>clear itab.</b>

endloop.

Read only

Former Member
0 Likes
591

Hi,

Try this:

loop at itab.

update BDC_data.

endloop.
perform call_transaction.

Read only

Former Member
0 Likes
590

Hi everyone,

Thanks for your reponse.Still the problem persists,kindly post answers ASAP.

Read only

0 Likes
590

hi,

chk the data in itab in debug mode...i.e whether itab is populated correctly..