BDC to call VF01

Hi...
I am fresher to ABAP.
I have a following requirement:
create an invoice for this delivery, by a BDC call (VF01, document-type?)
Trigger output on delivery using RSNAST00 passing parameters output application, object key, output type.
Could someone guide with step-to-step solution.
Thanks.

Hi,
Please find the BDC code for the VF01 transaction.
Change the billing type and delivery number as they are variable.
perform bdc_dynpro      using  'SAPMV60A'  '0102'.
perform bdc_field: using 'BDC_OKCODE' '=SICH',
                                    'RV60A-FKART' 'ZF2',
                                    'KOMFK-VBELN(01)' '80000141'.
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
  CLEAR it_BDCDATA.
  it_BDCDATA-PROGRAM  = PROGRAM.
  it_BDCDATA-DYNPRO   = DYNPRO.
  it_BDCDATA-DYNBEGIN = 'X'.
  APPEND it_BDCDATA.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA.
  CLEAR it_BDCDATA.
  it_BDCDATA-FNAM = FNAM.
  it_BDCDATA-FVAL = FVAL.
  APPEND it_BDCDATA.
ENDIF.
ENDFORM.
Then use the call transaction statement on VF01 and it will solve your purpose.
Thanks,
Mahesh.

Similar Messages

  • 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

  • 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

  • Can we create multiple session in BDC using Call session?

    Hi Experts,
    Can we create  multiple sessions in BDC using Call Session?
    Scenario:
    Program has to upload 1 million records,so can we programmatically create multiple sessions such that after every 50thousand records we create a different session.
    For moment due to large number of records BDC DYNPRO and BDC Field are unable to hold the large number of records,due to which we get a Out of memory error.
    Thanks in advance.
    Shilpa

    Hi
    If ITAB is your table with the data to be transfered:
    Open the first session:
    CALL FUNCTION 'BDC_OPEN_GROUP'.........
    IF SY-SUBRC = 0.
      FL_OPEN = 'X'.
    ENDIF.
    LOOP AT ITAB.
    IF FL_OPEN = SPACE.
    Create new session
    CALL FUNCTION 'BDC_OPEN_GROUP'.........
    IF SY-SUBRC = 0.
       FL_OPEN = 'X'.
    ENDIF.
    ENDIF.
    Here elaborate your data and fill BDCDATA
    Insert the transaction:
    CALL FUNCTION 'BDC_INSERT'
    IF SY-SUBRC = 0.
      COUNT = COUNT + 1.
      IF COUNT = COUNT_MAX.
        COUNT = 0.
    Close the session
        IF FL_OPEN = 'X'.
          CALL BDC_CLOSE_GROUP
          IF SY-SUBRC = 0.
            FL_OPEN = SPACE.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDLOOP.
    Max

  • Logical Database(instead of BDC)  to call FBL5N

    Hi all,
      I have a requirement wherein i have to call transaction 'FBL5N' when the user
    clicks on the Document Type column of the ALV grid o/p.
      In FBL5N initial screen,
    i have to fill in the details from the Selection-Screen of my report program like
    Company Code, Posting Date and then click on Dynamic Selection tab.
    This takes me to the next screen, wherein I have to click on Fiscal Year on left (for Dynamic Selection) and fill in Document Number and Fiscal on the Dynamic Selection Screen on right.
      Here, the data required for filling in the details in FBL5N, come from
    Selection-Screen of my report program and also from output table.
    I had implemented this using BDC but being an NJOI transaction, it
    throws an error.
      Thus, i have to implement LDB to achieve the same.
    Please let me know, how to go about it. Any pointers in this
    regard would be of great help. Reference code would also be
    of immense help.
    thanks & regards,
    Naresh.

    what is the problem you are facing..?

  • 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 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 for calling a screen in a method of a business object..

    Hi Gurus,
    Help me interpret this code....
    BEGIN OF METHOD ZNET CHANGING CONTAINER.
    DATA: net TYPE aufnr.
    swc_get_property self 'NET' net.
    REFRESH bdcdata.
    PERFORM bdc_fill USING :
    'X' 'SAPLCOKO' '2000',
    ' ' 'BDC_CURSOR' 'CAUFVD-AUFNR',
    ' ' 'CAUFVD-AUFNR' net,
    ' ' 'BDC_OKCODE' '=LIST',
    Next Screen
    'X' 'SAPLCOVG' '2000',
    ' ' 'BDC_CURSOR' 'AFVGD-VORNR(01)',
    ' ' 'RC27X-FLG_SEL(01)' 'X',
    ' ' 'BDC_OKCODE' '=INFV',
    Next Screen to AOd User Fields
    'X' 'SAPLCONW' '2700'.
    REFRESH messtab.
    CALL TRANSACTION 'CN22' USING bdcdata
    MODE 'E'
    UPDATE 'S'
    MESSAGES INTO messtab.
    END_METHOD.
    FORM bdc_fill USING var1
    var2
    var3
    CLEAR bdcdata.
    IF var1 IS NOT INITIAL.
    bdcdata-program = var2.
    bdcdata-dynbegin = var1.
    bdcdata-dynpro = var3.
    ELSE.
    bdcdata-fnam = var2.
    bdcdata-fval = var3.
    ENDIF.
    APPEND bdcdata.
    ENDFORM.
    I see that, the above code does not have the BDC generated code. Since there are no many perform statements. Im not clear with the BDC part of it.
    Thanks
    Syed.

    hi,
    Please post it in correct forum. this is for only CRM mobile .
    Regards,
    Latha

  • 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 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

  • 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 by Call transcation

    Hi all,
    In BDC. I gave a new recording for MM01. and when i run the program its coming invalid material. In m notepad file how should I give the materail code.from where i will get.

    hi,
    in mm01 transaction material no depends up on material type and industry sector.
    if u take ur mat type as services no extenal assignment of material no is allowed.take material no as anyting ex-sr456,industry sector as hardware/software.
    material type as raw materials.
    i am giving my flat file .check it.in my flat file i took mandatory fields only.
    my intenal table fields are:
    matnr like rmmg1-matnr,
           mbrsh like rmmg1-mbrsh,
           mtart like rmmg1-mtart,
           maktx like makt-maktx,
           meins like mara-meins,
           matkl like mara-matkl,
           bismt like mara-bismt,
           extwg like mara-extwg,
    matnr        mbrush    mtrat         maktx  etc
    SUDHU-6     R     ROH     MATSUDHU     "     001     7890     AA
    if it is useful dont forgot to give points

  • 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

  • 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

  • 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

Maybe you are looking for