Is BDC's CALL TRANSACTION 'VA01' is not equals to ONLINE(manual) creation?

Hi Experts,
Ours is IS-Oil.
If the user do not enters/inputs OIC_MOT (Mode Of Transport) at ITEM level on the External Details popup, SAP will get it from Customar Master-KNA1 and populates on it, because its a mandatory field (OIC_MOT), but, do not throws an Error message and interupts the sales order creation process.
We have a inbound IDOC posting function module for sales order (VA01), which posts the sales oreders by using BDC (CALL TRANSACTION 'VA01') in the system. In this function module, we are not populating the OIC_MOT field contained segment by hoping SAP will populate/default it while it hits CALL TRANSACTION 'VA01' of my BDC of my FM of IB IDOC. But, SAP is not defaulting/populating and throwing error message (saying 'OIC_MOT field is a mandatory input field' data is missing) and IDOC is failing, pls. let me know Wht its so? is the BDC's CALL TRANSACTION 'VA01' is not equals to ONLINE (manual ) creation of sales order?
Thank you

Hi
Several transactions can ba a different behavior between online and bdc process, but if you simulate the trx by SM35 you should find out these gaps
I don't know OIL vertical, but the main transactions have a bapi can be used insted of BDC program (BAPI_SALESORDER_CREATEFROMDAT2, but perhaps there's a particular BAPI for OIL).
Max

Similar Messages

  • Can anybody pls tell me  limitations of BDC Session & Call transaction?

    hi, Guys, this is srinivas.
    How can we deside which method is to(BDC session/ Call transaction)
    use to upload data to SAP database?
    Can we run Call Transaction in Background?
    Which is preferable for bulk data? and Why?
    how can we restart Session if any error occurs?
    Thanku?

    Hi,
    Hope it helps this......
    SAP BDC INTERVIEW QUESTIONS  & ANSWERS
    1.       What is full form of BDC Session?
    Batch Data Communication Session.
    2.       What are the steps in a BDC session?
    The first step in a BDC session is to identify the screens of the transaction that the program will process.  Next step is to write a program to build the BDC table that will be used to submit the data to SAP.  The final step is to submit the BDC table to the system in the batch mode or as a single transaction by the CALL TRANSACTION command.
    3.       How do you find the information on the current screen?
    The information on the current screen can be found by SYSTEM à STATUS command from any menu.
    4.       How do you save data in BDC tables?
    The data in BDC tables is saved by using the field name ‘BDC_OKCODE’ and field value of ‘/11’.
    5.       What is the last entry in all BDC tables?
    In all BDC tables the last entry is to save the data by using the field name BDC_OKCODE and a field value of ‘/11’.
    6.       What is a multiple line field?
    A multiple line field is a special kind of field which allows the user to enter multiple lines of data into it.
    7.       How do you populate data into a multiple line field?
    To populate data into a multiple line field, an index is added to the field name to indicate which line is to be populated by the BDC session (Line index).
    8.       Write the BDC table structure.
    BDC table structure
    FIELD                     TYPE                            DESCRIPTION
    Program                CHAR (8)                      Program name of transaction.
    DynPro                 CHAR (4)                      Screen number of transaction.
    DynBegin              CHAR (1)                      Indicator for new screen.
    Fnam                    CHAR (35)                     Name of database field from screen.
    Fval                      CHAR (80)                     Value to submit to field.
    9.       Does the CALL TRANSACTION method allow multiple transactions to be processed by SAP?
    No.  The CALL TRANSACTION method allows only a single transaction to be processed by SAP.
    10.    Does the BDC-INSERT function allow multiple transactions to be processed by SAP?
    Yes.
    11.    What is the syntax for ‘CALL TRANSACTION’?
    CALL TRANSACTION trans .
    Three possible entries are there for MODE.
                      A          -           Show all screens.
                      E          -           Show only screens with errors.
                      N          -           Show no screens.
    Regards,
    V.Balaji
    Reward if usefull

  • BDC Call Transaction - Doc.No not getting generated in Message Internal tab

    Dear All,
    I am using BDC Call Transaction method for uploading data for transaction, Iam able to successfully capture the Error messages, sucess messages and the transaction number is also displayed for the bdc run in Mode A, but in case of scheduling the job in background, the Error messages are displayed but the transaction number is not captured in the message Internal table( BDCMSGCOLL).
    Kindly look into the matter and revert back for any further info.
    Regards
    Naresh

    Hi,
    Please try using the following kind of code in 'CALL TRANSACTION'
        opt-dismode = 'E'.     " Exclusive mode
        opt-defsize = 'X'.
        opt-updmode = 'S'.
        opt-nobinpt = ' '.
        CALL TRANSACTION transaction_code USING ft OPTIONS FROM opt
                                                                             MESSAGES INTO t_bdcmsgcoll .
    Hope this will work.
    Thanks,
    Leo

  • BDC with call transaction VD02 works fin in A mode but not in N mode

    Hi All,
        I have BDC program developed in 4.6c using call transaction VD02 works fine with mode A but not with mode N.
    Now we upgraded to ECC 6.0.Do I need to change anything?

    No, you don't have to change anything for ECC. BTW, I wonder why VD02 is not working in the background for you?

  • CALL Transaction in background not working pls help URGENT

    hi i have writtin a bdc program which uses CALL TRSANCTION everything is working in foreground.
    if i schedule the program in background the call transaction does not work. any idea why?????????
    pls help its urgent

    hi
    good
    have you checked in the debug mode, if you have checked in the debug mode check wheather it is giving any error before data is displaying in the screen, if any error is displaying as a message than check that error why it is coming there.
    If no error is coming than check your flow of the bdc screen in the debug mode , there must be some prob, so that it is not working in the background.
    thanks
    mrutyun^

  • BDC to call transaction

    Hi,
    How to write a code to call transaction from BDC?

    hi,
    *& Report ZMATERIAL
    *& *& Description : Master Data Upload for material type FERT
    report zmaterial_fert.
    selection-screen :begin of block bl1 with frame title  text-001.
    parameters : p_fname type rlgrap-filename,
                   p_lgort type rlgrap-filename,
                   p_update(1) default 'N',
                 p_bdcgrp(12) default 'MM_MASTER'.
    selection-screen end of block bl1.
    data: v_chr_opengrp type c,
          r_matnr like mara-matnr,
          r_werks like marc-werks,
          v_str_fname   type string.
    data : begin of bdc_itab occurs 0.
            include structure bdcdata.
    data : end of bdc_itab.
    data: begin of messtab occurs 0.
            include structure bdcmsgcoll.
    data: end   of messtab.
    data: begin of count,
            inrec(9) type n,               " input I_MATERIAL count
            create(9) type n,              " create count
            error(9) type n,               " error count
            bdc(9) type n,                 " count of BDC creates
          end of count.
    data : begin of i_material occurs 0,
         matnr(018) type c,  "Material number
         mbrsh(001) type c,  "Industry sector
         mtart(004) type c,  "Material type
         werks(004) type c,  "Plant
         lgort(004),
         lgnum(004),
         vkorg(004),
         vtweg(002),
         mtpos_mara(004),
         spart(002),
         dwerk(004),
         taxkm(001),
         versg(001),
       MTPOS(004),
         maktx(040) type c,  "Material description
         meins(003) type c,  "Base unit of measure
        matkl(009) type c,  "Material group
        bismt(018),         "old material code
        brgew(017) type c,  "Gross weight
        gewei(003) type c,  "Weight unit
        ntgew(017) type c,  "Net weight
        magrv(004) type c,  "Matl grp pack matls
        tragr(004),         "
        ladgr(004),
        prctr(007),
      EKGRP(004),
      EKWSL(004),
        chap(012),
        mattype(001),
        nogrs(001),
        outmat(018),
        valid(010),
        curr(005),
        netdeal(018),
        asess(018),
        disgr(004),
        dismm(002) type c,
        dispo(003),
       LGORT(004),
        disls(002),
        maabc(001),
       lgpro(004),
       webaz(003),
       lgfsb(004),
        plifz(003),
       STRGR(002),
        fhori(003),
        sfepr(004),
        fevor(003),
        sfcpf(006),
        beskz(001),
       perkz(001),
      VRMOD(001),
      VINT1(003),
      VINT2(003),
      ALTSL(001),
      SBDKZ(001),
      FERVOR(002),
      SFCPF(006),
       stprs(015),
      AWSLS(006),
       mtvfp(002),
    STGRP(002),
    *PRCTR(007),
      bklas(004),
      vprsv(001),
      peinh(006),
    *EKALR(015),
      verpr(015),
      hrkft(002),
    *HKMAT,
    kosgr(010),
    *LOSGR(018),
    end of i_material.
    at selection-screen on value-request for p_fname.
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          program_name  = 'Z_MM_MATERIAL_UPLOAD'
          dynpro_number = '1000'
          field_name    = 'P_FNAME'
        changing
          file_name     = p_fname.
    at selection-screen on value-request for p_lgort.
    call function 'KD_GET_FILENAME_ON_F4'
        exporting
          program_name  = 'ZMATERIAL'
          dynpro_number = '1000'
          field_name    = 'P_FNAME'
        changing
          file_name     = p_lgort.
    start-of-selection.
      if p_fname is initial.
        message i016(rp) with 'Please enter a file name'.
        leave list-processing.
      else.
        move p_fname to  v_str_fname.
      endif.
      call function 'GUI_UPLOAD'
        exporting
          filetype                = 'ASC'
          filename                = v_str_fname
          has_field_separator     = 'X'
        tables
          data_tab                = i_material
        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.
      loop at i_material.
      r_matnr = i_material-matnr.
        r_werks = i_material-werks.
        add 1 to count-inrec.
        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-MATNR'
                                      i_material-matnr.
        perform bdc_field       using 'RMMG1-MTART'
                                      i_material-mtart.
        perform bdc_field       using 'RMMG1-MBRSH'
                                      i_material-mbrsh.
        perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(17)'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(03)'
    'X'.
    *PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(07)'
    *'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(08)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(06)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(09)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(10)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(11)'
    'X'.
    *PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(12)'
    *'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(13)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(14)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(15)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(16)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(17)'
    'X'.
    perform bdc_field using 'BDC_OKCODE' '=P+'.
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(07)'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(03)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
    'X'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
    'X'.
        perform bdc_dynpro      using 'SAPLMGMM' '0080'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RMMG1-LGNUM'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=ENTR'.
        perform bdc_field       using 'RMMG1-WERKS'
                                      i_material-werks.
        perform bdc_field       using 'RMMG1-LGORT'
                                      i_material-lgort.
        perform bdc_field       using 'RMMG1-LGNUM'
                                      i_material-lgnum.
        perform bdc_field       using 'RMMG1-VKORG'
                                      i_material-vkorg.
        perform bdc_field       using 'RMMG1-VTWEG'
                                      i_material-vtweg.
        perform bdc_dynpro      using 'SAPLMGMM' '4004'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'MAKT-MAKTX'
                                      i_material-maktx.
        perform bdc_field       using 'MARA-MEINS'
                                      i_material-meins.
        perform bdc_field       using 'MARA-MATKL'
                                      i_material-matkl.
        perform bdc_field       using 'MARA-BISMT'
                                      i_material-bismt.
        perform bdc_field       using 'MARA-BRGEW'
                                      i_material-brgew.
        perform bdc_field       using 'MARA-GEWEI'
                                      i_material-gewei.
        perform bdc_field       using 'MARA-NTGEW'
                                      i_material-ntgew.
        perform bdc_field       using 'MARA-MAGRV'
                                  i_material-magrv.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                i_material-maktx.
        perform bdc_dynpro      using 'SAPLMGMM' '4000'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'MAKT-MAKTX'
                                      i_material-maktx.
        perform bdc_field       using 'MARA-MEINS'
                                      i_material-meins.
        perform bdc_field       using 'MARA-MATKL'
                                      i_material-matkl.
         perform bdc_field       using 'MARA-SPART'
                                      i_material-spart.
        perform bdc_field       using 'MVKE-DWERK'
                                      i_material-dwerk.
        perform bdc_field       using 'BDC_CURSOR'
                                      'MG03STEUER-TAXKM(01)'.
        perform bdc_field       using 'MG03STEUER-TAXKM(01)'
                                      i_material-taxkm.
        perform bdc_dynpro      using 'SAPLMGMM' '4200'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'MAKT-MAKTX'
                                      i_material-maktx.
       perform bdc_dynpro      using 'SAPLMGMM' '4000'.
       perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
       perform bdc_field       using 'MAKT-MAKTX'
                                   i_material-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'
                                 i_material-maktx.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                  i_material-mtpos_mara.
    perform bdc_field       using 'MVKE-versg'
                                  i_material-versg.
    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'
                                   i_material-maktx.
        perform bdc_field       using 'MARA-BRGEW'
                                      i_material-brgew.
        perform bdc_field       using 'MARA-GEWEI'
                                      i_material-gewei.
        perform bdc_field       using 'MARA-NTGEW'
                                      i_material-ntgew.
        perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MAGRV'.
      perform bdc_field       using 'MARA-MAGRV'
                                  i_material-magrv.
    perform bdc_field       using 'MARA-TRAGR'
                                  i_material-tragr.
    perform bdc_field       using 'MARC-LADGR'
                                  i_material-ladgr.
    perform bdc_field       using 'MARC-PRCTR'
                                  i_material-prctr.
    perform bdc_field       using 'MARC-MTVFP'
                                 i_material-mtvfp.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  i_material-maktx.
    perform bdc_field       using 'BDC_CURSOR'
                                  'J_1IASSVAL-J_1IVALASS'.
    perform bdc_field       using 'J_1IMTCHID-J_1ICHID'
                                  i_material-chap.
    perform bdc_field       using 'J_1IMTCHID-J_1ISUBIND'
                                 'X'..
    perform bdc_field       using 'J_1IMTCHID-J_1ICAPIND'
                                 i_material-mattype.
    perform bdc_field       using 'J_1IMTCHID-J_1IGRXREF'
                                  i_material-nogrs.
    perform bdc_field       using 'J_1IMODDET-J_1IMOOM'
                                  i_material-outmat.
    perform bdc_field       using 'J_1IASSVAL-J_1IFRDATE'
                                  i_material-valid.
    perform bdc_field       using 'J_1IASSVAL-J_1IWAERS'
                                  i_material-curr.
    perform bdc_field       using 'J_1IASSVAL-J_1IVALNDP'
                                 i_material-netdeal.
    perform bdc_field       using 'J_1IASSVAL-J_1IVALASS'
                                  i_material-asess.
    *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'
                                 I_MATERIAL-MAKTX.
    *perform bdc_field       using 'MVKE-MTPOS'
                                 I_MATERIAL-MTPOS.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  'ENTR'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  i_material-maktx.
    perform bdc_field       using 'MARA-MEINS'
                                  i_material-meins.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARC-DISMM'.
    perform bdc_field       using 'MARC-DISMM'
                                  i_material-dismm.
    perform bdc_field       using 'MARC-DISPO'
                                  i_material-dispo.
    perform bdc_field       using 'MARC-DISLS'
                                  i_material-disls.
    perform bdc_field       using 'MARC-MAABC'
                                  i_material-maabc.
    perform bdc_field       using 'MARC-DISGR'
                                  i_material-disgr.
    perform bdc_dynpro      using 'SAPLMGMM' '4000'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  i_material-maktx.
    perform bdc_field       using 'MARC-FHORI'
                                  i_material-fhori.
    perform bdc_field       using 'MARC-LGPRO'
                                  i_material-lgpro.
    perform bdc_field       using 'MARC-LGFSB'
                                  i_material-lgfsb.
    perform bdc_field       using 'MARC-PLIFZ'
                                      i_material-plifz.
    *perform bdc_field       using 'MARC-STRGR'
                               I_MATERIAL-STRGR.
    perform bdc_field       using  'MARC-BESKZ'
                                 i_material-beskz.
    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'
                                   i_material-maktx.
    *perform bdc_field       using 'MARC-STRGR'
                               I_MATERIAL-STRGR.
    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'
                                   i_material-maktx.
       perform bdc_field       using 'MARC-SAUFT'
                                  'X'.
    perform bdc_field       using 'MARC-SFEPR'
                                  i_material-sfepr.
    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'
                                   i_material-maktx.
    perform bdc_field       using 'MArc-FEVOR'
                                  i_material-fevor.
    perform bdc_field       using 'MARC-SFCPF'
                                  i_material-sfcpf.
    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'
                                   i_material-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'
                                   i_material-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'
                                   i_material-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'
                                   i_material-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'
                                   i_material-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'
                                    i_material-maktx.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MBEW-BKLAS'.
    perform bdc_field       using 'MBEW-BKLAS'
                                  i_material-bklas.
    perform bdc_field       using 'MBEW-VPRSV'
                                  i_material-vprsv.
    perform bdc_field       using 'MBEW-PEINH'
                                  i_material-peinh.
    perform bdc_field       using 'MBEW-STPRS'
                                  i_material-stprs.
    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'
                                   i_material-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'
                                   i_material-maktx.
    perform bdc_field       using 'Mbew-kosgr'
                                   i_material-kosgr.
    perform bdc_field       using 'Mbew-HKMAT'
                                 'X'.
    perform bdc_field       using 'Mbew-HRKFT'
                                  i_material-hrkft.
    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'
                                   i_material-maktx.
    *perform bdc_field       using 'Mbew-KOSGR'
                                 I_MATERIAL-KOSGR.
        perform bdc_dynpro      using 'SAPLSPO1' '0300'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=YES'.
        perform post_transaction.
        refresh bdc_itab.
        clear   bdc_itab.
      endloop.
    end-of-selection.
      perform finalization.
           Start new screen                                              *
    form bdc_dynpro using program dynpro.
      clear bdc_itab.
      bdc_itab-program  = program.
      bdc_itab-dynpro   = dynpro.
      bdc_itab-dynbegin = 'X'.
      append bdc_itab.
    endform.                    "bdc_dynpro
           Insert field                                                  *
    form bdc_field using fnam fval.
      if fval <> ''.
        clear bdc_itab.
        bdc_itab-fnam = fnam.
        bdc_itab-fval = fval.
        append bdc_itab.
      endif.
    endform.                    "bdc_field
    *&      Form  POST_TRANSACTION
    form post_transaction.
      refresh messtab.
      clear   messtab.
      call transaction 'MM01' using bdc_itab
                  mode p_update
                update 'S'
              messages into messtab.
    submit zrpt_plantext with flatfile = p_lgort
                          with p_matnr = r_matnr
                          with p_werks = r_werks and return.
      read table messtab with key msgtyp = 'E'.
      if sy-subrc eq 0.
        perform process_error_messages.
        add 1 to count-bdc.
        if v_chr_opengrp is initial.
          perform bdc_open_group.
        endif.
        call function 'BDC_INSERT'
          exporting
            tcode          = 'MM01'
          tables
            dynprotab      = bdc_itab
          exceptions
            internal_error = 1
            not_open       = 2
            queue_error    = 3
            tcode_invalid  = 4
            others         = 5.
        if sy-subrc <> 0.
          case sy-subrc.
            when 1.
              write: / 'Internal error'.
            when 2.
              write: / 'Not open error'.
            when 3.
              write: / 'queue error'.
            when 4.
              write: / 'tcode invalid error'.
            when others.
              write: / 'other error'.
          endcase.
        endif.
      else.
        add +1 to count-create.
        format intensified off.
        format color col_normal.
        format color col_normal off.
      endif.
      clear   bdc_itab.
      refresh bdc_itab.
    endform.                               " POST_TRANSACTION
    *&      Form  PROCESS_ERROR_MESSAGES
    form process_error_messages.
      data: begin of loc_aux_message.
              include structure message.
      data: end of loc_aux_message.
      data : msgno type sy-msgno.
      loop at messtab.
        move messtab-msgnr to msgno.
        call function 'WRITE_MESSAGE'
          exporting
            msgid  = messtab-msgid
            msgno  = msgno
            msgty  = messtab-msgtyp
            msgv1  = messtab-msgv1
            msgv2  = messtab-msgv2
            msgv3  = messtab-msgv3
            msgv4  = messtab-msgv4
          importing
            messg  = loc_aux_message
          exceptions
            others = 1.
        if sy-subrc eq 0.
          format color col_negative on.
          write: /10 i_material-matnr.
          write: /10 loc_aux_message.
          format color col_negative off.
        else.
          format color col_negative on.
          write: /10 i_material-matnr.
          write: / 'Error creating message'.
          format color col_negative off.
          exit.
        endif.
      endloop.
    endform.                               " PROCESS_ERROR_MESSAGES
    *&      Form  BDC_OPEN_GROUP
    form bdc_open_group.
      call function 'BDC_OPEN_GROUP'
        exporting
          client              = sy-mandt
          group               = p_bdcgrp
          holddate            = sy-datum
          keep                = 'X'
          user                = sy-uname
        exceptions
          client_invalid      = 1
          destination_invalid = 2
          group_invalid       = 3
          group_is_locked     = 4
          holddate_invalid    = 5
          internal_error      = 6
          queue_error         = 7
          running             = 8
          system_lock_error   = 9
          user_invalid        = 10
          others              = 11.
      if sy-subrc eq 0.
        v_chr_opengrp = 'X'.
      endif.
    endform.                               " BDC_OPEN_GROUP
    *&      Form  FINALIZATION
    form finalization.
      if v_chr_opengrp = 'X'.
        call function 'BDC_CLOSE_GROUP'
          exceptions
            not_open    = 1
            queue_error = 2
            others      = 3.
      endif.
      get time.
      skip 2.
      write: / 'Time', sy-uzeit.
      skip.
      format color col_total on.
      write: / 'Total Records: ',           40 count-inrec.
      write: / 'PERNR not of Emp Group 6 ', 40 count-error.
      write: / 'Records Created: ',         40 count-create.
      write: / 'BDC Create in group: ',     40 count-bdc.
      if v_chr_opengrp = 'X'.
        skip 1.
        format intensified on.
        format color col_negative on.
        write: / 'PLEASE USE TRANSACTION "SM35" ',
                 'TO PROCESS THE GENERATED BDC SESSION ... ',
                 p_bdcgrp.
      endif.
    endform.                               " FINALIZATION

  • BDC using call transaction

    Hi ,
    This is vijay...
    can anyone help me plz
    Hi,
    Iam uploading data using call transaction.Tcode is ff67.In this TCode we have the begining balance(ssald) and ending balance(esald).The new record we are uploading will take the begining balance as the previous record ending balance, if we give the begining balance wrong then the record does not saved it will show error(the begining balance does not match with the prior ending balance).
    while uploading the data using MODE A iam able to get the desired output but by using the MODE N iam not able to get the desired output i,e if there is any error in the begining balance also the record is being saved iam not getting the error message.
    Iam attaching the code below..please help me
    report Z_BRS_BDC no standard page heading line-size 255.
            INTERNAL TABLES DECLARATIONS
    DATA : BEGIN OF bdcdata OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA : END OF bdcdata.
    DATA:  LV_OUT TYPE STRING.
    DATA : iopt LIKE ctu_params.
    DATA : wa_rec_err   TYPE i.
    DATA : wa_rec_wri TYPE i.
    DATA : wa_tot_rec TYPE i.
    DATA : amt(16) type c.
    DATA : BEGIN OF gu_upload OCCURS 0,
           hbkid LIKE febmka-hbkid,
           hktid LIKE febmka-hktid,
           aznum LIKE febmka-aznum,
           azdat LIKE febmka-azdat,
           ssald LIKE amt,
           esald LIKE amt,
           budtm LIKE febmka-budtm,
           mnam1 LIKE febmka-mnam1,
           jname LIKE febmka-jname,
           vgman LIKE febmka-vgman,
           valut LIKE febep-valut,
           kwbtr(13) TYPE c,
           chect_kf LIKE febmkk-chect_kf,
          END OF gu_upload.
    DATA:GU_DOWNLOAD LIKE GU_UPLOAD OCCURS 0 WITH HEADER LINE.
    kishi*********************************
    DATA: BEGIN OF itab OCCURS 0,
         vgman LIKE febmka-vgman,
         valut LIKE febep-valut,
         kwbtr(13) TYPE c,
         chect_kf LIKE febmkk-chect_kf,
         END OF itab.
    kishi)(_()00-8-09
    DATA: BEGIN OF  messtab OCCURS 0.
            INCLUDE STRUCTURE bdcmsgcoll.
    DATA: END OF messtab.
    DATA: BEGIN OF messtab1 OCCURS 0.
            INCLUDE STRUCTURE messtab.
    DATA: END OF messtab1.
    DATA : BEGIN OF int_count OCCURS 0.
            INCLUDE STRUCTURE alsmex_tabline.
    DATA : END OF int_count.
    DATA: c_tcode      LIKE sy-tcode              VALUE 'FF67',
          c_upd        LIKE ctu_params-updmode    VALUE 'S',
          c_def_size   LIKE ctu_params-defsize    VALUE 'X'.
    *VALUES FOR STARTING COLUMNS AND ROWS IN THE EXCEL SHEET
    DATA : c_begcol     TYPE i                     VALUE '1',
          c_begrow     TYPE i                     VALUE '1',
    *DATA IS ENDED AT THE 13TH COLUMN IN THE EXCELSHEET
          c_endcol     TYPE i                     VALUE '13',
    *LAST ROW IN THE EXCEL SHEET
          c_endrow     TYPE i                     VALUE '65536',
          c_path(3)    TYPE c                     VALUE 'C:\'.
    *Field Symbols
    FIELD-SYMBOLS: <fs>.
         SELECTION SCREEN PARAMETERS
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_file LIKE rlgrap-filename DEFAULT
    'C:\ ',
    *This is the path for downloading file
    P_FNAME2 LIKE RLGRAP-FILENAME ,
    c_mode LIKE ctu_params-dismode  DEFAULT 'N'.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    *F4 HELP FOR FILE SELECTION
      PERFORM validate_input_file.
    START-OF-SELECTION.
      CLEAR gu_upload.
      REFRESH gu_upload.
         UPLOAD THE DATA FROM FLAT FILE TO INTERNAL TABLE
      PERFORM file_upload.
      iopt-dismode = c_mode.
      iopt-updmode = c_upd.
      iopt-defsize = c_def_size.
         POPULATE THE DATA THROUGHSCREENS
      PERFORM bdc_upload.
    END-OF-SELECTION.
    *DISPLY THE ERROR RECORDS
    PERFORM DISPLAY-DATA.
          FORM file_upload                                              *
    FORM file_upload.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_file
                i_begin_col             = c_begcol
                i_begin_row             = c_begrow
                i_end_col               = c_endcol
                i_end_row               = c_endrow
           TABLES
                intern                  = int_count
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      LOOP AT int_count.
        ASSIGN COMPONENT int_count-col OF STRUCTURE gu_upload TO <fs>.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
        <fs> = int_count-value.
        AT END OF row.
          APPEND gu_upload.
          CLEAR gu_upload.
        ENDAT.
      ENDLOOP.
    *kishhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
      LOOP AT gu_upload.
        itab-vgman = gu_upload-vgman.
        itab-valut =  gu_upload-valut.
        itab-kwbtr = gu_upload-kwbtr.
        itab-chect_kf = gu_upload-chect_kf.
        APPEND itab.
      ENDLOOP.
    *kishiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
    ENDFORM.                    "file_upload
    *&      Form  BDC_UPLOAD
    FORM bdc_upload.
      LOOP AT gu_upload.
        CLEAR bdcdata.
        REFRESH bdcdata.
    *&      POPULATE THE DATA FOR FIRST SCREEN
    perform bdc_dynpro      using 'SAPMF40K' '0101'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'FEBMKA-JNAME'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'FEBMKA-BUKRS'
                                  'IN14'.
    perform bdc_field       using 'FEBMKA-HBKID'
                                  gu_upload-hbkid.
    perform bdc_field       using 'FEBMKA-HKTID'
                                  gu_upload-hktid.
    perform bdc_field       using 'FEBMKA-AZNUM'
                                  gu_upload-aznum.
    perform bdc_field       using 'FEBMKA-AZDAT'
                                  gu_upload-azdat.
    perform bdc_field       using 'FEBMKA-SSALD'
                                  gu_upload-ssald.
    perform bdc_field       using 'FEBMKA-ESALD'
                                  gu_upload-esald.
    perform bdc_field       using 'FEBMKA-BUDTM'
                                  gu_upload-budtm.
    perform bdc_field       using 'FEBMKA-MNAM1'
                                  gu_upload-mnam1.
    perform bdc_field       using 'FEBMKA-JNAME'
                                  gu_upload-jname.
    *&      POPULATE THE DATA FOR SECOND SCREEN
        DATA : fnam(20) TYPE c,
              idx      TYPE c.
        MOVE 1 TO idx.
        LOOP AT itab.
          PERFORM bdc_dynpro      USING 'SAPMF40K' '8000'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'FEBMKK-CHECT_KF(03)'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          CONCATENATE 'FEBMKA-VGMAN(' idx ')' INTO fnam.
          PERFORM bdc_field       USING fnam
                                        itab-vgman.
          CONCATENATE 'FEBEP-VALUT(' idx ')' INTO fnam.
          PERFORM bdc_field       USING fnam itab-valut.
          CONCATENATE 'FEBMKA-KWBTR(' idx ')' INTO fnam.
          PERFORM bdc_field       USING fnam itab-kwbtr.
          CONCATENATE 'FEBMKK-CHECT_KF(' idx ')' INTO fnam.
          PERFORM bdc_field USING fnam itab-chect_kf.
          idx = idx + 1.
        ENDLOOP.
    *perform bdc_dynpro      using 'SAPMF40K' '8000'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'FEBMKK-CHECT_KF(01)'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '/00'.
    *perform bdc_field       using 'FEBMKA-VGMAN(01)'
                                 'z001'.
    *perform bdc_field       using 'FEBEP-VALUT(01)'
                                 '2007/04/26'.
    *perform bdc_field       using 'FEBMKA-KWBTR(01)'
                                 '          5000-'.
    *perform bdc_field       using 'FEBMKK-CHECT_KF(01)'
                                 '1122'.
    perform bdc_dynpro      using 'SAPMF40K' '8000'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'FEBMKK-CHECT_KF(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SICH'.
    *&      POPULATE THE DATA FOR FOURTH SCREEN
    perform bdc_dynpro      using 'SAPMF40K' '0101'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'FEBMKA-BUKRS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BUCH'.
    perform bdc_field       using 'FEBMKA-BUKRS'
                                  'IN14'.
    perform bdc_field       using 'FEBMKA-HBKID'
                                  gu_upload-hbkid.
    perform bdc_field       using 'FEBMKA-HKTID'
                                  gu_upload-hktid.
    perform bdc_field       using 'FEBMKA-AZNUM'
                                  gu_upload-aznum.
    perform bdc_field       using 'FEBMKA-AZDAT'
                                  gu_upload-azdat.
    perform bdc_field       using 'FEBMKA-SSALD'
                                  gu_upload-ssald.
    perform bdc_field       using 'FEBMKA-ESALD'
                                  gu_upload-esald.
    perform bdc_field       using 'FEBMKA-BUDTM'
                                  gu_upload-budtm.
    perform bdc_field       using 'FEBMKA-MNAM1'
                                  gu_upload-mnam1.
    perform bdc_field       using 'FEBMKA-JNAME'
                                  gu_upload-jname.
    *perform bdc_dynpro      using 'SAPMF40K' '0101'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '/EENDE'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'FEBMKA-BUKRS'.
    perform bdc_dynpro      using 'SAPMF40K' '0101'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EABBR'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'FEBMKA-BUKRS'.
    *&      USING THE CALL TRANSACTION
        PERFORM call_transaction.
       CLEAR BDCDATA.                      "<--- Add here
       REFRESH BDCDATA.                 "<--- Add here
      ENDLOOP.
    ENDFORM.                    " BDC_UPLOAD
    *&      Form  VALIDATE_INPUT_FILE
    FORM validate_input_file.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_path         = ' c:\ '
                mask             = ',.txt,.*.'
                mode             = 'O'
                title            = 'Upload '
           IMPORTING
                filename         = p_file
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    IF sy-subrc <> 0.
    IF sy-subrc <> 0 AND sy-subrc <> 3.
       MESSAGE e100(zm) WITH text-007.
    ENDIF.
    ENDFORM.                    " VALIDATE_INPUT_FILE
           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.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDFORM.                    "bdc_field
    *&      Form  CALL_TRANSACTION
    FORM call_transaction.
      DATA: l_index LIKE sy-tabix.
      CALL TRANSACTION  c_tcode USING bdcdata
                                MODE c_mode
                                MESSAGES INTO messtab.
    *POPULATE THE ERROR RECORDS INTO INTERNAL TABLE
      IF SY-SUBRC NE 0.
        GU_DOWNLOAD-HBKID = GU_UPLOAD-HBKID.
       GU_DOWNLOAD-HBKID = GU_UPLOAD-HBKID.
        GU_DOWNLOAD-HKTID = GU_UPLOAD-HKTID.
        GU_DOWNLOAD-AZNUM = GU_UPLOAD-AZNUM.
        GU_DOWNLOAD-AZDAT = GU_UPLOAD-AZDAT.
        GU_DOWNLOAD-ESALD = GU_UPLOAD-ESALD.
        GU_DOWNLOAD-SSALD = GU_UPLOAD-SSALD.
        GU_DOWNLOAD-BUDTM = GU_UPLOAD-BUDTM.
        GU_DOWNLOAD-MNAM1 = GU_UPLOAD-MNAM1.
        GU_DOWNLOAD-JNAME = GU_UPLOAD-JNAME.
        GU_DOWNLOAD-VGMAN = GU_UPLOAD-VGMAN.
        GU_DOWNLOAD-VALUT = GU_UPLOAD-VALUT.
        GU_DOWNLOAD-KWBTR = GU_UPLOAD-KWBTR.
        GU_DOWNLOAD-CHECT_KF = GU_UPLOAD-CHECT_KF.
        APPEND GU_DOWNLOAD.
    *DISPLAY THE PROGRESS OF PROCESS
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
       PERCENTAGE       = 0
       TEXT             = 'Downloading is in process'.
    *DOWNLOADING THE ERROR RECORD
        LV_OUT = P_FNAME2.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME               =  LV_OUT
            WRITE_FIELD_SEPARATOR  =      'X'
          TABLES
            DATA_TAB                =  GU_DOWNLOAD.
    ENDIF.
      IF NOT messtab[] IS INITIAL.
        PERFORM format_message.
      ENDIF.
    ENDFORM.                    " CALL_TRANSACTION
    *&      Form  DISPLAY-DATA
    FORM display-data.
      SKIP.
      WRITE: 'SY-SUBRC' , sy-subrc.
    ENDFORM.                    " DISPLAY-DATA
          FORM FORMAT_MESSAGE                                           *
    FORM format_message.
      DATA: l_msg(100),
       l_index LIKE sy-tabix.
      LOOP AT messtab.
        READ TABLE gu_upload INDEX l_index.
        CALL FUNCTION 'FORMAT_MESSAGE'
             EXPORTING
                  id        = messtab-msgid
                  lang      = sy-langu
                  no        = messtab-msgnr
                  v1        = messtab-msgv1
                  v2        = messtab-msgv2
                  v3        = messtab-msgv3
                  v4        = messtab-msgv4
             IMPORTING
                  msg       = l_msg
             EXCEPTIONS
                  not_found = 1
                  OTHERS    = 2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
       WRITE:/ l_msg.
      ENDLOOP.
      WRITE:/ l_msg.
    ENDFORM.
    Message was edited by:
            vijayd duvvada

    Hi,
      First , keep the mode "E" and check the debugger , you can exactly see where the error is and let me know, what error and where it is stoping.
    By your coding, i suppose to think that, its proble in the amount (currency). When ever you are try to pass the value, and value is not there in upload file or data is mismatch, the call transaction will fail in mode 'A' and succesful in mode 'N'.
    In that situation use this before the currecny field.
    IF NOT FEBMKA-SSALD IS INTIAL.
       perform bdc_field using 'FEBMKA-ESALD'
                                      gu_upload-esald.
    ENDIF.
    tHANKS
    Manju

  • BDC or Call transaction QM01

    Hi,
    I need to call transaction QM01, on the first screen always select Z4, on the next always pass a deliverynumber and finally show the third screen to the user.
    Had it only been the forst screen I should skip a Call Transaction and skip, with parameters should be enough, but as far as I know, I can't skip two screens like that in Call Transaction.
    So I tried to do a Batch Input. But when playing my recording, these small windows keeps appearing with ok codes, that I need to confirm. How to get the Batch input to run in background and only show third screen to the user?
    Simple question from an ABAP wanna be
    Kind regards
    Mikkel

    Mikkel,
             The ideal solution would be to develop a mass maintanence transaction for this purpose. What I mean is to develop a table control. In effect you should be able to combine the functionality of the multiple screens in to a single screen and do the recording.
             The not so ideal solution would be to always force an error on the third screen for the user. In this way the third screen will always be forced to the user and he has to make amends for it.
    Hope this helps,
    Sojan

  • Need to write BDC program for Transaction VA01(Sales order creation)

    Dear Friends,
    I need to write a BDC program for uploading data into sap from an excel sheet file. The data contain Material Description,Customer Name,Date of Delivery,Quantity,Unit of measure etc.
    material desc customer date of delivery quantity unit of measure
    abcdf xyz ltd 24.12.2011 2 4 gm
    The transaction is VA01.How will I find the correct fields and related tables? What are the related fields needed in the transaction VA01.
    Thanking you
    Sacheen Pukhrambam
    Moderator Message: Put some self-effort before posting your question. Thread locked.
    Edited by: Suhas Saha on Nov 25, 2011 1:25 PM

    Hello,
    You could try using a BDC with VL04 but first preference would be to see if there are any BAPI functions (search for BAPI) that can do this.
    If BUS2032 doesn't have an attribute that you want (eg shipping point) then sub-delegate to ZBUS2032 and add the attribute, it's straightforward. You just have to know how to determine the value programmatically.
    regards
    Rick Bakker
    hanabi technology

  • BDC via call transaction method

    I have a requirement wherin I am supposed to execute transaction FI01 in background.
    While I do this, there is a pop-up window displayed for selection of jurisdiction code.I am unable to capture this in background.
    Can we capture pop-up window values ?
    In foreground, the scenario works fine,since there will be user intervention in this case.
    Thanks in advance,

    The answer has already been given by Frederic. You have to find out the BDC field names via F1 and technichal help. There you also can find the dynpro numbers and report names. With these parameters you have to fill the bdcdata table in the call transaction command. See
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/de/fa/09714d543b11d1898e0000e8322d00/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/de/fa/09714d543b11d1898e0000e8322d00/frameset.htm</a>
    Regards,
    Thomas

  • Regarding BDC and Call transaction Method

    hi gurus,
          can anyone tell the difference how many records Call transaction and Session
    Method can upload in case of single transaction and what is the time taken by each.its urgent pls.
    thanks and regards.

    Rajesh,
    u can do as many as ,
    coming to speed means it depends on server,
    if ur using session then u can calculate time ,
    with in one time h many records system will upload the records by seeing in sm35
    (first see h many records systems uploads, see the number and put the time , after one min again see the records h many it is ,) u can calculate by this.
    remember this speed will changes depends on server,
    so if u have n number of records better to do upload in weekends.
    2) if u r using call transaction method means , normally we use error file where ever record occurs that record is in error file, i think we cant analyze h many records it will be with in a time r .
    we can also check by going respective tables , just put the time and do refreshing the table after one minute , n this way u can analyze .
    Thanks

  • Error: "Transaction type could not be determined" during PO Creation fromSC

    Hi all,
    I'm working on SRM 5.5 with ECS.
    During the creation of  a PO  I want to add a SC as an item of PO.
    But when I chose the SC and click on the button Add to PO I recive the error:
    Transaction type could not be determined
    In the organizational unit I set the attribute BSA and DP_PROCT_TY.
    there are other steps I have to do to join the transaction type of SC and PO?
    rgs
    enzo

    Hi Enzo,
    First check if the attribute BSA and DP_PROC_TY have the same value.
    Then in the attribute value for BSA, change the source system for the document type to your SRM system.
    Create a new PO and a shopping cart.
    Try changing the PO by adding the shopping cart
    Hopefully your problem may get resolved.
    Thanks
    Sanjeev

  • Call transaction VA01 or VA03 and skip first screen using Web dynpro

    Hello Experts,
    I am calling the standard transactions using Web dynpro via ITS.
    I am able to reach to the initial screen of the standard transactions say VA03 and populate the sales order number through Web dynpro.
    My requirement is to skip the first screen of the transaction.
    I tried passing the screen number in the URL link but still it is showing the initial screen.
    Please suggest me solution for this.
    Thanks and Regards,
    Rahul Sinha

    Hello Rahul,
    Did you follow the ITS Wiki article?
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=22375
    Edgar

  • Call bdc or call transaction in bapi

    Hi,
    i  create MAM sales order using  bapi BAPI_ADMGMTSO_CREATEFROMDATA .
    But i want create genral business partner using t-code bug1 for that i use bdc.
    how i should call that bdc in above bapi.
    Please anybody suggest solution for this?

    Hi,
    I don't find BAPI_ADMGMTSO_CREATEFROMDATA, but what you can do is create a customize ZBAPI_ADMGMTSO_CREATEFROMDATA  and made a call function to BAPI_ADMGMTSO_CREATEFROMDATA and after commit you put your bdc code.

  • BDC by call transaction

    Hi all,
    In my recording I gave TC MM01 and inserted. Then in SE38.
    DATA : begin of itab occurs 0,
    matnr(15),mbrsh(15),mtart(15),maktx(15),meins(15),
    end of itab.
    called function
    There was no errror.
    How can I see the contents whether that is inserted or not.
    There are three internal tables
    RMMG1,MAKT,MARA. I cant see the contents of RMMG1.
    Then What is this error.
    Call_transaction MM01 return code = 1.001 Record.
    S No batch input data for screen SAPLMGMW 0100.
    what is this error.

    I would really suggest that you use the BAPI.
      You will save yourself a big headache.  Here is an example.
    In this example, were creating a HALB material using internal number assignment.  Of course if your material type uses external number assignment, you can assign it directly.
    report zrich_0001.
    data: headdata    type bapimathead.
    data: clientdata  type bapi_mara.
    data: clientdatax type bapi_marax.
    data: descdata    type table of bapi_makt with header line.
    data: return  type table of bapiret2 with header line.
    data: returnm type table of bapi_matreturn2 with header line.
    data: imat    type table of bapimatinr with header line.
    call function 'BAPI_MATERIAL_GETINTNUMBER'
      exporting
        material_type          = 'HALB'
    *   INDUSTRY_SECTOR        = 'M'
      tables
        material_number        = imat.
    read table imat index 1.
    if sy-subrc = 0.
      headdata-material = imat-material.
    endif.
    headdata-ind_sector      = 'M'.
    headdata-matl_type       = 'HALB'.
    headdata-basic_view = 'X'.
    clientdata-base_uom   = 'EA'.
    clientdatax-base_uom   = 'X'.
    clientdata-old_mat_no = 'Old Material'.
    clientdatax-old_mat_no = 'X'.
    clientdata-division = '00'.
    clientdatax-division = 'X'.
    descdata-langu = sy-langu.
    descdata-matl_desc = 'This is the description'.
    append descdata.
    call function 'BAPI_MATERIAL_SAVEDATA'
      exporting
        headdata                   = headdata
        clientdata                 = clientdata
        clientdatax                = clientdatax
        PLANTDATA                  =
        PLANTDATAX                 =
    *   FORECASTPARAMETERS         =
    *   FORECASTPARAMETERSX        =
    *   PLANNINGDATA               =
    *   PLANNINGDATAX              =
    *   STORAGELOCATIONDATA        =
    *   STORAGELOCATIONDATAX       =
    *   VALUATIONDATA              =
    *   VALUATIONDATAX             =
    *   WAREHOUSENUMBERDATA        =
    *   WAREHOUSENUMBERDATAX       =
    *   SALESDATA                  =
    *   SALESDATAX                 =
    *   STORAGETYPEDATA            =
    *   STORAGETYPEDATAX           =
    importing
        return                     = return
      tables
        materialdescription        = descdata
    *   UNITSOFMEASURE             =
    *   UNITSOFMEASUREX            =
    *   INTERNATIONALARTNOS        =
    *   MATERIALLONGTEXT           =
    *   TAXCLASSIFICATIONS         =
        returnmessages             = returnm
    *   PRTDATA                    =
    *   PRTDATAX                   =
    *   EXTENSIONIN                =
    *   EXTENSIONINX               =
    check sy-subrc  = 0.
    Regards,
    Rich Heilman

Maybe you are looking for