VAT code on vendor

Is it possible to restrict the VAT code(s) on a vendor account?  For instance invoices on vendor master 999 should only be posted with VAT code M1 or eventually with the M* range of VAT codes.
We talk about a larger number of vendors otherwise it was an option to create a GL-account per vendor.  So this proposal has been refused.

Dear:
      Please check SAPMF02K User exits: Vendor master data with ABAPER help.
      Regards

Similar Messages

  • F-28 - Incoming payments with residual items - Vat code

    Dear all,
    I need to define a process in which the user can create a residual item for a downpayment on an incoming payment from a customer, and the system automatically creates a new document with the residual posting.
    I have done the customizing for the "Residual Item Posting in Invoice Currency" and defined a Type of document for the residual item. The problem is that the standard procedure puts the vat code also in the payment document and in the residual item document on the customer position... and this is not correct.
    Someone can help me?
    Thank you
    Regards
    Marco.

    Yes, this is due to settings on GL Account for reconciliation account. Please fo t o FS00 provide reconciliation account nr (if down payment) from Sp. GL an d not from Vendor / Customer master and change settings on second tab > there is mantioned that posting without tax are not allowed. (input tax / only output tax only).
    Due to GL master data he post always with the VAT. Addtionally if You will have a discount system will correct the VAT line with discount during clearing all of that becasue of GL master data.
    Regards
    Tadeusz

  • Poland VAT CODE Configuration

    Hi Gurus,
    We have a requirement for VAT code creation for Poland for below scenario.
    For vendor Invoice value - 123/-
    1. One value with 23 percent rate- 50 and corresponding to it 11,5 amount for VAT- together 61,5.
    2. Second value on 61.5 which should have tax rate free of VAT.
    Please share your inputs to meet the requirement
    Thanks in advance

    Hello,
    I created a tax code as below, tax amount gets posted correctly but I should get base amount 50/- instead of 100
    Highly appreciated for any inputs.
    Thanks

  • VAT Registration Number & VAT code & VAT rate

    Hello Gurus,
    I am trying to find out,
    1) How can I retrieve (either via a table lookup or function module) a list of VAT codes & VAT rates by   
        Legal Entity and Country?
    2) How can I retrieve (either via a table lookup or function module) the VAT Registration number by Legal
        Entity/Country/RE?
    Any table or function module which can provide me the data is fine.
    Please help.
    Thanks in advance.

    Hi Kumail,
    1. List VAT Codes : use table T007A
        VAT Rates : You can use table KONP, or use function module GET_TAX_PERCENTAGE
    2. VAT Registration Number is usually maintained in Tax Number 1 in Vendor Master, so you can found it in table LFA1-STCD1

  • Vat code change, EDI file number finding and EDI file structure chage?

    Hello Gurus
    Our client has a plant in Europe, which has a largest supplier. We process electronic invoices to the vendor through a provider OB10 ( private company - invoicing provider ).
    In the transfer of the electronic data to the invoice posting, a VAT code is added to the details, that appears to be pulling from a certain Table in the system.
    I want to know from which tables this field has pulled up to the Invoice?
    In continuation of the process ...I have come across an issue on EDI file structure change. I have provided with the the Idoc numbers of above invoices, from the idoc numbers i need to find out the EDI file number. But when i went to WE02, WE05 with those idoc numbers i couldn't find the EDI file number( Interchange file number ref).
    How can i find the EDI file number and i have to suggest the EDI team for changing the file structure in regard to the VAT code updating according to the Plants abroad function.
    What are the things i need to suggest them exactly in regard to this?
    Please reply me ASAP...
    Thanks
    Mallik

    The table for tax code is T076M - maintainable using T code OBCD.  For EDI file number, execute T Code WE02 - enter IDoc number and execute (F8). In the right window pane, choose select layout -> change layout and pick up the field Interchange file reference. Guess this is what you are looking for.
    OR
    Go to transaction WE02 or WE05 enter Idoc number and choose execute. When Idoc data is displayed double click on Control Record in left pane. Choose Details tab. Interchangable file under References.
    You can also refer the entries in table EDIDC.
    Reference to interchange file:
    This field contains the reference number of the interchange file in which the EDI message was transmitted.

  • Default VAT code in the PO Releases.

    Hi All,
    Is there a way to give a default VAT code in the Blanket Purchase Agreements,so that the VAT code is come automatically when we release the items.
    Otherwise we need to enter a VAT code for each and every item.
    Thanks,
    Migara.

    Hi
    Tcode: ME11
    enter the vendor, purachse organisation and plant.
    in the next screen enter the description of info record, material group, order unit and sort  term (helpful in search).
    In the next screen enter details like planned delivery time, purchase group, standard qty, tax code and net price and save.
    regards
    girish
    Edited by: Gbettaiah on Aug 3, 2011 8:37 AM

  • Vat Code Determination

    Hi,
    I've looked at past threads relating to the config of vat code determination and it seems that our current config setting for the tax calculation is set up correctly. Currently the config is defaulted to 'Tax Calculation occurs in backend' .
    However on creation of the PO in SRM the vat code has to be manually set in the PO instead of defaulting automitically say for example if a foreign vendor is selected.
    I've tested creating a PO manually in the R3 backend and there the tax code is automatically set.
    Any ideas on why it is not doing this in SRM?Is there anything else i should look for?

    Hi Rozah,
    To award points, go to your user profile and select the relevant thread from the list of Recent Messages. Click on the hyperlinked title. You will be directed to a page that shows all the responses to your original post.
    Click on the star icon next to the response for which you wish to reward points. A popup window will appear. Use the radio buttons to mark a response "Solved My Problem," "Very Helpful," or "Helpful."
    You are allowed to grant only one 10 point "Solved My Problem" award and one six point "Very Helpful" award, so evaluate all the replies carefully. You may designate an unlimited number of two point "Helpful" awards.
    Kind regards,
    Yann

  • Issue with VAT ID in Vendor Master

    Hi All,
    While creating Vendor Master ,system is not accepting VAT ID:
    Error message is "VAT registration number contains invalid characters"
    Input VAT ID :GB0109413534
    Vendor Country : GB (United Kingdom)
    I checked country settings also:
    VAT registration no. 14      1   Maximum value length, without gaps
    I am inputting 12 characters only ,without any gaps.
    Please guide .
    Regards,
    Payal Saxena

    Dear Payal,
    This GB tax code is not valid. Please check the following website:
    http://ec.europa.eu/taxation_customs/vies/
    if you still need to save the vendor with this Vat reg number, you should unflag the GB settings in order to not check the validity of the vat registration numbers.
    or vendor, can provide the correct vat registration number.
    I hope it helps
    Silvia

  • Formatted Search on VAT Code

    Hi,
    I am trying to set a formatted search on the VAT Code field on Purchase Order; so that whenever the user selects Vendor ID SVFG00009; it will fill in VAT Code automatically as 'P22'.
    Can someone look into the below code?
    SELECT
    CASE
         WHEN $[OPOR.CardCode] = 'SVFG00009' THEN 'P22'
         ELSE (SELECT T1.VatGroupPU
                        FROM POR1 T0 JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
                             WHERE ItemCode = $[$38.1.0]
    END
    Thanks.

    Hi,
    You don't need to set up a formatted search, you can default the BP itself to use a specific VAT Code. Go to BP Accounting tab -> Tax tab and select the code you want to use.
    Regards,
    Nat

  • Miro - mass change of vat code in line items

    Hello,
    I'm having the following problem, when posting with T-Code MIRO, and having several line items with VAT codes from the PO, when I try to chage it in the basic data screen, the line items do not change to the vat code of the basic data... this does not happen in all situations, only in invoices refering to utilities.
    Does any one knows how to solve this?
    Further information: the system is SAP Retail, ECC6.0.
    Thank you in advance,
    Regards

    Hi Govardhan,
    Pl correct me if i am wrong....EINA-RELIF field is to check and uncheck for regular vendor...It will not change the vendor ID...
    EINA-LIFNR...is the field to change vendor no.., but i can not see this field name is not there in the table...
    Still i think that we can not change the vendor id's once it is created for Info record...
    Pl correct me if am wrong.
    Uts

  • I need a code for VENDOR AGEING REPORT

    plz help me i am in urgent need of source code of
    VENDOR AGEING REPORT.
    if any body help me regarding this above report i will be
    great ful to him/her.
    bcoz deadline is today.
    i  need ur urgent help, i treid very much but i failed,
    so hope help from anybody there.

    REPORT  zvender_os NO STANDARD PAGE  HEADING
                                  LINE-SIZE 132
                                  LINE-COUNT 65.
    Tables
    TABLES: bsik,          "open items (A/C: Secondary Index for Customers)
            lfa1,          "customer master
            lfb1,
            rf140,        "temp stru (Work Fields for Corrence(SAPF140*))
            bsak,          "cleared items (A/c Secnd Index for Cust(Clrms))
            skat.
    constants and variables
    TYPE-POOLS: slis.
    DATA: fieldcat             TYPE slis_t_fieldcat_alv,
          fieldcat1             TYPE slis_t_fieldcat_alv,
          fieldcat_ln          TYPE slis_fieldcat_alv,
          layout_in            TYPE slis_layout_alv,
          layout_in1           TYPE slis_layout_alv,
          sortcat              TYPE slis_t_sortinfo_alv,
          sortcat1              TYPE slis_t_sortinfo_alv,
          sortcat_ln           LIKE LINE OF sortcat,
          eventcat1             TYPE slis_t_event,
          eventcat             TYPE slis_t_event,
          eventcat_ln          LIKE LINE OF eventcat,
          col_pos              TYPE i.
    DATA:  targ_month(2)         TYPE n,                        "0001
           targ_year(4)          TYPE n,                        "0001
           targ_mth_abs          TYPE p,                        "0001
           doc_month(2)          TYPE n,                        "0001
           doc_year(4)           TYPE n,                        "0001
           doc_mth_abs           TYPE p,                        "0001
           mth_result            TYPE p,                        "0001
           doc_days              TYPE p,
           targ_days             TYPE p,
           addl_days             TYPE p,
           ext_days              TYPE p,
           v_days(3)             TYPE c,
           v_kkber               LIKE knkk-kkber.
    DATA:
          BEGIN OF inrec OCCURS 1000,                           "0001
            lifnr    LIKE bsik-lifnr,
            belnr    LIKE bsik-belnr,
            gjahr    LIKE bsik-gjahr,
            bldat    LIKE bsik-bldat,
            xblnr    LIKE bsik-xblnr,
            blart    LIKE bsik-blart,
            sgtxt    LIKE bsik-sgtxt,
            shkzg    LIKE bsik-shkzg,
            dmbtr    LIKE bsik-dmbtr,
            zfbdt    LIKE bsik-zfbdt,
            zbd1t    LIKE bsik-zbd1t,
            zbd2t    LIKE bsik-zbd2t,
            zbd3t    LIKE bsik-zbd3t,
            zuonr    LIKE bsik-zuonr,
          END OF inrec.
    DATA:
          BEGIN OF inrect OCCURS 1000,                          "0001
            lifnr    LIKE bsik-lifnr,
            belnr    LIKE bsik-belnr,
            gjahr    LIKE bsik-gjahr,
            bldat    LIKE bsik-bldat,
            xblnr    LIKE bsik-xblnr,
            blart    LIKE bsik-blart,
            sgtxt    LIKE bsik-sgtxt,
            shkzg    LIKE bsik-shkzg,
            dmbtr    LIKE bsik-dmbtr,
            zfbdt    LIKE bsik-zfbdt,
            zbd1t    LIKE bsik-zbd1t,
            zbd2t    LIKE bsik-zbd2t,
            zbd3t    LIKE bsik-zbd3t,
            zuonr    LIKE bsik-zuonr,
          END OF inrect,
          BEGIN OF t_item OCCURS 1000,                          " 0001
            lifnr LIKE bsik-lifnr,
            belnr LIKE bsik-belnr,
            gjahr LIKE bsik-gjahr,
            bldat LIKE bsik-bldat,
            xblnr LIKE bsik-xblnr,
            blart LIKE bsik-blart,
            sgtxt LIKE bsik-sgtxt,
            zfbdt LIKE bsik-zfbdt,
            dmbtr LIKE bsik-dmbtr,
            days(3)  TYPE c,
            zuonr    LIKE bsik-zuonr,
          END OF t_item,
          t_line LIKE t_item OCCURS 1000 WITH HEADER LINE,      " 0001
          BEGIN OF itab OCCURS 1000,
            lifnr    LIKE lfa1-lifnr,
            total    LIKE bsik-dmbtr,
            zfuture  LIKE bsik-dmbtr,
            zcurrent LIKE bsik-dmbtr,
            crbal   LIKE bsik-dmbtr,
            30days   LIKE bsik-dmbtr,
            60days   LIKE bsik-dmbtr,
            90days   LIKE bsik-dmbtr,
            99days   LIKE bsik-dmbtr,
            120days  LIKE bsik-dmbtr,
            180days  LIKE bsik-dmbtr,
            365days  LIKE bsik-dmbtr,
            bzirk    LIKE knvv-bzirk,
            vkbur    LIKE knvv-vkbur,
            vwerk    LIKE knvv-vwerk,
            vkgrp    LIKE knvv-vkgrp,
            klimk    LIKE knkk-klimk,
            cashd    LIKE knkk-cashd,
            grupp    LIKE knkk-grupp,
            erdat    LIKE lfa1-erdat,
            name1    LIKE lfa1-name1,
            name2    LIKE lfa1-name2,
            stras    LIKE lfa1-stras,
            ort01    LIKE lfa1-ort01,
            telf1    LIKE lfa1-telf1,
            psort(10),
            sperr    LIKE lfa1-sperr,
            totsal   LIKE bsik-dmbtr,
            txt50    LIKE skat-txt50,
            gsber    LIKE bsik-gsber,
          END OF itab.
    DATA: sel_tab     TYPE TABLE OF rsparams WITH HEADER LINE,
          p_debit(1) TYPE c,
          p_credit(1) TYPE c.
    DATA: t_variant LIKE disvariant OCCURS 0 WITH HEADER LINE.
    parameters and select-options
    SELECTION-SCREEN BEGIN OF BLOCK blck0 WITH FRAME TITLE text-002.
    PARAMETERS: stida LIKE sy-datum DEFAULT sy-datum OBLIGATORY,
                p_bukrs LIKE t001-bukrs DEFAULT 'PIIL' MEMORY ID buk
    OBLIGATORY.
              P_BUKRS LIKE T001-BUKRS DEFAULT 'CC01' OBLIGATORY.  "0003
    SELECT-OPTIONS: s_lifnr   FOR bsik-lifnr ,
                   s_vkbur FOR knvv-vkbur,
                   s_vkgrp FOR knvv-vkgrp,
                   s_bzirk FOR knvv-bzirk,
                   s_konda FOR knvv-konda,
                   s_kdgrp FOR knvv-kdgrp NO-DISPLAY ,
                   s_kvgr2 FOR knvv-kvgr2 NO-DISPLAY ,
                   s_kkber FOR knkk-kkber NO-DISPLAY ,
                   s_grupp FOR knkk-grupp NO-DISPLAY ,
                   s_ctlpc FOR knkk-ctlpc,
                    s_akont FOR lfb1-akont,
                    s_gsber FOR bsik-gsber.
    PARAMETERS: p_future AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK blck0.
    SELECTION-SCREEN BEGIN OF BLOCK blck1 WITH FRAME TITLE text-002.
    PARAMETERS: p_abs RADIOBUTTON GROUP zrad,
                p_due RADIOBUTTON GROUP zrad DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK blck1.
    *SELECTION-SCREEN BEGIN OF BLOCK blck2 WITH FRAME TITLE text-003.
    *PARAMETERS: c_run RADIOBUTTON GROUP zrac DEFAULT 'X',
               c_blk RADIOBUTTON GROUP zrac,
               c_all RADIOBUTTON GROUP zrac.
    *SELECTION-SCREEN END OF BLOCK blck2.
    *SELECTION-SCREEN BEGIN OF BLOCK blck3 WITH FRAME TITLE text-004.
    *PARAMETERS: p_debit AS CHECKBOX DEFAULT 'X' ,
               p_credit AS CHECKBOX DEFAULT 'X' NO-DISPLAY,
    *selection-screen end of block blck3.
    start-of-selection.
    START-OF-SELECTION.
    PERFORM BUILD_EVENTCAT.
      p_debit = 'X'.
      p_credit = 'X'.
      PERFORM get_customer_invoices.
    filter records based on selection criteria
      PERFORM filter_records.
    END-OF-SELECTION.
      PERFORM add_sort_field.
      PERFORM modify_field.
      PERFORM write_report.
    *&      Form  FILTER_RECORDS
          To collect all the required data from DB and store them in
          internal table.
    -->  p1        text
    <--  p2        text
    FORM filter_records.
    delete records based on selection criteria
      LOOP AT itab.
       SELECT vkbur vkgrp vwerk erdat konda kdgrp bzirk kvgr2
         INTO (itab-vkbur, itab-vkgrp, itab-vwerk, knvv-erdat,
               knvv-konda, knvv-kdgrp,itab-bzirk,knvv-kvgr2)
         FROM knvv WHERE lifnr =  itab-lifnr
                   ORDER BY erdat DESCENDING.
    AKS :- Not Required for PI
         CASE itab-vkbur.
           WHEN 'SA1'.
             itab-vkbur = 'SF25'.
           WHEN 'QLD1'.
             itab-vkbur = 'SF23'.
           WHEN 'WA1'.
             itab-vkbur = 'SF26'.
         ENDCASE.
    AKS.
         EXIT.
       ENDSELECT.
       IF itab-vkbur IN s_vkbur AND
          itab-vkgrp IN s_vkgrp AND
          knvv-konda IN s_konda AND
          knvv-kdgrp IN s_kdgrp AND
          itab-bzirk IN s_bzirk AND
          knvv-kvgr2 IN s_kvgr2.
       ELSE.
         DELETE itab.
         CONTINUE.
       ENDIF.
       SELECT SINGLE klimk grupp cashd
         INTO (itab-klimk, itab-grupp, itab-cashd)
         FROM knkk WHERE lifnr =  itab-lifnr
                   AND   kkber IN s_kkber
                   AND   ctlpc IN s_ctlpc
                   AND   grupp IN s_grupp.
       IF SY-SUBRC NE 0.
         DELETE ITAB.
         CONTINUE.
       ENDIF.
        SELECT SINGLE skat~txt50
             INTO (itab-txt50)
             FROM lfb1 INNER JOIN skat
             ON lfb1akont EQ skatsaknr
             WHERE lfb1~lifnr =  itab-lifnr
                       AND   lfb1~akont IN s_akont
                       AND   skat~spras EQ 'EN'.
        IF sy-subrc NE 0.
          DELETE itab.
          CONTINUE.
        ENDIF.
        SELECT SINGLE name1 name2 telf1 erdat stras ort01 sperr
             INTO (itab-name1, itab-name2, itab-telf1,
                     itab-erdat, itab-stras, itab-ort01, itab-sperr )
               FROM lfa1
               WHERE lifnr =  itab-lifnr
        IF sy-subrc NE 0 .
          DELETE itab.
          CONTINUE.
        ENDIF.
    AKS For Filteration of Customer base on Block Area.
       IF c_all NE 'X'.
         IF c_run EQ 'X' AND itab-sperr EQ 'X'.
           DELETE itab.
           CONTINUE.
         ELSE.
           IF c_blk EQ 'X' AND itab-sperr NE 'X'.
             DELETE itab.
             CONTINUE.
           ENDIF.
         ENDIF.
       ENDIF.
        MODIFY itab.
      ENDLOOP.
    ENDFORM.                               " FILTER_RECORDS
    *&      Form  GET_CUSTOMER_INVOICES
          text
    -->  p1        text
    <--  p2        text
    FORM get_customer_invoices.
      DATA:ztotcre  LIKE bsik-dmbtr.
      DATA:ztotsal  LIKE bsik-dmbtr.
      DATA: fsdate LIKE sy-datum.
      DATA: l_perio(4) TYPE c.
      MOVE stida             TO rf140-stida.
      MOVE rf140-stida+4(2)  TO targ_month.
      MOVE rf140-stida+0(4)  TO targ_year.
      MOVE rf140-stida+6(2)  TO targ_days.
      targ_mth_abs           =  ( targ_year * 12 ) + targ_month.
      CALL FUNCTION 'ZGET_PERIOD_FROM_DATE'
        EXPORTING
          i_date  = stida
        IMPORTING
          e_perio = l_perio.
      CONCATENATE l_perio '0401' INTO fsdate.
    select open items.
      IF p_due EQ 'X'.
        SELECT lifnr belnr gjahr bldat xblnr blart sgtxt        " 0001
               shkzg dmbtr zfbdt zbd1t zbd2t zbd3t
               zuonr
          FROM bsik INTO TABLE inrect
          WHERE bukrs =  p_bukrs
          AND   budat LE stida
          AND   lifnr IN s_lifnr
          AND   gsber IN s_gsber
          AND   umskz NE 'T'
          AND   umskz NE 'F'
          AND   umskz NE 'R'
          AND   umskz NE 'P'
          AND   umskz NE 'J'
          AND umskz NE 'L'.
    LOOP AT INREC.
       IF INREC-SHKZG = 'H'.
         INREC-DMBTR  = INREC-DMBTR * -1.
       ENDIF.
       MOVE-CORRESPONDING INREC TO T_ITEM.                     " 0001
       PERFORM COLLECT_INVOICE USING   INREC-lifnr    INREC-DMBTR
                                       INREC-ZFBDT    INREC-ZBD1T
                                       INREC-ZBD2T    INREC-ZBD3T.
       APPEND T_ITEM.
       CLEAR T_ITEM.
    ENDLOOP.
        LOOP AT inrect.
          inrec-lifnr = inrect-lifnr.
          inrec-belnr    = inrect-belnr.
          inrec-gjahr    = inrect-gjahr.
          inrec-bldat    = inrect-bldat.
          inrec-xblnr    = inrect-xblnr.
          inrec-blart    = inrect-blart.
          inrec-sgtxt    = inrect-sgtxt.
          inrec-shkzg    = inrect-shkzg.
          inrec-dmbtr    = inrect-dmbtr.
          CALL FUNCTION 'NJ_CAL_DATE_IN_INTERVAL'
            EXPORTING
              date      = inrect-zfbdt
              days      = inrect-zbd1t
              months    = 00
              signum    = '+'
              years     = 00
            IMPORTING
              calc_date = inrec-zfbdt.
          inrec-zbd1t    = inrect-zbd1t.
          inrec-zbd2t    = inrect-zbd2t.
          inrec-zbd3t    = inrect-zbd3t.
          inrec-zuonr    = inrect-zuonr.
          APPEND inrec.
          CLEAR inrec.
        ENDLOOP.
      ELSE.
        SELECT lifnr belnr gjahr bldat xblnr blart sgtxt        " 0001
               shkzg dmbtr zfbdt zbd1t zbd2t zbd3t
               zuonr
          FROM bsik INTO TABLE inrec
          WHERE bukrs =  p_bukrs
          AND   budat LE stida
          AND   lifnr IN s_lifnr
          AND   gsber IN s_gsber
          AND   umskz NE 'T'
          AND   umskz NE 'F'
          AND   umskz NE 'R'
          AND   umskz NE 'P'
          AND   umskz NE 'J'
          AND umskz NE 'L'.
      ENDIF.
      SORT inrec BY lifnr shkzg zfbdt .
      LOOP AT inrec.
        AT NEW lifnr.
    For Customers Credit Balance Transaction to be display in Report
    End of Credit Balance
          ztotcre = 0.
          ztotsal = 0.
        ENDAT.
        IF inrec-shkzg = 'H'.
          inrec-dmbtr = inrec-dmbtr * -1.
          ztotcre = ztotcre + inrec-dmbtr.
        ELSE.
          IF inrec-blart = 'RV'.
            IF inrec-bldat GE fsdate.
              ztotsal = ztotsal + inrec-dmbtr.
            ENDIF.
          ENDIF.
          ztotcre = ztotcre +  inrec-dmbtr.
       endif.
          IF p_debit EQ 'X'.
            IF ztotcre > 0.
              MOVE-CORRESPONDING inrec TO t_item.               " 0001
              PERFORM collect_invoice USING inrec-lifnr    ztotcre
                                          inrec-zfbdt    inrec-zbd1t
                                          inrec-zbd2t    inrec-zbd3t
                                          ztotsal.
              APPEND t_item.
              CLEAR t_item.
              ztotcre = 0.
              ztotsal = 0.
            ENDIF.
          ENDIF.
        ENDIF.
        IF p_credit EQ 'X'.
         AT END OF lifnr.
          IF ztotcre < 0.
            MOVE-CORRESPONDING inrec TO t_item.                 " 0001
            PERFORM collect_invoice USING inrec-lifnr    ztotcre
                                        inrec-zfbdt       inrec-zbd1t
                                        inrec-zbd2t    inrec-zbd3t
                                        ztotsal.
            APPEND t_item.
            CLEAR t_item.
            ztotcre = 0.
            ztotsal = 0.
           APPEND t_item.
           CLEAR t_item.
          ENDIF.
         ENDAT.
        ENDIF.
      ENDLOOP.
    select cleared items
      IF p_due EQ 'X'.
        REFRESH inrect.  CLEAR inrect.
        SELECT lifnr belnr gjahr bldat xblnr blart sgtxt
               shkzg dmbtr zfbdt zbd1t zbd2t zbd3t
               zuonr
          FROM bsak INTO TABLE inrect
          WHERE bukrs =  p_bukrs
          AND   budat LE stida
          AND   augdt >  stida
          AND   lifnr IN s_lifnr
          AND   gsber IN s_gsber
        REFRESH inrec.  CLEAR inrec.
        LOOP AT inrect.
          inrec-lifnr = inrect-lifnr.
          inrec-belnr    = inrect-belnr.
          inrec-gjahr    = inrect-gjahr.
          inrec-bldat    = inrect-bldat.
          inrec-xblnr    = inrect-xblnr.
          inrec-blart    = inrect-blart.
          inrec-sgtxt    = inrect-sgtxt.
          inrec-shkzg    = inrect-shkzg.
          inrec-dmbtr    = inrect-dmbtr.
          CALL FUNCTION 'NJ_CAL_DATE_IN_INTERVAL'
            EXPORTING
              date      = inrect-zfbdt
              days      = inrect-zbd1t
              months    = 00
              signum    = '+'
              years     = 00
            IMPORTING
              calc_date = inrec-zfbdt.
          inrec-zbd1t    = inrect-zbd1t.
          inrec-zbd2t    = inrect-zbd2t.
          inrec-zbd3t    = inrect-zbd3t.
          inrec-zuonr    = inrect-zuonr.
          APPEND inrec.
          CLEAR inrec.
        ENDLOOP.
      ELSE.
        REFRESH inrec.  CLEAR inrec.
        SELECT lifnr belnr gjahr bldat xblnr blart sgtxt
               shkzg dmbtr zfbdt zbd1t zbd2t zbd3t
               zuonr
          FROM bsak INTO TABLE inrec
          WHERE bukrs =  p_bukrs
          AND   budat LE stida
          AND   augdt >  stida
          AND   lifnr IN s_lifnr
          AND   gsber IN s_gsber
      ENDIF.
      SORT inrec BY lifnr shkzg zfbdt .
      LOOP AT inrec.
        AT NEW lifnr.
          ztotcre = 0.
          ztotsal = 0.
        ENDAT.
        IF inrec-shkzg = 'H'.
          inrec-dmbtr = inrec-dmbtr * -1.
          ztotcre = ztotcre + inrec-dmbtr.
        ELSE.
          IF inrec-blart = 'RV'.
            IF inrec-bldat GE fsdate.
              ztotsal = ztotsal + inrec-dmbtr.
            ENDIF.
          ENDIF.
          ztotcre = ztotcre +  inrec-dmbtr.
      endif.
          IF p_debit EQ 'X'.
            IF ztotcre > 0.
              MOVE-CORRESPONDING inrec TO t_item.               " 0001
              PERFORM collect_invoice USING inrec-lifnr    ztotcre
                                          inrec-zfbdt    inrec-zbd1t
                                          inrec-zbd2t    inrec-zbd3t
                                          ztotsal.
              APPEND t_item.
              CLEAR t_item.
              ztotcre = 0.
              ztotsal = 0.
            ENDIF.
          ENDIF.
        ENDIF.
        IF p_credit EQ 'X'.
         AT END OF lifnr.
          IF ztotcre < 0.
            MOVE-CORRESPONDING inrec TO t_item.                 " 0001
            PERFORM collect_invoice USING inrec-lifnr    ztotcre
                                        inrec-zfbdt    inrec-zbd1t
                                        inrec-zbd2t    inrec-zbd3t
                                        ztotsal.
            APPEND t_item.
            CLEAR t_item.
            ztotcre = 0.
            ztotsal = 0.
           APPEND t_item.
           CLEAR t_item.
          ENDIF.
         ENDAT.                                                " 0001
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " GET_CUSTOMER_INVOICES
    *&      Form  COLLECT_INVOICE
          text
         -->P_bsik_lifnr  text
         -->P_bsik_DMBTR  text
         -->P_bsik_ZFBDT  text
         -->P_bsik_ZFBDT1  text
         -->P_bsik_ZFBDT2  text
         -->P_bsik_ZFBDT3  text
    FORM collect_invoice USING    pp_lifnr
                                  pp_dmbtr
                                  pp_zfbdt
                                  pp_zbd1t
                                  pp_zbd2t
                                  pp_zbd3t
                                  pp_ztotsal.
      doc_month            =  pp_zfbdt+4(2).
      doc_year             =  pp_zfbdt+0(4).
      doc_mth_abs          =  ( doc_year * 12 ) + doc_month.
      mth_result           =  ( targ_mth_abs    - doc_mth_abs ).
    logic given by Mr. Ashok Singhvi
      doc_days             =  pp_zfbdt+6(2).
      addl_days            =  ( doc_days  -  targ_days ).
      IF addl_days <= 0.
        ADD 1 TO mth_result.
      ENDIF.
      IF NOT pp_zbd3t IS INITIAL.
        MOVE pp_zbd3t TO ext_days.
      ELSEIF NOT pp_zbd2t IS INITIAL.
        MOVE pp_zbd2t TO ext_days.
      ELSEIF NOT pp_zbd1t IS INITIAL.
        MOVE pp_zbd1t TO ext_days.
      ELSE.
        CLEAR ext_days.
      ENDIF.
    CHECK with Andrew whether this is working or not
    if extended payment terms exist, subtract no of mths from mth_result
    IF NOT ext_days IS INITIAL.
       CASE ext_days.
         WHEN 30.
           SUBTRACT 1 FROM mth_result.
         WHEN 60.
           SUBTRACT 2 FROM mth_result.
         WHEN 90.
           SUBTRACT 3 FROM mth_result.
         WHEN 120.
           SUBTRACT 4 FROM mth_result.
       ENDCASE.
    ENDIF.
    change to key date
      IF pp_dmbtr > 0.
        IF p_future = 'X'.                                      " 0001
          IF mth_result      <= 0.
            itab-zcurrent    =  pp_dmbtr.
            t_item-days       = 'CUR'.
          ELSEIF mth_result  =  1.
            itab-30days      =  pp_dmbtr.
            t_item-days       = '30D'.
          ELSEIF mth_result  =  2.
            itab-60days      =  pp_dmbtr.
            t_item-days        = '60D'.
          ELSEIF mth_result  =  3.
            itab-90days      =  pp_dmbtr.
            t_item-days        = '90D'.
          ELSEIF mth_result  >  3 AND mth_result  <=  4 .
            itab-99days      =  pp_dmbtr.
            t_item-days        = '99D'.
          ELSEIF mth_result  >  4 AND mth_result  <=  6 .
            itab-120days      =  pp_dmbtr.
            t_item-days        = '120D'.
          ELSEIF mth_result  >  6 AND mth_result  <=  12 .
            itab-180days      =  pp_dmbtr.
            t_item-days        = '180D'.
          ELSEIF mth_result  >  12 .
            itab-365days      =  pp_dmbtr.
            t_item-days        = '365D'.
          ENDIF.
        ELSE.
          IF mth_result      < 0.
            itab-zfuture     =  pp_dmbtr.
            t_item-days       = 'FUT'.
          ELSEIF mth_result  = 0.
            itab-zcurrent = pp_dmbtr.
            t_item-days       = 'CUR'.
          ELSEIF mth_result  =  1.
            itab-30days      =  pp_dmbtr.
            t_item-days       = '30D'.
          ELSEIF mth_result  =  2.
            itab-60days      =  pp_dmbtr.
            t_item-days       = '60D'.
          ELSEIF mth_result  =  3.
            itab-90days      =  pp_dmbtr.
            t_item-days       = '90D'.
          ELSEIF mth_result  >  3 AND mth_result  <=  4 .
            itab-99days      =  pp_dmbtr.
            t_item-days        = '99D'.
          ELSEIF mth_result  >  4 AND mth_result  <=  6 .
            itab-120days      =  pp_dmbtr.
            t_item-days        = '120D'.
          ELSEIF mth_result  >  6 AND mth_result  <=  12 .
            itab-180days      =  pp_dmbtr.
            t_item-days        = '180D'.
          ELSEIF mth_result  >  12 .
            itab-365days      =  pp_dmbtr.
            t_item-days        = '365D'.
          ENDIF.
        ENDIF.                                                  " 0001
        itab-crbal         = 0.
        itab-total         = pp_dmbtr.
      ELSE.
        IF p_future = 'X'.                                      " 0001
          IF mth_result      <= 0.
            itab-zcurrent    =  pp_dmbtr.
            t_item-days       = 'CUR'.
          ELSEIF mth_result  =  1.
            itab-30days      =  pp_dmbtr.
            t_item-days       = '30D'.
          ELSEIF mth_result  =  2.
            itab-60days      =  pp_dmbtr.
            t_item-days        = '60D'.
          ELSEIF mth_result  =  3.
            itab-90days      =  pp_dmbtr.
            t_item-days        = '90D'.
          ELSEIF mth_result  >  3 AND mth_result  <=  4 .
            itab-99days      =  pp_dmbtr.
            t_item-days        = '99D'.
          ELSEIF mth_result  >  4 AND mth_result  <=  6 .
            itab-120days      =  pp_dmbtr.
            t_item-days        = '120D'.
          ELSEIF mth_result  >  6 AND mth_result  <=  12 .
            itab-180days      =  pp_dmbtr.
            t_item-days        = '180D'.
          ELSEIF mth_result  >  12 .
            itab-365days      =  pp_dmbtr.
            t_item-days        = '365D'.
          ENDIF.
        ELSE.
          IF mth_result      < 0.
            itab-zfuture     =  pp_dmbtr.
            t_item-days       = 'FUT'.
          ELSEIF mth_result  = 0.
            itab-zcurrent = pp_dmbtr.
            t_item-days       = 'CUR'.
          ELSEIF mth_result  =  1.
            itab-30days      =  pp_dmbtr.
            t_item-days       = '30D'.
          ELSEIF mth_result  =  2.
            itab-60days      =  pp_dmbtr.
            t_item-days       = '60D'.
          ELSEIF mth_result  =  3.
            itab-90days      =  pp_dmbtr.
            t_item-days       = '90D'.
          ELSEIF mth_result  >  3 AND mth_result  <=  4 .
            itab-99days      =  pp_dmbtr.
            t_item-days        = '99D'.
          ELSEIF mth_result  >  4 AND mth_result  <=  6 .
            itab-120days      =  pp_dmbtr.
            t_item-days        = '120D'.
          ELSEIF mth_result  >  6 AND mth_result  <=  12 .
            itab-180days      =  pp_dmbtr.
            t_item-days        = '180D'.
          ELSEIF mth_result  >  12 .
            itab-365days      =  pp_dmbtr.
            t_item-days        = '365D'.
          ENDIF.
        ENDIF.                                                  " 0001
        itab-total         = pp_dmbtr.
        itab-crbal         = 0.
      ENDIF.
      itab-lifnr         = pp_lifnr.
      itab-totsal        = pp_ztotsal.
      COLLECT itab.
      CLEAR itab.
    ENDFORM.                    " COLLECT_INVOICE
    *&      Form  ADD_SORT_FIELD
          text
    -->  p1        text
    <--  p2        text
    FORM add_sort_field.
      DATA: l_amount(9)  TYPE n.
      IF p_future = 'X'.
        LOOP AT itab.
          l_amount = 999999999.
          IF     itab-365days > 0.
            l_amount = l_amount - itab-365days.
            CONCATENATE 'A' l_amount INTO itab-psort.
          ELSEIF     itab-180days > 0.
            l_amount = l_amount - itab-180days.
            CONCATENATE 'B' l_amount INTO itab-psort.
          ELSEIF     itab-120days > 0.
            l_amount = l_amount - itab-120days.
            CONCATENATE 'C' l_amount INTO itab-psort.
          ELSEIF     itab-99days > 0.
            l_amount = l_amount - itab-99days.
            CONCATENATE 'D' l_amount INTO itab-psort.
          ELSEIF itab-90days > 0.
            l_amount = l_amount - itab-90days.
            CONCATENATE 'E' l_amount INTO itab-psort.
          ELSEIF itab-60days > 0.
            l_amount = l_amount - itab-60days.
            CONCATENATE 'F' l_amount INTO itab-psort.
          ELSEIF itab-30days > 0.
            l_amount = l_amount - itab-30days.
            CONCATENATE 'G' l_amount INTO itab-psort.
          ELSEIF itab-zcurrent > 0.
            l_amount = l_amount - itab-zcurrent.
            CONCATENATE 'H' l_amount INTO itab-psort.
        ELSEif itab-zfuture > 0.
          L_AMOUNT = L_AMOUNT - ITAB-zfuture.
          CONCATENATE 'F' L_AMOUNT INTO ITAB-PSORT.
          ELSE.
            l_amount = ABS( itab-total ).
            CONCATENATE 'I' l_amount INTO itab-psort.
          ENDIF.
          MODIFY itab.
        ENDLOOP.
      ELSE.
        LOOP AT itab.
          l_amount = 999999999.
          IF     itab-365days > 0.
            l_amount = l_amount - itab-365days.
            CONCATENATE 'A' l_amount INTO itab-psort.
          ELSEIF     itab-180days > 0.
            l_amount = l_amount - itab-180days.
            CONCATENATE 'B' l_amount INTO itab-psort.
          ELSEIF     itab-120days > 0.
            l_amount = l_amount - itab-120days.
            CONCATENATE 'C' l_amount INTO itab-psort.
          ELSEIF     itab-99days > 0.
            l_amount = l_amount - itab-99days.
            CONCATENATE 'D' l_amount INTO itab-psort.
          ELSEIF itab-90days > 0.
            l_amount = l_amount - itab-90days.
            CONCATENATE 'E' l_amount INTO itab-psort.
          ELSEIF itab-60days > 0.
            l_amount = l_amount - itab-60days.
            CONCATENATE 'F' l_amount INTO itab-psort.
          ELSEIF itab-30days > 0.
            l_amount = l_amount - itab-30days.
            CONCATENATE 'G' l_amount INTO itab-psort.
          ELSEIF itab-zcurrent > 0.
            l_amount = l_amount - itab-zcurrent.
            CONCATENATE 'H' l_amount INTO itab-psort.
          ELSEIF itab-zfuture > 0.
            l_amount = l_amount - itab-zfuture.
            CONCATENATE 'I' l_amount INTO itab-psort.
          ELSE.
            l_amount = ABS( itab-total ).
            CONCATENATE 'J' l_amount INTO itab-psort.
          ENDIF.
          MODIFY itab.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " ADD_SORT_FIELD
    *&      Form  WRITE_REPORT
          text
    -->  p1        text
    <--  p2        text
    FORM write_report.
      PERFORM build_fieldcat.
      PERFORM build_sortcat.
      PERFORM build_eventcat.
      PERFORM build_layout.
      PERFORM start_list_viewer.
    ENDFORM.                    " WRITE_REPORT
    *&      Form  BUILD_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcat.
    lifnr
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
      fieldcat_ln-ref_tabname        = 'lfa1'.
      fieldcat_ln-fieldname          = 'LIFNR'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-emphasize = 'C41'.
      APPEND fieldcat_ln TO fieldcat.
    Name1
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
      fieldcat_ln-ref_tabname        = 'lfa1'.
      fieldcat_ln-fieldname          = 'NAME1'.
      fieldcat_ln-emphasize = 'C41'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-seltext_l          = 'Name'.
      APPEND fieldcat_ln TO fieldcat.
    City Details
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
      fieldcat_ln-ref_tabname        = 'lfa1'.
      fieldcat_ln-fieldname          = 'ORT01'.
      fieldcat_ln-seltext_l          = 'City'.
      fieldcat_ln-col_pos            = col_pos.
      APPEND fieldcat_ln TO fieldcat.
    Credit Limit
    ADD 1 TO col_pos.
    CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'KNKK'.
    fieldcat_ln-fieldname          = 'KLIMK'.
    fieldcat_ln-col_pos            = col_pos.
    fieldcat_ln-emphasize = 'C41'.
    APPEND fieldcat_ln TO fieldcat.
    ADD 1 TO col_pos.
    CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'bsik'.
    fieldcat_ln-ref_fieldname      = 'DMBTR'.
    fieldcat_ln-fieldname          = 'CRBAL'.
    fieldcat_ln-col_pos            = col_pos.
    fieldcat_ln-emphasize = 'C41'.
    fieldcat_ln-do_sum             = 'X'.
    fieldcat_ln-seltext_l          = 'Cr. Bal.'.
    fieldcat_ln-seltext_m          = 'Cr. Bal.'.
    fieldcat_ln-seltext_s          = 'Cr. Bal.'.
    APPEND fieldcat_ln TO fieldcat.
    Total Amount
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
      fieldcat_ln-fieldname          = 'TOTAL'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-emphasize = 'C41'.
      fieldcat_ln-do_sum             = 'X'.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-seltext_l          = 'Out.St.Amt.'.
      fieldcat_ln-seltext_m          = 'Out.St.Amt.'.
      fieldcat_ln-seltext_s          = 'Out.St.Amt.'.
      fieldcat_ln-ref_tabname        = 'zbsik'.
      fieldcat_ln-ref_fieldname      = 'ZDMBTR'.
      APPEND fieldcat_ln TO fieldcat.
      IF p_future NE 'X'.
    Future
        ADD 1 TO col_pos.
        CLEAR fieldcat_ln.
       fieldcat_ln-ref_tabname        = 'bsik'.
       fieldcat_ln-ref_fieldname      = 'DMBTR'.
        fieldcat_ln-fieldname          = 'ZFUTURE'.
        fieldcat_ln-col_pos            = col_pos.
        fieldcat_ln-do_sum             = 'X'.
        fieldcat_ln-hotspot            = 'X'.
        fieldcat_ln-emphasize = 'C41'.
        fieldcat_ln-seltext_l          = 'Future Due'.
        fieldcat_ln-seltext_m          = 'Future Due'.
        fieldcat_ln-seltext_s          = 'Future Due'.
        APPEND fieldcat_ln TO fieldcat.
      ENDIF.
    Current
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'bsik'.
    fieldcat_ln-ref_fieldname      = 'DMBTR'.
      fieldcat_ln-fieldname          = 'ZCURRENT'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-do_sum             = 'X'.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-emphasize = 'C41'.
      fieldcat_ln-seltext_l          = 'Normal Due'.
      fieldcat_ln-seltext_m          = 'Normal Due'.
      fieldcat_ln-seltext_s          = 'Normal Due'.
      APPEND fieldcat_ln TO fieldcat.
    30 Days
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'bsik'.
    fieldcat_ln-ref_fieldname      = 'DMBTR'.
      fieldcat_ln-fieldname          = '30DAYS'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-do_sum             = 'X'.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-emphasize = 'C41'.
      fieldcat_ln-seltext_l          = '0-30 Days'.
      fieldcat_ln-seltext_m          = '0-30 Days'.
      fieldcat_ln-seltext_s          = '0-30 Days'.
      APPEND fieldcat_ln TO fieldcat.
    60 Days
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'bsik'.
    fieldcat_ln-ref_fieldname      = 'DMBTR'.
      fieldcat_ln-fieldname          = '60DAYS'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-do_sum             = 'X'.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-emphasize = 'C41'.
      fieldcat_ln-seltext_l          = '31-60 Days'.
      fieldcat_ln-seltext_m          = '31-60 Days'.
      fieldcat_ln-seltext_s          = '31-60 Days'.
      APPEND fieldcat_ln TO fieldcat.
    90 Days
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'bsik'.
    fieldcat_ln-ref_fieldname      = 'DMBTR'.
      fieldcat_ln-fieldname          = '90DAYS'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-do_sum             = 'X'.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-emphasize = 'C41'.
      fieldcat_ln-seltext_l          = '61-90 Days'.
      fieldcat_ln-seltext_m          = '61-90 Days'.
      fieldcat_ln-seltext_s          = '61-90 Days'.
      APPEND fieldcat_ln TO fieldcat.
    99 Days
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'bsik'.
    fieldcat_ln-ref_fieldname      = 'DMBTR'.
      fieldcat_ln-fieldname          = '99DAYS'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-do_sum             = 'X'.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-emphasize = 'C41'.
      fieldcat_ln-seltext_l          = '91-120 Days'.
      fieldcat_ln-seltext_m          = '91-120 Days'.
      fieldcat_ln-seltext_s          = '91-120 Days'.
      APPEND fieldcat_ln TO fieldcat.
    *120Days
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'bsik'.
    fieldcat_ln-ref_fieldname      = 'DMBTR'.
      fieldcat_ln-fieldname          = '120DAYS'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-do_sum             = 'X'.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-emphasize = 'C41'.
      fieldcat_ln-seltext_l          = '121-180 Days'.
      fieldcat_ln-seltext_m          = '121-180 Days'.
      fieldcat_ln-seltext_s          = '121-180 Days'.
      APPEND fieldcat_ln TO fieldcat.
    *180 Days
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'bsik'.
    fieldcat_ln-ref_fieldname      = 'DMBTR'.
      fieldcat_ln-fieldname          = '180DAYS'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-do_sum             = 'X'.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-emphasize = 'C41'.
      fieldcat_ln-seltext_l          = '181-365 Days'.
      fieldcat_ln-seltext_m          = '181-365 Days'.
      fieldcat_ln-seltext_s          = '181-365 Days'.
      APPEND fieldcat_ln TO fieldcat.
    *365 Days
      ADD 1 TO col_pos.
      CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'bsik'.
    fieldcat_ln-ref_fieldname      = 'DMBTR'.
      fieldcat_ln-fieldname          = '365DAYS'.
      fieldcat_ln-col_pos            = col_pos.
      fieldcat_ln-do_sum             = 'X'.
      fieldcat_ln-hotspot            = 'X'.
      fieldcat_ln-emphasize = 'C41'.
      fieldcat_ln-seltext_l          = '>365 Days'.
      fieldcat_ln-seltext_m          = '>365 Days'.
      fieldcat_ln-seltext_s          = '>365 Days'.
      APPEND fieldcat_ln TO fieldcat.
    Last Payment Date
    ADD 1 TO col_pos.
    CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'KNKK'.
    fieldcat_ln-fieldname          = 'CASHD'.
    fieldcat_ln-col_pos            = col_pos.
    APPEND fieldcat_ln TO fieldcat.
    Street Name
    ADD 1 TO COL_POS.
    CLEAR FIELDCAT_LN.
    FIELDCAT_LN-REF_TABNAME        = 'lfa1'.
    FIELDCAT_LN-FIELDNAME          = 'STRAS'.
    FIELDCAT_LN-COL_POS            = COL_POS.
    APPEND FIELDCAT_LN TO FIELDCAT.
    Telephone
    ADD 1 TO COL_POS.
    CLEAR FIELDCAT_LN.
    FIELDCAT_LN-REF_TABNAME        = 'lfa1'.
    FIELDCAT_LN-FIELDNAME          = 'TELF1'.
    FIELDCAT_LN-COL_POS            = COL_POS.
    APPEND FIELDCAT_LN TO FIELDCAT.
    Credit Group
    ADD 1 TO COL_POS.
    CLEAR FIELDCAT_LN.
    FIELDCAT_LN-REF_TABNAME        = 'KNKK'.
    FIELDCAT_LN-FIELDNAME          = 'GRUPP'.
    FIELDCAT_LN-COL_POS            = COL_POS.
    APPEND FIELDCAT_LN TO FIELDCAT.
    *Sales District
    ADD 1 TO col_pos.
    CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'KNVV'.
    fieldcat_ln-fieldname          = 'BZIRK'.
    fieldcat_ln-col_pos            = col_pos.
    fieldcat_ln-seltext_l          = 'S_Distt'.
    fieldcat_ln-seltext_m          = 'S_Distt'.
    fieldcat_ln-seltext_s          = 'S_Distt'.
    APPEND fieldcat_ln TO fieldcat.
    Sales Office
    ADD 1 TO col_pos.
    CLEAR fieldcat_ln.
    fieldcat_ln-ref_tabname        = 'KNVV'.
    fieldcat_ln-fieldname          = 'VKBUR'.
    fieldcat_ln-col_pos            = col_pos.
    fieldcat_ln-seltext_l          = 'S_Off'.
    fieldcat_ln-seltext_m          = 'S_Off'.
    fieldcat_ln-seltext_s          = 'S_Off'.
    APPEND fieldcat_ln TO fieldcat.
    Cust Creat Date
    ADD 1 TO COL_POS.
    CLEAR FIELDCAT_LN.
    FIELDCAT_LN-REF_TABNAME        = 'lfa1'.
    FIELDCAT_LN-FIELDNAME          = 'ERDAT'.
    FIELDCAT_LN-COL_POS            = COL_POS.
    APPEND FIELDCAT_LN TO FIELDCAT.

  • Automatic VAT code during fixed asset PO creation

    Hi all,
    We have a classic AUC acquisition process : through MM with IO allocation.
    My question is = is it possible to automatically affect one VAT code relating to fixed asset acquisition during purchase order creation? (and not VAT relating to goods and services acquisition, we have to distinguish both with french rules).
    The person in charge of PO creation don't have to choice between VAT codes, this is the reason why VAT code has to be affected automatically.
    Thanks in advance for your answer.
    Best Regards

    Hi Ocean,
    if you use as91 you have to enter as followed:
    ***.acquis.val.     120.242,00 <- enter
    ***.down paymts                    
    ***.reval.of RV                    
    ***.invst.grant                    
    Accm.ord.deprec     70.809,18 <- enter
    ***.Spec.dep.                    
    ***.unplnd.dep.
    ***.reserves                    
    ***.reval.O.dep                    
    Net book value     49.432,82 <- calculated automatically
    ***. interest                    
    Reval. posted                    
    Ord.dep.posted     3.340,06 <- enter
    Pstd.spec.dep.                    
    Pstd.unpl.dep.     0,00
    Res.posted                    
    Of course SAP reverses the amount because it is entered as ord dep. posted (this means current fiscal year!!!) insted of accm. ord. depr. (depr. up to 31.12.2007)
    The ***. depreciation up to 31.12.2007 has to be enterend in ACCM. ord. deprec.
    The *** and posted depreciation from the current year has to entered in ORD.DEP.Posted, pls. have a look at my calculation.
    How to correct the fields Ord.-dep. posted and Accm ord. dep? This depends on many parameters:
    Have you carried out the datantransfer already in the P-System????
    Any other postings for SAP AM already carried out
    How many assets have to be changed.
    You can reset the Companycode in AM (only recommendable if deprun is not posted and no other postings - retirements, aquisitions transfers have been entered). Then start a new upload
    Even lsmw and a BI-recording as92 with the last screen could be a solution.
    At least if you have only a few assets - correct them manually - it's not worth the effort to create a BIR and a LSMW - the user is faster.
    Best regards
       Horst

  • More than one VAT code on one line item?

    Hello,
    Running ECS SRM 5.0.
    Is it absolutely impossible to set more than one VAT code on one order line in a SC or PO?
    Can this be acomplished by using a user exit or anything?
    This demand comes from a public sector company which pays different VAT dependent on what they use as account assignment. In some orders when split account assignment is used, it might be two different VAT codes on the same line.
    rgds
    GAR

    Hi
    Which SRM version are you using ?
    As far as i know, this is standard SRM functionality as it not feasible to have multiple VAT codes against one line item.. This is not possible .. Please confirm the same with SAP by creating a Customer OSS message.. Do let me know...
    However this is possible by making the code as per your business requirments using BBP_DOC_CHANGE_BADI.. However, since i have not tried this.. You need to try this yourself..
    Hope this will answer your query..
    Regards
    - Atul

  • Posting invoices in F-43 where items have different VAT codes

    Hi,
    I am not sure whether I am in the correct forum so just boot me into the correct one if I guessed incorrectly.
    I have to start by saying I have almost no FI knowledge and it seems no-one in the business has enough FI applications knowledge. I am thus flying blind.
    So while the company I am used to working in has MM integration which makes things a lot easier, they set up a sister company where they only want FI.
    The sister company is located in UK and I set up tax codes for them
    0%, 17.5% and the other 0%.
    Our finance team advised them to use f-43 to enter the invoices, attach the vat code and away they go.
    The problem comes when some items on the actual invoice has 17.5% and some have 0%. This means the vat % on the total varies.
    They are requesting the ability to override the % or the vat value, but still have the invoice recorded with a VAT code so that they can run VAT reports.
    I am sure that there must be SAP standard ways to solve this, but I don't know yet where to look and I don't have enough time to really start from scratch.
    Any help will be useful.

    Hi Charl,
    What ever you  are asking is against the procedure.... System has to calculate the VAT amount based on the stated percentage....
    So you can not chagne the VAT % or VAT value while posting the transaction.... But what you can do is to change the Tax base amount....
    When you are posting the invoice, system automatically takes the invoice value as bais for tax calculation, but one can change the Tax base value. So if user changed that value, system calculates the VAT amout on the modified base....
    In this way you can change the VAT amount....
    Thanks  & Regards
    Ravi C

  • Clearing customer down payment without VAT code

    Dear Freinds
    For normal cleared items ( between invoices and incoming payments) the VAT code doen't appear.
    But while clearing a Customer Down payment request, when we are using a sp. GL Indicator it is asking for tax code
    I want to clear customer down payment without tax code.According to the local legal requirement in the VAT report should not appear  any clearing with tax code even if Tax code has no tax.
    Can anybody help me?? I tried changing the tax category of Sp. Gl Recon account to blank but then it doesn't allow to post a down payment request with tax applicable.
    Rgds
    Sudip

    Hi Ravindra
    If we remove the tax category, then the problem is when we create a down payment request and do billing where tax rate is applicable, Entry will not happen in Accounting.
    Only thing which I need is that at time of clearing the down payment request, putting tax code should not be mandatory.Just like when I am clearing a normal invoice (Inv. and incoming payment) no tax code is required.
    Rgds

Maybe you are looking for

  • Screen not working and device not working properly!

    Npw im a careful person with mobile never had issues before  Earlier on in the day after just getting my phone today on contract with carephone warehouse i decided to do a little water test and take pics underwater , now the first thing i did was tes

  • Generic oracle eway code generation error in Java caps 5.1.3

    Hi, I'm using an oracle eway for adding records to a table. I have a prepared statement in the otd. When I try to build the project I'm getting the following error. Could any one let me know how this problem can be fixed? com.stc.codegen.framework.mo

  • Macbook pro will not wake up

    My 15" MacBook Pro seems to be "asleep" and I haven't been able to "wake" it up for over a day now. Even after I hold the power button down for 10 seconds it still will not reboot.

  • My applications!!!!!!

    i dont know why but my applications have question marks on them AND THEY WONT OPEN hellpppp meeeee

  • Error when downloading Itunes7 (file is not a valid win32 application)

    What the **** does this mean? I can install Itunes 7 - tried everything on troubleshooter but nothings working. Anyone got any ideas - apple smart guys I need you INTELLECT!!! many thanks Robbo