BDC for AR Posting (Tcode - FB01)

Dear All,
I am unable to post multiple line items while postnig AR Invoice using BDC recording of FB01.
Can anyone provide me the BDC program code to post multiple line items.
Thanks in Advance,
Harish

hi,
please check your document type with tcode oba7
field cust./vend. check (t003-XKKPR) -> set value = X
pls reward useful answers
thx.
Andreas

Similar Messages

  • Validations using OB28 is not working for GL posting using FB01

    Hi Experts,
    Validations using OB28 for posting using FB01 is not working.
    My requirement is after entering a line items and click post validations should be triggerd.
    i want to block a posting based on document type.
    i have maintained as below..
    Prerequisite.
    ( BKPF-TCODE = 'FB50' OR BKPF-TCODE = 'FB01' ) AND (
    BKPF-BUKRS = '1000' OR BKPF-BUKRS = '0001' OR
    BKPF-BUKRS = '0002' ) AND BKPF-BLART = 'XX'.
    check.
    Used userexit to check sy-ucomm = 'BU'  (for posting).
    entries are maintained in OB28 for relevant company codes.
    it is working for FB50 but not FB01.
    same thing i tried to maintain at header level as well as item level. but it is working only for FB50 but for FB01.
    Please help me.
    Regards.
    Venu.

    Hi Venu,
    Go to GGB0 and expand the navigation till you reach the validation name of line item level and choose menu item *Validation -> Simulate.
    Here you can enter the inputs, those you are entering while doing FB01 and execute it.
    Then in the results, you will have the log for each step of your total validation of line item level.
    Check , whether your questioned STEP's pre requisite is met and check is not fullfilled.
    Accordingly you can make the changes to the STEP.
    This info may help you.
    Regards,
    Srinivas

  • BDC for AR Posting

    Dear All,
    I am unable to post multiple line items while posting AR Invoice using BDC recording of FB01.
    Can anyone provide me the BDC program code to post multiple line items.
    Thanks in Advance,
    Harish

    Hi,
    Already created the program using BDC.
    Last Document not getting saved due to screen error.
    Is there any OK-CODE to post the final document and close the BDC session.
    Suggestion will be very helpful from you all.
    Thanks in advance.
    Regards,
    Harish

  • Bdc for FI module tcode.

    hi ,
         i m new i bdc,
    i got one issue for the tcode of fico 'J3GI'.
    for a particular doc no, then go in equipment means double click on equipment
    then after pressing the ETM data, if current location is starting by 'T' then go in location and chage the maintenace plant entry from 2240 to 1120.
    and in organization tab same change for bussiness area and planning plant.
    and this bdc will schedule for daily routine check and change.
    so please guide me by step of by code till scheduling the bdc.
    thanks in advance.
    vj
    rewards will be sure for helpfull answer*

    hi ,
         ok you can help me to give a general solution of that means what should i do here?
    well my flow is i have a transaction by running that transaction i got a screen where i wanna some conditional changes and this will be scheduled on daily basis.
    so please i m waiting for your valuable solution.
    thanks and regards
    vijay dwivedi

  • Bdc for posting gl accounts

    Hi All Gurus,
    does anyone have a bdc for (fb50)posting gl accounts? this is the first time Im writting one, with no technical specs... and its too crazy to work!!!!
    Any help is most welcome!!!
    Thanks, nina.

    Hi
    See the documentation of RFBIBL00.
    Anyway you have to create a program creates a file using these structure:
    - BGR00 for session data;
    - BBKPF for header data;
    - BBSEG for items  data
    All fields of BBKPF and BBSEG you don't need has to fill with 'no data' character, i.e. /
    So your file should be:
    BGR00 <---- Session data
    BBKPF <---- Start document data
    BBSEG
    BBSEG
    BBKPF <---- New document
    BBSEG
    BBSEG
    BBKPF <---- New document
    BBSEG
    BBSEG
    After creating the file you have to submit the report RFBIBL00:
    SUBMIT RFBIBL00 WITH DS_NAME  = <FILE NAME>
                    WITH CALLMODE = 'B'
                    AND RETURN.
    Max

  • BDC for Entering Invoice(MIRO) Problem

    Dear All,
    I am preparing a BDC for Entering Invoice (Tcode- MIRO ) & facing problem.
    During recording in PO reference tab i am using Bill of Lading and inserting data through More Allocation Criteria tab and in column cell entering 8 Reference at one time for more i am scrolling it and entering 8 more and adopting it.
    In recording after adopting it is showing all adopted documents but on saved recording it is adopting latest 8 reference.
    I coding for "P++" for scrolling but it is not working.
    Please help me out.
    Is it possible to code for scrolling of PO reference Bill of Lading pop of window.?
    Thanks & Regards,
    Varun

    Hello Suhas,
    No, not at all. We see that so many times in the forum that we are mistaken.
    There are 3 places where we find P++, P--, etc. :
    - the function codes assigned to the scrolling buttons in the standard toolbar for ABAP lists.
    - If I remember well, they are also assigned to the buttons inside the screen for the table control wizard.
    - SCROLLING_IN_TABLE
    But usually, we don't create buttons inside screens for scrolling.
    Table control scrolling via page down and page up keys, is made of 2 things : changing CXTAB_CONTROL-TOP_LINE + trigger enter key.
    I know 1 note which talks about that : [187946 - No positioning on PRT overview in routing|https://service.sap.com/sap/support/notes/187946]
    Sandra

  • BDC for Entering Invoice Problem

    Dear All,
    I am preparing a BDC for Entering Invoice (Tcode- MIRO) & facing problem.
    During recording in PO reference tab i am using Bill of Lading and inserting data through More Allocation Criteria tab and in column cell entering 8 Reference at one time for more i am scrolling it and entering 8 more and adopting it.
    In recording after adopting it is showing all adopted documents but on saved recording it is adopting latest 8 reference.
    I coding for "P++" for scrolling but it is not working.
    Please help me out.
    Is it possible to code for scrolling of PO reference Bill of Lading pop of window.?
    Thanks & Regards,
    Varun

    Hello Suhas,
    No, not at all. We see that so many times in the forum that we are mistaken.
    There are 3 places where we find P++, P--, etc. :
    - the function codes assigned to the scrolling buttons in the standard toolbar for ABAP lists.
    - If I remember well, they are also assigned to the buttons inside the screen for the table control wizard.
    - SCROLLING_IN_TABLE
    But usually, we don't create buttons inside screens for scrolling.
    Table control scrolling via page down and page up keys, is made of 2 things : changing CXTAB_CONTROL-TOP_LINE + trigger enter key.
    I know 1 note which talks about that : [187946 - No positioning on PRT overview in routing|https://service.sap.com/sap/support/notes/187946]
    Sandra

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

  • Error in BDC for tcode fbcj

    Hello Everyone,
    I am working on bdc for tcode fbcj.
    I have done recording through shdb only till saving of a row and not posting of document as per requirement.
    Now the Problem I am facing is that through BDC I am able to enter transaction , do the data entry and then the regular message saying vendor 10000001 is subject to withholding tax. After getting this message The whole record row gets disappered. So I am not able to do the data entry through BDC.
    Please I request you all to help me in this regard.
    Thanks,
    Pranil Shinde.

    hi,
          First of all go to FK03 and give the vendor name and company code and tick mark
    Withholding Tax and then enter.
    Here you need to maintain the withholding tax information. To do that take the help of FI Consultant. and then execute FBCJ transaction. I hope you can resolve your issue.
    Regards,
    Kasuladevi

  • 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

  • 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

  • Problem with uploading data from excel using BDC for tcode f-02

    Hi All,
    I am uploading data from excel using BDC for tcode f-02. The problem here is, while recording, the values of some fields are recording twice. I dont know why it's happening so. But if I run my abap program, I have to give those fields twice in my excel sheet. Otherwise data does not upload. But it is not the feasible way. We must give those fields once in excel. Please tell me, how I can solve the issue.
    With regards,
    Rosaline.

    Hi,
      in BDC each and every action is recording. If your press enter in same screen that also recorded once aging may be this is your case repeating field values will appear. we can solve the problem for repeat fields like below.
    suppose in your excel having repeated field X1 X2 X3 the X2 contains repeated field X3 means delete the X3 field.
    Now In your itab having X1 and X2 fields. While in the LOOP the ITAB pass the X2 field to repeated the fields.
    LOOP at ITAB to WA.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_CURSOR'.
    bdcdata_wa-fval = 'RM08M-EBELN'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'INVFO-BLDAT'.
    bdcdata_wa-fval = wa-X2." 1st time pass the X2 fields
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'INVFO-BLDAT'.
    bdcdata_wa-fval = wa-X2." pass the same value to repeated field
    APPEND bdcdata_wa TO bdcdata_tab.
    Endloop.
    Hope you can understand.
    Regards,
    Dhina..

  • Problem in BDC for TCode S_ALR_87013620

    Hi Gurus,
    I have recorded the BDC for TCode S_ALR_87013620.
    Executed the report S_ALR_87013620 by providing necessary details.
    Displays the report and then clicked on Report-> Print -> PrinterNa
    But when I execute through program it does not work. UNable to view Screens for Report-> Print->Printername
    screens.

    Hi   Praveen Kumar  
    Go TCode S_ALR_87013620
    In Program --> execute and print (Shift+f1)
    this will execute and print your report..
    i think ....no need BDC for printing  i guess.....
    Thanks
    Ramesh

  • 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

  • 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

Maybe you are looking for