LSMW RFBIBL00

Hi
I'm using RFBIBL00 prg for doing FB01 postings.
I use structures BBKPF,BBSEG. Actually in the source file i have 50 line items.
All the 50 line items should get posted as one Document. Now what happens is for each source record..a separate document is created.
Pls help... how to achieve this

I have done a similar thing using RFBIBL00.
I upload transactions via an excel spreadsheet and submit these to RFBIBL00.
Have a look at the code below:
======================================================================
Report     : Purchase Card Interface                                *
======================================================================
Title      : General Ledger Posting Interface                       *
Author     : Andy Scott                                             *
Date       : 15/12/2006                                             *
Purpose    : To process an input file containing G/L information    *
              from the Purchase Cards and to create a batch session. *
              This batch session will then replicate the G/L Account *
              Posting Transaction F-02 (FB01).                       *
              An Excel spreadsheet from RBS is loaded and validated  *
              against. It is then reformatted and transferred into   *
              the sap/usr/interfaces directory on to the application *
              server. A batch session is then created via RFBIBL00   *
              and processed as normal via SM35.                      *
              There are various types of card transactions that can  *
              be loaded. These are described below:                  *
              Level 1 transaction without split                      *
                     - (one transaction line and one VAT line)       *
              Level 1 transaction with split                           *
                     - (multiple transaction lines and VAT lines)    *
              Level 2 transaction without split                    *
                     - (one transaction line and one VAT line)       *
              Level 2 transaction with split                           *
                     - (multiple transaction lines and VAT lines)    *
              Level 3 transaction without split                    *
                     - (multiple transaction lines and VAT lines)    *
              Level 3 transaction with split                           *
                     - (multiple transaction lines and VAT lines)    *
======================================================================
Amendment History:                                                   *
Date      User ID    Request Number   Brief Description             *
15/12/06   CSSCOTTA   DV1K914412       Initial development           *
======================================================================
*EJECT
REPORT  zfii001 MESSAGE-ID z_msszfii.
TABLES
TABLES:    csks,          " Cost Centre
           skb1,          " G/L Account Master
           aufk.          " Order Master (Internal Order)
Internal Table to hold original xls values i.e. Row, Column etc.
DATA: excel_itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
*EJECT
Internal table containing data loaded from the Excel spread sheet
TYPES: BEGIN OF purchase_card_record,
        bbkpf_ind(1)               TYPE c,  " Indicates BBKPF (header) record needed
        exp_financial(1)           TYPE c,  " FIN. Exported Financial
        trans_date(10)             TYPE c,  " FIN. Transaction Date
        mast_txn_id(10)            TYPE c,  " FIN. Mastercard Txn ID
        merchant_name(30)          TYPE c,  " MCH. Merchant Name
        db_cr_code(1)              TYPE c,  " FIN. Debit Credit Code
        cust_code(20)              TYPE c,  " FIN. Customer Code
        trans_amount(15)           TYPE c,  " FIN. Primary Trans Amount
        vat_amount(10)             TYPE c,  " FIN. VAT Amount
        tax_amount(10)             TYPE c,  " PUR. Tax Amount
        net_trans_amount(15)       TYPE c,  " FIN. Net Transaction Amount
        ext_item_amount(15)        TYPE c,  " PUR. Extended Item Amount
        cost_centre(10)            TYPE c,  " FIN. Cost Centre
        gl_code(10)                TYPE c,  " FIN. GL Code
        internal_order(12)         TYPE c,  " FIN. Internal Order
        account_name(30)           TYPE c,  " Account Name
        line_item_info(30)         TYPE c,  " PUR. Line Item Information
        expense_descr(30)          TYPE c,  " FIN. Expense Description
        vat_indicator(10)          TYPE c,  " FIN. VAT Eligibilty Ind.
        split_sequence(10)         TYPE c,  " FIN. Split Sequence
        country(10)                TYPE c,  " MCH. Country
        acc_address(30)            TYPE c,  " ACC. Address
        company_code(4)            TYPE c,  " Company Code
        split_ind(1)               TYPE c,  " Indicates Multiple Split Line Items
        vat_type(20)               TYPE c,  " Type of VAT i.e. Normal or Level 3
        posting_key(2)             TYPE c,  " Posting key i.e. 40, 50
        holding_gl_account(1)      TYPE c,  " Post To Holding Account
        error_message(50)          TYPE c,  " Error Message For Holding Account
        row(4)                     TYPE c,  " Excel Spreadsheet Row No
      END OF purchase_card_record.
DATA:
    purchase_card_wa               TYPE          purchase_card_record,
    purchase_card_tab              TYPE TABLE OF purchase_card_record,
    last_purchase_card_wa          TYPE          purchase_card_record.
Internal table containing possible errors within the Excel
spread sheet
TYPES: BEGIN OF error_type,
         row_num(6)                TYPE c,
         message(80)               TYPE c,
         line(200)                 TYPE c,
       END OF error_type.
DATA:  error_wa                    TYPE error_type,
       error_tab                   TYPE STANDARD TABLE OF error_type.
*EJECT
Document Record structures containing RFBIBL00 data
There will be one header BBKPF record with more than one
associated BBSEG record(s) for each transaction.
i.e. BGR00  ( File Session Header )
      |
     BBKPF
      |
        BBSEG ....
        BBSEG ....
          etc ....
     BBKPF
      |
        BBSEG ....
        BBSEG ....
          etc ....
DATA:
      bgr00_record                 LIKE bgr00,   " Batch Input Structure for Session Data
      bbkpf_record                 LIKE bbkpf,   " Document Header  (Batch Input Structure)
      bbseg_record                 LIKE bbseg.   " Document Segment (Batch Input Structure)
DATA: bbseg_tab                    TYPE STANDARD TABLE OF bbseg.
DATA: empty_bbseg_record           LIKE bbseg,
      empty_bgr00_record           LIKE bgr00,
      empty_bbkpf_record           LIKE bbkpf.
*EJECT
      WORK AREA                                                      *
DATA: wa_num_rows_loaded           TYPE i,
      wa_mod                       TYPE n,
      wa_num_of_invalid_rows       TYPE i,
      wa_num_of_transactions       TYPE i,
      wa_num_of_transaction_lines  TYPE i,
      wa_num_of_vat_lines          TYPE i,
      wa_error_count               TYPE i,
      wa_error_exists(1)           TYPE c,
      wa_company_code              LIKE skb1-bukrs,
      wa_gl_code(10)               TYPE n,
      wa_aufnr(12)                 TYPE n,
      wa_counter                   TYPE i,
      wa_output_file(75)           TYPE c,            " Output file name
      wa_period                    TYPE i,            " Payroll Period
      wa_first_time(1)             TYPE c,
      wa_error(200)                TYPE c,
      wa_unix_command(100)         TYPE c,
      wa_todays_date(8)            TYPE c,
      wa_wrbtr(16)                 TYPE c,
      wa_format(3)                 TYPE c.
      Batch Totals                                                   *
DATA:
      wa_total_amount              LIKE bbseg-wrbtr,
      wa_total_vat                 LIKE bbseg-wrbtr.
Internal table to hold UNIX command
DATA:  BEGIN OF unix_itab OCCURS 10,
         text(80),
       END OF unix_itab.
Define constants
CONSTANTS:
     c_filename(75)                VALUE 'Purchase_Cards',
     c_data_directory(75)          VALUE '/sapinterfaces/data/',
     c_archive_directory(75)       VALUE '/sapinterfaces/archive/',
     c_holding_gl_account(4)       VALUE '7888'.
Excel Spreadsheet Filename / Location
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN COMMENT /30(70) TEXT-002.
SELECTION-SCREEN COMMENT /40(40) TEXT-003.
PARAMETERS: pa_file     LIKE rlgrap-filename OBLIGATORY MEMORY ID m01.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_file.
  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      mask      = ',.XLS,.XLS'
      static    = 'X'
    CHANGING
      file_name = pa_file.
*EJECT
START-OF-SELECTION.
Upload the excel spreadsheet into the the internal table
  PERFORM upload_xls_spreadsheet.
Any Records To Process ??
  IF wa_num_rows_loaded > 0.
    PERFORM process_file.
  ELSE.
    CONCATENATE 'No Data Found In The Excel Spreadsheet ' pa_file
    INTO wa_error SEPARATED BY space.
    CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
      EXPORTING
        titel        = 'File Error'
        textline1    = wa_error
        textline2    = 'Does File exist ?  '
        start_column = 25
        start_row    = 6.
  ENDIF.
END-OF-SELECTION.
*EJECT
     Form  UPLOAD_FILE
      Subroutine to upload excel file
FORM upload_xls_spreadsheet .
Call function to upload spreadsheet into an internal table
  REFRESH : excel_itab,
            purchase_card_tab.
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      filename                = pa_file
      i_begin_col             = '1'
      i_begin_row             = '2'  "Do not require headings
      i_end_col               = '21'
      i_end_row               = '10000'
    TABLES
      intern                  = excel_itab
    EXCEPTIONS
      inconsistent_parameters = 1
      upload_ole              = 2
      OTHERS                  = 3.
  IF sy-subrc <> 0.
    CONCATENATE 'Problem Trying To Read File' pa_file
    INTO wa_error SEPARATED BY space.
    CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
      EXPORTING
        titel        = 'File Error'
        textline1    = wa_error
        textline2    = 'Does File exist ?  '
        start_column = 25
        start_row    = 6.
  ELSE.
    PERFORM convert_table.
  ENDIF.
ENDFORM.                    " upload_xls_spreadsheet
*EJECT
     Form  PROCESS_FILE
This form will control the flow of the program
FORM process_file.
  Validate the input file
  PERFORM validate_input_file.
  Insert Document Header Records
  PERFORM insert_bbkpf_indicators.
  Display any invalid rows from the imported file
  IF wa_error_count > 0.
    PERFORM display_invalid_records.
  ENDIF.
  Create the text batch file which will be submitted to RFBIBL00
  PERFORM create_batch_file.
  Submit File - Call RFBIBL00 ( Batch Input Program )
  PERFORM submit_rfbibl00.
  Move the text batch file into the SAP archive directory
  PERFORM archive_file.
  Display Batch Total Amounts
  PERFORM batch_totals.
ENDFORM. " process_file.
*EJECT
     Form  Validate_Input_File
FORM validate_input_file.
This subroutine will validate the input file against the Business
Rules that have been created by the E-Trading and Accounts teams.
  CLEAR wa_counter.
Only select transactions which have not previously been posted i.e. = 0
  LOOP AT purchase_card_tab INTO purchase_card_wa WHERE exp_financial = '0'.
    wa_counter = wa_counter + 1.
Need to determine the Company Code
    CASE: purchase_card_wa-acc_address.
      WHEN 'SALFORD CITY COUNCIL'.
        wa_company_code = '1000'.
      WHEN 'SALFORD COMM LEISURE'.
        wa_company_code = '8000'.
      WHEN 'NEW PROSPECT HOUSING LTD'.
        wa_company_code = 'NPHL'.
    ENDCASE.
*EJECT
                           Cost Centre
    IF purchase_card_wa-cost_centre IS NOT INITIAL.
    Valid Cost Centre ?
      CLEAR csks.
      SELECT SINGLE *
        FROM csks
       WHERE kokrs = wa_company_code
         AND kostl = purchase_card_wa-cost_centre
         AND datbi = '99991231'.
      IF sy-subrc <> 0.
        PERFORM create_error_message USING 'Invalid Cost Centre'
                                           purchase_card_wa-cost_centre
                                           purchase_card_wa-row
                                           'Y'.
      ELSE.
        IF csks-pkzkp = 'X'.
          PERFORM create_error_message USING 'CC Blocked For Posting'
             purchase_card_wa-cost_centre
             purchase_card_wa-row
             'Y'.
        ENDIF.
      ENDIF.
    Verify Correct Cost Centre for Company
      CASE: wa_company_code.
        WHEN '1000'.                                   " Salford City Council
          IF  purchase_card_wa-cost_centre(1) CA 'JT'.
            PERFORM create_error_message USING 'Must Be SCC Cost Centre'
                                               purchase_card_wa-cost_centre
                                               purchase_card_wa-row
                                               'Y'.
          ENDIF.
        WHEN '8000'.                                   " Salford Community Leisure
          IF  purchase_card_wa-cost_centre(1) <> 'T'.
            PERFORM create_error_message USING 'Must Be SCL Cost Centre'
                                               purchase_card_wa-cost_centre
                                               purchase_card_wa-row
                                               'Y'.
          ENDIF.
        WHEN 'NPHL'.
          IF  purchase_card_wa-cost_centre(1) <> 'J'.  " New Prospect Housing
            PERFORM create_error_message USING 'Must Be NPHL Cost Centre'
                                               purchase_card_wa-cost_centre
                                               purchase_card_wa-row
                                               'Y'.
          ENDIF.
      ENDCASE.
    ENDIF.
*EJECT
                         GL Account Code
  Insert leading zeroes
    wa_gl_code = purchase_card_wa-gl_code.
    IF purchase_card_wa-gl_code IS INITIAL.
      PERFORM create_error_message USING 'G/L Account Code Required'
                                         purchase_card_wa-cost_centre
                                         purchase_card_wa-row'Y'.
    ELSE.
    Valid GL Account ?
      CLEAR skb1.
      SELECT SINGLE *
        FROM skb1
       WHERE bukrs = wa_company_code
         AND saknr = wa_gl_code.
      IF sy-subrc <> 0.
        PERFORM create_error_message USING 'Invalid G/L Account Code'
                                           purchase_card_wa-gl_code
                                           purchase_card_wa-row
                                           'Y'.
      ELSE.
        IF skb1-xspeb = 'X'.
          PERFORM create_error_message USING 'G/L Blocked For Posting'
                                   purchase_card_wa-gl_code
                                   purchase_card_wa-row
                                   'Y'.
        ENDIF.
      ENDIF.
    ENDIF.
*EJECT
                          Internal Order No.
There can be two types of internal order numbers:
       1)  RIO - Real Internal Order in format A12345
       2)  SIO - Statistical Intrenal Order  in format 12345
    IF purchase_card_wa-internal_order IS NOT INITIAL.
  Insert leading zeroes
      wa_aufnr = purchase_card_wa-internal_order.
  Decide which format. Check first character
      IF  purchase_card_wa-internal_order(1) CA 'ABCDEFGHIJKLMNOPQRSTUZWXYZ'.
        wa_format = 'RIO'.
      ELSE.
        wa_format = 'SIO'.
      ENDIF.
    Valid Internal Order - RIO only?
      IF wa_format = 'RIO'.
        SELECT SINGLE *
          FROM aufk
         WHERE aufnr = wa_aufnr.
        IF sy-subrc <> 0.
          PERFORM create_error_message USING 'Invalid Internal Order'
                                             purchase_card_wa-internal_order
                                             purchase_card_wa-row
                                             'Y'.
        ENDIF.
        IF  purchase_card_wa-cost_centre IS NOT INITIAL
        OR  purchase_card_wa-gl_code(1) <> '7'.
          PERFORM create_error_message USING 'Incorrect GL/Int Ord Combo'
                                             purchase_card_wa-internal_order
                                             purchase_card_wa-row
                                             'Y'.
        ENDIF.
      ELSE.
        IF purchase_card_wa-cost_centre    IS INITIAL.
          PERFORM create_error_message USING 'Cost Centre Required'
                                             purchase_card_wa-row
                                             'Y'.
        ENDIF.
        IF purchase_card_wa-gl_code(1) NA '45'.
          PERFORM create_error_message USING 'Incorrect GL Code for CC'
                                             purchase_card_wa-internal_order
                                             purchase_card_wa-row
                                             'Y'.
        ENDIF.
      ENDIF.
    ELSE.
      IF purchase_card_wa-cost_centre IS INITIAL
      OR purchase_card_wa-gl_code(1) NA '45'.
        PERFORM create_error_message USING 'Incorrect GL Code for CC'
                                           purchase_card_wa-gl_code
                                           purchase_card_wa-row
                                           'Y'.
      ENDIF.
    ENDIF.
*EJECT
                            VAT Amount.
    IF  purchase_card_wa-vat_amount > 0
    AND purchase_card_wa-country   <> 'GBR'.
      PERFORM create_error_message USING 'VAT Must Be 0 For Non UK Trans'
                                         purchase_card_wa-gl_code
                                         purchase_card_wa-row
                                         'Y'.
    ENDIF.
Keep a count of how many rows in the spreadsheet are invalid
    IF wa_error_exists = 'Y'.
      wa_num_of_invalid_rows = wa_num_of_invalid_rows + 1.
    ENDIF.
    CLEAR: wa_error_exists,
           purchase_card_wa.
  ENDLOOP.
ENDFORM.                    " Validate_Input_File
*EJECT
     Form  Insert_BBKPF_indicators
FORM insert_bbkpf_indicators.
  DATA:  wa_temp_date(12)                 TYPE c.
This routine wil make sure that the BBKPF indicator in the table is
set to 'Y' when a new unique FIN. Mastercard Txn ID is reached. This
is so that the correct document header records (BBKPF) can be created
in the text file.
  DATA:   previous_mast_txn_id(10)            TYPE c,
          previous_split_sequence(10)         TYPE c.
First we need to delete transactions that may have been previoulsy
posted
N.B. This is done after the validation process in order to keep
     the row number in sync with the excel spreadsheet
  DELETE purchase_card_tab WHERE exp_financial = '1'.
Sort Data Into FIN. Mastercard Transaction No. and Split Sequence order
  SORT purchase_card_tab BY mast_txn_id split_sequence.
Only select transactions which have not previously been posted
  LOOP AT purchase_card_tab INTO purchase_card_wa WHERE exp_financial = '0'.
  Keep a note of where we will need to write a new Document Header
  record i.e. BBKPF. A new Document Header is needed for each unique
  Mastercard Transaction ID
    IF purchase_card_wa-mast_txn_id <> previous_mast_txn_id.
      purchase_card_wa-bbkpf_ind = 'Y'.
      previous_mast_txn_id       = purchase_card_wa-mast_txn_id.
    ENDIF.
  We also need to keep a note of the split sequence for multiple line
  items. Basically we will not post the lines where the split sequence
  held in the Split Sequence (e.g. Split 1 ) is duplicated.
    IF  purchase_card_wa-split_sequence = previous_split_sequence
    AND purchase_card_wa-mast_txn_id    = previous_mast_txn_id
    AND purchase_card_wa-split_sequence <> '0'.
      purchase_card_wa-split_ind = 'Y'.
    ENDIF.
    previous_split_sequence = purchase_card_wa-split_sequence.
Need to determine the Company Code
    CASE: purchase_card_wa-acc_address.
      WHEN 'SALFORD CITY COUNCIL'.
        wa_company_code = '1000'.
      WHEN 'SALFORD COMM LEISURE LTD'.
        wa_company_code = '8000'.
      WHEN 'NEW PROSPECT HOUSING LTD'.
        wa_company_code = 'NPHL'.
    ENDCASE.
    purchase_card_wa-company_code = wa_company_code.
Convert Transaction Date From DD/MM/YY   to DD.MM.YYYY
                           OR DD/MM/YYYY to DD.MM.YYYY
    IF STRLEN( purchase_card_wa-trans_date ) = 8.
      CONCATENATE purchase_card_wa-trans_date+0(2)
                  purchase_card_wa-trans_date+3(2)
                  sy-datum+0(2)
                  purchase_card_wa-trans_date+6(2)
          INTO wa_temp_date.
    ELSE.
      CONCATENATE purchase_card_wa-trans_date+0(2)
                  purchase_card_wa-trans_date+3(2)
                  purchase_card_wa-trans_date+6(4)
          INTO wa_temp_date.
    ENDIF.
    purchase_card_wa-trans_date = wa_temp_date.
Each transaction line will normally be subject to VAT unless the
transaction line is for a Level 3 with No Splits. If this is the case
only ONE VAT line per transaction will be needed. Where as the other
transactions will have a VAT line posted for each individual line item.
    IF purchase_card_wa-country = 'GBR'
    AND (   purchase_card_wa-vat_amount > '0.00'
         OR purchase_card_wa-tax_amount > '0.00' ).
      purchase_card_wa-vat_type = 'Normal'.
    ENDIF.
    IF ( purchase_card_wa-vat_indicator  = 'GBR001'
    AND  purchase_card_wa-split_sequence = '0'      ).
      purchase_card_wa-vat_type = 'Level 3 No Splits'.
    ENDIF.
Posting Key - 40 ( Debit = '-' )   50 ( Credit = '+' )
    IF purchase_card_wa-db_cr_code = '-'.
      purchase_card_wa-posting_key = '40'.
    ELSE.
      purchase_card_wa-posting_key = '50'.
    ENDIF.
Update Internal Table
    MODIFY purchase_card_tab FROM purchase_card_wa.
  ENDLOOP.
Now need to remove all the duplicated split sequences
i.e. Where split_ind = 'Y'.
  DELETE purchase_card_tab WHERE split_ind = 'Y'.
ENDFORM.                    " insert_bbkpf_indicators
*EJECT
     Form  display_invalid_records
FORM display_invalid_records.
  WRITE: ' Total No Of Rows Uploaded From Spreadsheet:',
         wa_num_rows_loaded,'   From File : '  ,pa_file.
  WRITE sy-uline.
  SKIP 1.
  FORMAT INTENSIFIED.
  SKIP 1.
  WRITE: /40 'I N V A L I D   D A T A '.
  SKIP 1.
  WRITE:  /3 'Row',
          15 'Error Message',
         100 'Original Data'.
  WRITE:  /2 '------',
          15 '----
         100 '----
  FORMAT INTENSIFIED OFF.
Display contents of all invalid records from the excel spreadsheet
  LOOP AT error_tab INTO error_wa.
    COMPUTE wa_mod = sy-tabix MOD 2.
  Use alternative colours
    IF wa_mod = 0.
      FORMAT COLOR COL_KEY.
    ELSE.
      FORMAT COLOR COL_HEADING.
    ENDIF.
    WRITE:  /3 error_wa-row_num,
            15 error_wa-message,
           100 error_wa-line.
  ENDLOOP.
  SKIP 1.
  FORMAT COLOR COL_NEGATIVE.
  WRITE: ' No. Of Invalid Rows ',         wa_num_of_invalid_rows,
         '       Total No. Errors In Spreadsheet ' ,wa_error_count.
  ULINE.
ENDFORM.                    "display_invalid_records
*EJECT
     Form  create_batch_file
This form will create the text file containing all of the transaction
lines data i.e. BBKPF,BBSEG etc. This text file is then passed to the
SAP standard program RFBIBL00 which will create a batch session.
FORM create_batch_file .
Calculate payroll period
  IF sy-datum+4(2) >= 4.
    wa_period = sy-datum+4(2) - 3.
  ELSE.
    wa_period = sy-datum+4(2) + 9.
  ENDIF.
Todays Date
  CONCATENATE sy-datum+6(2)
              sy-datum+4(2)
              sy-datum+0(4)
      INTO wa_todays_date.
Append Date to File Name i.e. filenameDDMMYYYY
  CONCATENATE c_data_directory
              c_filename
              wa_todays_date
      INTO wa_output_file.
Initialise Accounting Document Work Areas
  PERFORM initialise_structure USING 'BGR00'
                                     'EMPTY_BGR00_RECORD'.
  PERFORM initialise_structure USING 'BBKPF'
                                     'EMPTY_BBKPF_RECORD'.
  PERFORM initialise_structure USING 'BBSEG'
                                     'EMPTY_BBSEG_RECORD'.
Open t

Similar Messages

  • LSMW RFBIBL00 withholding tax base amount in local currency cannot be updated by manual

    Hi SAP Guru,
    When I try to upload FI docs by program RFBIBL00 in LSMW, the field BWITH-WT_QSSHH(withholding tax base amount in local currency) cannot be updated.
    (1) The LSMW structure is defined as bellow:
         BGR00<--------DOC_HEAD
              BBKPF<--------DOC_HEAD
                   BBSEG<--------DOC_ITEM
                        BWITH <--------DOC_WHTX
    And fields in structure BWITH are defined as bellow:
    Field Name
    Type
    Length
    Field Description
    STYPE
    C
    1
    Batch Input Interface Record Type
    WITHT
    C
    2
    Withholding tax type
    WT_WITHCD
    C
    2
    Withholding tax type
    WT_QSSHB
    C
    21
    W/tax base amount in document currency (batch input
    field)
    WT_QSSHH
    C
    21
    W/tax base amount in Local currency (batch input
    field)
    (2) When I run LSMW, the doc can be posted successfully. All the information can be updated as the data I upload. Only the field WT_QSSHH is calculated by system automatically according to the current foreign exchange rate.
    (3) When I try to post this doc by manual(F-02), the field WT_QSSHH is not editable.
    How can I change the field WT_QSSHH into editable and update this field in LSMW RFBIBL00.
    Thank you very much!
    Eric

    Hi Nikitha,
    I tried posting an invoice in currency other then co. code currency, but the WT amount is getting calculated perfectly.
    also checked vendor with foreign curr recon account. the WT is working for that also
    Can you please share the screen shot of the transaction where after changing currency you are not getting the values picked up for WT
    May be i have not understood your questions
    Regards
    Pragya

  • LSMW RFBIBL00 using only one file

    Hello everyone,
    I am creating an LSMW for post documents. My input file is so far given by an legacy system.
    I have one file, which contains the accounting transactions.
    One accounting transaction is distributed over more than one line in my input file. So you have one debtor account and many contra-entries.
    My problem is, that every line has header data (debtor and contra-entry), so I have no idea how to tell my LSMW that there has to be a new line item instead of a new document.
    I hope anybody can help
    Best regards
    Patrick

    Hi Patrick,
    In LSMW RFBIBL00, where you want to upload transaction data, you generally have two files.. One for header data and the other for Line item data.
    In the Header Data, there is a field called link, say for example it is (1) and it will have other data like Date, Posting key, Currency etc.. (BKPF data)
    In the Line item file, also the field Link will have (1) and in fact this link will dictate when a new document is to be posted.. say for example this particular document has 5 line items to be posted. Then all the line items will have the same link (1)
    and the debit and credits should match to Zero. When this matched a document is posted..Then again the second line in header file will have link (2) and again the line item  file will have multiple line items all having link (2) so the second document will get posted.
    In short, system will pick up the link No. from the header file and look for all line items in line item file and match the debits and credit to Zero to post a document, the moment it finds a new Link No., it will post a new Document No.
    Regards,
    SAPFICO

  • Problem with LSMW - RFBIBL00 "FI_INVOICES: No terminations have been found"

    Hi experts,
    Hope you can help me.
    I'm trying to load open invoices into SAP from a legacy system using LSMW. I defined all the structures and finished all the step but didn't load any data. I looked at the converted data and everything looks Ok.
    This is the log:
    FB018                    File P2P_GRANITE_VENDORS_FI_INVOICES.lsmw.conv is being checked
    FB012                    Session 1 : Special character for 'empty field' is /
    FB019                    Session 1 session name FI_INVOICES : No terminations have been found
    Following further information about the LSMW:
    Object: 0100
    Method: 0000
    Program: RFBIBL00
    Program Type: D
    Source structures (linked by CNT field)
    INV_HEAD:
    Company Code (BUKRS), Fiscal Year (GJAHR), Document Type (BLART), Posting Date (BUDAT), Document Date (BLDAT), Document Header Text (BKTXT), Reference Document Number (XBLNR), Currency Key (WAERS), Count (CNT)
    INV_ITEM
    Posting Key for the Next Line Item (NEWBS), Account or Matchcode for the Next Line Item (NEWKO), Amount in document currency (WRBTR) , Baseline Date (ZFBDT), Cash Discount Days 1 (ZBD1T), Item Text (SGTXT), Count (CNT)
    Document Type ZC or KR
    Posting Key 31 and 40
    Thanks in advance,
    Mairo.

    It looks everything fine for me.. what is ther exact error message are you getting..
    However also go through my book on LSMW, it may help you.
    http://www.4shared.com/document/wkl5vHpv/LSMW_SATISH.html
    Satish

  • LSMW - RFBIBL00 background ko

    HEllo !
    i met problem by loading data by LSMW direct-input in background.
    i use the standard program /SAPDMC/SAP_LSMW_INTERFACE.
    and the last step (running RFBIBL00) fails in background mode only (it works well on foreground).
    by SM37 i got the error message E078 (BD class) : "data does not match job definition".
    i think that RFBIBL00 program is in the cause...
    did anyone already have this problem?
    thanks
    dev

    The message long text:
    NA BD078
    Text
    Job &: Data does not match the job definition; job terminated
    Diagnosis
    You wanted to start a direct input job. The system has found that the data does
    not match the data from the job definition.
    System Response
    The system terminated the job.
    Procedure
    Start the job from the Manage Data Transfers (Direct input) screen, where you can
    also schedule the job periodically.
    Proceed
    Rob

  • LSMW /RFBIBL00 CO-PA trouble

    Hello All,
    I try to load P&L account into FI-GL using LSMW and RFBIBL00.
    For some accounts, I have to load CO-PA charcteristics values.
    I did it into the mapping and relation structure, but the system doesn't write it. When I do the transaction FB01, I see there is on field to call CO-PAs screen : DKACB-FMORE.
    How can i add it or what i have to do on my lsmw transaction to obtain the same result ?
    Thanks for your answer,
    Best Regards
    Philippe

    I'm trying to do the same thing. My COPABBSEG structure does have all the COPA characteristics, but the COPA fields are not filled.
    When I execute the batch input, there's an indicator field on the screen XERGO, "Detail screen for profitability segment". I cannot find this field in the BSEG table. Could that be the problem ?
    Kind regards,
    Rianne

  • LSMW  + RFBIBL00 + PA

    Hello All,
    I try to load P&L account using LSMW  with program RFBIBL00.
    I need to load PA charcteristics values for some accounts.
    - DOCUMENTATION: With effect from Release 3.0D, you can also enter the characteristics from profitability analysis in the BBSEG structure. Program RFBIBL00 will then automatically generate a batch input session for FB01 with account assignment to the profitability segment (including assigning the profitability segment number, deriving characteristics and all validations that also take place during online posting).
    I filled the relation structure BBSEG with the fields I need, but the BI generated doesn't contain the dynpros and fields to load the PA characteristics.
    I need to fill a flag to activate this? or something like that?? if this program is prepared to load PA, why it doesn't work? what i'm doing wrong?
    Thanks for your answer,
    Best Regards
    Patricia

    Hi Max,
    Yes, I have filled my PA characteristics
    - Field Mapping --> BBSEG structure
    RKE_VTWEG
    RKE_WWFAM
    and if I debugg the program RFBIBL00 (when conversion) I can see the corresponding moves for this elements, but the program doesn't generate the dynpros to load the PA characteristics and I dont't know if I need a SAP Note or fill a checkbox of flag or something that indicates that I need those characteristics.
    Thanks.
    Patricia

  • In the LSMW RFBIBL00 Background error ?

    Hi Friends,
    I am using rfbibl00 to create batch input session for FI data upload .
    My poblem is Session can b pricessd successflly in forground . But when I submit it to back ground ,
    it goes into error .
    ZGL_BALANCE_HEADER G/L Balance Header
    BLDAT  C(008) Document Date
    BUDAT C(008) Posting Date
    BLART C(002) Document Type
    BUKRS C(004) Company Code
    WAERS C(005) Currency
    MONAT C(002) Posting Period
    WWERT C(008) Date (batch input)
    XBLNR C(016) Reference Document number
    BKTXT C(025) Document Header Text
    KURSF C(010) Exchange rate
    ZGL_BALANCE_ITEM G/L Balance Load Item
    BUKRS C(004) Company Code for the Next Line Item
    NEWBK C(004) New company code
    NEWBS C(002) Posting Key for the Next Line Item
    DUMMYX C(010) General Ledger Account
    MWSKZ C(002) Sales Tax Code
    TXJCD C(015) Tax Jurisdiction
    WRBTR C(016) Amount in document currency (batch input field)
    KOSTL C(010) Cost Center
    AUFNR C(012) Order Number
    PROJK C(008) No longer use this field (use PROJK)
    PRCTR C(010) Profit Center
    NPLNR C(012) Network Number for Account Assignment
    VBEL2 C(010) Sales Document
    EBELN C(010) Purchasing Document Number
    MENGE C(017) Quantity (Batch Input Field)
    PERNR C(008) Personnel Number (Batch Input Field)
    MATNR C(018) Material Number
    ZUONR C(018) Assignment Number
    SGTXT C(050) Item Text
    In the above structure have BUKRS and NEWBK is the key field.
    But it is working in foreground .
    Whenever it is in Background the below message are getting .
    Error message : ---
    Session ZGL_BALANCE_ is being processed by user NAGPATIL in mode N on server ptg-mrbsapdev                              0
    Field RF05A-NEWBK. does not exist in the screen SAPMF05A 0100     FB01     1
    Transaction error     FB01     1
    Processing statistics                0
             1 transactions read       0
             0 transactions processed  0
             1 transactions with errors       0
             0 transactions deleted                 0
    Batch input processing ended                0
    Thanking you.
    Subash

    Hello,
    The issue seems to be that your vendor reconciliation account is not tax
    relevant while the invoice comes with a tax code. You can check the G/L
    account master data and make sure there is an entry in the tax category,
    master data and make sure there is an entry in the tax category.
    If you sometimes don't want to enter a tax code for this vendor you
    can set the flag "Posting without tax allowed" in addition.
    Try the following to analyze this error:
    - set the flag for "Create BDC session" in tx OBCE
    - check the settings in OBCB (see SAP note 150120)
    - process the error idoc again
    - goto tx SM35 and process the batch input session from the idoc (IV...)
      in the foreground step by step until you get the message that this
      field for the discount base is not there
    - then, check if the vendor account is the right one
    - check if the field status of this vendor's reconciliation account
      is correct. In the section payment the payment terms must be ready for
      input (optional field).
    Regards,
    David

  • Standard LSMW for open vendor items with Withholding tax

    Hi All,
    I am searching the direct input LSMW which is having the Withholdig tax. There is a direct input program in LSMW ( RFBIBL00) but it is not uploaded the withholding tax for open vendor and open customer items.
    If anybody know which LSMW is recammanded or anthing related to BAPI or IDOC for this requirements.
    Dhiraj.

    Hi
    If you need to upload the WT tax you have to fill the structure BWITH of std BI RFBIBL00, so your LSMW project should create a file like this:
    ---> Session data
    BGR00
    ---> Document data
    BBKPF (Header data
    BBSEG (Vendor or customer item)
    BWITH (Withholding tax data)
    BBSEG (G/L item)
    Max

  • How to use std object RFBIBL00

    Dear All,
    For uploading open item of vendor and customer std lsmw RFBIBL00 is available.
    I know how to do recording in lsmw for new object but any one can help how to use std lsmw available in SAP. For eg.RFBIBL00
    Regards,
    Bhadresh

    You'll find that the RFBIBL00 program, suprisingly, has extensive documentation attached - or you could try
    http://help.sap.com/saphelp_45b/helpdata/en/35/a47e63763e0392e10000009b38f9b7/content.htm
    or the print documentation at
    help.sap.com/printdocu/core/Print46c/en/data/pdf/CAGTFADM/CAGTFADM-FI.pdf
    cheers
    Jonathan

  • F-43 and F-22 tcode will work by using the program RFBIBL00 in LSMW?

    Hi Guys,
    Currently we have the requirement like we need to post the vendor open items and customer open items by using the tcodes
    F-43 and F-22.
    Is it possible to create the records by using the program RFBIBL00 in LSMW?
    Thanks in advance
    SRS Reddy

    Dear Reddy,
    FB01 is the generic and classic transaction to post an FI document. There is no difference at all with F-43 and F-22 that are only linked to a specific document type and posting key.
    I hope this helps You.
    mauri

  • LSMW and RFBIBL00

    Hi,
    I am using RFBIBL00 in LSMW to upload AP/AR open items. When I run the job in the foreground, I am getting an error as the second line item is not filled (empty). I think that the structure of my upload file is not correct. Do you have sample upload file?
    The settings are:
    - Object: 0100
    - Method: 0000
    - Program name: RFBIBL00
    - Program Type: D
    The upload file (XLS) has two rows. The following columns are filled.
    <b>Row 1:</b>
    Document type:     KR
    Posting key:     31
    Account: 125263
    Company: code 8000
    Reference: lsmw1
    Currency key: EUR
    Amount: 100
    Document date:     19102007
    Posting date: 19102007
    Header text:     test lsmw
    Profitcenter:     
    Item text:     test lsmw
    <b>Row 2:</b>
    Posting key:     40
    Account: 41003000
    Company code: 8000
    Amount: 100
    Header text:     test lsmw
    Cost center: 310032     
    Profit center: Dummy
    Item text:     test lsmw
    Kind regards,
    Kenan

    Hi guys,
    I solved my problem
    The solution is:
    1) Create two structures for open item; STRUCT_HEADER and STRUCT_ITEM (lower level).
    2) Define the source fields. Create a dummy source key field with the same name (e.g. ITEM_NO) in both structures for linking header and items.
    3)  Maintain structure relations. Link BGR00 and BBKPF to STRUCT_HEADER and link BBSEG to STRUCT_ITEM.
    4) Maintain field mapping for all source fields except for key field (e.g. ITEM_NO)
    5) Specify two (table, separator tabular) source files. One for header and one for items.
    6) Prepare the source files. Define the key field (e.g. ITEM_NO) in both files. Use same key value (e.g. ITEM_NO = 001) in the "header.txt" for the related items in the source file "items.txt". So, you can have an open item with 1 header and 100 line items.
    Good luck!
    Kenan

  • How to use RFBIBL00 as direct input in LSMW

    Can any one Please help how to use RFBIBL00 as direct input in LSMW ? How should be structure Same level or subordinate level as I will be having single text file ?
    I have around 15 fields with me
    BKPF
    STYPE     C     1
    BLDAT     C     10
    BLART     C     2
    BUKRS     C     4
    BUDAT     C     10
    XBLNR     C     10
    WAERS     C     3
    XPRFG     C     1
    XMWST     C     1
    BSEG
    STYPE     C     1
    NEWBS     C     2
    DMBTR     C     10
    KOSTL     C     10
    SGTXT     C     10
    PRCTR     C     10
    NEWKO     C     10
    MWSKZ     C     2
    Thanks and Regards
    Guru

    Hi,
    look testabap RFBIBLT0, which creates testfile
    A.

  • Using Program RFBIBL00 ( LSMW)

    Hi ALL,
      I am trying to create journal upload in the transaction FB01. I am using LSMW to upload the data.
    while uploading i have Header data and Item data.
    <b>I am using standard batch input method and program is RFBIBL00.</b>
    <b>Header data conists of fields.
    1. Document date 2. Posting date 3. Type  4. Company code
    Item data consists of fields.
    1. Posting key 2. account  3. amount   4. taxcode   5. costcenter</b>
    <b>So whether i have two prepare two excel files.?</b>
    so how to link in LSMW with excel files.
    can anybody explain step by step procedure to create this journal upload using LSMW thru program RFBIBL00.
    Points will be awarded.
    Regards,
    vinoth.

    hi zarina,
           please send me the documents to my mail also
    ([email protected]),, waiting for your mail
    thanks in advance ,,
    krishna
    Message was edited by:
            Krishna Ramasamy

  • LSMW with RFBIBL00

    Hello. I had to create a lsmw for importin invoices with RFBIBL00. The problem is that when i run the lsmw there is an eror in sm35 that it says: COBL-GSBER there is no entry in the field for program SAPLKACB screen 0002. In there it should probably just be the BDC_OKCODE. How can i put the ok code so that the error doesnt apear anymore?
    Thank you,
    Cristian.

    Hi Cristian,
    guess just check with ur mapping step either the value which ur facing might be not mapped correctly. and also check the step display convert data ,
    the values of flat file r populating correctly r not , that u come to know in the display convert data.
    if every thing is ok , just have a check with few records and run it in Foreground.
    sorry Cristian no idea,
    i had face the same problem, in my case lsmw is running successfuly in foreground and error mode coming to background it showing error when i check the log the screen which i struck , its not related to that recording.
    so once again sorry ,
    y cant u try for Recording method, hope u can get success in this method.
    Thanks
    Naveen khan
    Message was edited by:
            Pattan Naveen

Maybe you are looking for

  • Where to download and how to install Oracle AS Portal ?

    Greetings, I'm using portal servers from BEA, IBM and JBoss since several years. I bought a book on Oracle AS Portal which showed me a couple of interesting things I wanted to look at. Surprinsingly enough, this book doesn't start as normally, with h

  • Calling a Procedure in BIP 10.1.3.2

    Hi All, I am creating a report, which first calls a procedure to populate the custom table and then it uses the custom table to create the report. My Question to you all is, is there a way to call a procedure first and then call the table from BIP. T

  • Passing coordinate arguments to screencapture

    Hello, I need to be able to pass screen coordinate info to /usr/sbin/screencapture, and the man page does not say anything about this. There used to be (or maybe there still is) a UNIX command (I think it was scrsave) that would do that. Does anyone

  • I maintain a website on which the main (index) page is frequently updated.

    I maintain a website on which the main (index) page is frequently updated. In order to make sure that the latest version is displayed, I use the following in the Head of the page: <META HTTP-EQUIV="Pragma" CONTENT="no-cache" /> This works on all web

  • Labview run time 8.5

    Where can I download labview run time 8.5?