BDC Problem

Dear Guru,
Here i have encountered a typical issue.
Im Performing BDC for VK11 (Create Condition Record) with "Key Combination" --->> "Location, Material Code (Base Price for Longs)".
While I am running this BDC ( source code attached below) in All screen mode every datas which are of type "CHAR" like--->>
Condition type(kschl) ,
Plant(werks) ,
Material No(matnr),
Valid From date(datab),
Valid To date(datbi),
Rate Unit(konwa) are coming properly from flatfile except
Rate (condition amount - KBETR) which is are of data type "CURR".
So guru I want to know what code i should add into my below bdc prog to fetch data properly into RATE - Condition amount field which is of type " CURR".
Pls Help.
Source Code:
REPORT z_bdc_vk11_famd
       NO STANDARD PAGE HEADING LINE-SIZE 255.
*& DATA-DECLARATION
TYPES: BEGIN OF t_cust,
            kschl LIKE rv13a-kschl,
            werks LIKE komg-werks,
            matnr LIKE komg-matnr,
            kbetr LIKE konp-kbetr,
           konwa LIKE konp-konwa,
            datab LIKE rv13a-datab,
            datbi LIKE rv13a-datbi,
       END OF t_cust.
TYPES: BEGIN OF t_sucrec,
         cnum TYPE komg-werks,
         cnam TYPE komg-matnr,
END OF t_sucrec.
TYPES: BEGIN OF t_errrec,
       lineno TYPE string,      "Line Number
      message TYPE string,      "Error Message
END OF t_errrec.
DATA:  v_file TYPE string,      "Variable for storing flat file
      it_cust TYPE STANDARD TABLE OF t_cust, "Internal table of Customer
      wa_cust LIKE LINE OF it_cust,  "Workarea of Internal table it_cust
    it_sucrec TYPE STANDARD TABLE OF t_sucrec,
                                      "Internal table of Success records
    wa_sucrec LIKE LINE OF it_sucrec,
                                   "Workarea of Internal table it_sucrec
    it_errrec TYPE STANDARD TABLE OF t_errrec,
                                   "Internal table of Error records
    wa_errrec LIKE LINE OF it_errrec,
                                   "Workarea of Internal table it_errrec
    it_bdctab LIKE bdcdata OCCURS 0 WITH HEADER LINE,
                                    "Internal table structure of BDCDATA
it_messagetab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,
                                    "Tracing Error Messages
       v_date LIKE sy-datum,  "Controlling of session date
      v_index LIKE sy-tabix,  "Index Number
     v_totrec TYPE i,         "Total Records
     v_errrec TYPE i,         "Error Records
     v_sucrec TYPE i,         "Success Records
    v_sesschk TYPE c.         "Session maintenance
*& SELECTION-SCREEN
SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001 NO
INTERVALS.
PARAMETERS: p_file    TYPE rlgrap-filename.
"rlgrap-filename is a predefined structure
SELECTION-SCREEN: END OF BLOCK blk1.
SELECTION-SCREEN: BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002 NO
INTERVALS.
PARAMETERS: p_mode    LIKE ctu_params-dismode DEFAULT 'N',
            p_update  LIKE ctu_params-updmode DEFAULT 'A'.
SELECTION-SCREEN END OF BLOCK blk2.
*& INITIALIZATION
INITIALIZATION.
  v_date = sy-datum - 1.
*& AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CALL FUNCTION 'F4_FILENAME'
    EXPORTING
      program_name  = syst-cprog
      dynpro_number = syst-dynnr
      field_name    = ' '
    IMPORTING
      file_name     = p_file.
*& START-OF-SELECTION
START-OF-SELECTION.
  v_file = p_file.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                = v_file
      filetype                = 'ASC'
      has_field_separator     = 'X'
    TABLES
      data_tab                = it_cust
    EXCEPTIONS
      file_open_error         = 1
      file_read_error         = 2
      no_batch                = 3
      gui_refuse_filetransfer = 4
      invalid_type            = 5
      no_authority            = 6
      unknown_error           = 7
      bad_data_format         = 8
      header_not_allowed      = 9
      separator_not_allowed   = 10
      header_too_long         = 11
      unknown_dp_error        = 12
      access_denied           = 13
      dp_out_of_memory        = 14
      disk_full               = 15
      dp_timeout              = 16
      OTHERS                  = 17.
  IF sy-subrc = 0.
****MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
*& END-OF-SELECTION
END-OF-SELECTION.
  LOOP AT it_cust INTO wa_cust.
    v_index = sy-tabix.
    PERFORM bdc_dynpro      USING 'SAPMV13A' '0100'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'RV13A-KSCHL'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=ANTA'.
    PERFORM bdc_field       USING 'RV13A-KSCHL'
                                  wa_cust-kschl.
    PERFORM bdc_dynpro      USING 'SAPLV14A' '0100'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'RV130-SELKZ(01)'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=WEIT'.
    PERFORM bdc_dynpro      USING 'SAPMV13A' '1595'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'RV13A-DATBI(01)'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '/00'.
    PERFORM bdc_field       USING 'KOMG-WERKS'
                                  wa_cust-werks.
    PERFORM bdc_field       USING 'KOMG-MATNR(01)'
                                  wa_cust-matnr.
    PERFORM bdc_field       USING 'KONP-KBETR(01)'
                                  wa_cust-kbetr.
    PERFORM bdc_field       USING 'KONP-KONWA(01)'
                                  'INR'.
    PERFORM bdc_field       USING 'RV13A-DATAB(01)'
                                  wa_cust-datab.
    PERFORM bdc_field       USING 'RV13A-DATBI(01)'
                                  wa_cust-datbi.
    PERFORM bdc_dynpro      USING 'SAPMV13A' '1595'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'KOMG-MATNR(01)'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=SICH'.
    CALL TRANSACTION 'VK11' USING it_bdctab
                             MODE p_mode
                           UPDATE p_update
                    MESSAGES INTO it_messagetab.
    IF sy-subrc = 0.
*& reading success records to corresponding internal table
      READ TABLE it_messagetab WITH KEY msgtyp = 'S'.
      IF sy-subrc = 0.
       wa_sucrec-cnum = it_messagetab-msgv1.
        wa_sucrec-cnum = wa_cust-werks.
        wa_sucrec-cnam = wa_cust-matnr.
        APPEND wa_sucrec TO it_sucrec.
        CLEAR wa_sucrec.
      ENDIF.
    ELSE.
*& reading error records to corresponding internal table
      READ TABLE it_messagetab WITH KEY msgtyp = 'E'.
      IF sy-subrc = 0.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id  = sy-msgid
            no  = it_messagetab-msgnr
            v1  = it_messagetab-msgv1
            v2  = it_messagetab-msgv2
            v3  = it_messagetab-msgv3
            v4  = it_messagetab-msgv4
          IMPORTING
            msg = wa_errrec-message.
        wa_errrec-lineno = v_index.
        APPEND wa_errrec TO it_errrec.
        CLEAR wa_errrec.
      ENDIF.
    ENDIF.
    CLEAR : it_bdctab, it_messagetab.
    REFRESH: it_bdctab, it_messagetab.
  ENDLOOP.
  DESCRIBE TABLE it_cust LINES v_totrec.
  DESCRIBE TABLE it_errrec LINES v_errrec.
  DESCRIBE TABLE it_sucrec LINES v_sucrec.
  PERFORM disp_data.
  SKIP 2.
  IF v_sucrec > 0.
    PERFORM disp_success_data.
  ENDIF.
  SKIP 2.
  IF v_errrec > 0.
    PERFORM disp_error_data.
  ENDIF.
*& Form bdc_dynpro
text
-->P_0104 text
-->P_0105 text
FORM bdc_dynpro USING program dynpro.
  CLEAR it_bdctab.
  it_bdctab-program  = program.
  it_bdctab-dynpro   = dynpro.
  it_bdctab-dynbegin = 'X'.
  APPEND it_bdctab.
ENDFORM. " bdc_dynpro
*& Form bdc_field
FORM bdc_field USING fnam fval.
  CLEAR it_bdctab.
  it_bdctab-fnam = fnam.
  it_bdctab-fval = fval.
  APPEND it_bdctab.
ENDFORM. " bdc_field
*& Form disp_data
FORM disp_data .
  ULINE (45).
  WRITE : / sy-vline,
  4 'FAMD Price Master UPDATE SUMMARY'(004) COLOR 1,
  45 sy-vline.
  ULINE /(45).
  WRITE : / sy-vline,
  'Total Records Processed'(007),
  28 '=',
  30 v_totrec,
  45 sy-vline,
  / sy-vline,
  'Error Records'(005),
  28 '=',
  30 v_errrec,
  45 sy-vline,
  / sy-vline,
  'Successful Records'(006),
  28 '=',
  30 v_sucrec,
  45 sy-vline.
  ULINE /(45).
ENDFORM. " disp_data
*& Form disp_success_data
FORM disp_success_data .
  ULINE (45).
  WRITE : / sy-vline,
  14 'Successful Records'(012) COLOR 1,
  45 sy-vline.
  ULINE /(45).
  WRITE : / sy-vline ,
  'Plant Number'(010) COLOR 2,
  17 sy-vline,
  25 'Material Number'(011) COLOR 2,
  45 sy-vline.
  ULINE /(45).
  LOOP AT it_sucrec INTO wa_sucrec.
    WRITE: / sy-vline ,
    wa_sucrec-cnum,
    17 sy-vline,
    19 wa_sucrec-cnam,
    45 sy-vline.
  ENDLOOP.
  ULINE /(45).
ENDFORM. " disp_success_data
*& Form disp_error_data
FORM disp_error_data .
  ULINE (90).
  WRITE : / sy-vline,
  35 'Error Records'(013) COLOR 1,
  90 sy-vline.
  ULINE /(90).
  WRITE : / sy-vline,
  'Record Number'(008) COLOR 2,
  sy-vline,
  37 'Reason for error'(009) COLOR 2,
  90 sy-vline.
  ULINE /(90).
  LOOP AT it_errrec INTO wa_errrec.
    WRITE : / sy-vline,
    wa_errrec-lineno,
    17 sy-vline,
    wa_errrec-message,
    90 sy-vline.
  ENDLOOP.
  ULINE /(90).
ENDFORM. " disp_error_data
Flat file Sequence:
Condition Type     Plant     Matrial No     Rate      Validity start date     Validity end date

Hi,
I think you are using  'wa_cust-kbetr' directly while populating rate field in BDC.
Please write wa_cust-kbetr into a character variable and pass the character variable to BDC.
data: t_rate(16) type c.
write wa_cust-kbetr to t_rate no-grouping.
Pass t_rate instead of wa_cust-kbetr in the BDC.
PERFORM bdc_field USING 'KONP-KBETR(01)'
      t_rate.
Like wise you might have to write your date variables also.
Thanks and regards,
S. Chandramouli.

Similar Messages

  • BDC problem with F-30

    Hi All,
    I want to record a BDC for F-30 to clear the deduction line items for a Document. These deduction line items have a "Reason code" with it... When I select a Document Number in F-30, it displays all the line items in a table control.. I need to select and clear only those items with "Reason code" in that...
    How can I select a line item from the table control and clear it based on the reason code in a BDC?
    I have looked at the previous posts... I have seen a solution provided by filling the structure BSELP. How this can be included in the program and how to fill the values... Is there any limit for the values to get it filled?.. Because I could see
    FELDN_1 to FELDN_18 in BSELP structure.....
    BDC problem in F-30
    BSELP-FELDN_1 = "BELNR"
    BSELP-SLVON_1 = "00002222221997003"
    How the rfbibl00 program works?
    Thanks for the help,
    Asha

    Hi,
        Use BAPI_PAYIT_POST_CLEARING
    or  FM POSTING_INTERFACE_CLEARING
    or
    try this code for transaction fb05:
    DATA: BEGIN OF bkey OCCURS   0,
            belnr LIKE bseg-belnr,
            gjahr LIKE bseg-gjahr,
            buzei LIKE bseg-buzei,
          END OF bkey.
    *Dynpro 122 - Header
        PERFORM bdc_dynpro USING 'SAPMF05A' '0122'.
        PERFORM bdc_field USING 'BKPF-BLDAT' agz-datum.
        PERFORM bdc_field USING 'BKPF-BLART' augblart.
        PERFORM bdc_field USING 'BKPF-BUKRS' htab-bukrs.
        PERFORM bdc_field USING 'BKPF-BUDAT' agz-datum.
        PERFORM bdc_field USING 'BKPF-WAERS' t001-waers.
        IF t003-xmref = 'X'.
          IF htab-xblnr <> space.
            PERFORM bdc_field USING 'BKPF-XBLNR' htab-xblnr.
          ELSE.
            PERFORM bdc_field USING 'BKPF-XBLNR' text-aag.
          ENDIF.
        ENDIF.
        UNPACK vorgang TO zeile.
        PERFORM bdc_field_loop USING zeile 'RF05A-XPOS1' 'X'.
        PERFORM bdc_field USING 'BDC_OKCODE'     'SL'.
        LOOP AT itab WHERE marked = 'X'.
    *Dynpro 0710 -
          PERFORM bdc_dynpro USING 'SAPMF05A' '0710'.
          PERFORM bdc_field USING 'RF05A-AGKON' agku-kunnr.
          PERFORM bdc_field USING 'RF05A-AGBUK' agku-bukrs.
          PERFORM bdc_field USING 'BDC_OKCODE'     'SLB'.         "ins
    *Dynpro 0733 - insert fi-document-nr.
          PERFORM bdc_dynpro USING 'SAPMF05A' '0733'.
          CLEAR:   zeile, cnt.
          LOOP AT htab WHERE agzif = agc-nr AND xfeld = 'X'
                        AND bukrs = agku-bukrs AND kunnr = agku-kunnr.
            CLEAR bkey.
            cnt = cnt + 1.
            UNPACK cnt TO zeile.
            PERFORM bdc_field_loop USING zeile 'RF05A-FELDN' 'BELNR'.
            MOVE-CORRESPONDING tab TO bkey.
            PERFORM bdc_field_loop USING zeile 'RF05A-SEL01'  bkey.
          ENDLOOP.
    <b>Reward points</b>
    Regards

  • BDC Problem : Tcode : F-30

    Hi All,
    BDC Problem :
    Iam working with Tcode : F-30.
    Iam able to post the the document in  All (A) screen mode
    But Iam unable to post the  document in  No (N) screen mode
    Please let me know how to solve this issue
    Thanks
    Sunil

    HI,
    R u getting any errors while creating using 'A'.
    If not then use commit work after BDC.
    Thanks

  • Change transaction using BDC-problem for large number of lines on screen

    Hi All,
    I am developing BAPI (using BDC) which creates quality notification in SAP which is entered via front end web application. Structure p_qmsm contain 3 lines of task in notification. The code is as given below. To avoid problem of large no of lines on screen,code lines starting with * is used. This actually for pagedown after entering every 2 lines and creates new line. so that 2 lines always push up on screen and there will not be problem for creating large no of lines on screen
    perform bdc_dynpro using 'SAPLIQS0' '7200'.
    perform bdc_field using 'BDC_OKCODE' '=10\TAB11'.
    LOOP AT p_qmsm INTO wa_qmsm.
    *IF wa_qmsm_cntr > 2.
           wa_qmsm_cntr = 2.
           perform bdc_dynpro  using 'SAPLIQS0'                   '7204'.
           perform bdc_field   using 'BDC_OKCODE'                 '=PEND'.
    ENDIF.
    perform bdc_dynpro using 'SAPLIQS0' '7204'.
    perform bdc_field using 'BDC_OKCODE' '/00'.
    CONCATENATE 'VIQMSM-QSMNUM(' wa_qmsm_cntr ')' INTO wm_qmsm_qsmnum.
    CONCATENATE 'VIQMSM-MNGRP(' wa_qmsm_cntr ')' INTO wm_qmsm_mngrp.
    CONCATENATE 'VIQMSM-MNCOD(' wa_qmsm_cntr ')' INTO wm_qmsm_mncod.
    CONCATENATE 'VIQMSM-MATXT(' wa_qmsm_cntr ')' INTO wm_qmsm_matxt.
    perform bdc_field using wm_qmsm_qsmnum wa_qmsm-qsmnum.
    perform bdc_field using wm_qmsm_mngrp wa_qmsm-mngrp.
    perform bdc_field using wm_qmsm_mncod wa_qmsm-mncod.
    perform bdc_field using wm_qmsm_matxt wa_qmsm-matxt.
    wa_qmsm_cntr = wa_qmsm_cntr + 01.
    ENDLOOP.
    CALL TRANSACTION 'IQS2' USING wt_bdc
    MODE 'N' UPDATE 'A'  MESSAGES INTO P_MESSTAB.
    The same code is used in modify mode also. web application is sending all 3 lines in modify mode even if single line is modified. It is already decided to send all rows back from web application to SAP in same sequence. It is working fine if i comment 5 lines which is starting with *. But in modify mode, how can i ensure that correct row is modified? and how can i achieve problem of large no of lines on screen?Please suggest?

    Hi yogesh,
    how can i ensure that correct row is modified?
    1. For this we need to know two things ;
       a) the database table in which the entries are already stored
       b) the sequence in which they are displayed in the transaction.
    2. So before changing any line, we need to compare (the primary key values / important values)
       a) as per the database table and as per the incoming data from web application (using bapi)
      b) if the match is ok, it means that particular row was not modified, else modified.
    how can i achieve problem of large no of lines on screen?
    1. For this I am  not sure about the transaction and its screen. Manytimes for appending row on the screen,
      there is a PLUS + button on the grid toolbar. So for every entry, (inspite of some empty/filled rows already visible on the screen), we should use the + button, and this new row always appears on the top i.e. row number 1.
    hope this helps.
    regards,
    amit m.

  • BDC -Problem with mode 'N'

    Hi
    BDC with mode 'A'  is working correctly  but when I make the mode 'N' it gives a dump.
    With mode 'A' the record is updated , what may be the cause?
    Thanks

    I am using the tcode 7kE1 for bdc , it works perfectly with mode 'A' , but not with mode 'N', It give error  'Message_Type_Unknown' .
    there is no problem with the file as values are going correctly in tcode
    Edited by: Puneeta Parnami on Jun 12, 2009 12:57 PM

  • F-32 Transaction BDC Problem

    Hi All,
           I am following the below procedure to populate the transaction F-32 using BDC but I have a small doubt:
    1) I go to F-32 Transaction code populate the required fields on that and press F5
    2) It takes to second screen which has three fields as Field in which I am populating BELNR, second field is Lower Limit field which has a value combination of year document type document number, third field is left blank.
           Now I need to Clear Only part of the second field say for example year part.
          How can I do that? Has anyone faced this kind of problem if so Please reply back.
    Thanks & Regards,
    Joseph Reddy.
    Message was edited by: Joseph Reddy Yeruva

    Hi Rob,
           This is how the code is written
          PERFORM bdc_dynpro      USING 'SAPMF05A' '0131'.
          PERFORM bdc_field       USING:
                               'BDC_CURSOR'  'BKPF-WAERS',
                               'BDC_OKCODE'  '=SLB',
                               'RF05A-AGKON' p_kunnr,
                               'BKPF-BUDAT'  lv_date,
                               'BKPF-MONAT'  '11',
                               'BKPF-BUKRS'  p_bukrs,
                               'BKPF-WAERS'  gv_waers.
                               'RF05A-XNOPS' c_x.
          perform bdc_dynpro      using 'SAPMF05A' '0733'.
          perform bdc_field       using 'BDC_CURSOR' 'RF05A-                                     SEL01(01)'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=PA'.
          perform bdc_field       using 'RF05A-FELDN(01)'
                                          'BELNR'.
          perform bdc_field       using 'RF05A-FELDN(02)'
                                        record-FELDN_02_008.
          perform bdc_field       using 'RF05A-FELDN(03)'
                                        record-FELDN_03_009.
          perform bdc_field       using 'RF05A-FELDN(04)'
                                        record-FELDN_04_010.
          perform bdc_field       using 'RF05A-SEL01(01)'
                                         lv_belnr.
          perform bdc_field       using 'RF05A-SEL01(02)'
                                        record-SEL01_02_012.
          perform bdc_field       using 'RF05A-SEL01(03)'
                                        record-SEL01_03_013.
          perform bdc_field       using 'RF05A-SEL01(04)'
                                        record-SEL01_04_014.
          perform bdc_dynpro      using 'SAPDF05X' '3100'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=OMX'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'DF05B-PSSKT(01)'.
          perform bdc_field       using 'RF05A-ABPOS'
                                          '001'.
          perform bdc_dynpro      using 'SAPDF05X' '3100'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=Z+'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'DF05B-PSSKT(01)'.
          perform bdc_field       using 'RF05A-ABPOS'
                                         '001'.
          perform bdc_dynpro      using 'SAPDF05X' '3100'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=BU'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'DF05B-PSSKT(01)'.
          perform bdc_field       using 'RF05A-ABPOS'
                                         '001'.
         CALL TRANSACTION 'F-32' USING gt_BDCDATA
                                 MODE   'A' "gv_mode
                                 UPDATE gv_updat.
    Rgds,
    Joseph

  • F-04 bdc problem

    HI
    FRIENDS  STUCK IN A SMALL PROBLEM IAM DOING A BDC FOR F-04
    IN WHICH I HAD FLAT FILE IN THE FOLLOWING FORMAT ,
    27.10.2004     sa     npil     31.07.2006 3689525.64     1000     2000     2810200     7400007174
                                                      7400007175
                                                      7400007176
    27.10.2004     sa     npil     31.07.2006 3689525.64     1001     2000     2810200     7400007177
                                                      7400007178
                                                      7400007179
    THE DATA IS SPLIT DEPENDING UPON BUSINESS AREA 1000 AND 1001 , BUT IAM NOT ABLE TO GET ALL THE
    ACCOUNT NOS STARTING FROM 7400 .. TO NEXT BUSINESS AREA I AM GETTING ONLY THE FIRST ACCT NO.
    HERE I THINK AT NEW IS NOT WORKING .
    SO PLS CAN ANYBODY TELL ME HOW TO DO THIS .

    This is the code ,
    LOOP AT i_final .
        CLEAR i_gsber.
        MOVE-CORRESPONDING i_final TO i_gsber.
        APPEND i_gsber.
      ENDLOOP.
      LOOP AT i_gsber.
        CLEAR item.
       MOVE-CORRESPONDING i_gsber TO item.
        IF i_gsber-gsber <> space .
          w_gsber = i_gsber-gsber.
        ENDIF.
        item-gsber = w_gsber.
        item-sel01 = i_gsber-sel01.
        APPEND item.
      ENDLOOP.
    *********************the include part
    PERFORM bdc_dynpro      USING 'SAPMF05A' '0731'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '/00'.
        LOOP AT item WHERE gsber = wa_itab-gsber.
          MOVE-CORRESPONDING item TO wa_item.
       ENDAT.
       LOOP AT item WHERE gsber = i_gsber-gsber.
          w_count = w_count + 1.
          CONCATENATE 'RF05A-SEL01(' w_count ')' INTO w_bdc.
          PERFORM bdc_field       USING   w_bdc
                                          wa_item-sel01.
          IF w_count >= 16.
            w_count = 0.
            PERFORM bdc_dynpro      USING 'SAPMF05A' '0731'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                             '/00'.
          ENDIF.
        ENDLOOP.
       AT END OF gsber.
        PERFORM bdc_dynpro      USING 'SAPMF05A' '0731'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                         '=PA'.
        PERFORM bdc_dynpro      USING 'SAPDF05X' '3100'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                         '=AB'.
        PERFORM bdc_dynpro      USING 'SAPMF05A' '0700'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BU'.
    regards

  • URGENT: BDC problem small one

    hi everybody
    I am new to BDC and I have created a BDC for MM01. It is working well. I am using it by call transaction method. But my problem is this when the last material is created it is good but it does not stop and starts the next material creation and every time when i run the bdc it will waste a material number.
    and please tell me the code to stop the bdc in each method and to move to next method
    follwoing is the bdc code.
    report ZDEMO_ZCON
           no standard page heading line-size 255.
    data: begin of record OCCURS 0,
           MATNR(018),
           MBRSH_001(001),
           MTART_002(004),
           WERKS_015(004),
            MAKTX(040),
            MEINS(003),
            MATKL(009),
           BISMT(18),
           EXTWG(18),
            EKGRP(003),
           XCHPF_025(001),
            WEBAZ(003),
            DISGR(004),
           DISMM_030(002),
           MINBE(18),
            DISPO(003),
           DISLS(002),
           MABST(18),
           SOBSL(2),
           PLIFZ_034(003),
           FHORI_036(003),
           MTVFP_039(002),
            BKLAS(004),
    END OF RECORD.
    include bdcrecx1.
    start-of-selection.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = 'C:\BOOKS3'           " Name of the tab delimited flat file on desktop
    FILETYPE = 'DAT'
    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 = record                   " Name of internal table with data.
    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.
    perform open_group.
    LOOP AT RECORD.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MATNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  'M'.
    perform bdc_field       using 'RMMG1-MTART'
                                  'ZCON'.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(13)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=P+'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(09)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(12)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(13)'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(08)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(04)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(05)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(06)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(07)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(08)'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMGMM' '0080'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-LGORT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'RMMG1-WERKS'
                                  'MFPL'.
    perform bdc_field       using 'RMMG1-LGORT'
                                  'ccon'.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MATKL'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins.
    perform bdc_field       using 'MARA-MATKL'
                                  record-matKl.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-EKGRP'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins.
    perform bdc_field       using 'MARC-EKGRP'
                                  record-ekgrp.
    perform bdc_field       using 'MARA-MATKL'
                                  record-matkl.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-DISGR'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins.
    perform bdc_field       using 'MARC-DISGR'
                                  record-disgr.
    perform bdc_field       using 'MARC-EKGRP'
                                  record-ekgrp.
    perform bdc_field       using 'MARC-DISMM'
                                  'ND'.
    perform bdc_field       using 'MARC-DISPO'
                                  record-dispo.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-WEBAZ'.
    perform bdc_field       using 'MARC-WEBAZ'
                                  record-webaz.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PB01'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins.
    perform bdc_field       using 'MARC-WEBAZ'
                                  record-webaz.
    perform bdc_dynpro      using 'SAPLQPLS' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMQAM-ARGUMENT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=NEU'.
    perform bdc_dynpro      using 'SAPLQPLS' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMQAM-AKTIV(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=WEIT'.
    perform bdc_field       using 'RMQAM-ART(01)'
                                  'ZCON'.
    perform bdc_field       using 'RMQAM-APA(01)'
                                  'X'.
    perform bdc_field       using 'RMQAM-AKTIV(01)'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins.
    perform bdc_field       using 'MARC-WEBAZ'
                                  record-webaz.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins.
    perform bdc_field       using 'MBEW-BKLAS'
                                  record-bklas.
    perform bdc_field       using 'MBEW-VPRSV'
                                  'V'.
    perform bdc_field       using 'MBEW-PEINH'
                                  '1'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins.
    perform bdc_field       using 'MARC-LOSGR'
                                  '1'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'MBEW-BKLAS'
                                  record-bklas.
    perform bdc_field       using 'MBEW-VPRSV'
                                  'V'.
    perform bdc_field       using 'MBEW-PEINH'
                                  '1'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'MARC-PERKZ'
                                  'M'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-MTVFP'.
    perform bdc_field       using 'MARC-MTVFP'
                                  '02'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins.
    perform bdc_field       using 'MARC-WEBAZ'
                                  record-webaz.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins.
    perform bdc_field       using 'MBEW-BKLAS'
                                  record-bklas.
    perform bdc_field       using 'MBEW-VPRSV'
                                  'V'.
    perform bdc_field       using 'MBEW-PEINH'
                                  '1'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins.
    perform bdc_field       using 'MARC-LOSGR'
                                  '1'.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx.
    perform bdc_field       using 'MBEW-BKLAS'
                                  record-bklas.
    perform bdc_field       using 'MBEW-VPRSV'
                                  'V'.
    perform bdc_field       using 'MBEW-PEINH'
                                  '1'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    perform bdc_transaction using 'MM01'.
    ENDLOOP.
    perform close_group.
    plz provide the solution
    points wil b awarded
    thanx and regards

    **&#12288;Program ID &#65306; ZMAT_CREATE
    **&#12288;Program Desc &#65306; Material Master Creation
    **&#12288;Process Overview &#65306;
    **&#12288;Created By &#65306; R. NAGARAJAN
    **&#12288;Created Date &#65306; 22/08/2006
    **&#12288;Company Name &#65306; Infoview Technologies Limited
    REPORT ZMAT_CREATE
    NO STANDARD PAGE HEADING LINE-SIZE 132 MESSAGE-ID ZBDCMSG.
    Internal table definition *
    DATA: BEGIN OF ITAB OCCURS 0,
    MATNR LIKE RMMG1-MATNR, " Material Number
    MBRSH LIKE RMMG1-MBRSH, " Industry Sector
    MTART LIKE RMMG1-MTART, " Material Type
    WERKS LIKE RMMG1-WERKS, " Plant
    LGORT LIKE RMMG1-LGORT, " Storage Location
    VKORG LIKE RMMG1-VKORG, " Sales Organization
    VTWEG LIKE RMMG1-VTWEG, " Distribution Channel
    LGNUM LIKE RMMG1-LGNUM, " Warehouse Number
    LGTYP LIKE RMMG1-LGTYP, " Storage Type
    MAKTX LIKE MAKT-MAKTX, " Material Description
    MEINS LIKE MARA-MEINS, " Base Unit of Measure
    MATKL LIKE MARA-MATKL, " Material Group
    SPART LIKE MARA-SPART, " Division
    MTPOS_MARA LIKE MARA-MTPOS_MARA, "General item category group
    GEWEI LIKE MARA-GEWEI, " Weight Unit
    TAXKM1 LIKE MG03STEUER-TAXKM, " Tax classification material
    TAXKM2 LIKE MG03STEUER-TAXKM, " Tax classification material
    KONDM LIKE MVKE-KONDM, " Material Pricing Group
    MTPOS LIKE MVKE-MTPOS , "ItemCategoryGroupFromMaterialMaster
    MTVFP LIKE MARC-MTVFP, " Checking Group for AvailabilityCheck
    TRAGR LIKE MARA-TRAGR, " Transportation group
    LADGR LIKE MARC-LADGR, " Loading group
    TDLINE LIKE RSTXT-TXLINE, " Text editor text line
    EKGRP LIKE MARC-EKGRP, " Purchasing Group
    DISMM LIKE MARC-DISMM, " MRP Type
    BESKZ LIKE MARC-BESKZ, " Procurement Type
    SOBSL LIKE MARC-SOBSL, " Special procurement type
    PERKZ LIKE MARC-PERKZ, " Period indicator
    PRMOD LIKE MPOP-PRMOD, " Forecast model
    KZINI LIKE MPOP-KZINI, " Initialization indicator
    AUTRU LIKE MARC-AUTRU, " Reset Forecast Model Automatically
    MODAV LIKE MPOP-MODAV, " Model selection procedure
    IPRKZ LIKE MARA-IPRKZ, " Period indicator for shelf life expiration date
    BWTTY LIKE MBEW-BWTTY, " Valuation Category
    BKLAS LIKE MBEW-BKLAS, " Valuation Class
    EKLAS LIKE MBEW-EKLAS, " Valuation Class for Sales OrderStock
    VPRSV LIKE MBEW-VPRSV, " Price Control Indicator
    EKALR LIKE MBEW-EKALR, "MaterialIsCostedWithQuantityStructure
    END OF ITAB,
    *// TEXT HEADER
    GT_HEAD LIKE THEAD,
    *// Text lines
    GT_TEXT LIKE STANDARD TABLE OF TLINE,
    GW_TEXT LIKE TLINE,
    Data definition *
    WS_REP_CNT(6) TYPE C,
    SESSION(12) TYPE C.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    PARAMETERS:
    PA_GROUP LIKE APQI-GROUPID OBLIGATORY DEFAULT 'MMupload',
    PA_FNAME LIKE IBIPPARMS-PATH OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    Include statements *
    INCLUDE ZBDCREX.
    At Selection Screen definition *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR PA_FNAME.
    *//GETTING FLAT FILE PATH
    PERFORM FILE_PATH USING PA_FNAME.
    Start of Selection definition *
    START-OF-SELECTION.
    *//UPLOADING THE FLAT FILE
    PERFORM DATA_UPLOAD TABLES ITAB USING PA_FNAME.
    *// BDC OPEN GROUP
    PERFORM OPEN_GROUP USING PA_GROUP.
    SKIP 3.
    FORMAT COLOR COL_HEADING INVERSE ON.
    WRITE 40 TEXT-001.
    FORMAT COLOR COL_HEADING INVERSE OFF.
    SKIP 1.
    FORMAT COLOR COL_NEGATIVE INVERSE ON.
    WRITE :/3 TEXT-002, 13 SY-MANDT, 104 TEXT-003, 113 SY-UNAME,
    /3 TEXT-004, 13 SY-DATUM, 104 TEXT-005, 113 SY-UZEIT.
    FORMAT COLOR COL_NEGATIVE INVERSE OFF.
    LOOP AT ITAB.
    WS_REP_CNT = WS_REP_CNT + 1. "To Count no. of Records Processed
    PERFORM MM_UPLOAD.
    ENDLOOP.
    *//STATUS INDICATION
    IF SY-SUBRC = 0.
    SESSION = PA_GROUP.
    SKIP 1.
    FORMAT COLOR COL_TOTAL INVERSE ON.
    WRITE: /38 TEXT-006 , WS_REP_CNT.
    FORMAT COLOR COL_TOTAL INVERSE OFF.
    MESSAGE S000 WITH SESSION.
    ENDIF.
    *// BDC CLOSE GROUP
    PERFORM CLOSE_GROUP.
    SET PF-STATUS 'ZMM01PF'.
    AT USER-COMMAND.
    CASE SY-UCOMM.
    WHEN 'SESSION'.
    CALL TRANSACTION 'SM35'.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'CANCEL'.
    LEAVE SCREEN.
    ENDCASE .
    FORM MM_UPLOAD *
    FORM MM_UPLOAD.
    REFRESH BDCDATA.
    *// Create Material: Initial Screen
    perform bdc_dynpro using 'SAPLMGMM' '0060'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'RMMG1-MATNR'
    ITAB-MATNR.
    perform bdc_field using 'RMMG1-MBRSH'
    ITAB-MBRSH.
    perform bdc_field using 'RMMG1-MTART'
    ITAB-MTART.
    *// Selection Views
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field using 'BDC_OKCODE'
    'SELA'.
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    *// Organization Levels
    perform bdc_dynpro using 'SAPLMGMM' '0080'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'RMMG1-WERKS'
    ITAB-WERKS.
    perform bdc_field using 'RMMG1-LGORT'
    ITAB-LGORT.
    perform bdc_field using 'RMMG1-VKORG'
    ITAB-VKORG.
    perform bdc_field using 'RMMG1-VTWEG'
    ITAB-VTWEG.
    perform bdc_field using 'RMMG1-LGNUM'
    ITAB-LGNUM.
    perform bdc_field using 'RMMG1-LGTYP'
    ITAB-LGTYP.
    *// Basic Data 1: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4004'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP04'.
    perform bdc_field using 'MAKT-MAKTX'
    ITAB-MAKTX.
    perform bdc_field using 'MARA-MEINS'
    ITAB-MEINS.
    perform bdc_field using 'MARA-SPART'
    ITAB-SPART.
    perform bdc_field using 'MARA-MTPOS_MARA'
    ITAB-MTPOS_MARA.
    perform bdc_field using 'BDC_CURSOR'
    'MARA-GEWEI'.
    perform bdc_field using 'MARA-BRGEW'
    '9000'.
    perform bdc_field using 'MARA-GEWEI'
    ITAB-GEWEI.
    perform bdc_field using 'MARA-NTGEW'
    '8000'.
    *// Sales: Sales Organization 1: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP05'.
    perform bdc_field using 'MG03STEUER-TAXKM(01)'
    ITAB-TAXKM1.
    perform bdc_field using 'MG03STEUER-TAXKM(02)'
    ITAB-TAXKM2.
    perform bdc_dynpro using 'SAPLMGMM' '4200'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP05'.
    *// Sales: Sales Organization 2: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP06'.
    perform bdc_field using 'BDC_CURSOR'
    'MVKE-KONDM'.
    perform bdc_field using 'MVKE-KONDM'
    ITAB-KONDM.
    perform bdc_field using 'MARA-MTPOS_MARA'
    ITAB-MTPOS_MARA.
    perform bdc_field using 'MVKE-MTPOS'
    ITAB-MTPOS.
    *// Sales: General / Plant Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP12'.
    perform bdc_field using 'MARA-MEINS'
    ITAB-MEINS.
    perform bdc_field using 'MARA-BRGEW'
    '9000'.
    perform bdc_field using 'MARA-GEWEI'
    ITAB-GEWEI.
    perform bdc_field using 'MARA-XCHPF'
    perform bdc_field using 'MARA-NTGEW'
    '8000'.
    perform bdc_field using 'MARC-MTVFP'
    ITAB-MTVFP.
    perform bdc_field using 'BDC_CURSOR'
    'MARC-LADGR'.
    perform bdc_field using 'MARA-TRAGR'
    ITAB-TRAGR.
    perform bdc_field using 'MARC-LADGR'
    ITAB-LADGR.
    *// MRP 1: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP13'.
    perform bdc_field using 'MARA-MEINS'
    ITAB-MEINS.
    perform bdc_field using 'MARC-EKGRP'
    ITAB-EKGRP.
    perform bdc_field using 'BDC_CURSOR'
    'MARC-DISMM'.
    perform bdc_field using 'MARC-DISMM'
    ITAB-DISMM.
    *// MRP 2: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP14'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1_BEZ-WERKS_BEZ'.
    perform bdc_field using 'MARC-BESKZ'
    ITAB-BESKZ.
    perform bdc_field using 'MARC-SOBSL'
    ITAB-SOBSL .
    *// MRP 3: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP16'.
    perform bdc_field using 'BDC_CURSOR'
    'MARC-PERKZ'.
    perform bdc_field using 'MARC-PERKZ'
    ITAB-PERKZ.
    perform bdc_field using 'MARC-MTVFP'
    ITAB-MTVFP.
    *// Forecasting Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP17'.
    perform bdc_field using 'BDC_CURSOR'
    'MPOP-PRMOD'.
    perform bdc_field using 'MARA-MEINS'
    ITAB-MEINS.
    perform bdc_field using 'MPOP-PRMOD'
    ITAB-PRMOD.
    perform bdc_field using 'MARC-PERKZ'
    ITAB-PERKZ.
    perform bdc_field using 'MPOP-PERAN'
    '60'.
    perform bdc_field using 'MPOP-ANZPR'
    '12'.
    perform bdc_field using 'MPOP-KZINI'
    ITAB-KZINI.
    perform bdc_field using 'MPOP-SIGGR'
    '4.000'.
    perform bdc_field using 'MARC-AUTRU'
    ITAB-AUTRU.
    perform bdc_field using 'MPOP-MODAV'
    ITAB-MODAV.
    *// Work Scheduling Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP19'.
    perform bdc_field using 'BDC_CURSOR'
    'MARC-FRTME'.
    perform bdc_field using 'MARA-MEINS'
    ITAB-MEINS.
    *// Plant data / Stor. 1: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP20'.
    perform bdc_field using 'BDC_CURSOR'
    'MAKT-MAKTX'.
    perform bdc_field using 'MARA-MEINS'
    ITAB-MEINS.
    perform bdc_field using 'MARA-IPRKZ'
    ITAB-IPRKZ.
    *// Plant data / Stor. 2: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP21'.
    perform bdc_field using 'BDC_CURSOR'
    'MAKT-MAKTX'.
    perform bdc_field using 'MARA-BRGEW'
    '9000'.
    perform bdc_field using 'MARA-GEWEI'
    ITAB-GEWEI.
    perform bdc_field using 'MARA-NTGEW'
    '8000'.
    *// Warehouse Management 1: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP23'.
    perform bdc_field using 'BDC_CURSOR'
    'MAKT-MAKTX'.
    perform bdc_field using 'MARA-MEINS'
    ITAB-MEINS.
    perform bdc_field using 'MARA-BRGEW'
    '9000'.
    perform bdc_field using 'MARA-GEWEI'
    ITAB-GEWEI.
    *// Quality Management Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP24'.
    perform bdc_field using 'BDC_CURSOR'
    'MAKT-MAKTX'.
    perform bdc_field using 'MARA-MEINS'
    ITAB-MEINS.
    *// Accounting 1: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP26'.
    perform bdc_field using 'MARA-MEINS'
    ITAB-MEINS.
    perform bdc_field using 'MBEW-BWTTY'
    ITAB-BWTTY.
    perform bdc_field using 'MARA-SPART'
    ITAB-SPART.
    perform bdc_field using 'BDC_CURSOR'
    'MBEW-STPRS'.
    perform bdc_field using 'MBEW-BKLAS'
    ITAB-BKLAS.
    perform bdc_field using 'MBEW-EKLAS'
    ITAB-EKLAS.
    perform bdc_field using 'MBEW-VPRSV'
    ITAB-VPRSV.
    perform bdc_field using 'MBEW-PEINH'
    '1'.
    perform bdc_field using 'MBEW-VERPR'
    '800'.
    perform bdc_field using 'MBEW-STPRS'
    '800'.
    *// Costing 1: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=SP27'.
    perform bdc_field using 'BDC_CURSOR'
    'MAKT-MAKTX'.
    perform bdc_field using 'MARA-MEINS'
    ITAB-MEINS.
    perform bdc_field using 'MBEW-EKALR'
    ITAB-EKALR.
    perform bdc_field using 'MARC-LOSGR'
    '1'.
    *// Costing 2: Screen
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=BABA'.
    perform bdc_field using 'BDC_CURSOR'
    'MAKT-MAKTX'.
    perform bdc_field using 'MBEW-BKLAS'
    ITAB-BKLAS.
    perform bdc_field using 'MBEW-BWTTY'
    ITAB-BWTTY.
    perform bdc_field using 'MBEW-EKLAS'
    ITAB-EKLAS.
    perform bdc_field using 'MBEW-VPRSV'
    ITAB-VPRSV.
    perform bdc_field using 'MBEW-PEINH'
    '1'.
    perform bdc_field using 'MBEW-VERPR'
    '800.00'.
    perform bdc_field using 'MBEW-STPRS'
    '800.00'.
    perform bdc_dynpro using 'SAPLSPO1' '0300'.
    perform bdc_field using 'BDC_OKCODE'
    '=YES'.
    *//BDC INSERT
    PERFORM BDC_TRANSACTION TABLES BDCDATA
    USING 'MM01'. " MESSAGES INTO GT_MSG.
    *// Text Header Data
    CONCATENATE ITAB-MATNR ' 000101'
    INTO GT_HEAD-TDNAME .
    GT_HEAD-TDOBJECT = 'MVKE' .
    GT_HEAD-TDID = '0001' .
    GT_HEAD-TDSPRAS = SY-LANGU.
    *// Sales Text
    GW_TEXT-TDFORMAT = '00'.
    GW_TEXT-TDLINE = ITAB-TDLINE .
    APPEND GW_TEXT TO GT_TEXT.
    CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
    CLIENT = SY-MANDT
    HEADER = GT_HEAD
    INSERT = 'X'
    SAVEMODE_DIRECT = 'X'
    OWNER_SPECIFIED = ' '
    TABLES
    LINES = GT_TEXT
    EXCEPTIONS
    ID = 1
    LANGUAGE = 2
    NAME = 3
    OBJECT = 4
    OTHERS = 5.
    IF SY-SUBRC 0.
    SKIP 2.
    FORMAT COLOR COL_NEGATIVE INVERSE ON.
    WRITE: / 'Unable to Insert Salestext for Material : ', ITAB-MATNR .
    FORMAT COLOR COL_NEGATIVE INVERSE OFF.
    ENDIF.
    CLEAR: GT_HEAD, GT_TEXT, GW_TEXT.
    ENDFORM. "MM_UPLOAD

  • F-28 BDC problem when not debugging

    Hello friends,
    I have developed a BDC for the TCODE F-28 and everything works fine when i do in debug mode. NO problem at all. However when I do a no screen and if I am not debugging, it posts the invoice for one record and from second record on it fails.
    ANy suggestions as what could be the reason for this.
    Shreekant

    Try to give WAIT after the first record call. May this will help you out.

  • BDC PROBLEM for MIGO

    Dear all,
    there is problem in BDC MIGO report.  when i uploaded the p_file the bdc run but on some fields it gives the error message
    S Field GOITEM-ERFME . is not an input field
    S Field GOITEM-ERFMG . is not an input field
    S Field GOITEM-LSMNG . is not an input field
    S Field GOITEM-LSMEH . is not an input field
    S Field GOITEM-BWART . is not an input field
    S Field GOITEM-LGOBE . is not an input field
    S Field GOITEM-WEMPF . is not an input field
    S Field GOITEM-ABLAD . is not an input field
    S Field GOITEM-SGTXT . is not an input field
    these are all input fields and i defiend as
    perform bdc_field       using 'BDC_CURSOR'
                                  'GOITEM-ERFME'.
    perform bdc_field       using 'GOITEM-ERFME'
                                  IT_DATA-ERFME.
    perform bdc_field       using 'GOITEM-ERFMG'
                                  IT_DATA-ERFMG.
    perform bdc_field       using 'GOITEM-LSMNG'
                                  IT_DATA-LSMNG.
    perform bdc_field       using 'GOITEM-LSMEH'
                                  IT_DATA-LSMEH.
    *perform bdc_field       using 'GOITEM-MIGO_ELIKZ'
                                 '1'.
    perform bdc_field       using 'GOITEM-BWART'
                                  '101'.
    perform bdc_field       using 'GOITEM-LGOBE'
                                  IT_DATA-LGOBE.
    perform bdc_field       using 'GOITEM-WEMPF'
                                  IT_DATA-WEMPF.
    perform bdc_field       using 'GOITEM-ABLAD'
                                  IT_DATA-ABLAD.
    perform bdc_field       using 'GOITEM-SGTXT'              "
                                  IT_DATA-SGTXT.
    please solve my problem.
    Regards,
    Pankaj

    HI,
    May this will throw some light for u
    Geting problem in BDC prog of MIGO transaction
    Regards,
    Aditya

  • VF01 BDC PROBLEM

    Hi.
    I have a BDC code which runs fine using call transaction VF01 and Mode = 'A'.
    But when I run it in Mode = N, its not executed. Invoice is not created.
    Any idea?
    I tried with other options like Update = 'S' and 'A' and 'L'.
    My code is as below ::
    FORM GET_OPENORDERS.
    SELECT VBELN ERDAT VKORG LFART FROM LIKP INTO TABLE ITAB_LIKP WHERE VKORG = '3010'.
      SELECT VBELN XBLNR FROM VBAK INTO TABLE ITAB_VBAK WHERE
      VBELN = '0000000483'.
                                             AUART = 'ZCKD' OR
                                             AUART = 'ZEXS' OR
                                             AUART = 'ZCLM' OR
                                             AUART = 'ZISO' OR
                                             VKORG = '3010' AND
                                             VTWEG = '30'  AND
                                             SPART = '30' AND
                                             ERDAT = SY-DATUM.
        IF NOT ITAB_VBAK[] IS INITIAL.
          SELECT VBELN VBTYP FROM VBUK INTO TABLE ITAB_VBUK FOR ALL ENTRIES IN ITAB_VBAK
                                                            WHERE
                                                            VBELN = ITAB_VBAK-VBELN AND
                                                            LFSTK = 'C' AND    " DELIVERY STATUS : COMPLETED
                                                            LFGSK = 'C' AND    " OVER ALLDELIVERY STATUS : COMPLETED
                                                            FKSAK NE 'C' AND   " BILLING STATUS ORDER : NOT COMPLETED
                                                            VBTYP = 'C'.       " DOC TYPE = ORDERS
        ENDIF.
      ENDFORM.                    " GET_OPENORDERS
    *&      Form  CREATE_INVOICE
          text
    -->  p1        text
    <--  p2        text
    FORM CREATE_INVOICE .
      LOOP AT ITAB_VBUK.
    DO.
       READ DATASET DATASET INTO RECORD.
       IF SY-SUBRC <> 0. EXIT. ENDIF.
        PERFORM BDC_DYNPRO      USING 'SAPMV60A' '0102'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                     '0000000464'.
                                       ITAB_VBUK-VBELN.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'KOMFK-VBELN(01)'
                                      ITAB_VBUK-VBELN.
                                     RECORD-VBELN_01_001.
        PERFORM BDC_DYNPRO      USING 'SAPMV60A' '0104'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'ZESO'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=SICH'.
       PERFORM BDC_TRANSACTION USING 'VF01'.
    ENDDO.
      WAIT UP TO 1 SECONDS.
        CALL TRANSACTION 'VF01' USING BDCDATA MODE 'N'
                                       UPDATE 'S'
                                       MESSAGES INTO MESSTAB.
        COMMIT WORK AND WAIT.
        CLEAR: BDCDATA, MESSTAB.
        REFRESH: BDCDATA, MESSTAB.
      ENDLOOP.
    PERFORM CLOSE_GROUP.
    PERFORM CLOSE_DATASET USING DATASET.
    loop at MESSTAB.
    write : Messtab.
    endloop.
    ENDFORM.                    " CREATE_INVOICE
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> SPACE.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.                    "BDC_FIELD

    Hi All,
    Thanks for the replies.
    Just adding my comments here.
    We need to do the saperate recording for this problem.
    In SHDB, we have to select "Simulate Background Mode"
    My problem is solved.
    Adding here so that it will appear in teh search results for others....
    May be.. cheers,

  • Fs00 bdc problem in ticking checkbox fields

    Hello All,
    I have written bdc for tcode FS00 for gl master record upload but im getting error while uploading.
    In flat file i have putted value 'x' for posting without tax allowed, manage in local currency,open item and line item but when im running a bdc the checkboxes are getting checked but im getting the error "enter a valid value"
    If i create every account manually and tick the checkbox thn its not giving error but in bdc program if i m putting tick in checkbox im getting error
    Pls let me knw is there any other value of checkbox other thn 'x'?
    Thnks
    Sunny

    hi Sunny,
    just rin the BDS in mode A (show all screens) or E (stop at error), so that you'll see what is exactly the problem. I assume the problem is somewhere else (not by the checkboxes), for another field you enter a wrong value, which is not accepted by the system. Just check, where the cursor is placed, right after the error message!
    hope this helps
    ec

  • VA01 BDC problem

    Hi Experts,
    I am running a BDC for VA01 transaction, it is working fine when customer is not having incompletion log, but my problem is suppose customer is having incompletion log that time in Va01 it is showing one report which indicates all the error against that customer in ALV format. 
    When i am trying to record that report that time recording is going up to report but it is not coming out from there.
    I am already capturing standard messages but it is not capturing the report error, i have discussed with functional team they are saying for them that report itself is error.
    Can any one help me on this if customer is having any incompletion log in va01 how to capture that in bdc.

    Hi,
    You may well be able to get around this by using BAPI_SALESORDER_CREATEFROMDAT2 instead of a BDC - it has a parameter "BEHAVE_WHEN_ERROR" that may let you save the document even with the incompletion entries.  The users would then just have to process the entries later via VA02 but that should be part of a normal business process anyway.
    Gareth.

  • BDC problem session hangs on F4.

    Hi all,
    suppose a material code has been created using mm01, know while performing
    valuation extension of this material code through  bdc call transaction method ,
    Problem arises when a wrong plant is given through flat file to a particular matnr ,
    a pop up window appears with a message , matnr is not matained for this plant,
    But know if after cancelling this pop up window and opening the search help in the plant field which shows the correct plant for which the material code matained, the system hangs here neither it allows to select this correct plant from search help,
    and nor it closes this window there after . hence after altctrldel has to be done due to which all other session and whole sap session gets close .
    Pls provide your valuable suggestions on this problem
    thanks in advance ,
    Regards,
    Vivek

    Hi!
    Try not solve this problem in BDC. Write your coding into the ABAP section.
    For example if there is a possible wrong plant, then search after it first.
    like: SELECT SINGLE werks FROM marc INTO lv_werks WHERE matnr = lv_matnr.
    If the werks (plant) is not correct, then use the plant from the select in the BDC.
    BDC is not very good for error handling.
    Regards
    Tamá

  • BDC problem in Open Excel

    Hi,
    We are facing the problem to run the BDC.
    Actually problem is that we are using the UBUNTU instead of Window XP / Server and Open Office instead of Microsoft Office..
    File extension of Open Excel is .ODS & Microsoft Excel extension is .XLS. Also our BDC is supporting the .XLS extension files.
    Is there any way to use the .ODS extension file in my BDC. Is it possible that if i change the code somewhere and use .ODS file, my BDC should run..
    How to upload my .ODS file in BDC?? or any other way to make my BDC successful??
    Thanks...
    Edited by: @ABAP@ on Oct 10, 2009 5:57 PM

    Hi,
    There are few things that I need you to check:
    1.Make sure your file is not open while executing the eport
    2.Declare internal table with all fields as Char type haning the length same as defined in the backend.
    3.You can either upload the XLs file using the direct FM TEXT_convert_xls_to_sap
    or save the xls file as the tabdeliminator file and use the Fm GUI_UPLOAD.
    4.FM GUI_DOWNLOAD is used to download any fiel data to the presentaion server.
    Hope now your problem will be solved.
    Pooja

  • BDC Problem for FF67

    Hi All,
    I have developed BDC for FF67 transaction ,
    Am having a problem in that , My problem is that the second screen number, where we enter line items, is different in development server and different in production server.
    In development am having second screen number as 8001 and in production server am having screen number as 8000.
    I want to know why the screen number is different in two servers.
    Regards,
    Bharat.
    Edited by: bharat tambat on Nov 6, 2008 3:21 PM
    am waiting for reply...
    Edited by: bharat tambat on Nov 7, 2008 6:23 AM

    Hi Bharat
    Probably too late for an advice but always try using a BAPI for SAP posting.
    Go for BDC only if one is not available !!
    Re: Regd : BAPI might interest you.
    Neeraj

Maybe you are looking for

  • Wireless internet slow and lags on macbook but not g5

    All of a sudden my macbook is barely loading pages. It get's stuck on ebay, or will continue to spin and load. On my G5 which is also on the same wireless it has no problems. What can I do to remedy this? Any ideas? w

  • Property loader / property saver

    Property loader works really well, but I have a question ... Where is the ability to 'Property save?'. I see the menu item, import/export properties. Is there an equivalent test stand statement that allows me to save properties from a sequence while

  • [Solved] Command to see the ArchLinux information?

    Hi, I saw in some images that with one command you can get the system info, like this: http://i.imm.io/A2HD.jpeg Anyone know which command is? Thanks. -- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/

  • Custom Components (CFC's)

    So I'm working on an app that requires 2 CFC's in order for it to function correctly. The first one is sosXML (http://sosxml.riaforge.org/) and the other is cfcUnit. So I downloaded both zipped files and dropped them in the root path of the website's

  • When trying to sync with my computer it downloads my roomates music

    I got a new shuffle and when I signed in itunes with my name and password it downloaded my roomates music and i can't even find my library. Did I lose all my music??