Skip to Content
0
Former Member
Jul 14, 2006 at 09:36 AM

REGARDING PAGE DOWN LOGIC IN TABEL CONTROL

48 Views

HI,

i am doin bdc recording(mm42) to upload data of more than 50 rcds.my problm is the first 11 rcds in teh first page r getting updated prefectly but from the next page thats not happening.i have used the ok-code'=p+' logic also.could anyone help me in this.

here i am attaching the sample code..also..

REPORT zmm

NO STANDARD PAGE HEADING LINE-SIZE 255.

DATA errtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF itab OCCURS 0,

matnr(18),

fiwrk(4),

perkz(1),

kovbw(5), "Corrected value

END OF itab.

DATA: BEGIN OF itab1 OCCURS 0,

matnr(18),

kovbw(5),

END OF itab1.

DATA: v_count(2) TYPE n.

DATA: v_val(15).

INCLUDE bdcrecx1.

START-OF-SELECTION.

PERFORM get_data1.

PERFORM get_data2.

PERFORM open_group.

LOOP AT itab.

CLEAR bdcdata.

REFRESH bdcdata.

v_count = '00'.

PERFORM bdc_dynpro USING 'SAPLMGMW' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(06)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'RMMW1-MATNR'

itab-matnr.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(06)'

'X'.

PERFORM bdc_dynpro USING 'SAPLMGMW' '4008'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/ENSCH'.

PERFORM bdc_field USING 'MAKT-MAKTX'

'Reference Article For Food (excl. Peri'.

PERFORM bdc_field USING 'MARC-DISMM'

'ND'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MARC-PERKZ'.

PERFORM bdc_field USING 'MPOP-PRMOD'

'0'.

PERFORM bdc_field USING 'MARC-PERKZ'

itab-perkz.

PERFORM bdc_field USING 'MARC-PLIFZ'

'2'.

PERFORM bdc_field USING 'MARC-BWSCL'

'2'.

PERFORM bdc_field USING 'MARC-EKGRP'

'ST1'.

PERFORM bdc_field USING 'MARC-MTVFP'

'01'.

PERFORM bdc_field USING 'MARC-XMCNG'

'X'.

PERFORM bdc_field USING 'MARC-LGFSB'

'FR01'.

PERFORM bdc_dynpro USING 'SAPLMGMW' '0081'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RMMW1-FIWRK'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

PERFORM bdc_field USING 'RMMW1-FIWRK'

itab-fiwrk.

PERFORM bdc_dynpro USING 'SAPLMGMW' '4008'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=PB31'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MAKT-MAKTX'.

PERFORM bdc_field USING 'MAKT-MAKTX'

'Reference Article For Food (excl. Peri'.

PERFORM bdc_field USING 'MARC-DISMM'

'ND'.

PERFORM bdc_field USING 'MARC-MINBE'

'1,000'.

PERFORM bdc_field USING 'MPOP-PRMOD'

'0'.

PERFORM bdc_field USING 'MARC-PERKZ'

'W'.

PERFORM bdc_field USING 'MARC-PLIFZ'

'2'.

PERFORM bdc_field USING 'MARC-BWSCL'

'2'.

PERFORM bdc_field USING 'MARC-EKGRP'

'ST1'.

PERFORM bdc_field USING 'MARC-MTVFP'

'01'.

PERFORM bdc_field USING 'MARC-MAABC'

'C'.

PERFORM bdc_field USING 'MARC-XMCNG'

'X'.

PERFORM bdc_field USING 'MARC-LGFSB'

'FR01'.

PERFORM bdc_dynpro USING 'SAPLMGMW' '4008'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

'Reference Article For Food (excl. Peri'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MARC-MINBE'.

PERFORM bdc_field USING 'MARC-DISMM'

'ND'.

PERFORM bdc_field USING 'MARC-MINBE'

'1,000'.

PERFORM bdc_field USING 'MPOP-PRMOD'

'0'.

PERFORM bdc_field USING 'MARC-PERKZ'

'W'.

PERFORM bdc_field USING 'MARC-PLIFZ'

'2'.

PERFORM bdc_field USING 'MARC-BWSCL'

'2'.

PERFORM bdc_field USING 'MARC-EKGRP'

'ST1'.

PERFORM bdc_field USING 'MARC-MTVFP'

'01'.

PERFORM bdc_field USING 'MARC-MAABC'

'C'.

PERFORM bdc_field USING 'MARC-XMCNG'

'X'.

PERFORM bdc_field USING 'MARC-LGFSB'

'FR01'.

PERFORM bdc_dynpro USING 'SAPLMGMW' '3110'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

LOOP AT itab1 WHERE matnr = itab-matnr.

IF v_count = '11'.

PERFORM bdc_dynpro USING 'SAPLMGMW' '3110'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=P+'.

v_count = '00'.

ENDIF.

v_count = v_count + 1.

CONCATENATE 'RM03M-KOVBW(' v_count ')' INTO v_val.

PERFORM bdc_field USING v_val itab1-kovbw.

ENDLOOP.

  • PERFORM bdc_field USING 'MAKT-MAKTX'

  • 'Reference Article For Food (excl. Peri'.

  • PERFORM bdc_field USING 'BDC_CURSOR'

  • 'RM03M-KOVBW(11)'.

  • PERFORM bdc_field USING 'RM03M-KOVBW(01)'

  • '11'.

  • PERFORM bdc_field USING 'RM03M-KOVBW(02)'

  • '12'.

  • PERFORM bdc_field USING 'RM03M-KOVBW(03)'

  • '13'.

  • PERFORM bdc_field USING 'RM03M-KOVBW(04)'

  • '14'.

  • PERFORM bdc_field USING 'RM03M-KOVBW(05)'

  • '15'.

  • PERFORM bdc_field USING 'RM03M-KOVBW(06)'

  • '16'.

  • PERFORM bdc_field USING 'RM03M-KOVBW(07)'

  • '17'.

  • PERFORM bdc_field USING 'RM03M-KOVBW(08)'

  • '18'.

  • PERFORM bdc_field USING 'RM03M-KOVBW(09)'

  • '19'.

  • PERFORM bdc_field USING 'RM03M-KOVBW(11)'

  • '11'.

PERFORM bdc_dynpro USING 'SAPLMGMW' '3110'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BABA'.

  • PERFORM bdc_field USING 'BDC_CURSOR'

  • 'MAKT-MAKTX'.

  • PERFORM bdc_field USING 'MAKT-MAKTX'

  • 'Reference Article For Food (excl. Peri'.

PERFORM bdc_dynpro USING 'SAPLMGMW' '4008'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BU'.

  • PERFORM bdc_field USING 'MAKT-MAKTX'

  • 'Reference Article For Food (excl. Peri'.

  • PERFORM bdc_field USING 'BDC_CURSOR'

  • 'MARC-MINBE'.

  • PERFORM bdc_field USING 'MARC-DISMM'

  • 'ND'.

PERFORM bdc_field USING 'MARC-MINBE'

'1,000'.

  • PERFORM bdc_field USING 'MPOP-PRMOD'

  • '0'.

  • PERFORM bdc_field USING 'MARC-PERKZ'

  • 'W'.

  • PERFORM bdc_field USING 'MARC-PLIFZ'

  • '2'.

  • PERFORM bdc_field USING 'MARC-BWSCL'

  • '2'.

  • PERFORM bdc_field USING 'MARC-EKGRP'

  • 'ST1'.

  • PERFORM bdc_field USING 'MARC-MTVFP'

  • '01'.

  • PERFORM bdc_field USING 'MARC-MAABC'

  • 'C'.

  • PERFORM bdc_field USING 'MARC-XMCNG'

  • 'X'.

  • PERFORM bdc_field USING 'MARC-LGFSB'

  • 'FR01'.

PERFORM bdc_transaction USING 'MM42'.

clear:itab,itab1.

ENDLOOP.

PERFORM close_group.

&----


*& Form get_data1

&----


  • text

FORM get_data1 .

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = 'D:\T1.TXT'

filetype = 'ASC'

has_field_separator = 'X'

TABLES

data_tab = itab.

ENDFORM. " get_data1

&----


*& Form get_data2

&----


  • text

FORM get_data2 .

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = 'D:\T2.TXT'

filetype = 'ASC'

has_field_separator = 'X'

TABLES

data_tab = itab1.

ENDFORM. " get_data2

than xin advance...