Application Development 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: 

table control--BDC

Former Member
0 Kudos

Hi Group,

When I am writting BDC for transaction in which table control occurs in the second screen,it is perfectly running when I am testing with the two records in the table control,when I increases the records (200) I am getting the error that <b>Screen is too large for Internal batch Input.</b>

Here I am attaching the part of code.


  MOVE 1 TO IDX.
  LOOP AT IT_DATATAB INTO WA_DATATAB.
    CONCATENATE 'FKKCMP_DIA-CHCKN(' IDX ')'
                                 INTO FNAM.
    perform bdc_field     using FNAM
                                wa_datatab-col5.
    CONCATENATE 'FKKCMP_DIA-GPART(' IDX ')'
                                 INTO FNAM.

    perform bdc_field       using fnam
                                wa_datatab-col1.
    CONCATENATE 'FKKCMP_DIA-VKONT(' IDX ')'
                                INTO FNAM.

    perform bdc_field   using fnam
                              wa_datatab-col2 .
    CONCATENATE 'FKKCMP_DIA-AUDAT(' IDX ')'
                                INTO FNAM.
    perform bdc_field   using fnam
                            wa_datatab-col3 .
    v_betrw = wa_datatab-col4.
    CONCATENATE 'FKKCMP_DIA-BETRW(' IDX ')'
                                INTO FNAM.
    write v_betrw to fval.
    perform bdc_field       using  fnam
                               fval.
    IDX = IDX + 1.
  ENDLOOP.

Please suggest

6 REPLIES 6

Former Member
0 Kudos

hi,

The table control on the screen can hold only particular no of records say 10 and if you enter more than that this error will come.

So set the screen for standard default screen.

*-- Structure for Parameter string for runtime of CALL TRANSACTION

data : x_ctu_params type ctu_params.

  • To have default screen size, mode and update

x_ctu_params-defsize = 'X'.

x_ctu_params-dismode = 'N'.

x_ctu_params-updmode = 'S'.

now check the no of lines in table control and if the no of records in internal table is greater than that than you need to use the page down functionality of the table control to enter more data.

Regards,

Richa.

0 Kudos

Hi Richa,

I think in general in the table controls there is no such limit on the records.

Former Member
0 Kudos

<b>A table control can contain many records, but the no of records you see on the screen is limited. In this case, the table control can hold only 16 records at a time and then we need to enter the page down and fill in more records.</b>

here is the sample code.

*--For each record in table IT_ICE_CONFM
    loop at it_ice_confm.
*--Get the correct line item from calling system.
*      it_ice_confm-ebelp = it_ice_confm-ebelp / '00010'.

*-- Check for Purchasing document validity
      read table lt_ekko with key ebeln = it_ice_confm-ebeln
                                  binary search.
      if sy-subrc <> 0.
         "error
      endif.
*-- Check for Purchasing document item validity
      read table lt_ekpo with key ebeln = it_ice_confm-ebeln
                                  ebelp = it_ice_confm-ebelp
                                  binary search.
      if sy-subrc <> 0.
       "error
      endif.

*--Clear local variables.
      clear : lv_tabix,
              lv_lfdat.

      lv_tabix = sy-tabix.
      lv_count1 = lv_count1 + 1.
*     For every new Purchase Order, populate first screen
      at new ebeln.
        read table it_ice_confm index lv_tabix.

        perform screen_insert tables it_bdc
                              using  'SAPMM06E' '0105' 'X'.
        perform field_insert: tables it_bdc
                              using  'BDC_OKCODE'  '/00',
                              tables it_bdc
                              using  'RM06E-BSTNR' it_ice_confm-ebeln.
      endat.
*     For every new Purchase Order line item, populate next screen
      at new ebelp.
        read table it_ice_confm index lv_tabix.

* if no Confirmation control key exist and no Goods receipt indicator
* occurs for the line item, set the Confirmation control key as 0001
        if lt_ekpo-bstae = ' '.
          if lt_ekpo-wepos = ' '.

            perform screen_insert tables it_bdc
                             using  'SAPMM06E' '0120' 'X'.

            perform field_insert: tables it_bdc
                             using  'RM06E-EBELP' it_ice_confm-ebelp,
                             tables it_bdc
                             using  'BDC_OKCODE' '/00'.

            perform screen_insert tables it_bdc
                              using  'SAPMM06E' '0120' 'X'.
            perform field_insert: tables it_bdc
                              using  'RM06E-TCSELFLAG(01)' 'X',
                              tables it_bdc
                              using  'BDC_OKCODE' '=DETA'.

            perform screen_insert tables it_bdc
                             using  'SAPMM06E' '0111' 'X'.

           perform field_insert: tables it_bdc
                                using  'EKPO-BSTAE' '0001',
                                tables it_bdc
                                using  'BDC_OKCODE' '=BACK'.

          else.
* if no Confirmation control key exist and and if Goods receipt
* indicator occurs for this line item, mark PO and line item as error

            concatenate 'Item no '                 it_ice_confm-ebelp
                        ' of Purchasing document ' it_ice_confm-ebeln
                        ' is invalid'
                       into return-message.
            move: 'E'                            to return-type,
                  'ZI'                           to return-id,
                  '999'                          to return-number.
            append return.
            clear return.
            continue.

          endif.

        else.

        endif.
          perform screen_insert tables it_bdc
                                using  'SAPMM06E' '0120' 'X'.
          perform field_insert: tables it_bdc
                                using  'RM06E-EBELP' it_ice_confm-ebelp,
                                tables it_bdc
                                using  'BDC_OKCODE' '/00'.

          perform screen_insert tables it_bdc
                                using  'SAPMM06E' '0120' 'X'.
          perform field_insert: tables it_bdc
                                using  'RM06E-TCSELFLAG(01)' 'X',
                                tables it_bdc
                                using  'BDC_OKCODE' '=BSTA'.

          clear lv_tab_line.
          perform select_line using it_ice_confm-ebeln
                                    it_ice_confm-ebelp
                           changing lv_tab_line.
          if not lv_tab_line is initial.
*--Position table control row for the first time
            lv_count2 = '01'.
            perform screen_insert  tables it_bdc
                                   using 'SAPLEINB' '0200' 'X'.
            perform field_insert   tables it_bdc
                                   using  'BDC_OKCODE' '=UMOD'.

            perform screen_insert  tables it_bdc
                                   using 'SAPLEINB' '0100' 'X'.
            perform field_insert   tables it_bdc
                                   using  'BDC_OKCODE' '=NP'.

            perform screen_insert  tables it_bdc
                                   using 'SAPLEINB' '0100' 'X'.
            perform field_insert   tables it_bdc
                                   using  'BDC_OKCODE' '=UMOD'.
          endif.

          perform screen_insert  tables it_bdc
                                 using 'SAPLEINB' '0200' 'X'.

        endat.

        lv_count2 = lv_count2 + 1.

*     Handle page down

*-- if confirmations already exist.
        if not lv_tab_line is initial.
*-- Check if it is 16th record, to position next record on page down
*   table control has 16 rows when default screen size,
*      mode and update are set
          if lv_count1 = 16.
            clear: lv_count1,
                   lv_count2.
*-- On page down, the next record comes to 2nd row
            lv_count2 = '02'.
            perform field_insert tables it_bdc
                                 using  'BDC_OKCODE' '=UMOD'.

            perform screen_insert  tables it_bdc
                           using 'SAPLEINB' '0100' 'X'.
            perform field_insert   tables it_bdc
                                   using  'BDC_OKCODE' '=NP'.

            perform screen_insert  tables it_bdc
                                   using 'SAPLEINB' '0100' 'X'.
            perform field_insert   tables it_bdc
                                   using  'BDC_OKCODE' '=UMOD'.

            perform screen_insert  tables it_bdc
                           using 'SAPLEINB' '0200' 'X'.
          endif.
        else.
*-- if confirmations does not exist, then check if it is 17th record.
*   to position next record on page down
          if lv_count1 = 17.
            clear: lv_count1,
                   lv_count2.
            lv_count2 = '02'.
            perform field_insert tables it_bdc
                                 using  'BDC_OKCODE' '=UMOD'.

            perform screen_insert  tables it_bdc
                           using 'SAPLEINB' '0100' 'X'.
            perform field_insert   tables it_bdc
                                   using  'BDC_OKCODE' '=NP'.

            perform screen_insert  tables it_bdc
                           using 'SAPLEINB' '0100' 'X'.
            perform field_insert   tables it_bdc
                                   using  'BDC_OKCODE' '=UMOD'.

            perform screen_insert  tables it_bdc
                           using 'SAPLEINB' '0200' 'X'.
*-- Initialize the table line to 1.
            lv_tab_line = 1.
          endif.
        endif.

        concatenate 'EKES-EBTYP(' lv_count2 ')' into lv_field.
        perform field_insert tables it_bdc
                             using  lv_field 'Z1'.

        if not it_ice_confm-eindt is initial.
          clear: lv_field,
                 lv_date.
          concatenate 'RM06E-EEIND(' lv_count2 ')' into lv_field.
          move it_ice_confm-eindt to lv_lfdat.
          write lv_lfdat to lv_date.

          perform field_insert tables it_bdc
                               using  lv_field lv_date.
        endif.

        if not it_ice_confm-uzeit is initial.
          clear: lv_field,
                 lv_time.
          concatenate 'EKES-UZEIT(' lv_count2 ')' into lv_field.
          write it_ice_confm-uzeit to lv_time.
          perform field_insert tables it_bdc
                               using  lv_field lv_time.
        endif.

        clear lv_field.
        concatenate 'EKES-XBLNR(' lv_count2 ')' into lv_field.
        perform field_insert tables it_bdc
                             using  lv_field it_ice_confm-scacd.

        clear lv_field.
        concatenate 'EKES-MENGE(' lv_count2 ')' into lv_field.
        perform field_insert tables it_bdc
                             using  lv_field it_ice_confm-quantity.

        at end of ebelp.
          clear: lv_tab_line,
                 lv_count1,
                 lv_count2.
          perform field_insert tables it_bdc
                               using  'BDC_OKCODE' '=BACK'.

        endat.

        at end of ebeln.
          clear: lv_lines,
                 lv_msg.

          perform screen_insert  tables it_bdc
                         using 'SAPMM06E' '0120' 'X'.
          perform field_insert tables it_bdc
                         using 'BDC_OKCODE' '=BU'.


          call transaction  <b>tcode</b> using  it_bdc
                  options from x_ctu_params
                  messages into lt_message.



          clear w_success.
          if sy-subrc <> 0.
            w_success = 'N'.
          endif.
          refresh: it_bdc,
                    lt_message.
        endat.
      endloop.

Regards,

Richa

Former Member
0 Kudos

What's the transaction?

Rob

0 Kudos

Transaction is FP50

Former Member
0 Kudos

While calling the transaction use call transaction tcode using i_bdcdata options from opt message into i_messages.

Also while recording the BDC enter more number of data in table control. For example if 10 lines are visible in the table control enter values for all the rows and press page-down then enter some more values.

data: lws_cnt type char2,

lws_field type char15.

LOOP AT i_invoicing_plan INTO wa_invoicing_plan.

lws_cnt = sy-tabix.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = lws_cnt

IMPORTING

output = lws_cnt .

CONCATENATE 'FPLT-AFDAT(' lws_cnt ')' INTO lws_field.

CONCATENATE wa_invoicing_plan-date+6(2)

wa_invoicing_plan-date+4(2)

wa_invoicing_plan-date+0(4) INTO lws_date

SEPARATED BY '.'.

PERFORM bdc_field USING lws_field lws_date.

CONCATENATE 'FPLT-FPROZ(' lws_cnt ')' INTO lws_field.

lws_perct = wa_invoicing_plan-percentage.

CONDENSE lws_perct.

PERFORM bdc_field USING lws_field lws_perct.

ENDLOOP.

While calling the transaction give like this:

DATA: opt TYPE ctu_params.

opt-dismode = 'N'.

opt-updmode = 'A'.

opt-defsize = 'X'.

CALL TRANSACTION tcode

USING i_bdcdata OPTIONS FROM opt MESSAGES INTO i_messages.

LOOP AT i_messages.

ENDLOOP.

Also before calling the transaction u have write a small logic. Check the code for that:

DESCRIBE TABLE i_invoicing_plan LINES n.

IF n LE 7.

PERFORM bdc_dynpro USING 'SAPLV60F' '0030'.

PERFORM bdc_field USING 'BDC_OKCODE' 'BACK'.

LOOP AT i_invoicing_plan INTO wa_invoicing_plan.

lws_cnt = sy-tabix.

PERFORM converion_input USING lws_cnt CHANGING lws_cnt.

CONCATENATE 'FPLT-AFDAT(' lws_cnt ')' INTO lws_field.

CONCATENATE wa_invoicing_plan-date+6(2)

wa_invoicing_plan-date+4(2)

wa_invoicing_plan-date+0(4) INTO lws_date

SEPARATED BY '.'.

PERFORM bdc_field USING lws_field lws_date.

CONCATENATE 'FPLT-FPROZ(' lws_cnt ')' INTO lws_field.

lws_perct = wa_invoicing_plan-percentage.

CONDENSE lws_perct.

PERFORM bdc_field USING lws_field lws_perct.

ENDLOOP.

ELSEIF n > 7.

x = CEIL( n / 7 ).

lws_start = 1. lws_end = 7.

DO x TIMES.

PERFORM bdc_dynpro USING 'SAPLV60F' '0030'.

PERFORM bdc_field USING 'BDC_OKCODE' '=P+'.

LOOP AT i_invoicing_plan INTO wa_invoicing_plan FROM lws_start TO

lws_end.

lws_cnt = lws_cnt + 1.

PERFORM converion_input USING lws_cnt CHANGING lws_cnt.

CONCATENATE 'FPLT-AFDAT(' lws_cnt ')' INTO lws_field.

CONCATENATE wa_invoicing_plan-date+6(2)

wa_invoicing_plan-date+4(2)

wa_invoicing_plan-date+0(4) INTO lws_date

SEPARATED BY '.'.

PERFORM bdc_field USING lws_field lws_date.

CONCATENATE 'FPLT-FPROZ(' lws_cnt ')' INTO lws_field.

lws_perct = wa_invoicing_plan-percentage.

CONDENSE lws_perct.

PERFORM bdc_field USING lws_field lws_perct.

ENDLOOP.

lws_bal_entry = n - lws_end.

lws_rem = lws_bal_entry MOD 7.

IF lws_bal_entry GT 7 OR lws_rem IS INITIAL.

lws_start = lws_start + 7.

ELSE.

lws_start = lws_start + lws_rem.

ENDIF.

lws_end = lws_end + 7.

IF lws_end GT n.

lws_end = n.

ENDIF.

CLEAR: lws_cnt, lws_bal_entry, lws_rem.

ENDDO.

PERFORM bdc_dynpro USING 'SAPLV60F' '0030'.

PERFORM bdc_field USING 'BDC_OKCODE' 'BACK'.

ENDIF.

Regards,

Prakash.