Clearing partially a document using POSTING_INTERFACE_CLEARING

Hello.
I want to clear <b>partially</b> a financial document using POSTING_INTERFACE_CLEARING (transaction FB05), but when I try to do it, I obtain an error "No data for SAPDF05X dynpro 3100".
I can clear it completely.
Is it possible to clear partially a financial document?
Thanks very much.

Hi Friends,
I had the same problem (partially) and solved it by the FM with a simple solution.
When the value is not same, you can post other document, to costumer like this:
Batch Input Values
lt_ftpost-stype = 'P'."Header
lt_ftpost-count =  2. "number of Dynpro
lt_ftpost-fnam = 'RF05A-NEWBS'.
lt_ftpost-fval = '40'. "
*Same type as documents cleared via F-32
APPEND lt_ftpost.
lt_ftpost-count =  2. "number of Dynpro
lt_ftpost-fnam = 'RF05A-NEWKO'.
lt_ftpost-fval = gl_account "G/L account.
*Same type as documents cleared via F-32
APPEND lt_ftpost.
lt_ftpost-stype = 'P'."Header
lt_ftpost-count =  2. "number of Dynpro
lt_ftpost-fnam = 'BSEG-WRBTR'.
lt_ftpost-fval = '600,00'. " the partially amount.
*Same type as documents cleared via F-32
APPEND lt_ftpost.
Batch Input Values
lt_ftpost-stype = 'P'."Header
lt_ftpost-count =  3. "number of Dynpro
lt_ftpost-fnam = 'RF05A-NEWBS'.
lt_ftpost-fval = '01'. "costumer account.
*Same type as documents cleared via F-32
APPEND lt_ftpost.
lt_ftpost-count =  3. "number of Dynpro
lt_ftpost-fnam = 'BSEG-HKONT'.
lt_ftpost-fval = '9000125'. "costumer account
*Same type as documents cleared via F-32
APPEND lt_ftpost.
lt_ftpost-stype = 'P'."Header
lt_ftpost-count =  3. "number of Dynpro
lt_ftpost-fnam = 'BSEG-WRBTR'.
lt_ftpost-fval = '400,00'. "residual amount
*Same type as documents cleared via F-32
APPEND lt_ftpost.
Documents to be cleared
lt_ftclear-agkoa = 'D'. "Account Type
lt_ftclear-xnops = 'X'. "Indicator: Select only open items which are not special G/L?
"LT_FTCLEAR-XFIFO = 'X'.
lt_ftclear-agbuk = p_bukrs. "Example company code
lt_ftclear-agkon = p_kunnr. "Example Customer
lt_ftclear-selfd = 'BELNR'."Selection Field
lt_ftclear-selvon = p_doc1. "document selected
lt_ftclear-selbis = p_doc1.
APPEND lt_ftclear.

Similar Messages

  • Clearing partial payments using POSTING_INTERFACE_CLEARING

    Hi
    I'm trying to clear partial payment of a document number.
    I succeeded to clear full payment but not partial.
    where and how should  i send the partial amount??
    Thanks.

    you can only clear partial payments with tcode fb05 (Dynpro partial pmt.)
    A.

  • How to use function to Post with Clearing - Partial Pymnt with FB05

    hi,Dears,
    I am write a function to post with clearing - partial pymnt or Res. Items with FB05, but there is no any BAPI to do that, and I find the function POSTING_INTERFACE_CLEARING.
    but it seems that the function is only for Post with Clearing-Standard Screen, how to use that function to post with clearing - partial pymnt or Res. Items???
    Many thanks.

    Hi  Guys,
    If you post partiall payment you don't clear the invoice. Just post a normal item and fill the connection with the invoice, filling fields rebzg, rebzj, rebzz.
      PERFORM fill_ftpost using:
                       'P' '3' 'BSEG-BSCHL' '15', "
                       'P' '3' 'BSEG-HKONT'  customer_id ,
                       'P' '3' 'BSEG-WRBTR'  tmpt,
                       'P' '3' 'BSEG-GSBER'  it_pozkli-gsber,
                       'P' '3' 'BSEG-SGTXT'  'Patial payment',
                       'P' '3' 'BSEG-REBZG'  it_pozkli-belnr,
                       'P' '3' 'BSEG-REBZJ'  it_pozkli-gjahr,
                       'P' '3' 'BSEG-REBZZ'  it_pozkli-buzei.

  • Clearing two documents with POSTING_INTERFACE_CLEARING

    Hi, all
    I'm trying to use POSTING_INTERFACE_CLEARING function module to clearing two documents each other with
    additional cost. It's detail is like belows:
    1st,
    01(D) Customer A/R (100 EUR)  
    50(C) Sale (100 EUR)
    2nd,
    40(D) Bank Account (80 EUR)    
    50(C) Imcoming (80 EUR)
    3rd,
    40(D) Incoming (80 EUR)
    40(D) Cost for sale (20 EUR)        
    15(C) Customer A/R (100 EUR)
    Function Module really works fine.
    But the problem is that it displays popup dialog box asking whether to post
    the different amount of 1st and 2nd documents.
    I have to suppress this dialog box.
    But I could not found any way to hide it.
    I hope there would be some helpful replies...
    Thanks and regards,
    Lee

    hi,
    i think that's not possible to block this.
    an alternativfe is abap <b>rfbibl00</b> (see docu with trx. se38)
    A.

  • Error Rounding Difference too high when reset cleared document using FBRA

    My Client has posted cleared document with T_Code F-51. This cleared document has cleared 6040 open items.
    And now, they want to reset and reverse that cleared document.
    We found error "Rounding difference too high" when we are reset cleared document using FBRA.
    Kindly need your advice.
    Many thanks in advance.
    Regards,

    Hello,
    Please let me know the ERROR number.
    Regards,
    Ravi

  • Window pops up stating"browser error" when trying to access documents using google doc's. Holding shift key and refresh does not clear window. What's next?

    Shut down and restarted computer, "browser error" still pops up when trying to access documents using Google doc's.
    Holding shift key and clicking refresh does not clear window.
    What else can be done to clear the window and gain access to my documents?

    Hi,
    Found a note explaining the significance of these errors.
    It says:
    "NZE-28862: SSL connection failed
    Cause: This error occurred because the peer closed the connection.
    Action: Enable Oracle Net tracing on both sides and examine the trace output. Contact Oracle Customer support with the trace output."
    For further details you may refer the Note: 244527.1 - Explanation of "SSL call to NZ function nzos_Handshake failed" error codes
    Thanks & Regards,
    Sindhiya V.

  • Hello, I have installed a new Laserjet Pro M1217nfl using Wi-Fi. My laptop prints everything e-mails, Word documents etc. My iPad 3 (latest issue) only prints documents using Wi-Fi so has clearly recognised the printer. How can I prin e-mails using iPad 3

    Hello, I have installed a new Laserjet Pro M1217nfl using Wi-Fi. My laptop prints everything e-mails, Word documents etc. My iPad 3 (latest issue) only prints documents using Wi-Fi so has clearly recognised the printer. How can I print e-mails? Thanks.

    In the email you want to print, on the top right there is an arrow. Click that and an option should appear that says print. That should work. Have you already tried that?

  • In WM how to clear partially difference in an open storage type with one mi

    Hi
    I would like to know how in WM to clear partially differences in an open storage type with one mixed bin not totally counted?
    thanks in advance
    cadanj

    Please do the inventory check for the whole bin.Count the each quant of the material. Difference can be cleared.Use following transactions.
    1.LI01N-Create Inventory document.
    2.LI11N-Enter inventory count.
    3.LI20-Clear WM differences
    4.LI21-Clera IM differences.
    Let me know if u have any other question.
    Regards,
    PRashant

  • FB05 posting problem using POSTING_INTERFACE_CLEARING

    Hi All,
      I have a problem posting FB05 using POSTING_INTERFACE_CLEARING.My requirement is to select open item based on document number and then create another leg for that open item using GL account,posting key and amount that matches the selected open item amount.
    I am not sure whether I am not doing the right thing because I get an error 'Difference is too large for  clearing'. If I actually go to FB05 and 'choose open item' for document number and try to hit 'Save' on the list of open items screen,I get the same error. I then  select 'Charge off difference' and it takes me to screen that is quite similar to FB01 and I enter the other leg of the entry i.e posting key,acct no,amount etc.I want to replicate the same process using funtion module.I am sending you the code,please help me.
    start-of-selection.
      i_splitinput-compcode = '0410'.
      i_splitinput-currency = 'USD'.
      i_splitinput-amount = '299'.
      i_splitinput-reference = '90286483'.
      i_splitinput-date = '20090320'.
      i_splitinput-type = 'D'.
      i_splitinput-clearingacct = '101002'.
      append i_splitinput.
      loop at i_splitinput.
        at first.
          perform posting_interface_start using 'C'.
        endat.
        at new currency.
          perform f_create_document_header using i_splitinput-compcode
                                                 i_splitinput-currency.
        endat.
        perform f_create_document_items .
        at end of currency.
          perform f_post_gl_document.
        endat.
        at last.
          perform f_posting_interface_end.
        endat.
      endloop.
    *&      Form  posting_interface_start
          text
         -->P_P_TYPE  text
    form posting_interface_start  using    p_type.
      data lv_mode type c value 'N'.
      if p_type = 'C'.
        call function 'POSTING_INTERFACE_START'
          exporting
            i_function         = 'C'
            i_mode             = lv_mode
            i_update           = 'S'
          exceptions
            client_incorrect   = 1
            function_invalid   = 2
            group_name_missing = 3
            mode_invalid       = 4
            update_invalid     = 5
            others             = 6.
        if sy-subrc <> 0.
          message 'Error initializing posting interface'(e05) type 'I'.
        endif.
      endif.
    endform.                    " posting_interface_start
    *&      Form  f_create_document_header
          text
    -->  p1        text
    <--  p2        text
    form f_create_document_header using p_compcode p_currency.
      data: l_waers type waers,
    l_postdate(10) type c,
    l_docdate(10),
    l_bktxt type bktxt,
    l_blart type blart.
    *---Convert dates to proper format MM/DD/YYYY
      write p_pstdat to l_postdate mm/dd/yyyy.
      write p_docdat to l_docdate  mm/dd/yyyy.
      i_ftpost-stype = 'K'.   "Header
      i_ftpost-count = 1.
      perform ftpost_field using: 'BKPF-BUKRS' p_compcode,  "Company Cd
                                  'BKPF-WAERS' p_currency,  "Doc Currency
                                  'BKPF-BLART' p_doctyp,  "Doc Type
                                  'BKPF-BLDAT' l_docdate,   "Doc Date
                                  'BKPF-BUDAT' l_postdate,   "Posting Dt
                                  'BKPF-BKTXT' p_doctxt,  "Header Text
                                  'BKPF-XBLNR' p_ref,     "Ref Doc
                                  'RF05A-AUGTX' 'Test'.  "Clearing item text
    *creditnote to your own
    *debit to customer but sometimes you post credit
    *payor-vendor +ve    payee-customer  -ve
      i_ftpost-count = 0.
    endform.                    " f_create_document_header
    *&      Form  ftpost_field
          text
         -->P_1045   text
         -->P_PA_BUKRS  text
    form ftpost_field using field_name type any
                            field_value type any.
      i_ftpost-fnam = field_name.
      i_ftpost-fval = field_value.
      append i_ftpost.
    endform.                    " ftpost_field
    *&      Form  f_create_document_items
          text
    -->  p1        text
    <--  p2        text
    form f_create_document_items .
    *concatenate i_splitinput
      i_ftclear-agkoa  = 'D'."D-cust, v-vend
      i_ftclear-agkon  = '1041048'."cust/ven acct
      i_ftclear-agbuk  = i_splitinput-compcode.
      i_ftclear-xnops  = 'X'.
      i_ftclear-xfifo  = space.
      i_ftclear-agums  = space.
      i_ftclear-avsid  = space.
      i_ftclear-selfd  = 'BELNR'.
      i_ftclear-selvon = i_splitinput-reference.
      i_ftclear-selbis = 'Test'.                              
      collect i_ftclear.clear i_ftclear.
    i_ftclear-selvon = '101002'.
    i_ftclear-selbis = '101002'.                           
    append i_ftclear.
      i_ftpost-stype = 'P'.  "Details
      i_ftpost-count = i_ftpost-count + 1.
      perform ftpost_field using: 'RF05A-NEWBS' '15',      "Post Key
                                  'RF05A-NEWKO' '1071990',   "GL Account
                                  'BSEG-WRBTR'  '299',     "DC Amount
                                  'BSEG-SGTXT'  'SAN'.      "Item Text
                                 'BSEG-ZUONR'  i_post-merchant_id.
    *lt_ftclear-selvon = p_doc2.
    *lt_ftclear-selbis = p_doc2.
    *APPEND lt_ftclear.
    endform.                    " f_create_document_items
    *&      Form  f_post_gl_document
          text
    -->  p1        text
    <--  p2        text
    form f_post_gl_document .
      refresh i_blntab.
      clear i_blntab.
      call function 'POSTING_INTERFACE_CLEARING'
        exporting
          i_auglv                          = 'UMBUCHNG'
          i_tcode                          = 'FB05'
        I_SGFUNCT                        = ' '
        I_NO_AUTH                        = ' '
        importing
          e_msgid                          = v_msgid
          e_msgno                          = v_msgno
          e_msgty                          = v_msgty
          e_msgv1                          = v_msgv1
          e_msgv2                          = v_msgv2
          e_msgv3                          = v_msgv3
          e_msgv4                          = v_msgv4
          e_subrc                          = g_subrc
        tables
          t_blntab                         = i_blntab
          t_ftclear                        = i_ftclear
          t_ftpost                         = i_ftpost
          t_fttax                          = i_fttax
       exceptions
         clearing_procedure_invalid       = 1
         clearing_procedure_missing       = 2
         table_t041a_empty                = 3
         transaction_code_invalid         = 4
         amount_format_error              = 5
         too_many_line_items              = 6
         company_code_invalid             = 7
         screen_not_found                 = 8
         no_authorization                 = 9
         others                           = 10
      if sy-subrc <> 0.
        v_message = 'Posting Interface Error.'.
      endif.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = v_msgid
            lang      = sy-langu
            no        = v_msgno
            v1        = v_msgv1
            v2        = v_msgv2
            v3        = v_msgv3
            v4        = v_msgv4
          IMPORTING
            msg       = v_message
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
    WRITE : V_MESSAGE.
    endform.                    " f_post_gl_document
    *&      Form  f_posting_interface_end
          text
    -->  p1        text
    <--  p2        text
    form f_posting_interface_end .
      call function 'POSTING_INTERFACE_END'
        exporting
          i_bdcimmed              = ' '
        exceptions
          session_not_processable = 1
          others                  = 2.
      if sy-subrc <> 0.
      endif.
    endform.                    " f_posting_interface_end
    Thanks in advance.

    Hi Abaper,
      This is in continuation of my previous email,I am sending you my code.Please take a look and let me know your suggestions.Also can you please share with me your code if you have ever worked with FB05.
    Also I have debugged and found that at the end on program SAFM05A screen 0733 ,the code enters document number BELNR and does okcode - /11. This takes to the screen SAPDF05X  screen 3100 where it does try to save.I believe 3100 is a final screen according to the FM code but there is something I may not be passing which is not allowing it to save.
    *Session header
          perform populate_xbgr00.
          append xbgr00 to dataset.
        write p_docdat to p_docdat mm/dd/yy.
        write p_pstdat to p_pstdat mm/dd/yy.
    *Document header
              perform populate_xbbkpf using
                i_splitinput-compcode
                p_docdat
                p_pstdat
                p_doctyp
                 i_splitinput-currency
                sum_inprec_hd_tmp-xblnr
                'Test'.
              append xbbkpf to dataset.
    *bbseg bselk and bselp
            perform populate_xbbseg .
    *********forms
    form populate_xbgr00 .
      move '0' to xbgr00-stype.
      move 'zsan' to xbgr00-group.
      move sy-mandt to xbgr00-mandt.
      move sy-uname to xbgr00-usnam.
      move 'X' to xbgr00-xkeep.
    move space to xbgr00-xkeep.
      move '/' to xbgr00-nodata.
    endform.                    " populate_xbgr00
    form populate_xbbkpf  using  p1 p2 p3 p4 p5  p7.
      move '1' to xbbkpf-stype.
      move 'FB05' to xbbkpf-tcode.
      move p2 to xbbkpf-bldat.
      move p4 to xbbkpf-blart.
      move p1 to xbbkpf-bukrs.
      move p3 to xbbkpf-budat.
      move '/' to xbbkpf-monat.
      move p5 to xbbkpf-waers.
      move '/' to xbbkpf-kursf.
      move '/' to xbbkpf-belnr.
      move '/' to xbbkpf-wwert.
    move p6 to xbbkpf-xblnr.
      move '/' to xbbkpf-bvorg.
      move p7 to xbbkpf-bktxt.
      move '/' to xbbkpf-pargb.
      move 'UMBUCHNG' to xbbkpf-auglv.
    endform.
    form populate_xbbseg  .
      move '2' to xbbseg-stype.
      move 'BBSEG' to xbbseg-tbnam.
      move '15'  to xbbseg-newbs.
      move '100'  to xbbseg-wrbtr.
      move 'Assign'  to xbbseg-zuonr.
      move 'Itemtext'  to xbbseg-sgtxt.
      move I_SPLITINPUT-CLEARINGACCT to xbbseg-newko.        "G/L
      append xbbseg to dataset.
    xbselk-stype = '2'.
    xbselk-agkon = 'CUST0010'.
    xbselk-agbuk = i_splitinput-compcode.
    xbselk-agkoa = 'K'.
    xbselk-sende = '/'.
    xbselk-tbnam = 'BSELK'.
    XBSELK-XNOPS = 'X'.
    append xbselk to dataset.
    xbselp-stype = '2'.
    xbselp-feldn_1 = 'BELNR'.
    xbselp-slvon_1 = i_splitinput-reference.
    xbselp-slbis_1 = 'Test'.
    xbselp-tbnam = 'BSELP'.
    append xbselp to dataset.
    endform
    Edited by: abap78 on Mar 23, 2009 5:10 AM

  • Error While Posting documents using F-28

    Dear Friends,
                            While posting Documents using 'F-28' after I passed posting key and account number I m getting the Error
    'Entry not Possible'. Can anyone tell what may be the problem how to clear this error.
    Regards
    Balamurugan N
    Moderator message: duplicate post locked, follow up on your previous one instead of opening a new thread for the identical problem.
    Edited by: Thomas Zloch on Apr 26, 2011 8:34 PM

    Hi,
    I Guess this error is occuring because of the posting key and account number (Account type) combination is not correct. For each account type a perticular posting is is defined for debit and credit entries.
    Check with your functional the correct posting key for account type and account number you are using.

  • How to clear the open documents in case if document currency and local curr

    Hi,
        Can anyboday advise how to clear the open document of a particular vendor for a particular company code. Here the issue is that balace is netted to Zero in the document currency but not in the local currency. The document was posted in Currency CAD and the local currency is GBP.
    When i check the FBL1N, there is it showing net balance is ZERO, but document is still in open
    status. I tried using Transaction code F-44, but it is not allowing me.
    Can anyboday advise how to perform this. Points will be awarded.
    Regards,
    Sree.

    Hi,
    In the Company code global parameters(OBY6),select the check box "NO FOREX RATE DIFF.WHEN CLEARING IN LC"
    and try clearing again.(You can have a F1 help on the check box to see what exactly it is).
    Hope this will resolve
    Assign points if useful
    Thanks
    Aravind
    Edited by: Aravind Aitipamula on May 22, 2008 1:36 AM

  • How to clear vendor open documents

    How to clear vendor open documents, I had previously tried to clear the documents in PRD with transaction F-44 and I get the following message.
    X. Ex.rate diff.accts are incomplete for account 00015080 currency CAD

    You can clear using the t code F-44 which is manual or by using F.13 which is automatic.
    The error you are getting is with refernce to a transaction between your Local currency and Currency "CAD"
    Maintain a transalation ratio and the exchange rate. Here the system also looks for a exchange loss or gain on such conversion also. Map those accounts and you will be clearing the transaction.
    If you are using automacti clearing you need to decide on the link(Common feild)  between the DR open item and CR open item and these open items after having this as a refernce can be cleared automatcially in F.13.
    Hope you understood.
    Reward points if useful.
    sarma

  • How 2 creat report for displaying the details of a Delivery Document using

    how to create report for displaying the details of a Delivery Document using the tables LIKP, LIPS
    thank you
    regards,
    jagrut bharatkumar shukla
    points will be rewarded

    HI
    I AM GIVING YOU MY DELIVERY DOCUMENT CODE...MODIFY IT ACCORDING TO YOUR REQUIREMENT
    *& Report  ZDELIVERY                                *
    report  zdelivery  message-id z9bhu          .
    types: begin of t_likp,
               vbeln type likp-vbeln,      "Delivery
               erdat type likp-erdat,      "Date for rec creation
    *           LFDAT TYPE LIKP-LFDAT,      "Delevery Date
    *           WAERK TYPE LIKP-WAERK,      "Currency
               kunnr type likp-kunnr,      "Ship-To Party
               kunag type likp-kunag,      "Sold-to party
               traty type likp-traty,      "Means-of-Transport
           end of t_likp.
    types: begin of t_lips,
               vbeln type lips-vbeln,      "Delivery
               posnr type lips-posnr,      "Delivery item
               matnr type lips-matnr,      "Material Number
               arktx type lips-arktx,      "Short Text for Sales Order Item
               lfimg type lips-lfimg,      "Actual quantity delivered
               netpr type lips-netpr,
    *           MEINS TYPE LIPS-MEINS,      "Base Unit of Measure
               vgbel type lips-vgbel,      "Doc no of the reference document
            end of t_lips.
    types: begin of t_vbpa,
               vbeln type vbpa-vbeln,      "SD DocumenT Number
               posnr type vbpa-posnr,      "Item number
               parvw type vbpa-parvw,      "Partner function
               kunnrb type vbpa-kunnr,      "Customer Number 1
           end of t_vbpa.
    types: begin of t_kna1,
               kunnr type kna1-kunnr,      "Customer Number 1
               name1 type kna1-name1,      "Name 1
               ort01 type kna1-ort01,      "City
               adrnr type kna1-adrnr,      "Address
           end of t_kna1.
    types: begin of t_li_vbpa,
               vbeln type likp-vbeln,      "Delivery
               erdat type likp-erdat,      "Date for rec creation
    *           LFDAT TYPE LIKP-LFDAT,      "Delevery Date
    *           WAERK TYPE LIKP-WAERK,      "Currency
               kunnr type likp-kunnr,      "Ship-To Party
               kunag type likp-kunag,      "Sold-to party
               traty type likp-traty,      "Means-of-Transport
               vbeln1 type lips-vbeln,      "Delivery
               posnr type lips-posnr,      "Delivery item
               matnr type lips-matnr,      "Material Number
               arktx type lips-arktx,      "Short Text for Sales Order Item
               lfimg type lips-lfimg,      "Actual quantity delivered
               netpr type lips-netpr,      "Net Price
    *           MEINS TYPE LIPS-MEINS,      "Base Unit of Measure
               vgbel type lips-vgbel,      "Doc no of the reference document
               vbeln3 type vbpa-vbeln,     "SD DocumenT Number
               parvw type vbpa-parvw,      "Partner function
               kunnrb type vbpa-kunnr,      "Customer Number 1
           end of t_li_vbpa.
    types: begin of t_final,
               vbeln type likp-vbeln,      "Delivery
               erdat type likp-erdat,      "Date for rec creation
               kunnr type likp-kunnr,      "Ship-To Party
               kunag type likp-kunag,      "Sold-to party
               traty type likp-traty,      "Means-of-Transport
               vbeln1 type lips-vbeln,      "Delivery
               posnr type lips-posnr,      "Delivery item
               matnr type lips-matnr,      "Material Number
               arktx type lips-arktx,      "Short Text for Sales Order Item
               lfimg type lips-lfimg,      "Actual quantity delivered
               netpr type lips-netpr,      "Net Price
               vgbel type lips-vgbel,      "Doc no of the reference document
               vbeln3 type vbpa-vbeln,     "SD DocumenT Number
               parvw type vbpa-parvw,      "Partner function
               kunnrb type vbpa-kunnr,     "Customer Number 1
               name1 type kna1-name1,      "Name 1
               ort01 type kna1-ort01,      "City
               adrnr1 type kna1-adrnr,     "Address
               name2 type kna1-name1,      "Name 1
               ort02 type kna1-ort01,      "City
               adrnr2 type kna1-adrnr,     "Address
               name3 type kna1-name1,      "Name 1
               ort03 type kna1-ort01,      "City
               adrnr3 type kna1-adrnr,     "Address
           end of t_final.
    *            D A T A  D E C L A R A T I O N
    *&*********Internal Table Declaration****************&*
    data: it_likp type standard table of t_likp.
    data: it_lips type standard table of t_lips.
    data: it_vbpa type standard table of t_vbpa.
    data: it_kna1 type standard table of t_kna1.
    data: it_li_vbpa type standard table of t_li_vbpa.
    data: it_li_vbpa_temp type standard table of t_li_vbpa.
    data: it_final type standard table of t_final.
    *&*********Work Area Declaration********************&*
    data: wa_likp type t_likp.
    data: wa_lips type t_lips.
    data: wa_vbpa type t_vbpa.
    data: wa_kna1 type t_kna1.
    data: wa_li_vbpa type t_li_vbpa.
    data: wa_li_vbpa_temp type t_li_vbpa.
    data: wa_final type t_final.
    *&*********Data Declaration************************&*
    data: d_vbeln type likp-vbeln.
    data: flag type i value 0.
    *           S E L E C T I O N  S C R E E N   D E C L A R A T I O N
    selection-screen begin of block block2 with frame title text-001.
    select-options: s_vbeln for d_vbeln obligatory.    "Delivery no
    selection-screen end of block block2.
    *            A T  S E L E C T I O N - S C R E E N   E V E N T S
    *AT SELECTION-SCREEN.
    *PERFORM VALIDATE_DATA.
    *            S T A R T   O F  S E L E C T I O N     E V E N T S
    start-of-selection.
    perform fetch_data.
    perform merge_data_kna1.
    *INCLUDE Z9BT_SH_***4_FORMS.
    call function 'OPEN_FORM'
    exporting
    *   APPLICATION                       = 'TX'
    *   ARCHIVE_INDEX                     =
    *   ARCHIVE_PARAMS                    =
        device                            = 'PRINTER'
    *   DIALOG                            = 'X'
    *   FORM                              = ' '
       language                          = sy-langu
    *   OPTIONS                           =
    *   MAIL_SENDER                       =
    *   MAIL_RECIPIENT                    =
    *   MAIL_APPL_OBJECT                  =
    *   RAW_DATA_INTERFACE                = '*'
    *   SPONUMIV                          =
    * IMPORTING
    *   LANGUAGE                          =
    *   NEW_ARCHIVE_PARAMS                =
    *   RESULT                            =
    exceptions
       canceled                          = 1
       device                            = 2
       form                              = 3
       options                           = 4
       unclosed                          = 5
       mail_options                      = 6
       archive_error                     = 7
       invalid_fax_number                = 8
       more_params_needed_in_batch       = 9
       spool_error                       = 10
       codepage                          = 11
       others                            = 12
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    sort it_final by vbeln.
    loop at it_final into wa_final.
    call function 'START_FORM'
    exporting
    *   ARCHIVE_INDEX          =
       form                   = 'Z9BT_DELIVERY'
       language               = sy-langu
    *   STARTPAGE              = ' '
    *   PROGRAM                = ' '
    *   MAIL_APPL_OBJECT       =
    * IMPORTING
    *   LANGUAGE               =
    exceptions
       form                   = 1
       format                 = 2
       unended                = 3
       unopened               = 4
       unused                 = 5
       spool_error            = 6
       codepage               = 7
       others                 = 8
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function 'WRITE_FORM'
    exporting
       element                        = 'ITEM_LIST'
       function                       = 'SET'
       type                           = 'BODY'
       window                         = 'MAIN'
    * IMPORTING
    *   PENDING_LINES                  =
    * EXCEPTIONS
    *   ELEMENT                        = 1
    *   FUNCTION                       = 2
    *   TYPE                           = 3
    *   UNOPENED                       = 4
    *   UNSTARTED                      = 5
    *   WINDOW                         = 6
    *   BAD_PAGEFORMAT_FOR_PRINT       = 7
    *   SPOOL_ERROR                    = 8
    *   CODEPAGE                       = 9
    *   OTHERS                         = 10
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function 'END_FORM'
    * IMPORTING
    *   RESULT                         =
    exceptions
       unopened                       = 1
       bad_pageformat_for_print       = 2
       spool_error                    = 3
       codepage                       = 4
       others                         = 5
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endloop.
    call function 'CLOSE_FORM'
    * IMPORTING
    *   RESULT                         =
    *   RDI_RESULT                     =
    * TABLES
    *   OTFDATA                        =
    exceptions
       unopened                       = 1
       bad_pageformat_for_print       = 2
       send_error                     = 3
       spool_error                    = 4
       codepage                       = 5
       others                         = 6
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    *&      Form  VALIDATE_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form validate_data .
    select single vbeln into wa_likp-vbeln
                        from likp where vbeln in s_vbeln.
    append wa_likp to it_likp.
    if sy-subrc <> 0.
    flag = 1.
    endif.
    endform.                    " VALIDATE_DATA
    *&      Form  FETCH_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form fetch_data .
    select a~vbeln
           a~erdat
           a~kunnr
           a~kunag
           a~traty
           b~vbeln
           b~posnr
           b~matnr
           b~arktx
           b~lfimg
           b~netpr
           b~vgbel
           c~vbeln
           c~parvw
           c~kunnr
             into table it_li_vbpa
                    from likp as a
                    left outer join lips as b on a~vbeln = b~vbeln
                    inner join vbpa as c on b~vgbel = c~vbeln
                    where a~vbeln in s_vbeln and
                    c~parvw = 'RE'.
    endform.                    " FETCH_DATA
    *&      Form  MERGE_DATA_KNA1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form merge_data_kna1 .
    if it_li_vbpa[] is not initial.
    it_li_vbpa_temp[] = it_li_vbpa[].
    sort it_li_vbpa_temp by kunnr.
    delete adjacent duplicates from it_li_vbpa_temp comparing kunnr.
    loop at it_li_vbpa into wa_li_vbpa.
    read table it_li_vbpa_temp into wa_li_vbpa_temp with key kunnr =
    wa_li_vbpa-kunag.
    if sy-subrc <> 0.
    wa_li_vbpa_temp = wa_li_vbpa.
    append wa_li_vbpa_temp to it_li_vbpa_temp.
    endif.
    read table it_li_vbpa_temp into wa_li_vbpa_temp with key kunnr =
    wa_li_vbpa-kunnrb.
    if sy-subrc <> 0.
    wa_li_vbpa_temp = wa_li_vbpa.
    append wa_li_vbpa_temp to it_li_vbpa_temp.
    endif.
    endloop.
    endif.
    if it_li_vbpa_temp[] is not initial.
    select  kunnr
            name1
            ort01
            adrnr into table it_kna1 from kna1
                        for all entries in it_li_vbpa_temp
                        where kunnr = it_li_vbpa_temp-kunnr.
    endif.
    loop at it_li_vbpa into wa_li_vbpa .
    wa_final-vbeln = wa_li_vbpa-vbeln.
    wa_final-erdat = wa_li_vbpa-erdat.
    *it_final-LFART = it_li_vbpa-LFART.
    wa_final-kunnr = wa_li_vbpa-kunnr.
    wa_final-kunag = wa_li_vbpa-kunag.
    *it_final-VSTEL = it_li_vbpa-VSTEL.
    wa_final-traty = wa_li_vbpa-traty.
    wa_final-vbeln1 = wa_li_vbpa-vbeln.
    wa_final-posnr = wa_li_vbpa-posnr.
    wa_final-matnr = wa_li_vbpa-matnr.
    wa_final-arktx = wa_li_vbpa-arktx.
    wa_final-lfimg = wa_li_vbpa-lfimg.
    wa_final-netpr = wa_li_vbpa-netpr.
    *wa_final-GEWEI = it_li_vbpa-GEWEI.
    *it_final-VOLUM = it_li_vbpa-VOLUM.
    *it_final-VOLEH = it_li_vbpa-VOLEH.
    wa_final-vgbel = wa_li_vbpa-vgbel.
    wa_final-vbeln3 = wa_li_vbpa-vbeln.
    *wa_final-PARVW = wa_li_vbpa-PARVW.
    wa_final-kunnrb = wa_li_vbpa-kunnrb.
    read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunnr.
    if sy-subrc = 0.
    wa_final-name1 = wa_kna1-name1.
    wa_final-ort01 = wa_kna1-ort01.
    wa_final-adrnr1 = wa_kna1-adrnr.
    endif.
    read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunag.
    if sy-subrc = 0.
    wa_final-name2 = wa_kna1-name1.
    wa_final-ort02 = wa_kna1-ort01.
    wa_final-adrnr2 = wa_kna1-adrnr.
    endif.
    read table it_kna1 into wa_kna1 with key kunnr = wa_li_vbpa-kunnrb.
    if sy-subrc = 0.
    wa_final-name3 = wa_kna1-name1.
    wa_final-ort03 = wa_kna1-ort01.
    wa_final-adrnr3 = wa_kna1-adrnr.
    endif.
    append wa_final to it_final.
    clear wa_final.
    endloop.
    endform.

  • Unable to update XBLNR field on BKPF when posting a document using BAPI_ACC_GL_POSTING_POST

    Hi,
    I'm trying to post a clearing document using BAPI_ACC_GL_POSTING_POST, but after posting i'm unable to see the data in the reference field on header (BKPF-XBLNR). I'm passing the data in the header structure of the BAPI  (DOCUMENTHEADER-REF_DOC_NO).
    Thanks in advance.
    Regards,
    Sandeep

    We restricted our entry to five decimals and solved the issue.

  • Problems in creating and storing new documents using BAPI_DOCUMENT_CREATE2

    Hi experts,
    I'm getting problems in creating and storing new documents using BAPI_DOCUMENT_CREATE2.
    I have a scenario where is defined the document type ZC1, document part 200, authorization group 0002 and for all of these  documents the storage category "Cofre DMS1". And the status which demands the storage category is 'FR'.
    I've been fullfiling the BAPI_DOCUMENT_CREATE2 in this way:
    "Tables
    data: it_doc like bapi_doc_draw2,
          it_return like bapiret2,
          it_files like bapi_doc_files2 occurs 0 with header line,
          it_objs like bapi_doc_drad occurs 0 with header line.
    "Variables
    data: wl_doctype like bapi_doc_draw2-documenttype,
          wl_docnumber like bapi_doc_draw2-documentnumber,
          wl_docpart like bapi_doc_draw2-documentpart,
          wl_docversion like bapi_doc_draw2-documentversion.
    it_doc-documenttype = 'ZC1'.
    it_doc-documentpart = '200'.
    it_doc-documentversion = '00'.
    it_doc-description = 'Test of documents creation via BAPI'.
    it_doc-username = sy-uname.
    it_doc-statusextern = 'FR'.
    it_doc-authoritygroup = '0002'.
    refresh it_files[].
    clear it_files.
    it_files-originaltype = '1'.
    it_files-storagecategory = 'Cofre DMS1'.
    it_files-wsapplication = 'PDF'.
    it_files-docfile = 'c:\110307.pdf'.
    it_files-description = 'Test file'.
    append it_files.
    refresh it_objs[].
    clear it_objs.
    it_objs-objecttype = 'EKPO'.
    it_objs-objectkey = '47000497600010'.
    append it_objs.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
      EXPORTING
        documentdata = it_doc
      IMPORTING
        documenttype = wl_doctype
        documentnumber = wl_docnumber
        documentpart = wl_docpart
        documentversion = wl_docversion
        return = it_return
      TABLES
        objectlinks = it_objs
        documentfiles = it_files.
    After execute the BAPI process I got the following error:
    E26 087 - Data carrier COFRE DMS1 not defined
    Does anybody have a sugestion to help me, please?
    Thks
    David
    Edited by: David Tsutsui on Mar 18, 2010 10:52 AM

    Please refer to this thread, it tells why you need a data carrier you can also configure the same in DC20.
    Data Carriers for Storage the Originals of DMS

Maybe you are looking for