AWKEY field of the Document Header of BAPI_ACC_DOCUMENT_POST

HI Experts,
I am using BAPI_ACC_DOCUMENT_POST to create Finance Postings and have a requirement to populate the Reference key field externally while using this BAPI.
I am aware of the fact that if I leave the fields OBJ_TYP(Reference Transaction), OBJ_KEY(Reference Key) and OBJ_SYS(current system name) of the DOCUMENTHEADER segment of the BAPI as blank while executing the BAPI, these fields will be automatically populated with values as under:
OBJ_TYP = 'BKPFF'
OBJ_KEY = '0100000021BE102011' (BELNRBUKRSGJAHR)
OBJ_SYS = System name
But the Reference transaction (OBJ_TYP) which we need to use is 'HRPAY' and the OBJ_KEY should have the value of BELNR (only), OBJ_SYS should be populated as usual.
I tried get the next BELNR available, using the FM 'NUMBER_GET_NEXT' and then tried assigning it to the BAPI in the BELNR field of the DOCUMENTHEADER segment of the BAPI, but as we know that the BAPI_ACC_DOCUMENT_POST also determines the next BELNR internally, the number returned by the FM NUMBER_GET_NEXT becomes redundant and the BAPI_ACC_DOCUMENT_POST uses the number next to it.
To understand it in detail consider the below example:
Suppose the number BELNR available (number returned by NUMBER_GET_NEXT) is 0100000021 and I pass it to the BAPI, since I have already used this number (by executing NUMBER_GET_NEXT) the BAPI_ACC_DOCUMENT_POST will create a Posting with 0100000022 as the BELNR.
I am looking for a way to reserve the BELNR, so that the resultant BELNR should be the same as the one which I pass to the BAPI_ACC_DOCUMENT_POST.
I would avoid trying to get the previous BELNR used (NUMBER_GET_INFO), increment it by 1, and then pass it to the BAPI_ACC_DOCUMENT_POST.
Please suggest.

Hi Amit,
To swap the OBJ_TYP of the AWKEY from BKPFF to HRPAY sounds strange to me and I am unclear about the purpose. There are many other fields available to indicate the source of the document. (BKPF-XBLNR).
Another approach would be to check if any exit exists for this BAPI thru which you can manipulate the OBJ_TYP:
[User exit for BAPI_ACC_DOCUMENT_POST..? |User exit for BAPI_ACC_DOCUMENT_POST..?;
Regards,
Robert

Similar Messages

  • How to Add Values in INVOICE SUB-TYPE field at the Invoice Header Forms

    Hello,
    Does any body knows how could I add/modify values in the INVOICE SUB-TYPE field at the Invoice Header Forms?. This values are related to the Globalization, in this case for the Chilean Localizations.
    Thanks,
    Alejandro R.

    It gives any error or just does nothing?
    Have you tried making another simple form with just one block and one or two items?
    You can do this type of testing in these conditions.
    Which version of forms are you using?

  • Field functional area does not appear as an entry field into the document..

    Hi,
    We are using the functional area field in our system. In order to access this field, we proceeded
    to customize the system as follows:
    -  We already activate Cost of Sales Accounting for our Company Code.
    -  The field functional area was set optional through transaction OB41, for the posting keys required.
    -  The field functional area was set optional using transaction OB14, for the field status group assigned to the GL accounts.
    However, we cannot enter the area functional when we are posting documents related to customers and vendors. 
    Although the field functional area was set optional, it does not appear as an entry field into the document screen for the
    different transactions: fb70, fb60, f-02,fb01.  It is only happening when we areentering the document position for the vendor/customer.
    Regards,
    Efrain

    Hi,
    In FB70 or FB60 change the layout ........ select the line item layout configuration, you get a separate Table Settings screen pop up where in you need to select "Administrator"  button the system displays another pop up window where in you can check whether the Functional Area field is checked as invisible if so remove the check mark and active the settings.
    Kind Regards

  • EEWB and adding additional fields to the IBASE header

    Hello,
    I have used the EEWB (Easy Enhancement WorkBench) to add additional fields to the IBASE header. The process ends with a success state and in all steps there are no logs. The objects are generated and visible in the database table of the IBASE header and activated.
    When I go to the IB53 transaction the systems starts compiling. After the compiling there are no additional fields visible?
    In the EEWB no more actions are possible and it seems only an append structure was created with the new fields (GENERIC_IC_TASK).
    How do I get the fields to be visible in the IBASE transaction?
    I am using CRM 5.0.

    Ramakanth/Kiran,
    For creating screen structures or additional fields on the IBase header screen you would need to manually append entries in Database Tables T371D.... through T371Z, it is a set of around12-14 tables depending on the scenario which would need updations.
    Once updated in the right sequence you can see the EEWB fields on the Ibase header screen.
    Hope this helps.
    Amit Sitlani

  • The Document header txt and Reference Field are empty

    The BKPF table is not populated with
    BKTXT and XBLNR for document type TE
    on Posting
    Is there any configuration
    where i can see the issue
    please advice

    All the posting is done via standard SAP programs set up as jobs
    RPRTEC00   to settle trips
    RPRFIN00_40  to create posting run
    RPRPOSTD to post the entry
    on checking the OBA7 the reference field and document header text are not checked
    in bothe Q and D systems
    But in D system the values appear on repeating the same in Q the values are not there
    Please advice
    Shall i recomment to Check these two entris in OBA7 and then give a try

  • Free form partner function field in Sales document header and item..

    Hello Experts,
    Is there anyway we can use the partner functions functionality in Sales document header and item level, so that we can enter a free form number in the Partner field? I mean is it possible to be able to enter a free form number WITHOUT getting validated against corresponding master data like Customer or Vendor master, Contact person, Personnel or User master records?

    Hi,
    It is not possible.
    Because partner function will be determined in the sales document header and item as per the configuration you have done in the partner determination.
    It is not possible to enter a number wihich is not created and assigned.
    Regards,
    Mullairaja

  • Using javascript to save a pdf to a different directory and generating a new filename based on form fields in the document.

    I have built the following script in an attempt to create a submit button that will automatically save the document in a different directory on my computer. It will also use the form field data "customer" and "date" to generate the filename. I printed out the variable myPath and it looks like it printed the correct string. I keep getting the following error:
    TypeError: redeclaration of const path
    any help would be much appreciated.
    var customer = this.getField("Customer").value;
    var date = this.getField("Date").value;
    var path = "C:/Users/awilliams/My Documents/Test/"
      var reg = date.match(/(\d+)\/(\d+)\/(\d+)/);
    var myPath= "C:/Users/awilliams/My Documents/Test/" + customer + "_" + reg[1] + "." + reg[2] + "." +
    reg[3] + ".pdf";
    this.saveAs(myPath);

    "path" is a keyword within a PDF you should not use keywords as a name for any other object as a general rule.
    Have you checked the PDF Reference to see how to create a file path name within a PDF,  3.10.1 File Specification Strings page 118?
    Did you carefully read the Acrobat JavaScript Reference for the saveAs method?
    The notes following the description:
    Note: This method can only be executed during a batch or console event. See Privileged versus non-privileged context for details. The event object contains a discussion of JavaScript events.
    (Adobe Reader S): This method is available in Adobe Reader for documents that have Save usage rights.
    How to Save a PDF with Acrobat JavaScript

  • Automatic filling of form table-fields in the document

    Hi Gurus,
    We are working with sap RM on WAS640.
    In our Record Model we need to include a Word document that is to be used as a template. Inside the template we defined a table which has a fixed number of columns and one line which will be contains one position of a SAP document (for example an order).
    We want to fill the lines of the table at run time. We need that the system add a new line to the table inside of  the document/template, if necessary (SAP document has more than one position), dynamically.
    Is it possible by means of de connection parameter <b>FUNCTION_GET_FORM_DATA</b>?. if no, does exist another ‘exit’ to fill this kind of ‘table’ form fields dynamically?
    Thanks in advance,
       Cima.

    "path" is a keyword within a PDF you should not use keywords as a name for any other object as a general rule.
    Have you checked the PDF Reference to see how to create a file path name within a PDF,  3.10.1 File Specification Strings page 118?
    Did you carefully read the Acrobat JavaScript Reference for the saveAs method?
    The notes following the description:
    Note: This method can only be executed during a batch or console event. See Privileged versus non-privileged context for details. The event object contains a discussion of JavaScript events.
    (Adobe Reader S): This method is available in Adobe Reader for documents that have Save usage rights.
    How to Save a PDF with Acrobat JavaScript

  • Assignment field in the document line items

    Hi,
    I have a document where the assignment field is automatically populated with values. May i know where and how these automatic values are determined?
    I have checked the document substitution but cannot find any rules there for this field.

    Hi Raja,
    What kind of documents are these? If they are billing documents, the assignment and reference fields are copied as per the configuration done for SD document copy control. If these docuemnts are uploaded documents or coming through an extenal system, the abap program must be populating these values based on sime criteria.
    Kindly check let us know the kind of documents and how the entry happens.
    Thanks and Regards,
    Anit

  • Ribbon Button activating when a field in the Document / List item metadata = 'Yes'

    Im hoping this is an easy answer as Im sure it must be, but my mind has gone blank!
    Basically I have created a button to run some javascript code to fire a custom (manual) workflow on an item that is selected in a Document Library (or List)
    I have set the ribbon button to only be active IF one item is selected in the Library but what I want now is to only activate the ribbon button if one item is selected AND IF a specific field in the item = 'Yes' (The field in this case being called 'DraftDoc'
    [Choice field]).
    Ive tried a few methods but none seem to work and VS2012 errors on debugging.
    My code to enable the button so far is:
    // Method to enable/disable the button on the ribbon.
    function EnableSubmitDraftDocument() {
    // request number of selected items.
    var items = SP.ListOperation.Selection.getSelectedItems();
    var count = CountDictionary(items);
    // only return true is a single item is selected.
    return (count == 1);
    Can anyone help me with the extra code I need?
    Cheers

    Hi,     
    According to your description, you have been able to set the ribbon button to be actived if one item is selected. Now, you want to activate the ribbon button if there is one
    item selected and the value of "DraftDoc" column is "Yes".
    We can achieve it by getting the value of this "DraftDoc" column of the selected item to check whether it is "Yes".
    Here is a code demo about checking whether the value of "DraftDoc" column of the selected item for your reference:
    function retrieveSelectedFiles()
    this.clientContext = SP.ClientContext.get_current();
    var web = this.clientContext.get_web();
    this.selectedItem = SP.ListOperation.Selection.getSelectedItems();
    this.selectedList = SP.ListOperation.Selection.getSelectedList();
    if (CountDictionary(selectedItem) == 1)
    this.listItem = web.get_lists().getById(this.selectedList).getItemById(this.selectedItem[0].id);
    this.clientContext.load(this.listItem);
    this.clientContext.executeQueryAsync(Function.createDelegate(this, onRequestSucceeded), Function.createDelegate(this, onRequestFailed));
    function onRequestSucceeded() {
    str = listItem.get_item('DraftDoc');
    if(str == 'Yes')
    str+="Yes";
    alert(str);
    function onRequestFailed(sender, args) {
    alert('Error: ' + args.get_message());
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to place aggregated fields in the page header or group header

    Hi,
    i have a report where in i have to display a header based on the aggregated value of a field
    currently the field has values like
    row1  blank
    row2  blank
    row3 Cookies
    row4 blank
    I wanted to know how to get the maximum of these rows in the page header i.e. it should come as Cookies for this case.
    Is there any way to get this? it is easy in the footer where i can do a maximum of this field and get the value but not sure how to get this in the group header.How do we group maximum at the page header or group header?
    Require your help on this at the earliest.
    Thanks
    Shilpi

    Hi Shilpi,
    >
    Shilpi Sinha wrote:
    > currently the field has values like
    > row1  blank
    > row2  blank
    > row3 Cookies
    > row4 blank
    >
    Do display these things in a subreport(i mean adda subreport in detail section). And Create a formula in the subreport itself with shared varible for assiging  the maximum value ..
    Then in the main report , create one formula with same shared variable and just display in Header secton..
    Regards,
    Salah.

  • Notes to vendor field of the PO header

    We are creating a Drop ship PO from an Approved Requisition, using Auto create functionality. We want to populate the Notes to vendor field of the PO headers using the same Auto create functionality.We don't want to do that manually.
    Please let us know how to do.

    My understanding is that Autocreate works on individual Requisition lines level and not on the entire Requisition. And therefore I can see in (PO_INTERFACE_S) package - AutoCreate PO package body the code copies the note_to_vendor from po_lines_interface table to po_lines_all table.
    But if I understand your post correctly you want to copy the header level note_to_vendor on Requisition Headers to the note_to_vendor field on PO_HEADERS_ALL.
    Can you confirm my understanding?
    Thanks
    Arun

  • How can i make it where if data is entered into a field it is mirrored to another field within the document?

    I do not want them named the same as I don't want the second one appearing until after it is entered into the first field.

    Hi,
    If the form fields have the same name then the data entered in one field will be auto populated in other with the same name. For example, if there is a form field named custom field 1 in one document and there is another field with the same name(custom field 1) in the other document and you upload them together into a single transaction and send the document, then the data entered in custom field 1 in one document will be auto populated in custom field 1 of other document as well. This also applies for one document only as well.
    Does this help?

  • Once i scan a document and create a pdf.  how do i then change the fields on the document

    once i scan a document and create a pdf.  how do i then change the the info on the document.  i have to update a couple of the columns and cannot figure out how. please help.

    You are probably only looking at a graphic. You have to run OCR before you can do the corrections. For your use, you would need the ClearScan option. Once you have a text based document, you can then use the Text Touchup Tool. Expect to have problems. Editing a PDF is not easy to do well and is not really recommended, except for minor edits. Wordwrap and such features are not part of the editing options. It would be best if you could get an electronic copy of the original, edit that, then create a new PDF.

  • Reg: Addition of Tab  with fields to the Invoice Header - VF01

    Hi,
      The Requirement is to add an additional tab to the Invoice Header -VF01.Is there any Badi to add the Tab?
    Please Provide me the Solution.
    Thanks in Advance,
    Praveen

    Hi Sourabh,
           Thanks for the Reply.But I could not create an Implemention for the BADI : BADI_SD_CUST_HEAD as it is for SAP internal use.
          Is there any other alternative where we can add a tab to the Invoice Header - VF01.
    Please provide me a solution.It would be of great help to me.
    Thanks in Advance,
    Praveen

Maybe you are looking for

  • How do I connect an existing Behance account to a new Adobe ID account ?

    Hello, I am an existing Behance account holder. I recently started a new job, where they give me access to a personal Macbook & Adobe cc account. I want to link my existing Behance profile to my new Adobe CC account. Is this even possible - If so how

  • Can I send a text to a "group" contact without selecting each individual member?

    Can I send a text to a "group" contact without selecting each individual member?  I have a group formed in my contacts, but I still have to select each member in that group to send a text or email from my phone.

  • OAS 4.0.8.2 Vs. OAS 4.0.8.2.1

    Oracle has a known BUG in OAS 4.0.8.2 that it does not release the MEMORY used by Jave components. I just wanted to know that whether this BUG has been removed in the OAS 4.0.8.2.1 ot not... null

  • Cffileupload get rid of upload box

    Okay, everything works EXCEPT the notification that the file upload is complete.  The cffileupload box just stays where it is. I have even tried to send it to another page and it won't go. I have this code on my testing.cfm page right now. <cffileupl

  • Multiple size and format exports

    Is there a way to hit the export button on a selection of images one time and produce multiple sizes and formats of each image? Maybe an automator script. It would speed things up if you didn't have to go back and choose a different format from the d