Table control bdc for mb1a

Hi All,
Can anyone tell me is table control BDC possible for MB1A tcode
Thanks in advance.

well there may be 2 cases,
1. if ur batch manahement is active and the batch is determined internally,in that case it is not possible.
2.However if ur batch management is not active,then a bdc can be written.
But i would suggest u use an LSMW and record using the BAPI method,SAP provides good standard BAPI's.

Similar Messages

  • Table control--BDC

    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

    <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

  • BAPI_GOODSMVT_CREATE or BDC for MB1A not creating Accounting Doc

    It is a strange scenario.  We can manually process a Goods Issue (without reference to a PO# - WBS Element used instead) via MB1A and have an Accounting Doc generated without a problem - movememt 415Q.  But for some reason, we can only create the Material Doc for Goods Issue when using BAPI_GOODSMVT_CREATE or BDC for MB1A (foreground or background).
    Does anyone have any idea why in the world this would be happening?  Especially if we're using the exact same data used to manually create the Goods Issue via MB1A?

    Thanks for the response.  Yes, I did try BAPI_TRANSACTION_COMMIT in all of my tests.  The Accounting Document simply will not get generated.
    Again, what makes it strange is that we created a BDC for MB1A - based on data that worked & that produced an Accounting document.  However, when processing that BDC, either in the foreground or background - the Accounting document likewise does not get created.

  • Screen Resolution in table control bdc

    Hi ,
    Im working on bdc table control using call transaction method for vk11 and mek1.While uploading data for vk11 for the first time it is taking all the records of the input file and if i do the same for the second time by changing the amount value it is taking only 24 records .(i.e if the input file contains only 24 records it wil update else if it has 25 records or more it not updating even single record and it is showing error " No batch input data for screen sapmv13A ..)...this issue is with the production server......................whereas in development and quality servers there is no problem....................
    what migh be the problem and how to solve it?
    can anyone plz help me on this

    if its a problem in screen resolution then while recording through SHDB mark the check box default size
    or
    to make the bdc execute in standard screen size check the code below
    data x_ctuparams type ctu_params.
    x_ctuparams-defsize = 'X'. " This would freeze the resolution in any system
    x_ctuparams-dismode = 'N'.
    x_ctuparams-updmode = 'S'.
    call transaction <TCODE> using it_bdcdata options from x_ctuparams.
    So whatever is the screen size of the users front-end, the BDC will execute in standard screen size

  • Table Control BDC to CHANGE the contents problem

    Hi,
    I am having a problem in BDC. The screen is having a table control and I want to change the contents depending on certain conditions.
    This BDC is not to upload the data but to change already existing data.
    How can I dynamically know the contents of the screen or contents or the row so that I can select the correct row to be changed?

    Hi,
    No its not like that.
    Suppose I want to update/change sheduling agreements <b>not upload</b>
    I will be calling the transaction which will list the scheduling lines in a table control. The order of the lines in table control will be as per logic of SAP's Application program.
    Now when I read the file and how will I dynamically know the exact line which should get selected.
    Say my internal table is having the data to be changed but I can not determine the exact ordering of the records as per table control.
    Hence I am facing the problem to know the exact ordering of table control
    Let me give another example. Using ME12 transaction I am supposed to delete certain rows from info records say having condition '15EC'.
    Now when I call a transction how will I know that for a particular vendor which line will contain this condition value so that can select the line and press delete
    Regards,
    Nitin

  • Page down functionality in table control BDC-CJ02 tcode

    Hi Friends,
    I am doing a BDC with Table control for Tcode CJ02.
    When I reach certain number of records, say 13, the page down functionality doesnt work.I tried different ways like using the BDC_OKCODE as "=P" and "=P+".Also, I tried doing a recording by pressing the down key in the table contral, in SHDB, but none of them worked.
    Refered a post in SDN as well, but it doesnt hold any solution.
    Do throw some light on the same to achieve page down functionality for the bdc tcode CJ02.
    Thanks in advance.
    Shri.

    Hi,
    I already posted an answer to that here Re: BDC scroll down with OK_CODE '=P+':
    P+ (=P+ in the BDC) is not a universal function code, but only one which is defined in ABAP lists . So, 99% of time, it doesn't work for all others situations (like yours).
    Scrolling a table control is not so easy to do. When you record a page down on a table control in SHDB, you'll get probably a /00 which corresponds to Enter. When you play the recording, it won't scroll. The issue is that "page down" is processed in 2 parts, it changes the "top line" of the table control, and executes Enter. But it's not possible to record/play the "top line" information.
    The solution is that the program usually implements a function code:
    either "add new line"
    or "position at line"
    Sometimes, the function code is hidden so you must look at inside the program (or search SAP notes, like here: [SAP note 187946 (No positioning on PRT overview in routing)|https://service.sap.com/sap/support/notes/187946 ])
    And sometimes, there's no function code at all, and then you're stuck ! (or use SAP GUI scripting, but it may only work in dialog).
    For CJ02, I can't tell how to scroll through BDC, but anyway, there is a BAPI (don't remember the name, search the forum, it will be easy to find it), so you should always prefer them over BDC.
    Sandra

  • Update records in table control BDC

    I am using BDC on table control in which I have to scroll the table. The table shows 4 rows by default. I want to enter values for the 1st and 6th row. I use =p+ OK code to scroll.
    When enter value for 6th row the value in the first row vanishes.
    Please suggest

    I have to perform f_bdc_dynpro for screen 'MP901200' '2000' repeatedly for scrolling
    perform f_bdc_dynpro      using 'MP901200' '2000'.
    perform f_bdc_field       using 'BDC_CURSOR'
                                  'PT9012-SALARYSCHED'.
    perform f_bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform f_bdc_field       using 'P9012-BEGDA'
                                  '19.01.2009'.
    perform f_bdc_field       using 'P9012-ENDDA'
                                  '31.12.9999'.
    perform f_bdc_field       using 'PT9012-PLANN'
                                  '1143'.
    perform f_bdc_field       using 'PT9012-SALARYSCHED'
                                  '01'.
    perform f_bdc_field       using 'PPHDX-ENTRY_IDX'
                                  '1'.
    Here I enter value for individual fields other than the table control.
    perform f_bdc_dynpro      using 'MP901200' '2000'.
    perform f_bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform f_bdc_field       using 'P9012-BEGDA'
                                  '19.01.2009'.
    perform f_bdc_field       using 'P9012-ENDDA'
                                  '31.12.9999'.
    perform f_bdc_field       using 'PT9012-PLANN'
                                  '1143'.
    perform f_bdc_field       using 'PT9012-SALARYSCHED'
                                  '01'.
    perform f_bdc_field       using 'PPHDX-ENTRY_IDX'
                                  '1'.
    perform f_bdc_field       using 'PT9012-DEGREE(01)'
                                  '03'.
    Here I enter value in the first row of table control.
    perform f_bdc_dynpro      using 'MP901200' '2000'.
    perform f_bdc_field       using 'BDC_OKCODE'
                                  '=p+'.
    perform f_bdc_field       using 'P9012-BEGDA'
                                  '19.01.2009'.
    perform f_bdc_field       using 'P9012-ENDDA'
                                  '31.12.9999'.
    perform f_bdc_field       using 'PT9012-PLANN'
                                  '1143'.
    perform f_bdc_field       using 'PT9012-SALARYSCHED'
                                  '01'.
    perform f_bdc_field       using 'PPHDX-ENTRY_IDX'
                                  '1'.
    here i scroll down to come to the sixth row.
    perform f_bdc_field       using 'BDC_OKCODE'
                                  '=/00'.
    perform f_bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform f_bdc_field       using 'P9012-BEGDA'
                                  '19.01.2009'.
    perform f_bdc_field       using 'P9012-ENDDA'
                                  '31.12.9999'.
    perform f_bdc_field       using 'PT9012-PLANN'
                                  '1143'.
    perform f_bdc_field       using 'PT9012-SALARYSCHED'
                                  '01'.
    perform f_bdc_field       using 'PPHDX-ENTRY_IDX'
                                  '6'.
    perform f_bdc_field       using 'PT9012-DEGREE(02)'
                                  '01'.
    Here I enter the value at second row as the 6th row is now the 2nd row after scrolling.
    but due to this the value in the first row vanishes.

  • How to update DBtable in table control (MPP) for selected lines.

    Hi Folks,
    I need to update DBtable from the table control after modification of  only multiple selected rows.
    But my issue. any row if edited is being modified in DBtable.
    Client does not want me to use Check box so im using Selcolumn in module pool table control.
    Please help me in resolving the issue. Let me know if you have any queries
    Thanks
    Reddy

    Hi Reddy,
    Hope it helps.
    For  Sel column.
    Declare:
    Data : SEL  TYPES XFELD in Structure.
    Double click on the sel  field     give the structure name and field name as below in screen shoot.
    In Flow logic.
    PROCESS AFTER INPUT.
    loop at it_tab.
        FIELD YTBLCTRL-SEL.
    MODULE update.
    ENDLOOP.
    MODULE Updatedb.
    In Editor.
    MODULE UPDATE INPUT.
       MODIFY it_tab FROM YTBLCTRL INDEX tbc1-current_line.
       if ytblctrl-sel IS NOT INITIAL.
       lv_cnt = lv_cnt + 1.
       endif.
    ENDMODULE.
    MODULE UPDATEDB INPUT.
    Case sy-ucomm.
    WHEN 'SAVE'.
    if lv_cnt is NE '1'.
    Message 'select more than one item.
    else.
    Update DB.
    endif.
    Endcase.
    Regards,
    Venkat.

  • Table Control Modification for Note implementation.

    I am applying a note, wherein I have to add a field TAX1 to a table control. I am able to add the field, but it is shaded grey. Moreover when I run the note after doing the necessary modifications, it is giving an error 'Element TAX1 touches or overlaps other element'. Whats the solution?

    Hi,
    when I removed the text element, which gives the heading for that particular field, its not showing the error. But in the second table control for the same screen, it is giving the same error for an element which i did not place at all in the table control, i.e., i inserted the field ADDTAX1, but it is giving the error for ADDRATE1, which i am not inserting into the table control at all.

  • Table Control Variant For ME21N - Item level - account assignment tab.

    Dear All,
    I want to change Table Control Screen that is in Me21n(Service PO)>Item level> Account Assignment  tab -> Table control.
    In that table control i want to add one column Name is OrderNo(AUFNR) ,but system is not changing the table control.
    When i m going to change table control scrren in ---> Condition tab its working fine but not for above case.
    Please guide me to solve this issue.
    Regards,
    Sanket.

    Please provide the solution.
    Regards,
    Sanket.

  • Problem with the table control BDC in FV60 transaction

    Hi All,
    I got the problem with the table control in FV60 transaction.
    This is working for 900 line items.After 900 line items it is giving the problem like it is 1000th line item.You can post only 999 line items.
    I know we can post only 999 line items,but in my file only 920 line items.
    Please give me solution,if anybody come across this situation.
    Thanks & regards,
    rakesh.

    Hello Rakesh ,
    your file may have only 920 line items , but based on those line items, SAP may create few more  new lines ( based on the clearing recon accounts , inter company transaction ...etc )...
    regards
    Prabhu

  • Table control program for updating database table

    Does anybody have a sample code for a table control program which can insert/delete/update a database table?
    I mean like on the output on table control, if the user insert/delete/update the records, the corresponding records will be updated in database table also.
    Appreciate your input.
    Thanks.

    hi nuren,
    TABLES: kna1,knbk.
    DATA: v_kunnr LIKE kna1-kunnr.
    DATA: v_check TYPE c.
    DATA: BEGIN OF it_knbk OCCURS 0,
          banks LIKE knbk-banks,
          bankl LIKE knbk-bankl,
          bankn LIKE knbk-bankn,
          bkont LIKE knbk-bkont,
          koinh LIKE knbk-koinh,
          chk TYPE c,
          END OF it_knbk.
    DATA: v_ucomm TYPE sy-ucomm,
          v_dynnr TYPE sy-dynnr.
    DATA: l_index TYPE sy-index.
    data: count type i.
    CONTROLS: tc1 TYPE TABLEVIEW USING SCREEN 0200.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'ABC'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE user_command_0100 INPUT.
      v_ucomm = sy-ucomm.
      CASE v_ucomm.
        WHEN 'DISP' OR 'CHNG'.
          IF v_kunnr <> space.
            SELECT banks
                   bankl
                   bankn
                   bkont
                   koinh
                   FROM knbk
                   INTO TABLE it_knbk
                   WHERE kunnr = v_kunnr.
            LEAVE TO SCREEN '0200'.
          ENDIF.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  MOD_KUNNR  INPUT
          text
    MODULE mod_kunnr INPUT.
      IF NOT v_kunnr IS INITIAL.
        SELECT SINGLE
               kunnr
               FROM kna1
               INTO v_kunnr
               WHERE kunnr = v_kunnr.
        IF sy-subrc <> 0.
          MESSAGE e000(zz) WITH 'INCORRECT CUSTOMER NUMBER'.
        ENDIF.
      ENDIF.
      IF v_kunnr IS INITIAL.
        MESSAGE e000(zz) WITH 'PLEASE ENTER A VALUE'.
      ENDIF.
    ENDMODULE.                 " MOD_KUNNR  INPUT
    *&      Module  STATUS_0200  OUTPUT
          text
    MODULE status_0200 OUTPUT.
      SET PF-STATUS 'ABC1'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    *&      Module  SCREENMOD  OUTPUT
          text
    MODULE screenmod OUTPUT.
      IF v_ucomm = 'DISP'.
        LOOP AT SCREEN.
          screen-input = 0.
          MODIFY SCREEN.
        ENDLOOP.
      ELSE."if v_UCOMM = 'CHNG'.
        LOOP AT SCREEN.
            IF screen-group1 = 'G1'.
              screen-input = 0.
            ELSE.
              screen-input = 1.
            ENDIF.
         MODIFY SCREEN.
        ENDLOOP.
    endif.
    if sy-ucomm = 'INSE'.
    loop at screen.
    IF ( tc1-current_line <> tc1-lines ).
      screen-input = 0.
    else.
    screen-input = 1.
    modify screen.
    endif.
    endloop.
    endif.
    ENDMODULE.                 " SCREENMOD  OUTPUT
    *&      Module  EXIT2  INPUT
          text
    MODULE exit2 INPUT.
      LEAVE TO SCREEN 0.
    ENDMODULE.                 " EXIT2  INPUT
    *&      Module  modify  INPUT
          text
    MODULE modify INPUT.
          IF v_check =  'X'.
            it_knbk-chk =  'X'.
            MODIFY it_knbk index tc1-current_line.
          ELSE.
            CLEAR it_knbk-chk .
         ENDIF.
    ENDMODULE.                 " modify  INPUT
    *&      Module  USER_COMMAND_0200  INPUT
          text
    MODULE user_command_0200 INPUT.
    v_ucomm = sy-ucomm.
      CASE v_ucomm.
        WHEN 'DELE'.
            DELETE it_knbk where chk eq 'X'.
            DESCRIBE TABLE it_knbk LINES tc1-lines.
        WHEN 'INSE'.
          CLEAR it_knbk.
          APPEND it_knbk.
          DESCRIBE TABLE it_knbk LINES tc1-lines.
        WHEN 'LIST'.
          LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN '0200'.
          WRITE 'Report'.
        WHEN 'BACK'.
          LEAVE TO SCREEN '0100'.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0200  INPUT
    *&      Module  validate  INPUT
          text
    module validate input.
    IF IT_KNBK IS INITIAL.
    MESSAGE E000(ZZ) WITH 'A BLANK LINE CANNOT BE SAVED'.
    ENDIF.
    endmodule.                 " validate  INPUT

  • Need help on BDC  for MB1A transaction.

    Hello Abapers,
    I need to create a BDC for t-code MB1A to do the Goods Issue with reference to reservation.
    I am not able to use the BAPI 'BAPI_GOODSMVT_CREATE' to do the goods issue as there are some additional functionalities (Stock Determination) to be included.
    The problem I am facing is, The stock determination will determine the Quantity, Storage Location and Valuation type for every item of the reservation. The quantity will be picked up from multiple storage locations and as a result the line item of reservation will be split into two or more for Goods Issue.
    When this happens, If the reservation is having multiple line items, tracking the next item becomes a problem.
    Please suggest a way to approach this problem.
    Usefull answers will be rewarded.
    Thanks in Advance,
    Vinutha.

    Hi
    The COMMIT before and after CALL TRANSACTION is useless, The transaction FB01 calls the commit by itself, so u need only:
    CALL TRANSACTION 'FB01' USING BDC_TAB
                                                   MODE 'N'
                                                   UPDATE 'S'
                                                   MESSAGE ITAB.
    Now ITAB is like structure BDCMSGCOLL, so after CALL Transaction u can use message statament in order to show a popup with message:
    CALL TRANSACTION 'FB01' USING BDC_TAB
                                                   MODE 'N'
                                                   UPDATE 'S'
                                                   MESSAGE ITAB.
    LOOP AT ITAB.
    MESSAGE ID ITAB-MSGID TYPE 'I' NUMBER ITAB-MSGNR
             WITH ITAB-MSGV1 ITAB-MSGV2 ITAB-MSGV3 ITAB-MSGV4.
    ENDLOOP.
    Max

  • BDC for production order confirmation (co11n)

    Dear All,
    Is it better to create a table control BDC for Production Order confirmation (CO11n)?
    Or there is any other efficient way?
    Pls guide me.
    Thank you
    Vijay

    Hi,
    There are different BAPIs available:
    BAPI_PRODORDCONF_CREATE_ACT    Enter activity confirmation
    BAPI_PRODORDCONF_CREATE_HDR    Enter Order Confirmations
    BAPI_PRODORDCONF_CREATE_TE     Enter Time Event Confirmation
    BAPI_PRODORDCONF_CREATE_TT     Enter Time Ticket Confirmation
    You can use them depenidng on your requirement..

  • In BDC table control

    hi
    In BDC how to transfer the data to table control

    hi
    what ever the data that u want to trnasfer to table ctrl, put it in a flat file.
    create an internal able that can occupy those datas.
    then transfer from internal table to table control.
    ex: for me41/.
    REPORT YELS_ME41_BDC_V  NO STANDARD PAGE HEADING LINE-SIZE 255.
    INCLUDE BDCRECX1.
    INTERNAL TABLE DECLARATION.
    DATA : BEGIN OF ITAB OCCURS 0,
           V_NUM(3) TYPE  C,"SERIAL NUMBER
           EMATN LIKE EKPO-EMATN,
           TXZ01 LIKE EKPO-TXZ01,
           ANMNG(13) TYPE C,
           MEINS(3) TYPE C,
           LPEIN LIKE RM06E-LPEIN,
           EEIND LIKE RM06E-EEIND,
           MATKL LIKE EKPO-MATKL,
           END OF ITAB.
    VARIABLE DECLARATION
    DATA : V_LASTNUM(3) TYPE C,
           V_TEMPVAR(15),
           V_PAGES(3) TYPE C VALUE '10',
           V_COUNT TYPE I,
           V_CTR TYPE I,
           V_TCTR(2) TYPE C,
           V_TEST TYPE C VALUE 0,
           ITEM LIKE RM06E-EBELP.
    *DATA: BDCDATA TYPE BDCDATA OCCURS 0 WITH HEADER LINE.
    BEGIN OF PROGRAM.
    START-OF-SELECTION.
      PERFORM GET-DATA.
      SORT ITAB BY NUM EEIND.
      PERFORM OPEN_GROUP.
    *DATA TRANSFERRED FROM INTERNAL TABLE TO IST 2ND SCREEN FIELDS(HEADER
    *DATA)
      LOOP AT ITAB.
        IF ITAB-V_NUM NE V_LASTNUM.
        " HEADER DATA EXECUTES FOR ONLY ONE TIME FOR ONE RFQ GENERATION
    WHEN SNO IS NOT EQUAL TO LASTNUMBER. THEN PROCEED.
          V_TEST = 0.
          PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0300'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EKKO-ANGDT'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM BDC_FIELD       USING 'RM06E-ASART'
                                        'AN'. "RFQ TYPE.
          PERFORM BDC_FIELD       USING 'EKKO-SPRAS'
                                        'EN'. " LANGUAGE KEY.
          PERFORM BDC_FIELD       USING 'RM06E-ANFDT'
                                        '19.07.2007'."RFQ DATE.
          PERFORM BDC_FIELD       USING 'EKKO-ANGDT'
                                        '29.07.2007'."QUOTATION DEAD LINE.
          PERFORM BDC_FIELD       USING 'EKKO-EKORG'
                                        '3000'."PURCHASE ORGANISATION.
          PERFORM BDC_FIELD       USING 'EKKO-EKGRP'
                                        '003'."PURCHASE GROUP.
          PERFORM BDC_FIELD       USING 'RM06E-LPEIN'
                                        'T'.
    IIND SCREEN.
          PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0301'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EKKO-SUBMI'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        'BU'.
          PERFORM BDC_FIELD       USING 'EKKO-EKGRP'
                                        '003'.
          PERFORM BDC_FIELD       USING 'EKKO-PINCR'
                                        '10'." ITEM INTERVAL.
          PERFORM BDC_FIELD       USING 'EKKO-SUBMI'
                                        '1'." COLL NO.
          PERFORM BDC_FIELD       USING 'EKKO-SPRAS'
                                        'EN'.
          PERFORM BDC_FIELD       USING 'EKKO-UPINC'
                                        '1'." SUB ITEM INTERVAL.
          PERFORM BDC_FIELD       USING 'EKKO-ANGDT'
                                        '29.07.2007'.
          PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0301'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EKKO-EKGRP'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM BDC_FIELD       USING 'EKKO-EKGRP'
                                        '003'.
          PERFORM BDC_FIELD       USING 'EKKO-PINCR'
                                        '10'.
          PERFORM BDC_FIELD       USING 'EKKO-SUBMI'
                                        '1'.
          PERFORM BDC_FIELD       USING 'EKKO-UPINC'
                                        '1'.
          PERFORM BDC_FIELD       USING 'EKKO-ANGDT'
                                        '29.07.2007'.
    **********tab ctrl*********************************************
    IIIRD SCREEN
          PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0320'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                'RM06E-EEIND(01)'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM BDC_FIELD       USING 'EKKO-ANGDT'
                                        '29.07.2007'.
    DATA MOVED FROM INTERNAL TABLE TO TABLE CONTROL
          V_CTR = 0.
          "FOR ONE RFQ , MORE ITEMS WILL BE THERE. COUNT STARTS HERE.
          LOOP AT ITAB WHERE V_NUM = ITAB-V_NUM." CHECK THE SNO IS EQUAL .
            V_CTR = V_CTR + 1." COUNT IS INCREMENTED BY 1.
    MY TAB CTRL CAN HAVE ONLY 20 RECORDS.
    IF COUNT IS LESS THAN OR EQUAL TO 20 ASSIGN THIS VALUE TO TCTR VAR
            IF V_CTR <= 20.
            V_TCTR = V_CTR.
            ENDIF.
    *IF COUNT IS GREATER THAN  20 ASSIGN THIS VALUE TO TCTR VAR
            IF V_CTR > 20.
              V_TCTR = '20'.
            ENDIF.
    IF COUNT IS LESS THAN OR EQUAL TO 10 BLANK SPACE IS ALLOTTED TO TEST
    VAR.
            IF V_CTR >= 10.
              V_TEST = ''.
            ENDIF.
    WHEN COUNT IS LESS THAN 20 THEN ITEM (PAGES) WILL BE 10.
            IF V_CTR < 20.
              V_PAGES =  10.
              PERFORM BDC_FIELD       USING 'RM06E-EBELP'
                                 V_PAGES.
            ENDIF.
    WHEN COUNT IS GREATER THAN 20 THEN ITEM (PAGES) WILL BE INCREMENTED BY
    10 FOR EVERY ENTRY..
            IF V_CTR >= 20.
              V_PAGES = V_PAGES + 10.
              PERFORM BDC_FIELD       USING 'RM06E-EBELP'
                                 V_PAGES.
            ENDIF.
          CONCTAENATION IS DONE TO GET A PATTERN LIKE EKPO-EMATN(01).
          UPLOAD EMATN FIELD INTO TABLE CONTROL
            CONCATENATE  'ekpo-ematn(' V_TEST  V_TCTR ')' INTO V_TEMPVAR.
            CONDENSE V_TEMPVAR NO-GAPS.
            PERFORM BDC_FIELD    USING V_TEMPVAR ITAB-EMATN.
          UPLOAD SHORT TEXT FIELD INTO TABLE CONTROL
            CONCATENATE  'ekpo-txz01(' V_TEST  V_TCTR ')' INTO V_TEMPVAR.
            CONDENSE V_TEMPVAR NO-GAPS.
            PERFORM BDC_FIELD    USING V_TEMPVAR ITAB-TXZ01.
          UPLOAD QUANTITY FIELD INTO TABLE CONTROL
            CONCATENATE  'rm06e-anmng(' V_TEST  V_TCTR ')' INTO V_TEMPVAR.
            CONDENSE V_TEMPVAR NO-GAPS.
            PERFORM BDC_FIELD    USING V_TEMPVAR ITAB-ANMNG.
          UPLOAD UNIT OF MEASURE FIELD INTO TABLE CONTROL
            CONCATENATE  'ekpo-meins(' V_TEST  V_TCTR ')' INTO V_TEMPVAR.
            CONDENSE V_TEMPVAR NO-GAPS.
            PERFORM BDC_FIELD    USING V_TEMPVAR ITAB-MEINS.
          UPLOAD DATE FORMAT FIELD INTO TABLE CONTROL
            CONCATENATE  'rm06e-lpein(' V_TEST  V_TCTR ')' INTO V_TEMPVAR.
            CONDENSE V_TEMPVAR NO-GAPS.
            PERFORM BDC_FIELD    USING V_TEMPVAR ITAB-LPEIN.
          UPLOAD DATE FIELD INTO TABLE CONTROL
            CONCATENATE  'rm06e-eeind(' V_TEST  V_TCTR ')' INTO V_TEMPVAR.
            CONDENSE V_TEMPVAR NO-GAPS.
            PERFORM BDC_FIELD    USING V_TEMPVAR ITAB-EEIND.
          UPLOAD MATERIAL GROUP FIELD INTO TABLE CONTROL
            CONCATENATE 'EKPO-MATKL(' V_TEST  V_TCTR ')' INTO V_TEMPVAR.
            CONDENSE V_TEMPVAR NO-GAPS.
            PERFORM BDC_FIELD USING  V_TEMPVAR ITAB-MATKL.
            PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0320'.
            PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                          'EKKO-ANGDT'.
            PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                          '=LS'.
            PERFORM BDC_FIELD       USING 'EKKO-ANGDT'
                                          '29.07.2007'.
    *AFTER INSERTING ONE ROW OF DATA PRESS ENTER .CURSOR SHOULD BE AT DEAD
    *LINE DATE.
            CONCATENATE  'ekpo-ematn(' V_TEST V_TCTR ')' INTO V_TEMPVAR.
            CONDENSE V_TEMPVAR NO-GAPS.
            PERFORM BDC_FIELD    USING 'BDC_CURSOR' V_TEMPVAR.
            PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/00'.
          ENDLOOP.
    *************************vendor addr*******************
          V_LASTNUM = ITAB-V_NUM.
    *******ENTER VENDOR NUMBER AND SAVE.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0140'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EKKO-LIFNR'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM BDC_FIELD       USING 'EKKO-LIFNR'
                                        '9054'." VENDOR NUMBER.
          PERFORM BDC_DYNPRO      USING 'SAPLMEXF' '0100'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=ENTE'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'RM06E-SPRAS'.
          PERFORM BDC_FIELD       USING 'BUTTON_INIT'
                                        'X'.
          PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0140'.
          PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0140'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EKKO-LIFNR'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=BU'.
          PERFORM BDC_FIELD       USING 'EKKO-LIFNR'
                                        '9054'.
          PERFORM BDC_FIELD       USING 'ADDR1_DATA-NAME1'
                                        'tttt'.
          PERFORM BDC_FIELD       USING 'ADDR1_DATA-SORT1'
                                        'TT'.
          PERFORM BDC_FIELD       USING 'ADDR1_DATA-COUNTRY'
                                        'AZ'.
          PERFORM BDC_DYNPRO      USING 'SAPLSPO1' '0300'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=YES'.
          PERFORM BDC_TRANSACTION USING 'ME41'.
          REFRESH BDCDATA.
        ENDIF.
      ENDLOOP.
      PERFORM CLOSE_GROUP.
    *&      Form  get-data
         UPLOAD FLAT FILES TO INTERNAL TABLE.
    FORM GET-DATA.
    *TRANSFER DATA FROM FLAT FILE TO INTERNAL TABLE.
      CALL FUNCTION 'UPLOAD'
       EXPORTING
        CODEPAGE                      = ' '
         FILENAME                      = ' '
         FILETYPE                      = ' '
      ITEM                          = ' '
      FILEMASK_MASK                 = ' '
      FILEMASK_TEXT                 = ' '
      FILETYPE_NO_CHANGE            = ' '
      FILEMASK_ALL                  = ' '
      FILETYPE_NO_SHOW              = ' '
      LINE_EXIT                     = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      SILENT                        = 'S'
    IMPORTING
      FILESIZE                      =
      CANCEL                        =
      ACT_FILENAME                  =
      ACT_FILETYPE                  =
        TABLES
          DATA_TAB                      = ITAB
       EXCEPTIONS
         CONVERSION_ERROR              = 1
         INVALID_TABLE_WIDTH           = 2
         INVALID_TYPE                  = 3
         NO_BATCH                      = 4
         UNKNOWN_ERROR                 = 5
         GUI_REFUSE_FILETRANSFER       = 6
         OTHERS                        = 7
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "get-data
    reward if useful

Maybe you are looking for