Postings in FB01 transaction

Hello friends,i have an urgent requirement to post the AR,AP and G/l account's .
Currently there exists a bdc program to perform the above job but the program has been a dependent on the file format  i.e, if i give the file sequence as for ar 01 , 50 and rest all as 50's.the requirement is to post any order irrespective like 01 50 01 50 and so on .....
Can anyone suggest me an LSMW or a code to perform the above operations .Please note the same is the requirement with others types i.e AP and G/L also./.
your early suggestions are greatly appreciated.
thanks in advance.

Hi,
  Can you give an example of the file  in the specified format? Ot is it BIBL format that is being used???
Thanks
Pradipta

Similar Messages

  • How to add new fields for FB01 transaction both at Header and Line item

    Hi Guys,
    I would like to add the new fields at header and item level in FB01 transaction. Can I acheive this by using transaction EEWB....please help me on this.
    Thanking you

    Hi,
    We are trying to copy a work flow objects from ECC6.0 to 4.6C...where we found the following Select statement.
    *Determine Top WorkItem Instance
      if im_top_wi_id is initial.
       select wi_id top_wi_id wi_rh_task into lw_top_id from sww_wi2obj
         up to 1 rows
         where wi_rh_task = im_wftask and
               catid      = 'BO'      and
               instid     = l_instid  and
               typeid     = 'FIPP'.
       endselect.
       endif
    As table sww_wi2obj can't be found in 4.6C, can any one help how to replace or implement the same logic as above statements.
    Thank you....

  • Idoc for Posting data to FB01 transaction

    Hi,
    In my Interface, i need to post data to a SAP FI system->FB01 transaction from XI. The scenario is nonSAP system->XI->SAP FI.So what are the possibilites to post data to SAP FI->FB01 transaction. Is there any Idocs for that or any other method.
    Please share your ideas..Ponts will be rewarded for good inputs...
    Thanks

    Hi,
    You need to get the file with the required format from the sender system and there shouldn't be any mapping in PI. Also please check the below link on how to get the file structure.
    Re: File for 'RFBIBL00'
    There is also a help for the RFBIBL00 program. Check this too.
    http://help.sap.com/saphelp_45b/helpdata/en/35/a47e63763e0392e10000009b38f9b7/content.htm
    The file should be placed in the ECC application folder and this program needs to be scheduled with that file path. If you are not able to get the file in the required format then you may need to go with the IDOC or BAPI solution.
    ~Vaas

  • IDOC Message type for FB01 transaction.

    Hi,
    I am going to get a file which I will pass through PI (XI) and bring into IDOC and post into SAP ECC 6.0.
    I just wanted to know which IDOC message type / basic type I should use for posting an FI document i.e. FB01 transaction.
    Rgds

    Hi,
    please read SAP notes 892103 and 551035.
    The correct IDOC type should be FIDCC1 / FIDCC2.
    Best regards,
    Andreas

  • Make synchronous the update process of the FB01 transaction.

    Hello, we are using the BTE 1080 that is inside of the FB01 transaction
    to execute a "call transaction" to the F-51. At this point we use the
    FI accounting document data (identified by: {BUKRS, BELNR, GJAHR})
    "created" by FB01 as an input to the F-51 "call transaction".
    Due to the update process in the FB01 is asynchronous (in update task)
    some times the update process delays longer than usual and the F-51 fails
    because is unable to find the FI accounting document data in the database.
    We could use the "wait" instruction to wait for a period of time until the
    "update task" write data to the database, but we don't know how much
    time it will take. We would like to know if it is possible to make synchronous
    the update process of the FB01 in order to warranty the existency of the
    data in the database that will be used by the next transaction F-51.
    Thank you and best regards,
    José.
    Edited by: Ivan Gonzalez on Sep 15, 2010 2:48 AM

    Hi,
    I don't think it's possible. You can do a simple select from BKPF and if the new document is already there then don't wait. Otherwise wait for reasonable time and check again.
    Cheers

  • Posting FI  documents to FB01 transaction

    Hi ,
    My program collects data from database tables and sends the final data to a file in SAP directory.
    Now my requirement is to post this data into FB01 transaction.
    When the program runs, the following entry is posted
           Dr   210001023        
           Cr   229001017.
    SO which FM do I need to use to post these two GL accounts?Is there any other method to do so.
    My file contains Vendor info and check details like no, date,amount...
    I appreciate quick response.
    Thanks in Advance.
    Swathi.

    Hi Rhea,
    Have a look at my program below. Its has no customer no's.but  dr and cr accounts.
    *---SELECTION-SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_zbukr LIKE payr-zbukr OBLIGATORY,      " Paying Company
                p_hbkid LIKE payr-hbkid OBLIGATORY,      " House Bank
                p_hktid LIKE payr-hktid OBLIGATORY,      " Account ID
                p_file LIKE rlgrap-filename OBLIGATORY.  " Output file name
    SELECT-OPTIONS: s_prundt FOR sy-datum OBLIGATORY NO-EXTENSION,
                                                         " Previuos run date
                    s_crundt FOR sy-datum NO-EXTENSION.
    " Current run date
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS      p_chkvd AS CHECKBOX DEFAULT 'X'.     " Update TVARV
    SELECTION-SCREEN COMMENT 04(79) text-014.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 01(64) text-013 FOR FIELD p_mon.
    PARAMETERS  p_mon(2) TYPE n DEFAULT '24'.   " Months considered
    " for abandoned period of uncashed checks
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END   OF BLOCK b1.
    *---INITIALIZATION
    INITIALIZATION.
    Initialize Unix File Path
      PERFORM initialize_filepath.
    *---AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
    Selection Screen Validations
      PERFORM validations.
    Populate current extraction date
      PERFORM get_current_date.
    *---START-OF-SELECTION
    START-OF-SELECTION.
    Get data from PAYR
      PERFORM get_payr.
    Get data from VF_KRED
      PERFORM ger_vf_kred.
    Process data
      PERFORM process_data.
    *---END-OF-SELECTION
    END-OF-SELECTION.
      IF f_data IS INITIAL.
    Transfer data to file
        PERFORM transfer_data.
    Write report
        PERFORM write_report.
      ENDIF.
    *---PAGE HEADING
    TOP-OF-PAGE.
    Write the Page Heading
      PERFORM page_heading.
    *&      Form  Initialize_filepath
          Initialize Unix File Path
    FORM initialize_filepath.
    Output File
      CONCATENATE '/int/'
                  sy-sysid
                  sy-mandt
                  '/out/'
                  INTO p_file.
    ENDFORM.                    " Initialize_filepath
    *&      Form  Validations
          Selection Screen Validations
    FORM validations.
    Local variable
      DATA: l_text(5).  " variable to hold 5 char data
    Validate paying company
      SELECT SINGLE bukrs INTO l_text FROM t001 WHERE bukrs = p_zbukr.
      IF sy-subrc <> 0.
        MESSAGE e003 WITH 'Invalid Paying Company'(002) p_zbukr.
      ENDIF.
    Validate House bank
      SELECT SINGLE hbkid INTO l_text FROM t012 WHERE bukrs = p_zbukr AND
                                                      hbkid = p_hbkid.
      IF sy-subrc <> 0.
        MESSAGE e003 WITH 'Invalid Hoouse Bank'(003) p_hbkid.
      ENDIF.
    Validate Account Id
      SELECT SINGLE hktid INTO l_text FROM t012k WHERE bukrs = p_zbukr AND
                                                       hbkid = p_hbkid AND
                                                       hktid = p_hktid.
      IF sy-subrc <> 0.
        MESSAGE e003 WITH 'Invalid Account ID'(004) p_hktid.
      ENDIF.
    Validate File name
      PERFORM validate_filename.
    ENDFORM.                    " Validations
    *&      Form  validate_filename
          Validate File name
    FORM validate_filename.
      DATA : l_len TYPE i.
      l_len = strlen( p_file ).
      IF p_file CA space.
        IF sy-fdpos < l_len.
          MESSAGE e003 WITH
            'File name should not contain spaces'(005).
        ENDIF.
      ENDIF.
      IF p_file CA '\'. "File name should not contain '\'.
        MESSAGE e003 WITH
          'File name should not contain \'(006).
      ENDIF.
      IF p_file0(1) = '/' AND p_file1(127) = space.
        MESSAGE e003 WITH
          'File name should not contain only /'(007).
      ENDIF.
    ENDFORM.                    " validate_filename
    *&      Form  get_payr
          Get data from PAYR
    FORM get_payr.
      SELECT zbukr
             hbkid
             hktid
             checf
             laufd
             lifnr
             vblnr
             zaldt
             waers
             rwbtr FROM payr INTO TABLE t_payr
             BYPASSING BUFFER
             WHERE zbukr = p_zbukr AND
                   hbkid = p_hbkid AND
                   hktid = p_hktid AND
                   zaldt IN s_crundt AND
                   bancd = '00000000' AND
                   voidr = '00'.
      IF sy-subrc = 0.
        SORT t_payr.
    Get the sending company code from REGUH
        SELECT laufd
               zbukr
               lifnr
               vblnr
               absbu FROM reguh INTO TABLE t_reguh
               BYPASSING BUFFER
               FOR ALL ENTRIES IN t_payr
               WHERE laufd = t_payr-laufd AND
                     xvorl = space AND
                     zbukr = t_payr-zbukr AND
                     lifnr = t_payr-lifnr AND
                     vblnr = t_payr-vblnr.
        IF sy-subrc = 0.
          SORT t_reguh.
        ENDIF.
      ELSE.
        MESSAGE i003 WITH 'No data exists for the given selection'(011).
        f_data = c_f.
        STOP.
      ENDIF.
    ENDFORM.                    " get_payr
    *&      Form  ger_VF_KRED
          Get data from VF_KRED
    FORM ger_vf_kred.
      IF NOT t_reguh[] IS INITIAL.
        SELECT lifnr
               bukrs
               name1
               ort01
               ort02
               pstlz
               regio
               stcd1
               stras
               qsrec
               adrnr
               FROM vf_kred INTO TABLE t_lfa1
               BYPASSING BUFFER
               FOR ALL ENTRIES IN t_reguh
               WHERE lifnr = t_reguh-lifnr AND
                     bukrs = t_reguh-absbu.
        IF sy-subrc = 0.
          SORT t_lfa1.
        ELSE.
          MESSAGE i003 WITH 'No vendor data exists'(012).
        ENDIF.
      ENDIF.
    ENDFORM.                    " ger_VF_KRED
    *&      Form  process_data
          Process data
    FORM process_data.
      LOOP AT t_payr.
    Get the sending company code from T_REGUH
        READ TABLE t_reguh WITH KEY laufd = t_payr-laufd
                                    zbukr = t_payr-zbukr
                                    lifnr = t_payr-lifnr
                                    vblnr = t_payr-vblnr
                                    BINARY SEARCH TRANSPORTING absbu.
        IF sy-subrc <> 0.
          CLEAR t_reguh-absbu.
        ENDIF.
        clear t_lfa1.
    Get the vendor data from T_LFA1
        READ TABLE t_lfa1 WITH KEY lifnr = t_payr-lifnr
                                   bukrs = t_reguh-absbu
                                   BINARY SEARCH.
        IF sy-subrc <> 0.
          CLEAR t_lfa1.
          SELECT SINGLE name1 stcd1 adrnr INTO
                       (t_lfa1-name1, t_lfa1-stcd1, t_lfa1-adrnr)
                       FROM lfa1 WHERE lifnr = t_payr-lifnr.
          IF sy-subrc <> 0.
            CLEAR t_lfa1.
          ENDIF.
        ENDIF.
        clear t_address.
        clear : t_lfa1-ort01,
                t_lfa1-ort02,
                t_lfa1-pstlz,
                t_lfa1-regio,
                t_lfa1-stras.
    Vendor Address
      select single city1
                    str_suppl1
                    post_code1
                    region
                    street
               from adrc into t_address
               where addrnumber = t_lfa1-adrnr.
      if sy-subrc = 0.
        move-corresponding t_address to t_lfa1.
      endif.
    Vendor Type
        CASE t_lfa1-qsrec.
          WHEN c_01.
            t_file-vend_type = c_s.
          WHEN c_07 OR c_20.
            t_file-vend_type = space.
    Clear Vendot TIN
            CLEAR t_lfa1-stcd1.
          WHEN OTHERS.
            t_file-vend_type = c_f.
        ENDCASE.
    Vendor TIN
        t_file-vend_tin = t_lfa1-stcd1.
    Vendor Name
        t_file-vend_name = t_lfa1-name1.
    Mail Address1
        t_file-addr1 = t_lfa1-stras.
    Mail Address2
        t_file-addr2 = t_lfa1-ort02.
    City
        t_file-city  = t_lfa1-ort01.
    State
        t_file-state = t_lfa1-regio.
    Zip Code
        t_file-zip   = t_lfa1-pstlz.
    Check ID
        t_file-check_id = c_ms08.
    Check Number
        t_file-check_no = t_payr-checf.
    Application Description
        t_file-appl_desc = c_app_desc.
    Check Date
        t_file-check_dt = t_payr-zaldt.
    *TPR 1944 : Begin   "Vinay
    Check Amount sign
       IF T_PAYR-RWBTR GE 0.
         T_FILE-CHECK_SIGN = C_POS.
       ELSE.
         T_FILE-CHECK_SIGN = C_NEG.
       ENDIF.
        IF t_payr-rwbtr GE 0.
          t_file-check_sign = c_neg.
        ELSE.
          t_file-check_sign = c_pos.
        ENDIF.
    *TPR 1944: End "Vinay
    Check Amount
        UNPACK t_payr-rwbtr TO t_file-check_amt1.
        t_file-check_amt2 = t_file-check_amt1.
        t_file-amt = t_payr-rwbtr.
        t_file-vend_no = t_payr-lifnr.
        t_file-waers = t_payr-waers.
        APPEND t_file.
        CLEAR t_file.
      ENDLOOP.
    ENDFORM.                    " process_data
    *&      Form  transfer_data
          Transfer data to file
    FORM transfer_data.
      DATA : l_pgm_id LIKE sy-repid,
             l_file_mode LIKE pppch-acces VALUE 'A'.
      l_pgm_id = sy-repid.
    Open data file
      CALL FUNCTION 'ZZ_OPEN_OUTBOUND_INTERFACE'
        CHANGING
          file_name                     = p_file
          pgm_id                        = l_pgm_id
          mode                          = l_file_mode
      FILE2                         =
      FILE3                         =
      FILE4                         =
      FILE5                         =
      FILE6                         =
      FILE7                         =
      FILE8                         =
      FILE9                         =
      FILE10                        =
      ABEND_ON_ERROR_IF_SPACE       =
       EXCEPTIONS
         error                         = 1
         OTHERS                        = 2
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Transfer data to the file
      LOOP AT t_file.
        TRANSFER t_file+0(1221) TO p_file.
        v_count = v_count + 1.
      ENDLOOP.
    Close data file
      CALL FUNCTION 'Z_CLOSE_INTERFACE_FILE'
           EXPORTING
                pgm_id = l_pgm_id.
    ENDFORM.                    " transfer_data
    *&      Form  get_current_date
          Populate current extraction date
    FORM get_current_date.
      DATA: l_date LIKE sy-datum,
           l_mon(2) TYPE n,
           l_months TYPE i.
      l_mon = sy-datum+4(2).
      l_mon = l_mon - 1.
      l_date = sy-datum.
      l_date+4(2) = l_mon.
      CALL FUNCTION 'SG_PS_GET_LAST_DAY_OF_MONTH'
           EXPORTING
                day_in            = l_date
           IMPORTING
                last_day_of_month = l_date
           EXCEPTIONS
                day_in_not_valid  = 1
                OTHERS            = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Calculate date with no.of months considered for abandoned period of
    uncashed checks
      l_months = p_mon * -1.
      CALL FUNCTION 'MONTH_PLUS_DETERMINE'
           EXPORTING
                months  = l_months
                olddate = l_date
           IMPORTING
                newdate = s_crundt-high.
    Begin of D02K921571
      CALL FUNCTION 'SG_PS_GET_LAST_DAY_OF_MONTH'
           EXPORTING
                day_in            = s_crundt-high
           IMPORTING
                last_day_of_month = s_crundt-high
           EXCEPTIONS
                day_in_not_valid  = 1
                OTHERS            = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    End of D02K921571
      REFRESH s_crundt.
      s_crundt-low = s_prundt-high + 1.
      s_crundt-sign = 'I'.
      s_crundt-option = 'BT'.
      APPEND s_crundt.
      CLEAR s_crundt.
    ENDFORM.                    " get_current_date
    *&      Form  write_report
          Write Report
    FORM write_report.
    Selection Report
      PERFORM select_report.
    Audit Report
      PERFORM audit_report.
    Detail Report
      PERFORM detail_report.
    ENDFORM.                    " write_report
    *&      Form  Page_heading
          page heading
    FORM page_heading.
      FORMAT COLOR COL_HEADING INTENSIFIED ON.
      ULINE.
      WRITE: /1 sy-vline,
              2  sy-repid,
              65 'ABBOTT LABORATORIES'(015) CENTERED,
                146 sy-datum,
                156 sy-vline.
      WRITE: /1 sy-vline,
              2   sy-sysid,
              5  '/',
              6  sy-mandt,
              59 'SAP to Tracker Outbound Interface'(016) CENTERED,
              148 sy-uzeit,
              156 sy-vline.
      WRITE: /1 sy-vline,
              2 sy-uname,
              (120) v_title CENTERED,
              145 'Page:'(017), sy-pagno,
              156 sy-vline.
      ULINE.
      IF v_title = 'Detail Report'(030).
        FORMAT COLOR COL_HEADING INTENSIFIED OFF.
        WRITE: /1 sy-vline,
                2 'Paying Company'(031),
                17 sy-vline,
                18 'House Bank'(032),
                29 sy-vline,
                30 'Account ID'(033),
                41 sy-vline,
                42 'Current Extract Range'(034),
                156 sy-vline.
        FORMAT COLOR OFF.
        WRITE:   /1 sy-vline,
                 2 p_zbukr CENTERED,
                 17 sy-vline,
                 18 p_hbkid CENTERED,
                 29 sy-vline,
                 30 p_hktid CENTERED,
                 41 sy-vline.
        LOOP AT s_crundt.
          WRITE: 44 s_crundt-low,
                 58 'to'(035),
                 62 s_crundt-high.
        ENDLOOP.
        WRITE: 156 sy-vline.
        ULINE.
        FORMAT COLOR COL_HEADING INTENSIFIED OFF.
        WRITE: /1 sy-vline,
                2 'Vendor Type'(036),
                14 sy-vline,
                15 'Vendor TIN'(037),
                26 sy-vline,
                27 'Vendor No.'(038),
                38 sy-vline,
                39 'Vendor Name'(039),
                82 sy-vline,
                83 'Vendor State'(040),
                96 sy-vline,
                97 'Check Number'(041),
                118 sy-vline,
                119 'Check Issue Date'(042),
                136 sy-vline,
                137 'Check Amount'(043),
                156 sy-vline.
        ULINE.
      ENDIF.
    ENDFORM.                    " Page_heading
    *&      Form  select_report
          selection-report
    FORM select_report.
      NEW-PAGE.
      v_title = 'Selection Report'(028).
      FORMAT COLOR COL_NORMAL INTENSIFIED ON.
      WRITE: /1 sy-vline,
              2 'Paying company code      :'(018),
              28 p_zbukr,
             156 sy-vline.
      FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
      WRITE: /1 sy-vline,
              2 'House bank               :'(019),
              28 p_hbkid,
             156 sy-vline.
      FORMAT COLOR COL_NORMAL INTENSIFIED ON.
      WRITE:/1 sy-vline,
             2 'Account ID               :'(020),
             28 p_hktid,
            156 sy-vline.
      FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
      WRITE:/1 sy-vline,
             2 'Output file name         :'(021),
             28 p_file,
            156 sy-vline.
      FORMAT COLOR COL_NORMAL INTENSIFIED ON.
      WRITE: /1 sy-vline,
              2 'Previous extraction date :'(022).
      LOOP AT s_prundt.
        WRITE: 28 s_prundt-low,
               42 'to'(035),
               46 s_prundt-high.
      ENDLOOP.
      WRITE: 156 sy-vline.
      FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
      WRITE: /1 sy-vline,
       2 'Current extraction date  :'(023).
      LOOP AT s_crundt.
        WRITE: 28 s_crundt-low,
               42 'to'(035),
               46 s_crundt-high.
      ENDLOOP.
      WRITE: 156 sy-vline.
      FORMAT COLOR COL_NORMAL INTENSIFIED ON.
      WRITE: /1 sy-vline,
       2 'Update TVARV             :'(024),
       28 p_chkvd,
      156 sy-vline.
      FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
      WRITE:   /1 sy-vline,
         2 text-025,
         67 p_mon,
          156 sy-vline.
      ULINE.
    ENDFORM.                    " select_report
    *&      Form  audit_report
          Audit Report
    FORM audit_report.
      NEW-PAGE.
      v_title = 'Audit Report'(029).
      FORMAT COLOR COL_NORMAL INTENSIFIED ON.
      WRITE: /1 sy-vline,
             2 'No. of records extracted          :'(026),
             36 v_count,
             156 sy-vline.
      FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
      WRITE: /1 sy-vline,
             2 'No. of records transferred to file:'(027),
             36 v_count,
             156 sy-vline.
      ULINE.
    ENDFORM.                    " audit_report
    *&      Form  detail_report
          Detail Report
    FORM detail_report.
      DATA : l_inten TYPE i,
             l_date LIKE sy-datum.
      NEW-PAGE.
      v_title = 'Detail Report'(030).
      LOOP AT t_file.
        l_inten = sy-tabix MOD 2.  " for alternate colors in report
        IF l_inten = 0.
          FORMAT COLOR COL_NORMAL INTENSIFIED ON.
        ELSE.
          FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
        ENDIF.
        l_date = t_file-check_dt.
        WRITE: /1 sy-vline,
                2 t_file-vend_type,
                14 sy-vline,
                15 t_file-vend_tin,
                26 sy-vline,
                27 t_file-vend_no,
                38 sy-vline,
                39 t_file-vend_name,
                82 sy-vline,
                83 t_file-state,
                96 sy-vline,
                97 t_file-check_no,
                118 sy-vline,
                119 l_date,
                136 sy-vline,
                137 t_file-amt CURRENCY t_file-waers,
                156 sy-vline.
      ENDLOOP.
      ULINE.
    ENDFORM.                    " detail_report

  • Set up automatically Currency/rate in FB01 transaction

    Hi friends,
    Let me know if someone can help me.
    I would like to set up automatically currency/rate field (BKPF-WAERS) in FB01 transaction, I mean, when the user entries on the transation automatically this field should be set up.
    Thanks
    Daniel Dorta

    Hello,
    Now you have three options for currency.
    Go to FB00
    "Default Document Currency" area
    Local Currency
    Last document currency used
    None
    If you select none - no default currency gets filled in FB00
    Note that this is only for currency.
    If you want to put an exchange rate, then it needs to be ENTERED MANUALLY. Not automatically picked up from OB08. There may be difference between OB08 and ENTERED MANUALLY, then the system issue a warning message.
    Hope this solves your issue.
    Regards,
    Ravi
    Edited by: Ravi Sankar Venna on May 19, 2009 4:32 PM

  • IDOC type for FB01 transaction

    Hi,
       Can anyone please let me know about the IDOC message type that I can use for posting a document
       in the FB01 transaction?
    Regards,
    Sudeep

    Hi Sudeep,
    These are the Idoc types.. for Posting transactions...
    ACLPAY01 Posting in acctng: InB invoice
    ACLREC01 Posting in acctng: Billing document
    ACPJOU01 Posting in acctng from Mat.s mgmt
    Go to we82(t-code) and enter the above idoc type then you will know the Message type,s for Posting..
    Regards,
    Prabhudas

  • Table Name for screen layout in FB01 transaction

    Hi frnds,
       I am using call transaction method to upload data from flat file to FB01 transaction. But depends on the accounting document types some fields are hidden. So I have to validate the screen active status. Eg : BSEG-WMWST is hidden based on the accounting document type.
       Can any one give me the table name where the details regarding the field status for accounting document transaction is maintained.
       Please help me.
    Thanks in Advance.
    Edited by: anand muthu on Aug 27, 2008 12:34 PM

    Anand
    Check following SPRO settings:
    SPRO -> IMG -> Financial Accounting -> Accounts Receivable and Accounts Payable -> Business Transactions -> Incoming Payments -> Incoming Payments Global Settings -> Carry Out and Check Document Settings -> Maintain Field Status Variants
    Thanks
    Amol Lohade

  • Working of  FB01 Transaction

    Dear Experts,
    I am a beginner. Kindly help me in understanding the following things
    1. When to use FB01 Transaction.
    2. Can it be used used to POST Invoices with reference to P.O.
    3. We have POSTING of invoices to FI when completing MIRO then why we are using FB01.
    4 Relevance of Tax Codes & Condition Types When Posting through FB01.
    Please also suggest me a Documents/PDF's/Sites that will help understand FI part of SAP.
    Thanks in Advance
    Ninan

    Hi Ninan,
    Trx.code FB01 is meant for posting FI document with doc.type JV,BR and similar to Trx.code F-02.
         2.you can post only FI doc. only and Posting with incoming invoice (F-43)amd parking invoice(FI) with F-63,FB64 and FB65.
        3.Don't confuse with MIGO/MIRO with FB01 and it is the Trx.code to post FI doc.
        4.No relevance.
    If you have specific query on the subject .please shoot.
    Regards,
    Nageswar Rao Jalla

  • Double postings after running transaction FAGLF101

    Hi All,
    After running transaction FAGLF101 some postings double (only in Ledger 0L, YQ seems to work)
    While running this transaction, we have to do it twice, with two different valuation areas.
    This resulted in double postings for few Adjustment accounts (for example adjustment account foreign payables, adjustment account domestic receivables, etc).
    I have checked the Ledgers 0L and YQ. Document splitting is not active.
    Can any one suggest me how to analyze further and solve this issue.
    Thanks in Advance,
    Deepthi.

    Hi All,
    Can anyone provide any suggestions to analyze this issue please.
    Thanks in Advance,
    Deepthi.

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

  • Bank Statement Postings Using FB01

    Bank statement processing transactions (i.e. FF_5, Feba_bank_statement, FEBP, etc.) call FB01 in order to post to the ledger.  To do this, we had to assign FB01 to users which is a control issue because the user could separately call FB01 and post non-bank account related entries directly to the ledger without someone approving the posting.  Is there a way to either post bank statements without calling FB01 or somehow use FB01 but not allow the users to call that transaction directly?  Thanks!

    SAP Note 497712 addresses this issue.

  • 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

  • What is exact BAPI for FB01 transaction......

    Hi,
       Currently i got requirement to upload transactional data into FB01 using BAPI. I used BAPI_acc_gl_posting_post but it applicable only for GLs, but i want to upload Vendors, Customers, assets, Materials.. Please tell me apropriate BAPI for the requirement. Its urgent.
    Thanks in advance...........
    Regards,
    Chinna.

    Thanks Atish....
        I have written code using BAPI_ACC_DOCUMENT_POST. But it is not posting and it is not generating Object Key...
    Please go thru the code and tell the solutions....
    Thanks in Advance......
    REPORT  zk_fi_fb01                     .
    Data: v_objkey(20) type c.
    Data: Docheader type BAPIACHE09.
    Data: ACCOUNTGL LIKE BAPIACGL09 occurs 0 with header line,
         ACCOUNTRECEIVABLE like BAPIACAR09,
          ACCOUNTPAYABLE like BAPIACAP09 occurs 0 with header line,
          CURRENCYAMOUNT like BAPIACCR09 occurs 0 with header line,
          RETURN like BAPIRET2 occurs 0.
    Data: obj_typ like BAPIACHE09-OBJ_TYPE,
          OBJ_KEY like BAPIACHE09-OBJ_KEY,
          OBJ_SYS like BAPIACHE09-OBJ_SYS.
    Data: gv_belnr type belnr_d.
    Data:file_Na type String.
    Data: lsys like TBDLS-LOGSYS.
    *START OF SELECTION
    START-OF-SELECTION.
    *CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
       nr_range_nr                  = '19'
       object                       = 'RF_BELEG' "'FIAA-BELNR'
      QUANTITY                      = '1'
      SUBOBJECT                     = '7777'
      TOYEAR                        = '2007'
      IGNORE_BUFFER                = ' '
    IMPORTING
      NUMBER                        = gv_belnr
    QUANTITY                      =
    RETURNCODE                    =
    *CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
    IMPORTING
      OWN_LOGICAL_SYSTEM                   = lsys
    EXCEPTIONS
      OWN_LOGICAL_SYSTEM_NOT_DEFINED       = 1
      OTHERS                               = 2
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    *concatenate gv_belnr '7777' '2007' into v_objkey.
    *Filling Document Header Details
    *Docheader-OBJ_TYPE = 'BEBD'.
    *Docheader-OBJ_key = V_objkey.
    *Docheader-OBJ_SYS = lsys.
    *docheader-BUS_ACT = 'RFBU'.
    Docheader-USERNAME = sy-uname.
    Docheader-COMP_CODE = '7777'.
    Docheader-DOC_DATE   = '20070725'.
    Docheader-PSTNG_DATE = '20070725'.
    Docheader-FISC_YEAR = '2007'.
    *DOCHEADER-OBJ_KEY_R = 'X'.
    Docheader-DOC_TYPE = 'KR'.
    *Item data for ACCOUNTGL
    ACCOUNTGL-ITEMNO_ACC = '0000000001'.
    ACCOUNTGL-GL_ACCOUNT = '0000000102'.         "99900
    ACCOUNTGL-DOC_TYPE   = 'KR'.
    ACCOUNTGL-COMP_CODE  = '7777'.
    ACCOUNTGL-FISC_YEAR  = '2007'.
    ACCOUNTGL-PSTNG_DATE = '20070725'.
    ACCOUNTGL-DE_CRE_IND = 'S'.
    append ACCOUNTGL.
    ACCOUNTGL-ITEMNO_ACC = '0000000002'.
    ACCOUNTGL-GL_ACCOUNT = '0000400002'.         "99900
    ACCOUNTGL-DOC_TYPE   = 'KR'.
    ACCOUNTGL-COMP_CODE  = '7777'.
    ACCOUNTGL-FISC_YEAR  = '2007'.
    ACCOUNTGL-PSTNG_DATE = '20070725'.
    ACCOUNTGL-DE_CRE_IND = 'H'.
    append ACCOUNTGL.
    *Account payable
    ACCOUNTPAYABLE-ITEMNO_ACC = '0000000001'.
    ACCOUNTPAYABLE-GL_ACCOUNT = '0000000102'.
    ACCOUNTPAYABLE-COMP_CODE  = '7777'.
    append ACCOUNTPAYABLE.
    ACCOUNTPAYABLE-ITEMNO_ACC = '0000000002'.
    ACCOUNTPAYABLE-GL_ACCOUNT = '0000400002'.
    ACCOUNTPAYABLE-COMP_CODE  = '7777'.
    append ACCOUNTPAYABLE.
    *Currency Amount
    CURRENCYAMOUNT-ITEMNO_ACC = '0000000001'.
    CURRENCYAMOUNT-CURRENCY_ISO = 'INR'.
    MOVE 1000 TO CURRENCYAMOUNT-AMT_DOCCUR.
    Append CURRENCYAMOUNT.
    CURRENCYAMOUNT-ITEMNO_ACC = '0000000002'.
    CURRENCYAMOUNT-CURRENCY_ISO = 'INR'.
    MOVE '1000-' to CURRENCYAMOUNT-AMT_DOCCUR.
    Append CURRENCYAMOUNT.
    clear CURRENCYAMOUNT.
    clear ACCOUNTGL.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
      EXPORTING
        documentheader          = Docheader
      CUSTOMERCPD             =
      CONTRACTHEADER          =
    IMPORTING
       OBJ_TYPE                =  obj_typ
       OBJ_KEY                 =  obj_key
       OBJ_SYS                 =  obj_sys
      tables
       ACCOUNTGL               = ACCOUNTGL
      ACCOUNTRECEIVABLE       =
      ACCOUNTPAYABLE          = ACCOUNTPAYABLE
      ACCOUNTTAX              =
        currencyamount          = CURRENCYAMOUNT
      CRITERIA                =
      VALUEFIELD              =
      EXTENSION1              =
        return                  = return.
    if sy-subrc = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = ' '.
    endif.
    if sy-subrc = 0.
    WRITE: / OBJ_KEY,
             OBJ_TYP,
             OBJ_SYS.
    endif.

Maybe you are looking for

  • Issues with BAM Connection in JDeveloper

    I have issue with Jdeveloper BAM connection. After BAM & OiD configuration, I can't test BAM connection in Jdeveloper. Jdev reports BAM configuration error.

  • Animated gif in a JButton which is a CellRenderer...

    I'm currently dealing with quite a huge thing... My cellRenderer is here to give a button aspect, this button has 3 kind of icons in fact : a cross when the line is ready to be treated a loading animation while in treatment... and here is the problem

  • Unexpected and random shutdowns

    I just got a new 27 iMac and it has be unexpectedly shuting down a fews times a day on me since I got it and I cant figure out why and nether can apple care, Please Help... copy from log 8/27/10 11:16:24 PM shutdown[259] SHUTDOWN_TIME: 1282976184 985

  • FF crashes on start up after install

    FF crashes on startup, no page displayed. Crashes in Safe mode. Un-install, re-install gives same result. Crash report is too obtuse for me to understand.

  • ISync and iCal in a loop?

    I have recently had to reset my sync history. I now seem to have a problem setting my K800i phone to sync. Having added the device, when I check the box for calendars, I get a dialogue box saying DO YOU WANT TO USE ICAL AS YOUR CALENDAR APPLICATION.