BDC For FB01

Hi Friends,
Anyone who had developed the BDC for FB01 T-code, please send me the source code . I am not able to create BDC for both header and line itemswise.
Deepak.

Hi Deepak,
check BDC standard program RFBIBL00 or FM
BAPI_ACC_GL_POSTING_POST
BAPI_ACC_DOCUMENT_POST
Also check
Re: LSMW: problem with object RFBIBL00 tx FB01 (sapmf05a no data)
Hope this helps
Thanks
Lakshman

Similar Messages

  • Please help in finding the bug in this BDC for FB01

    Please find the bug in the following BDC for FB01 of mine. It picks up the entries from the very first record of the excel file, every time.
    report ZFI_BDC
           no standard page heading line-size 255.
    data: bdcdata1 like bdcdata occurs 0 with header line.
    data : vf_index type i.
    DATA: BEGIN OF ENTRIES occurs 0,
            BLDAT(8),
            BUKRS(4),
            BLART(2),
            WAERS(5),
            BUDAT(8),
            RECNO(5),
            NEWBS(2),
            NEWKO(17),
            NEWNUM(1),
            WRBTR(13),
            GSBER(4),
            SECCO(4),
            zuonr(18),
            SGTXT(50),
            NEWBS_2(2),
            NEWKO_2(17),
            NEWNUM_2(1),
            WRBTR_2(13),
            GSBER_2(4),
            SECCO_2(4),
            zuonr_2(18),
            SGTXT_2(50),
            no type i,
    END OF ENTRIES.
    DATA: BEGIN OF ENTRIES2 OCCURS 0 ,
            BLDAT(8),
            BUKRS(4),
            BLART(2),
            WAERS(5),
            BUDAT(8),
            RECNO(5),
            NEWBS(2),
            NEWKO(17),
            NEWNUM(1),
            WRBTR(13),
            GSBER(4),
            SECCO(4),
            zuonr(18),
            SGTXT(50),
            NEWBS_2(2),
            NEWKO_2(17),
            NEWNUM_2(1),
            WRBTR_2(13),
            GSBER_2(4),
            SECCO_2(4),
            zuonr_2(18),
            SGTXT_2(50),
            no type i,
    END OF ENTRIES2.
    DATA: TEMP(8),
          DOCDATE(8),
          SPLGL(1),
          PKEY(2),
          GL(17),
          VCHAMT(13),
          BUSAREA(4),
          SECCODE(4),
          zzuonr(18),
          COSTCEN(10),
          AUFNR(3),
          SGTXT(50),
          item(50)           TYPE c,
          DS TYPE I,
          DS2 TYPE I.
    data : vf_start_col type i value '1',      "start column
           vf_start_row type i value '1',      "start row
           vf_end_col   type i value '256',    "maximum column
           vf_end_row   type i value '65536',  "maximum row
           p_text(20).                         "stores error messages
    Internal Table
    data : it_excel type  kcde_cells occurs 0 with header line.
    */ Field symbol
    field-symbols : <fs>.
    parameters: p_file   LIKE rlgrap-filename MEMORY ID M01,
                NOHEADER AS CHECKBOX.
    parameters: COMPANY(4) TYPE C DEFAULT 'SCL',
                GROUP(12) TYPE C DEFAULT 'BDCTEST',
                USER(12) TYPE C DEFAULT SY-UNAME,
                KEEP(1) TYPE C DEFAULT 'X',
                POSTDATE LIKE SY-DATUM DEFAULT SY-DATUM,
                DOC_TYPE(2) TYPE C DEFAULT 'SA',
                HOLDDATE LIKE SY-DATUM.
    ***********************************************upload data from excel
    CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
      EXPORTING
        filename                      = p_file
        i_begin_col                   = VF_START_COL
        i_begin_row                   = VF_START_ROW
        i_end_col                     = VF_END_COL
        i_end_row                     = VF_END_ROW
      tables
        intern                        = IT_EXCEL
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3 .
    IF sy-subrc <> 0.
              WRITE: / 'EXCEL UPLOAD FAILED :', p_file, SY-SUBRC.
    else.
      sort it_excel by row col.
          loop at it_excel.
         IF NOHEADER = 'X'
        AND It_EXCEL-row = 1.
          CONTINUE.
        ENDIF.
         vf_index = it_excel-col.
       assign component vf_index of structure ENTRIES to <fs>.
            move  it_excel-value to <fs>.
          at end of row.
            append ENTRIES.
            clear ENTRIES.
          endat.
          endloop.
      endif.
    start-of-selection.
    DS = 1.
    LOOP AT ENTRIES.
    ENTRIES-NO = DS.
    MODIFY ENTRIES.
    DS = DS + 1.
    *ON CHANGE OF ENTRIES-zuonr.
    *DS = 1.
    *ENTRIES-NO = DS.
    *MODIFY ENTRIES.
    *DS = DS + 1.
    *ENDON.
    ENDLOOP.
    LOOP AT ENTRIES where no = 1.
        MOVE-CORRESPONDING  ENTRIES TO ENTRIES2.
    APPEND ENTRIES2.
    CLEAR ENTRIES2.
      ENDLOOP.
    DS2 = 1.
    LOOP AT ENTRIES2.
    ENTRIES2-NO = DS2.
    MODIFY ENTRIES2.
    DS2 = DS2 + 1.
    *ON CHANGE OF ENTRIES2-zuonr.
    *DS2 = 1.
    *ENTRIES2-NO = DS2.
    *MODIFY ENTRIES2.
    *DS2 = DS2 + 1.
    *ENDON.
    ENDLOOP.
    LOOP AT ENTRIES.
    REFRESH BDCDATA1.
      WRITE: /  ENTRIES-RECNO,
                ENTRIES-NEWBS,
                ENTRIES-NEWKO,
                ENTRIES-NEWNUM,
                ENTRIES-WRBTR,
                ENTRIES-GSBER,
                ENTRIES-SECCO,
                ENTRIES-ZUONR,
                ENTRIES-SGTXT.
    ENDLOOP.
    WRITE: / 'THIS IS THE BDC PROGRAM FOR SAMTEL'.
    TEMP = POSTDATE.
    DOCDATE = TEMP+6(2).
    DOCDATE2(2) = TEMP4(2).
    DOCDATE4(4) = TEMP0(4).
    *delete ENTRIES where no = 1.
    delete ENTRIES2 where no = 2.
    clear ENTRIES.
    clear ENTRIES2.
    LOOP AT ENTRIES .
    if ENTRIES-no = 2.
    perform bdc_dynpro      using 'SAPMF05A' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWKO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BKPF-BLDAT'            "DOCDATE.
                                   ENTRIES-BLDAT.
    perform bdc_field       using 'BKPF-BLART'            "DOC_TYPE.
                                   ENTRIES-BLART.
    perform bdc_field       using 'BKPF-BUKRS'            "COMPANY.
                                   ENTRIES-BUKRS.
    perform bdc_field       using 'BKPF-BUDAT'            "DOCDATE.
                                   ENTRIES-BUDAT.
    perform bdc_field       using 'BKPF-WAERS'            "INR'.
                                   ENTRIES-WAERS.
    perform bdc_field       using 'RF05A-NEWBS'
                                  ENTRIES-NEWBS.
    perform bdc_field       using 'RF05A-NEWKO'
                                  ENTRIES-NEWKO.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-SGTXT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ENTRIES-GSBER.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWKO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT.
    perform bdc_field       using 'RF05A-NEWBS'
                                  ENTRIES-NEWBS.
    perform bdc_field       using 'RF05A-NEWKO'
                                  ENTRIES-NEWKO.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ENTRIES-GSBER.
    perform bdc_dynpro      using 'SAPMF05A' '0301'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'BSEG-SGTXT_2'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR_2.
    perform bdc_field       using 'BSEG-GSBER'
                                  ENTRIES-GSBER_2.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT_2.
    perform bdc_dynpro      using 'SAPMF05A' '0301'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-WRBTR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR_2.
    perform bdc_field       using 'BSEG-GSBER'
                                  ENTRIES-GSBER_2.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT_2.
    call transaction 'F-02' using bdcdata1 mode 'A'.
    else.
    perform bdc_dynpro      using 'SAPMF05A' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWKO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BKPF-BLDAT'            "DOCDATE.
                                   ENTRIES-BLDAT.
    perform bdc_field       using 'BKPF-BLART'            "DOC_TYPE.
                                   ENTRIES-BLART.
    perform bdc_field       using 'BKPF-BUKRS'            "COMPANY.
                                   ENTRIES-BUKRS.
    perform bdc_field       using 'BKPF-BUDAT'            "DOCDATE.
                                   ENTRIES-BUDAT.
    perform bdc_field       using 'BKPF-WAERS'            "INR'.
                                   ENTRIES-WAERS.
    perform bdc_field       using 'RF05A-NEWBS'
                                  ENTRIES-NEWBS.
    perform bdc_field       using 'RF05A-NEWKO'
                                  ENTRIES-NEWKO.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-SGTXT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ENTRIES-GSBER.
    perform bdc_dynpro      using 'SAPMF05A' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF05A-NEWKO'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT.
    perform bdc_field       using 'RF05A-NEWBS'
                                  ENTRIES-NEWBS_2.
    perform bdc_field       using 'RF05A-NEWKO'
                                  ENTRIES-NEWKO_2.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'COBL-GSBER'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'COBL-GSBER'
                                  ENTRIES-GSBER_2.
    perform bdc_dynpro      using 'SAPMF05A' '0301'.
    **perform bdc_field       using 'BDC_CURSOR'
                                 'BSEG-SGTXT_2'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR_2.
    perform bdc_field       using 'BSEG-GSBER'
                                  ENTRIES-GSBER_2.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT_2.
    perform bdc_dynpro      using 'SAPMF05A' '0301'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BSEG-WRBTR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'BSEG-WRBTR'
                                  ENTRIES-WRBTR_2.
    perform bdc_field       using 'BSEG-GSBER'
                                  ENTRIES-GSBER_2.
    perform bdc_field       using 'BSEG-SGTXT'
                                  ENTRIES-SGTXT_2.
    call transaction 'F-02' using bdcdata1 mode 'A'.
    endif.
    ENDLOOP.
    clear entries.
    refresh entries.
           Start new screen                                              *
    form bdc_dynpro using program dynpro.
       clear bdcdata1.
      bdcdata1-program  = program.
      bdcdata1-dynpro   = dynpro.
      bdcdata1-dynbegin = 'X'.
    append bdcdata1.
    endform.
           Insert field                                                  *
    form bdc_field using fnam fval.
       clear bdcdata1.
        bdcdata1-fnam = fnam.
        bdcdata1-fval = fval.
    append bdcdata1.
    endform.

    Alok,
    1) Write upload data from excel in Start of selection
    2) I could not find any need for table entries2 in the logic.
    3) I feel the data mapping from the uploaded file is wrong. Can you look into http://www.sapdevelopment.co.uk/file/file_upexcelalt1.htm for the proper usage. Actually, this logic will work. Similar way you can map the data to your internal table <b>entries</b>
    4) BDC part I feel its ok.
    Let me know if you have still error after these steps.
    Rgds,
    TM

  • BDC  for FB01  Transaction.

    Hi Experts,
    I am having the bdc recording of the transaction FB01 in shdb transaction.I have converted the recording into an program.I am finding difficulty in Line items posting. As I am new to FI module.
    How to go about for the line item positng with respect to  psoting key is NEWBS.
    Thanks in Advance
    Irfan Hussain

    Hi,
    FB01 is a transaction very nice to learn BDC
    Here a code (with french comment)
    report z_fi_in_01 no standard page heading
                      line-size 80
                      line-count 65.
    *-------------------------------- DATA --------------------------------*
    data : v_infile(200) type c ,              " Chemin physique fich.
           v_periode(4)  type n ,              " Periode
           v_t_code(20)  type c value 'FB01' , " Code transaction.
           v_count(3)    type n ,              " Compteur de poste piec
           v_decimal(1)  type c ,              " Representation decimal
           v_nb_blanc(6) type n ,              " Nb ligne montant nul
           v_date(8)     type c .              " Date comptable
    data : begin of itab_fichier_in occurs 0,
             societe(4)   type c ,                  " Société
             poste(2)     type c ,                  " Poste -> type piece
             centre(8)    type c ,                  " Centre de couts
             compte(10)   type c ,                  " Compte comptable
             code_dc(1)   type c ,                  " Code debit/credit C/D
             montantc(13) type p decimals 2 ,       " Montant credit
             montantd(13) type p decimals 2 ,       " Montant debit
           end of itab_fichier_in.
    data: begin of bdc_tab occurs 100.
            include structure bdcdata.
    data: end of bdc_tab.
    data : begin of itab_piece occurs 0 ,
             typepiece(2) type c ,
             montantc(13) type p decimals 2 ,       " Montant credit
             montantd(13) type p decimals 2 ,       " Montant debit
             solde(13)    type p decimals 2 ,       " Solde
           end of itab_piece.
    *--------------------------- PARAMETERS -------------------------------*
    parameters : p_infile(100) type c
                               default '.dat'
                               lower case
                               obligatory ,
                 p_nom(12) type c
                            default 'Z_PAIE'
                            obligatory ,
                 p_waers like t001-waers
                            obligatory .
    *-------------------------------- MAIN --------------------------------*
    start-of-selection.
    * Recherche des chemins physique à partir des chemins logiques.
      perform p_recherche_chemin.
    * Copie du contenu du fichier dans la table interne ITAB_FICHIER_IN.
      perform p_lecture_input.
    * Test si les données sont bien equilibrées.
      perform p_test_donnee.
    * Ouverture du dossier.
      perform open_bdc using p_nom.
    * Transformation des données type pleiade au format SAP.
      perform p_creation_batch.
    * Fermeture du dossier.
      perform close_bdc.
    * Edition.
      perform p_edition.
    end-of-selection.
    *------------------------------ PROCEDURE -----------------------------*
    *   Procédure P_RECHERCHE_CHEMIN.                                      *
    *   Recherche des chemins de fichiers physiques à partir des chemins   *
    *   de fichiers logiques.                                              *
    form p_recherche_chemin.
    * Fonction de recherche du chemin physique depuis le chemin logique
    * On passe en parametre le nom du fichier.
      call function 'FILE_GET_NAME'
           exporting
                client           = sy-mandt
                logical_filename = 'Z_FI_PAIE_PLEIADE_FILE'
                operating_system = sy-opsys
                parameter_1      = p_infile
           importing
                file_name        = v_infile
           exceptions
                file_not_found   = 1
                others           = 2.
    * Si probleme d ouverture message et on arrete tout.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        stop.
      endif.
    endform.                               " P_RECHERCHE_CHEMIN
    *   Procédure P_LECTURE_INPUT.                                         *
    *   Ouverture, lecture, fermeture du fichier de paie.                  *
    form p_lecture_input.
      data : v_msg(100)    type c ,     " Message d erreur ouverture fichier
             v_buffer(200) type c.      " Buffer lecture fichier
    * Ouverture du fichier en entrée.
      open dataset v_infile for input in text mode message v_msg.
      if sy-subrc ne space.
        write : /1 'ERREUR FATALE !' color 3,
                   'IMPOSSIBLE D OUVRIR LE FICHIER EN ENTREE :',
                   p_infile ,
                /1 v_msg.
        stop.
      endif.
    * Lecture sequentiele du fichier en entrée.
      do.
        read dataset v_infile into v_buffer.
    *   Test fin de fichier.
        if sy-subrc ne space.
          exit.
        endif.
    *   Transfert du buffer dans la table interne.
        move : v_buffer+6(4)   to v_periode ,
               v_buffer+10(8)  to itab_fichier_in-centre ,
               v_buffer+18(10) to itab_fichier_in-compte ,
               v_buffer+28(2)  to itab_fichier_in-poste ,
               v_buffer+32(1)  to itab_fichier_in-code_dc ,
               v_buffer+33(18) to itab_fichier_in-montantc ,
               v_buffer+51(18) to itab_fichier_in-montantd .
    *   Allimente le code société.
        if     v_buffer+0(2) eq '04'.
          move '1614' to itab_fichier_in-societe.
        elseif v_buffer+0(2) eq '09'.
          move '2826' to itab_fichier_in-societe.
        else.
          write : /1 'Société inconnue ! traitement interrompu !' ,
                     v_buffer+0(2) .
        endif.
    *   On replace la decimale sur le montant.
        itab_fichier_in-montantc = itab_fichier_in-montantc / 100.
        itab_fichier_in-montantd = itab_fichier_in-montantd / 100.
    *   Enregistrement de la ligne dans la table interne ITAB_FICHIER_IN.
        append itab_fichier_in.
        clear  itab_fichier_in.
      enddo.
    * Fermeture du fichier en entrée.
      close dataset v_infile.
    * Trie de la table interne ITAB_FICHIER_IN.
      sort itab_fichier_in by societe poste compte centre.
    endform.                               " P_LECTURE_INPUT.
    *   Procédure P_TEST_DONNEE.                                           *
    *   Verifie si la somme des debits est egale a la somme des credits.   *
    *   Verifie si n y a pas de montant nul.                               *
    *   Verifie que les differents type de piece sont equilibrés entre     *
    *   eux.                                                               *
    *   Force le centre de cout à 91001038 pour les comptes comptables     *
    *   commencent par 481801.                                             *
    form p_test_donnee.
      data : v_montantc(13) type p decimals 2 ,
             v_montantd(13) type p decimals 2 .
    * Cumul les montants debit et credit.
      loop at itab_fichier_in.
        v_montantc = v_montantc + itab_fichier_in-montantc.
        v_montantd = v_montantd + itab_fichier_in-montantd.
      endloop.
    * Test si debit = credit.
      if v_montantc ne v_montantd.
        skip 2.
        write : /1 'ATTENTION LE FICHIER N EST PAS EQUILIBRE !!' color 3.
        skip 2.
        write : /5 'Total montant debit  :',
                   v_montantd ,
                /5 'Total montant credit :' ,
                   v_montantc .
        stop.
      endif.
    * Verifie s il n y a pas de montant nul. Si oui on efface.
      loop at itab_fichier_in.
        if itab_fichier_in-montantc eq space and
           itab_fichier_in-montantd eq space.
          v_nb_blanc = v_nb_blanc + 1.
          delete itab_fichier_in.
        endif.
      endloop.
    * Verifie que les differents postes sont equilibrés.
      clear : v_montantc, v_montantd.
      loop at itab_fichier_in.
        v_montantc = v_montantc + itab_fichier_in-montantc.
        v_montantd = v_montantd + itab_fichier_in-montantd.
        at end of poste.
          if v_montantc ne v_montantd.
            skip 2.
            write : /1 'ATTENTION LE FICHIER N EST PAS EQUILIBRE !!'
                        color 3 ,
                    /1 'Au moins un type de piece n''est pas equilibré.'.
            skip 2.
            write : /5 'Montant debit  :',
                       v_montantd ,
                    /5 'Montant credit :' ,
                       v_montantc .
            stop.
          endif.
          clear : v_montantc, v_montantd.
        endat.
      endloop.
    * Si le compte comptable commence par 481801 on force le centre de
    * couts à 91001038.
      loop at itab_fichier_in
           where compte(6) = '481801'.
        move '91001038' to itab_fichier_in-centre.
        modify itab_fichier_in.
      endloop.
    endform.                               " P_TEST_DONNEE.
    *   Procédure P_CREATION_BATCH.                                        *
    *   Application de regle de gestion :                                  *
    *     - La date est obtenue à partir de la zone période. On prend le   *
    *       dernier jour du mois indiqué dans le fichier en entrée.        *
    *     - Si le poste est PR alors le type de document est AC sinon il   *
    *       est SA.                                                        *
    *     - Si c est un debit la clé est 40, si c est un credit 50.        *
    *     - Le montant du fichier en entrée est exprimé en centime.        *
    form p_creation_batch.
      data : v_totald(13)  type p decimals 2 ,   " Total debit
             v_totalc(13)  type p decimals 2 ,   " Total credit
             v_total(13)   type p decimals 2 ,   " Total general
             v_clef(2)     type n ,              " Clef 50/40
             v_montant(13) type p decimals 2 ,   " Montant temporaire
             v_flag_fin(1) type n .              " Indicateur fin piece
    * Recherche de la date de fin de mois de la periode
      perform p_last_day_of_month using    v_periode
                                  changing v_date.
    * Recherche de la constante utilisateur sur la decimal.
      perform p_decimal.
    * Boucle sur la table interne.
      loop at itab_fichier_in.
    *   Compteur de poste de piece.
        v_count = v_count + 1.
    *   Gestion du cumul des montants.
        if itab_fichier_in-code_dc eq 'D'.
          v_total  = v_total  + itab_fichier_in-montantd.
          v_totald = v_totald + itab_fichier_in-montantd.
        else.
          v_total  = v_total  - itab_fichier_in-montantc.
          v_totalc = v_totalc + itab_fichier_in-montantc.
        endif.
    *   -= Au changement de poste. =-
        at new poste.
    *     Nouvelle entete
          perform p_entete_piece using itab_fichier_in-societe
                                       itab_fichier_in-poste
                                       v_date.
    *     Initialisation compteur de poste de piece.
          v_count = 1.
        endat.
    *   -= A la fin du poste. =-
        at end of poste.
    *     Modifie l indicateur de dernier poste.
          v_flag_fin = 1.
        endat.
    *   Si c est le dernier poste de la piece on ferme...
        if v_flag_fin = 1.
          if itab_fichier_in-code_dc eq 'D'.
            move 40 to v_clef.
            perform p_fermeture_piece using v_clef
                                            itab_fichier_in-compte
                                            itab_fichier_in-centre
                                            itab_fichier_in-montantd.
          else.
            move 50 to v_clef.
            perform p_fermeture_piece using v_clef
                                            itab_fichier_in-compte
                                            itab_fichier_in-centre
                                            itab_fichier_in-montantc.
          endif.
    *     Gestion de l indicateur de fin de piece.
          move 0 to v_flag_fin.
    *     Gestion de la table des pieces pour l edition.
          move : itab_fichier_in-poste  to itab_piece-typepiece ,
                 v_totalc               to itab_piece-montantc ,
                 v_totald               to itab_piece-montantd .
          append itab_piece.
          clear : v_totalc, v_totald, itab_piece.
    *   Cas normal d un poste de la piece.
        else.
    *     Recherche de la clef.
          if itab_fichier_in-code_dc eq 'D'.
            move 40 to v_clef.
            perform p_poste_piece using itab_fichier_in-societe
                                        v_clef
                                        itab_fichier_in-compte
                                        itab_fichier_in-centre
                                        itab_fichier_in-montantd
                                        v_date.
          else.
            move 50 to v_clef.
            perform p_poste_piece using itab_fichier_in-societe
                                        v_clef
                                        itab_fichier_in-compte
                                        itab_fichier_in-centre
                                        itab_fichier_in-montantc
                                        v_date.
          endif.
        endif.
    *   -= Poste de piece. =-
    *   Si plus de 900 postes dans la piece on equilibre et on contre-passe
    *   dans une nouvelle piece.
        if v_count gt 900.
    *     Recherche de la clef pour l'equilibrage (inverse de la normal).
          if v_total gt 0.
            move 50 to v_clef.
            v_montant = v_total.
          elseif v_total lt 0.
            move 40 to v_clef.
            v_montant = 0 - v_total.
          endif.
    *     Equilibrage.
          perform p_fermeture_piece using v_clef
                                          '2122010900'
                                          v_montant.
    *     Nouvelle entete de piece.
          perform p_entete_piece using itab_fichier_in-societe
                                       itab_fichier_in-poste
                                       v_date.
    *     Initialization de la variable de poste de piece.
          v_count = 1.
    *     Recherche de la clef pour la contre-partie.
          if v_total gt 0.
            move 40 to v_clef.
            v_montant = v_total.
          elseif v_total lt 0.
            move 50 to v_clef.
            v_montant = 0 - v_total.
          endif.
    *     Contre-partie.
          perform p_poste_piece using itab_fichier_in-societe
                                      v_clef
                                      '2122010900'
                                      v_montant
                                      v_date.
    *     Gestion de la table des pieces pour l edition.
          move : itab_fichier_in-poste  to itab_piece-typepiece ,
                 v_totalc               to itab_piece-montantc ,
                 v_totald               to itab_piece-montantd .
          append itab_piece.
          clear : v_totalc, v_totald, itab_piece.
        endif.                  " Supperieur 900 lignes.
      endloop.
    endform.                               " P_CREATION_BATCH
    *   Procédure P_LAST_DAY_OF_MONTH.                                     *
    *   Calcul du dernier jour du mois.                                    *
    form p_last_day_of_month using    i_datum
                             changing e_tt.
      data: datmm   type i ,
            datjj   type i ,
            year(4) type n ,
            date(8) type n ,
            rest    type i ,
            zw_tt   type i .
    * Initialization
      clear e_tt.
    * Recherche du mois.
      datmm = i_datum+2(2).
    * Nombre de jour par mois.
      case datmm.
        when 1.  zw_tt = 31.
        when 2.  zw_tt = 28.
        when 3.  zw_tt = 31.
        when 4.  zw_tt = 30.
        when 5.  zw_tt = 31.
        when 6.  zw_tt = 30.
        when 7.  zw_tt = 31.
        when 8.  zw_tt = 31.
        when 9.  zw_tt = 30.
        when 10. zw_tt = 31.
        when 11. zw_tt = 30.
        when 12. zw_tt = 31.
      endcase.
    * Cas particulier du mois de fevrier.
      if datmm = 2.
        move : '20'          to year(2) ,
                i_datum+0(2) to year+2(2) .
        datjj = year.
        rest  = datjj mod 4.
        if rest = 0.
          zw_tt = 29.
        endif.
      endif.
      move : '20'         to date+4(2) ,
             i_datum+0(2) to date+6(2) ,
             i_datum+2(2) to date+2(2) ,
             zw_tt        to date+0(2) .
      e_tt = date.
    endform.
    *   Procédure P_ENTETE_PIECE.                                          *
    *   Regles :                                                           *
    *            Si le poste est PR alors le type de piece est AC, sinon   *
    *            il est SA.                                                *
    form p_entete_piece using v_bukrs
                              poste
                              v_date.
    * Lancement ecran en-tete de piece.
      perform bdc_dynpro using 'SAPMF05A' '0100'.
    * Validation.
      perform bdc_field using 'BDC_OKCODE' '/00'.
    * Date de piece.
      perform bdc_field using 'BKPF-BLDAT' v_date.
    * Date comptable.
      perform bdc_field using 'BKPF-BUDAT' v_date.
    * Type de piece.
      if poste eq 'PR'.
        perform bdc_field using 'BKPF-BLART' 'AC'.
      else.
        perform bdc_field using 'BKPF-BLART' 'SA'.
      endif.
    * Société.
      perform bdc_field using 'BKPF-BUKRS' v_bukrs.
    * Devise.
      perform bdc_field using 'BKPF-WAERS' p_waers.
    endform.
    *   Procédure P_POSTE_PIECE.                                           *
    *   En fonction de la marque de decimale choisi par l'utilisateur      *
    *   on passe les ',' en '.'  ou inversement.                           *
    form p_poste_piece using v_bukrs
                             v_clef
                             v_compte
                             v_centre
                             v_total
                             v_date.
      data : v_data(25) type c ,           " data temporaire pour valeurs
             v_text like bseg-sgtxt ,      " Texte du poste de la piece
             v_fdlev like skb1-fdlev.      " Niveau trésorerie
    * Vérifie que le compte est traité en trésorerie.
      select single fdlev
             into v_fdlev
             from skb1
             where bukrs eq v_bukrs
             and   saknr eq v_compte.
    * Gestion de la zone texte de poste de la piece.
      move : v_compte to v_text ,
             '/'      to v_text+10 ,
             v_centre to v_text+11 ,
             '/'      to v_text+19 ,
             text-001 to v_text+22 .
    * Gestion zone P -> C
      move v_total to v_data.
      shift v_data left deleting leading space.
    * Test la constante utilisateur marquant la decimale.
      if v_decimal eq 'X'.
        replace ',' with '.' into v_data.
      else.
        replace '.' with ',' into v_data.
      endif.
    * Test s il sagit du premier poste de la piece.
      if v_count eq 1.
    *   Clé de comptabilisation.
        perform bdc_field using 'RF05A-NEWBS' v_clef.
    *   Compte comptable.
        perform bdc_field using 'RF05A-NEWKO' v_compte.
      else.
        perform bdc_dynpro using 'SAPMF05A' '0300'.
        perform bdc_field using 'BDC_OKCODE' '/00'.
    *   Clé de comptabilisation.
        perform bdc_field using 'RF05A-NEWBS' v_clef.
    *   Compte comptable.
        perform bdc_field using 'RF05A-NEWKO' v_compte.
    *   Inconnu ...
        perform bdc_field using 'BDC_SUBSCR' 'SAPLKACB'.
    *   Indique de ne pas repasser sur la saisie des centres de couts ...
        perform bdc_field using 'DKACB-FMORE' ' '.
      endif.
    * Lancement ecran poste de piece.
      perform bdc_dynpro using 'SAPMF05A' '0300'.
    * Validation.
      perform bdc_field using 'BDC_OKCODE' '/00'.
    * Si compte gestion tresorerie alors on positionne la date.
      if v_fdlev ne space.
        perform bdc_field using 'BSEG-VALUT' v_date.
      endif.
    * Montant.
      perform bdc_field using 'BSEG-WRBTR' v_data.
    * Texte du poste de la piece.
      perform bdc_field using 'BSEG-SGTXT' v_text.
    * Inconnu ...
      perform bdc_field using 'BDC_SUBSCR' 'SAPLKACB'.
    * Si le centre de couts est vide on ne traite pas l ecran
    * de saisie du centre de couts.
      if v_centre ne space.
    *   Indique de passer sur le dynpro de saisie centre de couts ...
        perform bdc_field using 'DKACB-FMORE' 'X'.
    *   Ecran de saisie des centres de couts.
    *   Saisie des données du poste de la piéce.
        perform bdc_dynpro using 'SAPLKACB' '0002'.
        perform bdc_field using 'BDC_OKCODE' '/EENTE'.
    *   Centre de coûts.
        perform bdc_field using 'COBL-KOSTL' v_centre.
    *   Encore un inconnu ...
        perform bdc_field using 'BDC_SUBSCR' 'SAPLKACB'.
      else.
    *   Indique de passer sur le dynpro de saisie centre de couts ...
        perform bdc_field using 'DKACB-FMORE' ' '.
      endif.
    endform.
    *   Procédure P_FERMETURE_PIECE.                                       *
    form p_fermeture_piece using v_clef
                                 v_compte
                                 v_centre
                                 v_total.
      data : v_data(25) type c ,           " data temporaire pour valeurs
             v_text like bseg-sgtxt.
    * Gestion de la zone texte de poste de la piece.
      move : v_compte to v_text ,
             '/'      to v_text+10 ,
             v_centre to v_text+11 ,
             '/'      to v_text+19 ,
             text-001 to v_text+22 .
    * Gestion zone P -> C
      move v_total to v_data.
      shift v_data left deleting leading space.
    * Test la constante utilisateur marquant la decimale.
      if v_decimal eq 'X'.
        replace ',' with '.' into v_data.
      else.
        replace '.' with ',' into v_data.
      endif.
      perform bdc_dynpro using 'SAPMF05A' '0300'.
      perform bdc_field using 'BDC_OKCODE' '/00'.
    * Clé de comptabilisation.
      perform bdc_field using 'RF05A-NEWBS' v_clef.
    * Compte comptable.
      perform bdc_field using 'RF05A-NEWKO' v_compte.
    * Inconnu ...
      perform bdc_field using 'BDC_SUBSCR' 'SAPLKACB'.
    * Indique de ne pas repasser sur la saisie des centres de couts ...
      perform bdc_field using 'DKACB-FMORE' ' '.
      perform bdc_dynpro using 'SAPMF05A' '0300'.
      perform bdc_field using 'BDC_OKCODE' '=BU'.
    * Montant.
      perform bdc_field using 'BSEG-WRBTR' v_data.
    * Texte du poste de la piece.
      perform bdc_field using 'BSEG-SGTXT' v_text.
    * Inconnu ...
      perform bdc_field using 'BDC_SUBSCR' 'SAPLKACB'.
      if v_centre ne space.
    *   Indique de passer sur la saisie des centres de couts ...
        perform bdc_field using 'DKACB-FMORE' 'X'.
    *   Ecran de saisie des centres de couts.
    *   Saisie des données du poste de la piéce.
        perform bdc_dynpro using 'SAPLKACB' '0002'.
        perform bdc_field using 'BDC_OKCODE' '/EENTE'.
    *   Centre de coûts.
        perform bdc_field using 'COBL-KOSTL' v_centre.
    *   Encore un inconnu ...
        perform bdc_field using 'BDC_SUBSCR' 'SAPLKACB'.
      else.
    *   Indique de ne pas repasser sur la saisie des centres de couts ...
        perform bdc_field using 'DKACB-FMORE' ' '.
      endif.
    * Transfert du dossier.
      perform insert_bdc using v_t_code.
      refresh bdc_tab.
      clear bdc_tab.
    endform.
    *   Form OPEN_BDC                                                      *
    *   Ouverture du dossier Batch-Input.                                  *
    form open_bdc using v_nom_dossier.
      call function 'BDC_OPEN_GROUP'
           exporting
                client              = sy-mandt          " Numéro de mandant
                group               = v_nom_dossier     " Nom dossier batch
                keep                = 'X'               " Code
                user                = sy-uname          " Nom utilisateur
           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 ne 0.
        write : /1 text-001 ,
                /1 'Erreur :' , sy-subrc.
      endif.
      refresh bdc_tab.
      clear   bdc_tab.
      exit.
    endform.                       " OPEN_BDC
    *   Form CLOSE_BDC                                                     *
    *   Fermeture du dossier BTCI                                          *
    form close_bdc.
      call function 'BDC_CLOSE_GROUP'
           exceptions
                not_open    = 1
                queue_error = 2
                others      = 3.
      if sy-subrc ne 0.
        write : /1 text-002 ,
                /1 'Erreur :' , sy-subrc.
      endif.
    endform.                     " CLOSE_BDC
    *   Form BDC_DYNPRO                                                    *
    *   Alimentation de la ligne d'entête de BDCTAB                        *
    form bdc_dynpro using value(progname)
                          value(dynpronr).
    * Efface la header-line.
      clear bdc_tab.
    * Insertion des valeurs.
      bdc_tab-program  = progname.
      bdc_tab-dynpro   = dynpronr.
      bdc_tab-dynbegin = 'X'.
    * Enregistrement des valeurs.
      append bdc_tab.
    endform.                    " BDC_DYNPRO
    *   Form BDC_FIELD                                                     *
    *   Traitement des enregistrements de la structure BDCTAB              *
    *      --> FIELDNAME  Nom du champ                                     *
    *      --> FIELDVALUE Valeur du champ                                  *
    form bdc_field using value(fieldname) value(fieldvalue).
    * Efface la header-line.
      clear bdc_tab.
    * Insertion des valeurs.
      bdc_tab-fnam = fieldname.
      bdc_tab-fval = fieldvalue.
    * Enregistrement des valeurs.
      append bdc_tab.
    endform.                " BDC_FIELD
    * Form BDC_CURSOR                                                      *
    * Positionnement du curseur sur un champ particulier                   *
    form bdc_cursor using value(fieldname) value(fieldvalue).
    * Efface la header-line.
      clear bdc_tab.
    * Insertion des valeurs.
      bdc_tab-fnam = fieldname.
      bdc_tab-fval = fieldvalue.
    * Enregistrement des valeurs.
      append bdc_tab.
    endform.              " BDC_CURSOR
    *   Form  INSERT_BDC                                                   *
    *   Insertion dans le dossier BTCI                                     *
    *   Attention : la transaction est codée en dur                        *
    form insert_bdc using t_code.
      call function 'BDC_INSERT'
           exporting
                tcode            = t_code
           tables
                dynprotab        = bdc_tab
           exceptions
                internal_error   = 1
                not_open         = 2
                queue_error      = 3
                tcode_invalid    = 4
                printing_invalid = 5
                posting_invalid  = 6
                others           = 7.
      if sy-subrc ne 0.
        write : /1 text-003 ,
                /1 'Erreur :' , sy-subrc.
      endif.
    endform.                  " INSERT_BDC
    *   Procédure P_DECIMAL.                                               *
    form p_decimal.
    * Recherche de la constante utilisateur sur la virgule decimale.
      select single dcpfm
             into v_decimal
             from usr01
             where bname eq sy-uname.
    endform.
    *   Procédure P_EDITION.                                               *
    *   Procédure d'edition du resultat de la génération du dossier        *
    *   Batch-Input.                                                       *
    form p_edition.
      data : v_solde(13) type p decimals 2.
      skip 1.
      write : /1 'Comptabilisation de la paie venant de Pléïades.'.
    * Le mois.
      skip 2.
      case v_periode+2(2).
        when 01.
          write : /1 'Mois : Janvier'.
        when 02.
          write : /1 'Mois : Fevrier'.
        when 03.
          write : /1 'Mois : Mars'.
        when 04.
          write : /1 'Mois : Avril'.
        when 05.
          write : /1 'Mois : Mai'.
        when 06.
          write : /1 'Mois : Juin'.
        when 07.
          write : /1 'Mois : Juillet'.
        when 08.
          write : /1 'Mois : Aout'.
        when 09.
          write : /1 'Mois : Septembre'.
        when 10.
          write : /1 'Mois : Octobre'.
        when 11.
          write : /1 'Mois : Novembre'.
        when 12.
          write : /1 'Mois : Decembre'.
      endcase.
    * La date comptable.
      skip 1.
      write : /1  'Date comptable :' ,
               18 v_date+0(2) ,
               20 '/' ,
               21 v_date+2(2) ,
               23 '/' ,
               24 v_date+4(4).
    * Piece SA.
      skip 2.
      write : /1  'Piece(s) SA :' ,
              /10 'Montant Debit' ,
               40 'Montant Credit' ,
               70 'Solde'.
      loop at itab_piece where typepiece ne 'PR'.
        v_solde = itab_piece-montantd - itab_piece-montantc.
        write : /1  itab_piece-montantd ,
                 31 itab_piece-montantc ,
                 61 v_solde.
      endloop.
    * Piece AC.
      skip 2.
      write : /1  'Piece(s) AC :' ,
              /10 'Montant Debit' ,
               40 'Montant Credit' ,
               70 'Solde'.
      loop at itab_piece where typepiece eq 'PR'.
        v_solde = itab_piece-montantd - itab_piece-montantc.
        write : /1  itab_piece-montantd ,
                 31 itab_piece-montantc ,
                 61 v_solde.
      endloop.
      skip 4.
      write : /1 'Anomalie :' ,
              /1 'Nombre de lignes dont le montant est nul :' ,
                 v_nb_blanc no-zero.
    endform.

  • Need help in BDC for FB01 transaction

    My requirement is like this,
    I have a selection screen in which I need to give file name in and have two radio buttons 1)test mode 2)Update mode
    u2022     On execution of the program in test mode a pop up screen should appear for user stating any errors in the line items.
    u2022     On execution of the program in the Update mode...a pop up screen should appear stating the documents numbers posted.
    u2022     On successful execution the system will open a new screen stating the document number which was generated. In case       of error the new screen should show the error and should not post  any items in that file.
    Could anybody help me in this. And which BDC method is best for this scenario.
    Regards
    Tom

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

  • Standard BDC for t.code: FB01

    Hi,
    Is there any standard BDC available for T.code: FB01.
    Thanks and Regards,
    VK

    Hi,
    You can use standard program RFBIBL00 or BAPI BAPI_ACC_DOCUMENT_POST for this purpose.
    Creating BDC for FB01 mainly depends on your need. A generic one is difficult to be created due to multiple alternative screeens.
    Regards,
    Gaurav

  • How to move ahead using RFBIBLOO for FB01 BDC

    Can anyone guide me how to fill in the three structures namely BGR00, BBKPF and BBSEG with my data in order to use RFBIBLOO standard program for data upload for FB01.
    Thanx in advance,
    Alok.

    Hello,
    Check this thread,
    Re: Input File in RFBIBL00.
    and
    Check out the program, <b>RFBIBLT0</b>
    Regards,
    Naimesh

  • Function Module  for FB01 Vendor line items postings in 3.1 Version

    Hello all,
    Is there any Function Module  for FB01 Vendor line items postings in 3.1 Version. I do not want to go for BDC. Please suggest.
    Thanks,
    Subba

    Hi,
    search for function module ACCPOSTING* or get development class of transaction FB01 and goto SE80, enter development class - and search in function group's function module.
    Cheers.
    ...Reward if useful.

  • BDC for transaction F-28

    Hi All,
    I need to use transaction F-28 to create an interface for automatic postings of customer payments.
    Is it possible to create BDC for F-28?
    Regards

    Hello,
    It is very difficult to make bdc for any FI transaction. My advice is to use RFBIBL00 program for this.
    See my answer to this thread
    Re: FB01 DATA UPLOAD USING POSTING_INTERFACE_DOCUMENT FUNCTION
    Regards,
    Naimesh

  • Problem in bdc for f-22

    Hi freinds iam doing upload program for f-22 open customer balances..iam stucked as iam new in abap, here is the problem ..
    when i try to run the program after 2 screens i get a pop up with costcenter ,profitcenter, and business area field...which in nomal t.code are not in the form of popup.....and when  i put valid data (account) which has profit center and cost center then it works ..but when i put data which had no profict center and costcenter it process but shows and errror
    "CURSOR FIELD 'COBL-KOSTL' DOESNOT EXITS.
    AND I TRIED TO COMPARE IT WITH SKB1 TABLES FIELD FSTAG...ALSO ...
    THE REQUIREMENT IS ITHOULD PROCESS THE ACCOUNT WHHICH HAS PROFIT CNETER AND COST CENTER IF ASSIGN FOR A ACCOUNT IOF NO THEN REST SHOULD BE PROCESSD,
    HERE IS MY CODE ..PLS CORRECT ME WITH MY CODE IF IAM WRONG SOMEHERE ..AND GIVE ME SUGGETSION FOR IT (URGENT)
    *Selecting fieldstatus from skb1 for comparision
        SELECT SINGLE fstag FROM skb1 INTO w_fstag WHERE
                       saknr =  i_final-newko2.
        IF sy-subrc = 0.
          PERFORM bdc_field       USING 'COBL-KOSTL'
                                        i_final-kostl2.
          PERFORM bdc_field       USING 'COBL-PRCTR'
                                        i_final-prctr2.
        ENDIF. "IF SY-SUBRC
        PERFORM bdc_dynpro      USING 'SAPMF05A' '0330'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'BSEG-CCBTC'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BU'.
        PERFORM bdc_transaction USING 'F-22'.
      ENDLOOP.

    Using batch input to post financial transactions is always difficult. As said earlier, RFBIBL00 (or a BAPI) are the preferred method. However, if you must use BDC, you have to allow for the coding block in the popup (the COBL fields).
    This workds for FB01 for cost centers, fund centers and funds. You can adapt it to include the profit center in F-22:
          perform dynpro using:
    * Debit the central account the full amount
           'X' 'SAPMF05A'    '0300',         "second screen - 300
           ' ' 'BSEG-WRBTR'  ltcap_int-tot_inc,"DR amount
           ' ' 'BSEG-ZUONR'  zuonr,            "allocation
           ' ' 'BSEG-SGTXT'  sgtxt1,           "text
           ' ' 'RF05A-NEWBS' '50',             "post key = credit
           ' ' 'RF05A-NEWKO' p_acc,            "bofa clearing acct
           'X' 'SAPLKACB'    '0002',           "coding block
           ' ' 'COBL-KOSTL'  '11732',          "cost center
           ' ' 'COBL-FISTL'  '103387',         "fund center
    * Credit the fund the final amount
           'X' 'SAPMF05A'    '0300',           "CR screen
           ' ' 'BSEG-WRBTR'  ltcap_int-fin_inc,"CR amount
           ' ' 'BSEG-SGTXT'  sgtxt1,           "text
           'X' 'SAPLKACB'    '0002',           "coding block
           ' ' 'COBL-KOSTL'  '11733',          "cost center
           ' ' 'COBL-GEBER'  ltcap_int-fund,   "fund
           ' ' 'COBL-FISTL'  ltcap_int-cfc.    "fund center
    Rob

  • Need help on BDC  for MB1A transaction.

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

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

  • BDC for F - 43, Multiple posting keys,multiple line items

    Dear gurus,
                     I need to develop a bdc for  F-43, it it working for multiple posting keys with two line items, but not working for multiple line items, can you tell me where to loop the line items.
    regards,
    vidyasagar yadav.

    F-43 is actually FB01 (with two parameters, check it with SE93).
    So you could use the following FMs in sequence to build the BDC :
    POSTING_INTERFACE_START
    POSTING_INTERFACE_DOCUMENT
    POSTING_INTERFACE_END
    Else
    Re-execute transaction SHDB for a document with 2 items and for a document with a dozen items and analyze the result.
    Use a BAPI like BAPI_ACC_INVOICE_RECEIPT_POST or BAPI_ACC_DOCUMENT_POST
    Regards,
    Raymond

  • Error while running a BDC for the Transaction F-02

    Hi,
           I'm getting an error <b><i>"Parking not possible during Batch Input"</i></b> while running a BDC for the transaction F-02.
           When i click on the error message it displays the message [b<i>]"In Customizing, you can control whether an error message is issued."</b></i>
            How to solve this issue?.
            Waiting for ur replies.........
    Regards
    N.Senthil

    Hi,
    When you are doing the recording in SHDB, and in the same screen where the TCODE to be recorded is given, there are options that you can choose called "Recording Parameters"...Select the checkbox which says "Not a Batch Input Session", this will set the sy-binpt variable to " "(in a recording by default it is "X")...and you will not get this error...
    Also make sure while writing the BDC program to make use of the "bdc options" parameter which has this property to switch of sy-binpt...
        Refer below theard for sample bdc code for f-02.
    https://forums.sdn.sap.com/click.jspa?searchID=5126766&messageID=1538409
    Regards

  • Problem in creation of BDC for transaction phap_create

    Hello Friends,
    I am trying to create BDC for PHAP_CREATE.
    When you run a transaction a pop up window appears to select the template id.
    And in BDC it is selected by cursor position. So once selected, the value of template id cannot be changed.
    I want this as a parameter.So that each time I run a BDC I will be able to create different types of Appraisal documents i.e with different template ids.
    How to go about it???
    Regards,
    Bhushan

    Hi,
    For selecting the id, while doing recording,
    record with
    CTRL + F ( Where u can give ur id) and proceed further.

  • How to give line items in flatfile while doing BDC for Table control

    Hi all,
    I am writing BDC for Multiple line items and Transaction  is : FSE5N.
    How do i give the data in the flat file. I mean how do we give the multiple line items in flat file , i.e for second line item again we have to header data or not ?
    ex:
    1015;ALL;demo;kr;INR;01;0001;3000172;100
    1015;ALL;demo;kr;INR;01;0001;3000172;200
    for first lineitem  : 3000172;100
    for 2nd line item : 3000172; 200.
    header data : 1015;ALL;demo;kr;INR;01;0001.
    Thanks in advance
    krupali

    Hii ,
    u can give in the same format as u have done in the example.
    A       B    C     D  E    F   G        H          I
    1015;ALL;demo;kr;INR;01;0001;3000172;100
    1015;ALL;demo;kr;INR;01;0001;3000172;200
    and while writing the loop u can give
    loop at it_head.
    loop at it_head where a = it_head-A and b = it_head-B ..........upto G = it_head-G.
      endloop.
    endloop.
    check this
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    Neeraj

  • BDC for TCODE F150

    Hi Friends,
    I am facing problem while developing BDC for tcode F150. The last action i.e. scheduling for particular dunning date is not getting executed in my BDC.
    I am also pasting the end part of my BDC recording. Please review it and advise.
    PERFORM bdc_dynpro      USING 'SAPLF150_JOBS' '1000'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'F150V-STRZT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=JOBS'.
      PERFORM bdc_field       USING 'F150V-STRDT'
                                    rdate.
      PERFORM bdc_field       USING 'F150V-XSTRF'
                                    'X'.
        select single SPLD into p_out from USR01 where bname = sy-uname.
      perform bdc_field       using 'ITCPO-TDDEST'
                                     p_out.
      CALL TRANSACTION 'F150'
    Thank you,
    Swapnil
    Edited by: Swapnil Tawade on Sep 22, 2008 3:15 PM

    Hi,
       If u want it for  some specific plants then before populating data  to bdcdata internal table  check the conditions for which the plant fields required values to be passed  and if the condition is satisfied then pass the plant field to bdcdata table . If the condition is not satisfied then dont pass that plant field to bdcdata table bcoz  if  u r not passing any field to bdcdata table then that field is going have default values.
    Regards,
    Shafi

Maybe you are looking for

  • BT Infinity, XboX and Battlefield 3

    Hi, I have a problem with playing Battlefield 3 on Xbox since i upgraded to 40meg infinity and the homehub 3. The game is no longer fluid during gameplay it is stuttering, laggy and overall feels like it's been covered in treacle - i didn't suffer an

  • PowerBookG4 with iPhoto 5.0.4 can't/won't open photos

    Ok, first of all I am extremely ignorant of OSX, and especially iPhoto. I used Classic until finally forced into X. I had been using OS 10.4.11 and have upgraded my old laptop as far as it will go (to 10.5.8) recently and that is what has caused this

  • I phone screen is blank, have tried holding both buttons but not working

    I phone screen is blank, have tried holding both buttons to reset but still will not work any suggestions?

  • How to detect client's max screen size?

    I am using 2 functions right now, but I don't quite understand what they do. //Create and set up the window. frame = new JFrame("Test of TAN Books product database"); frame.setBounds(30,30,1024,740); The main content pane is a table: table.setPreferr

  • Backup - how to restore the entire configuration (system cloning)

    Hi, is it possible to backup the entire system configuration on order to restore file and system configuration? Time machine is a file backup, if I reset yosemite I've to configure the entire operative system...