IS-Retail POSDM- double posting of  material documents and billing document

Hello All,
I had initially posted this question in "Industries Solution General" forum. Reposting it in the appropriate forum-
We have a nightly job for program "RWPOS_PARA_ENQUEUE" which processes all WPUBON idocs (sales info) that comes in from POSDM. Sometimes we have noticed that for one idoc 2 material documents and 2 billing documents are being created with the same information.
Note that this happens sporadically and we have no idea why or when it can happen. Also, we have duplicate checks in POSDM and this happens only when the idoc flows into ECC from POSDM i.e. one sales idoc posts 2 sets of documents for no apparent reason. Is there any way to prevent this? Why is this happening? Your inputs will be really appreciated.
Thanks,
Smitha

hi,
Just go to FB03 click enter and then
Company code
Fiscal Year
Ledger
Document type against customer invoice DR and then if u hav an idea abt the customer invoice doc then give doc number ....other excute and search for the customer no....
And then double click on the document
then goto ENVIRONMENT -
> Document over view -
> relation ship brower click
then you can see all the relating document to that account  i.e account doc,profitcenter doc ,material ,oytbond delivery doc ,billing doc etc...
if useful assign points.....
regards,
santosh kumar

Similar Messages

  • Table for link between Accounting document and Billing document

    Which is the table for link between Accounting document and Billing document ?
    Thanks & Regards

    Ø Go to SE16N, enter table BSAD
    Ø In the Reference Field (VBELN) enter the Billing Document no. 
    Tips:
    Ø Make sure that only those billing documents will be considered whose accounting documents actually exists
    Ø No Accounting documents will be displayed for Credits, Free of charge orders and those acc. Documents which have been cancelled.

  • Pricing date in delivery document and billing document

    Hi All,
    Pricing date in billing document can be controlled by copy control between order and billing document. This config is done in the field Pricing source. If i its set as "order", then my pricing date in billing doc will be same as that of order document pricing date. Tell me if i am right???
    Where can i maintain the setting for determining the pricing date in delivery document.???

    Hi Tushar
    Where do you find Pricing date in Delivery and Billing ?
    Pricing date is in Sales order, system takes rate of the pricing conditions valid on this date, from their condition record.
    Are you talking of Pricing in Billing document, whether it will be copied from sales order, or delivery document etc , Right?
    It is controlled from the "Pricing source" field (D- delivery, Blank- order,E - delivery/order etc.) in the copy control table at item level (VTFL).
    Suppose, the value is E, that means Pricing data will be copied from order aswell as delivery(if any).
    The copied will be copied as it is or Tax will be redermined or Freight will be redetermined etc will be decided from the "Pricing type "field.

  • Different pricing procedure for order document and billing document

    In which scenerio order and billing has diffrent pricing procedure?

    Hi,
    intercompany billing is one of the scenario.
    Business case: -
    Customer orders goods to company code/Sales organization A (Eg.4211/4211).Sales org 4211 will accept and punch the order in the system with sold to party as end customer code in the system. Company code/sales org B (Eg.4436) will deliver the goods to end customer and raise an intercom any billing on 4211 with reference to delivery. This can happen only after 4211 raises invoice to his end customer to whom the material has been delivered by 4436.
    SPRO Customization required:-
    1. Assign plant of delivering company code (Eg.SI81) to sales org/distribution channel combination of ordering company code (Eg.4211/RT)
    2. Maintain intercom any billing type as IV for sales document type OR
    3. Assign Organizational Units By Plant (Eg.SI81/4211/RT/11)
    4.Define Internal Customer Number By Sales Organization (Eg.4436 will create customer master for 4211 company code and that number will be maintained in this relationship:-4211/231)
    5. Automatic posting to vendor account (Optional)
    6. Maintain pricing procedure determination for 4211/RT/A/1/RVAA01-For customer sales and billing
    Maintain pricing procedure determination for 4436/RT/A/1/ICAA01-For intercompony billing
    Master data to be maintained:-
    1. Create end customer master in company code/sales org 4211/RT/11
    2. Create customer master for 4211 company code/sales org in 4436/RT/11
    3. Maintain PR00 as price for end customer-Active in RVAA01
    4. Maintain PI01 as price which has to be paid to 4436-Statistical in RVAA01
    5. Maintain IV01 as inter-company Price-Active in ICAA01
    Process:-
    1. Create OR with sold to party as end customer.
    2. Plant to be selected is delivering plant belonging to different company code. With this selection system will treat this order as intercomany sales.
    3. Pricing procedure is RVAA01
    4. With reference to this order delivery will be created from the delivering plant and post the goods issue for this delivery.
    5. Ordering sales org will create billing document F2 with reference to delivery for end customer.
    6. Delivering sales org will create intercompany billing IV with reference to delivery document.
    I hope this helps you.Reward points if solution is useful.
    Regards,
    Amrish Purohit

  • How to find sales document and billing document number of a accounting doc

    Hi,
    I have opened a accounting doc. using fb03. Now how to find the corresponding sales doc. and billing doc. no. of this accounting doc. no.

    Dear satyam
    Go to SE16 / BKPF, give the accounting document number reference in "Document number" and execute, so that you will get the respective billing document number.  Make a note of it.
    Now go to again SE16 and give table VBFA and give all the billing document references in "Follow-on doc" and maintain "C" in "Prec.doc.categ." and execute.
    Alternatively, you can try with table joining BKPF and VBFA in SQVI.
    thanks
    G. Lakshmipathi

  • Maximum no of Line items for sales order,delivery document and billing docu

    Dear friends,
    How many line items we can enter for the following,
    1) a Sales order
    2) a Delivery document
    3) a Billing Document
    Thanks in advance.
    Regards,
    Shrikant

    Hello,
    the maximum limit of line items are as follows
    order-9999
    for delivery and invocie , it is restricted to 999 accouitng line items. since the tranfer to accounting can handle only 999 items , the restriction on delivery and invocie
    ex if there are excise postings, for a single line , there might be 5/6 lines genetrated for each line in invocie , therfore as per this the line in invocie get restricted
    you have a sap note , which offers suggestions to partially over come this
    hope this helps
    Thanks
    akasha

  • Tables where header text of sale document and bill document is stored

    dear all,
                   i need a table and field in which header text of sale docu is stored .i need to print a text entered by user at the tie of vf01 .
    so plz tell me the table and way how to print that text in print of invoice
    if any function is there for that please also tell me
    waiting for positive response
    regards & thanks

    Take a look at OSS <a href="hhttps://service.sap.com/sap/support/notes/600408">Note 600408 - Smart Forms: header texts and item texts</a>, it may be useful for you
    <i>Symptom
    The system does not print header texts and item texts of the billing document in the Smart Form standard form LB_BIL_INVOICE.
    Other terms
    SMARTFORMS, print, text, completion note, invoice
    Solution
    The following solution describes how to include a 'header note' on header level and an 'item note' on item level in the form.
    If you want to insert other texts into your form, you must adjust the access key (text name, text object, text ID) which you create under point 4 or 11 correspondingly.
    The formatting characteristics of the text are transferred from the billing document to the output. That is, you can change the character format only in the document.
    to correct the form, proceed as follows:
          1. Display form LB_BIL_INVOICE in the change mode of Transaction SMARTFORMS.
          2. Expand the navigation tree on the left side and choose the following path: 'Pages and Windows -> FIRST -> MAIN'.
          3. After text node TITLEINVOICEDETAILS, insert text node HDTEXT with description 'Header text'.
          4. Maintain the general attributes of this node as follows:
              o Text Type: Include Text
              o Text Name:
              o Text Object: VBBK
              o Text ID: 0001
              o Language:
              o No error if no text exists: X
          5. Create the following variable under 'Global Definitions':
          Variable name                    Reference type
          GD_IT_TXT_KEY       TYPE         TDOBNAME
          6. Choose the following path: 'Pages and Windows -> FIRST -> MAIN -> TABLEITEM'. Expand the 'TABLEITEM' table node.
          7. Below the 'TABLEITEM' node (after node IT_REFVG2_COL2_A), insert program line node ITEM_TEXT_KEY with description 'Key for item text'.
          8. Maintain the following parameters for the node:
              o Input parameter: GS_IT_GEN
              o Output parameter: GD_IT_TXT_KEY
          9. Insert the following program lines:
                        clear gd_it_txt_key.
    move gs_it_gen-bil_number to gd_it_txt_key.
    move gs_it_gen-itm_number to gd_it_txt_key+10.
          10. After the new program line node ITEM_TEXT_KEY, insert text node ITEM_TEXT with description 'Item text'.
          11. Maintain the following general attributes of the node:
              o Text Type: Include Text
              o Text Name:
              o Text Object: VBBP
              o Text ID: 0002
              o Language:
              o No error if no text exists: X
          12. Make the following settings under 'Output Options':
              o New Line: X
              o Line Type: IT_DESC
              o New Cell: X,    1 Skip Cells
          13. Activate your form.</i>
    Regards

  • Table link between contract document and billing document

    Hi,
    Please let me know the table link between contract data and its billing plan nnumber.
    Regards,
    bhaarathi.

    VBKD is the Table name
    if Ordertype "G"  <--- that means It is a contract
    From VBAK and VBAP you can get the Contract Details for the Order Type "G"
    Go to Table VBKD, with the contract and get the billing plan .
    FPLNR <--- is the Billing plan
    Here you get the relation Between Contract and Billing Plan

  • Gross Wight is not gettting copied between Delivery and Billing Document

    Hello,
    I´m trying to determine freight costs based on data from Delivery document (essentialy weight). Although, when I change manually the "Total weight" in the Delivery screen (which is actually the gross weight, I assume), this new weight is not copied to the billing document.
    What am I missing in this one?
    Useful answers will be rewarded...
    Adriano Cardoso

    Hi Adrino,
    Please check the copying routines involed between your Delivery document and billing document.
    Transaction VTFL
    I hope it will help you,
    Regards,
    Murali.

  • Sync of Material document and accounting document during MIGO

    Hi Friends,
    Can we synchronize the Document numbers between Material document (WE) for GR (101) and Accounting documents created for the MIGO transaction????
    We have 50 is assigned to WE. But, we have a gap in numbers of Material document number and Accounting document numbers??? though the document type WE is common for both.
    I have seen that "Buffer" is the culprit. But, not sure how to fix that.
    Appreciate your help in this regard.
    Dev.

    When the document type is same (WE) for both, how come the accounting doc has continuous numbers and Material doc has breaks ( from buffer)????
    document type WE is same for GR for material document and accounting docu but number range are stored diffrentely.
    OMBT is where u store the number range for material document
    and this number range is assigned to group of materia doc we wf wo ww
    OMBA is where u create diffrent number range for accounting document hear U assign WE to ur transaction code and in turn WE is assigned a number range what is created in OMBA, this number range is nothing to do with number range u have created in OMBT.
    when ever u post the docunemt in system
    SAp hav efixed the document type for GR that is WE
    it goes in OMBA in the group of Material documents for goods receipts
    check what is the year and number range assigned and current number so it assignes this number first
    than it go to OMBA  cheks what is the Tcode u are using and what is document type u have assigned to that tcode and it can be any WE or what ever u have assigned to that tcode
    taking that doc type it goes and see what Number range is assigned say 50 and then checks company code and year for this 50 and get the number for accounting doc
    so i think its is clear that material and account are 2 diffrent ranges
    skiping of numbers might be due to buffer
    also go throught following post it will be helpfull
    GR NO SEQUENCE - MISMATCH
    hope this helps

  • Unable to Post FI Document through Billing Document in SD(For Credit Card)

    Hi Experts,
    I was able to successfully post FI document through Billing document in SD.
    The Problem is encountered when a Sales Order is created
    for Credit Card customers.
    When the sales order is created the credit card information we are prompted with an error message Payment terms is a required field for G/L Acc so and so...
    The payment terms field in the posting key 01 is marked required and the same field for the reconcilation account is optional. However this config has not created any problem for the Non credit card sales orders.
    If any one has faced the same problem. Please help me out in this issue. I have been working on this for a long time.
    Thanks for your help...
    Thanks,
    Chaitanya

    Hi Folks,
    Please refer SAP OSS Note 119047.
    In the OSS Note they have mentioned..
    Pass the payment terms to the field
    xaccit-zterm = '0001'. in the User Exit.
    Program : LV60BF0C,
    Customer Function ]002'.
    Include File ZXVVFU02.
    Still I don't understand why SAP doesn't support payment terms for Credit Card. But when a Sales Order is  created without credit card the field xaccit-zterm  has a value.
    Thanks,
    Chaitanya K

  • I'm looking for the old toolbar that doesn't double post the web adress and only has single line entries and the extension xpi doesn't work with my new computer

    I'm looking for the old toolbar that doesn't double post the web adress and only has single line entries and the extension xpi doesn't work with my new computer

    Mike wrote:
    > Could someone tell me why this prototype-based lightbox
    seems to work on one
    > of my sites but not on the other?
    >
    > I literally took the exact same .js & css files,
    copied them over from one
    > site to the other, but it's only partially working on
    the new site.
    >
    > Works :
    >
    http://www.roxanacampagiorni.com/
    >
    > Doesn't work :
    >
    http://www.vilverset.com/sample.html
    >
    > Been troubleshooting this one for days, and I'm stumped.
    Script wants
    > nothing to do with lightboxing HTML files on the new
    site. Only straight
    > JPGs. But it was written to work with them, and it
    *does* work with them
    > just fine on the *other* site.
    >
    > Where is the anomaly between the two sites that's
    causing it to break in
    > sample.html?
    >
    >
    Not sure if this is relevant but on the page that works you
    have these
    js files linked - 4.....
    <script type="text/javascript"
    src="/scripts/jscripts.js"></script>
    <script type="text/javascript"
    src="/scripts/prototype.js"></script>
    <script type="text/javascript"
    src="/scripts/effects.js"></script>
    <script type="text/javascript"
    src="/scripts/control.modal.2.2.3.js"></script>
    and on the page that doesn't - 3......
    <script type="text/javascript"
    src="/scripts/prototype.js"></script>
    <script type="text/javascript"
    src="/scripts/effects.js"></script>
    <script type="text/javascript"
    src="/scripts/control.modal.2.2.3.js"></script>
    HTT
    chin chin
    Sinclair

  • Difference amount in sales order and billing document (For one line item)

    Hi Experts,
    User created sales order with 3 line items and billing document. but problem is that there is difference in value of sale order and billing only for line item 10. The remaining items values are same in sales order & billing doc.if I check in sales order condition I found that VPRS condition is used and the value is 692.13and the amount is 3245.26in sales order. But if suppose I check the same value in billing doc the value is 0.69 and the amount is 3245.28. Can u suggest me which configuration I have to check for this.
    I also checked change lock but there is no change in sales and billing document & Material
    Regards
    Sunina agarwal

    Morning Sunina
    Now consider this scenario
    Item a - 10
    Item b - 20
    Item c - 30
    and the validity of condition rec for item C is 31st of Jan
    after 31st JAN the record changes or there isn't any.
    In Copy control the pricing type is 'B' i.e., carry out new pricing.
    Now if the document is created in January it will take all the above prices. and this document is then billed in Feb. Now the copycontrol, whilst copying the prices, will predetermine the same.
    Now your task is to check if there was user intervention, check the pricing in order and check what condition types got affected in order and in billing.
    If your scenario is still not amongst the above cases...
    I don't know what to do, if you figure out please let us also know, god know when we would face the same scenario....
    Take care

  • Problem with copy control from sales document to billing document

    Hi,
    I have a copy control from a sales document to a billing document,
    which is copying everything from the sales document, except the
    conditoin values. Any ideas on why will a copy routine won't copy the
    condition values from a source document? I don't even have a document
    pricing procedure assigned to my billing document. Any setting, that
    we can do to for the conditions to get copied from the sales document
    to the billing document...just as they are in the sales document?
    Thanks for the help in advance.
    Regards,
    Vijay

    In IMG,
    Implementation Guide for R/3 Customizing (IMG)
    -->Sales and Distribution
       -->Billing
          -->Billing Documents
             -->Maintain Copying Control For Billing Documents
                -->Copying control: Sales document to billing document
    What setting do you have for your source sales document type to target billing document type? Select the row that shows the document type you are interested in and double click on item(on the left pane). Select the item category and do display. What value do you see under the 'Pricing Type' and 'Price Source'?
    May be that is where some config setting is missing.
    Srinivas

  • From which tables i would find the delivery and billing document field..??

    I need to create an ALV report which displays the following details in the output.
    Order No  Item No     Material     Order Qty     Item Category     Plant     Delivery     Billing Document     Sales Org     Dist Channel     Division     Created By     Created On      Changed On
    For(Order No  Item No     Material     Order Qty     Item Category     Plant) i took the fields from vbap and
    for(Sales Org     Dist Channel     Division     Created By     Created On      Changed On)i took the fields from vbak..
    From which tables i would find the delivery and billing document field related to sales document.??
    need help...
    Moderator message : Requirements dumping not allowed, thread locked.
    Edited by: Vinod Kumar on Mar 6, 2012 2:53 PM

    i am new to abap...so i dont have idea about sd table relationship.
    so please reply how to add delivery and billing doc in my coding below..
    *& Report  ZINAA_SD
    REPORT  zinaa_sd.
    TABLES: vbap, vbak, vbfa.
    TYPE-POOLS: slis.
    CONSTANTS: c_x TYPE char1 VALUE 'X'.
    TYPES:
            BEGIN OF st_vbap,
             vbeln TYPE vbap-vbeln,
             posnr TYPE vbap-posnr,
             matnr TYPE vbap-matnr,
             pstyv TYPE vbap-pstyv,
             kwmeng TYPE vbap-kwmeng,
             werks TYPE vbap-werks,
            END OF st_vbap,
            BEGIN OF st_vbak,
              vbeln TYPE vbak-vbeln,
              erdat TYPE vbak-erdat,
              ernam TYPE vbak-ernam,
              vkorg TYPE vbak-vkorg,
              vtweg TYPE vbak-vtweg,
              spart TYPE vbak-spart,
              aedat TYPE vbak-aedat,
            END OF st_vbak, 
           BEGIN OF st_final,
             vbeln TYPE vbap-vbeln,
             posnr TYPE vbap-posnr,
             matnr TYPE vbap-matnr,
             pstyv TYPE vbap-pstyv,
             kwmeng TYPE vbap-kwmeng,
             werks TYPE vbap-werks,
             erdat TYPE vbak-erdat,
             ernam TYPE vbak-ernam,
             vkorg TYPE vbak-vkorg,
             vtweg TYPE vbak-vtweg,
             spart TYPE vbak-spart,
             aedat TYPE vbak-aedat,
           END OF st_final.
    DATA:
          lt_vbap TYPE TABLE OF st_vbap,
          ls_vbap TYPE st_vbap,
          lt_vbak TYPE TABLE OF st_vbak,
          ls_vbak TYPE st_vbak,
          lt_final TYPE TABLE OF st_final,
          ls_final TYPE st_final,
          lt_fieldcat TYPE slis_t_fieldcat_alv,
          ls_fieldcat TYPE slis_fieldcat_alv,
          layout TYPE slis_layout_alv,
          lt_sort TYPE slis_t_sortinfo_alv,
          ls_sort TYPE slis_sortinfo_alv.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_vbeln FOR vbap-vbeln,
                    s_erdat FOR vbap-erdat.
    SELECTION-SCREEN END OF BLOCK b1.
    PERFORM select_data.
    PERFORM loop_final.
    PERFORM sort.
    PERFORM a USING:
          'VBELN' TEXT-002,
          'POSNR' TEXT-003,
          'MATNR' TEXT-004,
          'KWMENG' TEXT-005,
          'PSTYV' TEXT-006,
          'WERKS' TEXT-007,
          'VKORG' TEXT-008,
          'VTWEG' TEXT-009,
          'SPART' TEXT-010,
          'ERNAM' TEXT-011,
          'ERDAT' TEXT-012,
          'AEDAT' TEXT-013.
    PERFORM display.
    *&      Form  SELECT_DATA
          text
    FORM select_data.
      SELECT
       vbeln
       vkorg
       vtweg
       spart
       ernam
       erdat
       aedat
       INTO CORRESPONDING FIELDS OF TABLE lt_vbak
       FROM vbak
       WHERE vbeln IN s_vbeln AND erdat IN s_erdat.
      IF sy-subrc = 0.
        SORT lt_vbak by vbeln.
      ENDIF.
      SELECT
       vbeln
       posnr
       matnr
       kwmeng
       pstyv
       werks
       INTO CORRESPONDING FIELDS OF TABLE lt_vbap
       FROM vbap
       FOR ALL ENTRIES IN lt_vbak
       WHERE vbeln = lt_vbak-vbeln.
      IF sy-subrc = 0.
        SORT lt_vbap by vbeln.
      ENDIF.
    ENDFORM.                    "SELECT_DATA
    *&      Form  LOOP_FINAL
          text
    FORM loop_final.
      LOOP AT lt_vbap INTO ls_vbap.
        ls_final-vbeln = ls_vbap-vbeln.
        ls_final-posnr = ls_vbap-posnr.
        ls_final-matnr = ls_vbap-matnr.
        ls_final-kwmeng = ls_vbap-kwmeng.
        ls_final-pstyv = ls_vbap-pstyv.
        ls_final-werks = ls_vbap-werks.
        READ TABLE lt_vbak INTO ls_vbak WITH KEY vbeln = ls_vbap-vbeln BINARY SEARCH.
        ls_final-vkorg = ls_vbak-vkorg.
        ls_final-vtweg = ls_vbak-vtweg.
        ls_final-spart = ls_vbak-spart.
        ls_final-ernam = ls_vbak-ernam.
        ls_final-erdat = ls_vbak-erdat.
        ls_final-aedat = ls_vbak-aedat.
        APPEND ls_final TO lt_final.
        CLEAR ls_final.
      ENDLOOP.
      ENDFORM.                    "LOOP_FINAL
    *&      Form  SORT
          text
    FORM sort.
      ls_sort-spos = '01' .
      ls_sort-fieldname = 'VBELN'.
      ls_sort-tabname = 'LT_FINAL'.
      ls_sort-up = c_x.
      ls_sort-subtot = c_x.
      APPEND ls_sort TO lt_sort .
    ENDFORM.                    "SORT
    *&      Form  A
          text
         -->FNAME      text
         -->SELTEXT    text
         -->EMPHA      text
    FORM a USING fname TYPE string seltext TYPE string.
      IF fname = 'KWMENG'.
        ls_fieldcat-do_sum =  c_x.
      ENDIF.
      ls_fieldcat-fieldname = fname.
      ls_fieldcat-seltext_m = seltext.
      APPEND ls_fieldcat TO lt_fieldcat.
      CLEAR ls_fieldcat.
    ENDFORM.                    "A
    *&      Form  ALV
          text
    FORM display.
      layout-zebra = c_x.
      layout-colwidth_optimize = c_x.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       i_callback_program                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
        is_layout                         = layout
        it_fieldcat                       = lt_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
        it_sort                           = lt_sort
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = C_X
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
        t_outtab                          = lt_final
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "ALV

Maybe you are looking for