Using 'validation in accounting documents' set up in IMG in an abap program

In IMG, we've set up accounting document validation at the item level - it seems that the information gets stored in GB* tables.  We need to access these validation rules in an abap program - does anyone know what SAP function modules to use to invoke these validation rules?

Ok Les, use G_VSR_VALIDATION_CALL FM to call SAP´s validation rules routine.
Here you got a sampe code:
* used for the validation function module
  gc_co_validation TYPE tkaze-valid   VALUE 'CO_ITEM',
  gc_co_valuser    TYPE gb03-valuser  VALUE 'CO',
  gc_valid_event   TYPE tkaze-event   VALUE '0001',
  gc_line_no       TYPE mesg-zeile    VALUE '000',
  gc_cobl          TYPE rgbl5-tabname VALUE 'COBL',
  gc_cobk          TYPE rgbl5-tabname VALUE 'COBK',
  gc_parking       TYPE cobl-hkont    VALUE '0000420274',
  gc_rfbu          TYPE cobl-glvor    VALUE 'RFBU', " FI postings
  gc_bkpf          TYPE cobl-awtyp    VALUE 'BKPF',
  gc_coin          TYPE cobk-vrgng    VALUE 'COIN',
  gc_zb            TYPE sy-msgid      VALUE 'ZB',
  gc_023           TYPE sy-msgno      VALUE '023',
  gc_all           TYPE sy-msgv1      VALUE 'all'.
  REFRESH:
      gt_val_tabnames.
* For validation rules check, populate itab
* with the structure names
  APPEND: gc_cobl TO gt_val_tabnames, " COBL
          gc_cobk TO gt_val_tabnames. " COBK
* Set up COBL & COBK structures
  gs_cobl-glvor = gc_rfbu. " FI postings
  gs_cobl-vorgn = gc_rfbu. " FI postings
  gs_cobl-awtyp = gc_bkpf. " FI header
  gs_cobl-kokrs = gc_mit.  " MIT controlling area
  gs_cobl-hkont = gc_parking. " G/L 420274
  gs_cobl-zfbdt = sy-datum.   " later validate against each reservation
  gs_cobk-orgvg = gc_rfbu. " FI postings
* COIN = CO: Interface (FI transactions create this transaction code)
  gs_cobk-vrgng = gc_coin.
  CASE g_co_type.
    WHEN gc_cctr.
      gs_cobl-kostl = g_kostl.
    WHEN gc_intord.
      gs_cobl-aufnr = g_aufnr.
    WHEN gc_wbs.
*       internal PSPNR assigned above when selecting from prps
  ENDCASE.
  CALL FUNCTION 'G_VSR_VALIDATION_CALL'
    EXPORTING
      callup_point  = gc_valid_event " 0001
      tab_data1     = gs_cobl
      tab_data2     = gs_cobk
      validation    = gc_co_validation " CO_ITEM
      valuser       = gc_co_valuser " CO
      zeile         = gc_line_no " 000
    TABLES
      tabnames      = gt_val_tabnames " COBL & COBK
    EXCEPTIONS
      abend_message = 1
      errormessage  = 2
      not_found     = 3
      OTHERS        = 4.
I really hope this to be helpful.
Kind regards,
Federico Alvarez.

Similar Messages

  • Can I use a gmail account to set up my child's IPhone?

    Can I use a gmail account to set up my child's iphone? He already has a gmail account I don't want to set up an icloud email address. My husband and I could use our gmail addresses.

    You can use any email address that you like as an Apple ID - it doesn't have to be an icloud one.
    My only suggestion would be to use an address that you know you will have access to for a long while - like the gmail one - so you don't have to worry about changing the Apple ID in the future.
    ~Lyssa

  • I have replaced my lost ipod touch 4 8GB and need to know if I should use my itune account or set up a new 1 with another email and password

    I now have a new I pod touch 4 8GB and still am using the find my iphone in the icloud  for the 1 I lost, what I need to know now is should I use my itune account I have now or set up a new account with a different email and password for my new ipod? at this point I don't know what to do

    As lllaass said, change your password. Go to http://appleid.apple.com, click Manage Account, click Password & Security.

  • KM ABAP : How to publish document in ECC 6.0 with an abap program

    Hello,
    There is something (MF, Class) to publish a document in KM with an abap program in ECC 6.0 ?
    Regards,
    Aurélien

    The balances in both tables should be the same, right?  It is just that in FAGLFLEXA you may have some extra line items due to document splitting.

  • T Code OB28 Validation of Accounting Document

    Hi,
    I am trying to maintain the validation rule for instituting the check for duplicate AP invoices (i.e. Invoices with same Reference field which is mandatory while accounting for AP Invoices). When I am trying to create the validation check using the aforesaid T Code OB28, after entering the Co. Code and Call Point etc. when I click on Validation under "Environment" tab, the system prompts for Message ID to be configured. In the drop down list I find number of  message ids but am unsure as to which one is to be used. Could any one advise as to how can I proceed further?
    Thanks in advance.
    Best Regards,

    Hi Eli,
    When I am trying to create the Message, the systems prompts for certain fields to be maintained -
    Message Class
    Short Description
    Package
    Application Component
    Could you guide as to what are these meant for and how to maintain these? I understand Application component refers to FI etc.
    Thanks,
    Regards

  • Validation for accounting document during MIGO

    Hello experts,
    I would like to force the user to choose document type: FR while trying to post a credit memo via MIGO.
    How can I do it ?
    Thanks a lot.

    Hi, sorry, I wrote for miro.
    But for migo you can use badi MB_MIGO_BADI, method CHECK_HEADER.
    Also you can try ob28, but the main problem is how to know movement type.
    And 'post a credit memo via MIGO' - you mean move type 102?

  • How to use SET BIT and GET BIT in ABAP Programming

    Hi,
    Our team is currently working for an Upgrade  project which is using a tool automatically upgrades when we supplly the code. fine, But now the requirement is , we need to write different test cases for the available key words in ABAP. Now we r looking for the usage of  " BIT ", keyword. so , kindly provide any program or code using this key word.
    Please find the description Provided and give some relative ABAP code to satisfy the given description.
    The data object byte_string must be byte-type. The statement reads the bit at the bit position BITPOS of the variable byte_string and assigns its value to the variable val. A default mode can be specified if required *
    Thanks & Regards,
    P.N.Kumar.

    What on earth are you testing? That ABAP still works? I think SAP might have run that through rigourous testing themselves.
    If you want sample code, why not read the ABAP help, and work some out for yourself?
    matt

  • TS1702 Is there a way to lock out or restore original settings on an iPad used in a school lab setting. We need something like the program cornerstone, which will allow the iPad to revert back to its original setup.

    We setup iPads for a mobile lab and students change the settings or set up a pass code on the iPad. Is there a way to lock the settings folder or an app to revert any changes back to the original set up like the program cornerstone (for a pc)?

    you might need to post this question on iPad in the Enterprice community
    check these posts, it might help:
    https://discussions.apple.com/message/18419745#18419745
    https://discussions.apple.com/message/11401701#11401701

  • How to convert a Word document to text or html in an ABAP program

    Hi,
    At my client's site, for the recruitment system, they have the word processing system set to RTF, instead of SAP Script. This means that all the correspondence is in Word format. A standard SAP program takes the word letter, loads word, does the mail merge with the applicant's info and then sends the document to a printer.
    The program name is RPAPRT05. The program creates a document proxy (interface I_OI_DOCUMENT_PROXY) and manipulates the document using the methods of the interface.
    Now what we want to do is to instead of sending the document to a printer, we want to email the document contents to the applicant. But I don't know how to get the content from the Word document into text or html format so that I can make an email from it.
    I know I can send an email with the word document as an attachment, but we'd prefer not to do that.
    I would appreciate any help very much.
    Thanks

    Ok, here's what I ended up doing:
    First of, in order to call FM 'CONVERT_RTF_TO_ITF' you need the RTF document in a table with line length 156. The document is returned from FM 'DP_CREATE_URL' in a table with line length 132. So first I convert the table:
        Transform data table from 132 character lines to
        256 character lines
          LOOP AT data_table INTO dataline.
            IF newrow = 'X'.
            Add row to new table
              APPEND INITIAL LINE TO xdatatab ASSIGNING .
              newrow = space.
            ENDIF.
          Convert the raw line of old table to characters
            ASSIGN dataline TO .
          Check line lengths to determine how to add the
          next line of old table
            newlinelen = STRLEN( newline ).
            ADD addspaces TO newlinelen.
            linepos = linemax - newlinelen.
            IF linepos > datalen.
            Enough space available in new table line for all of old table line
              newline+newlinelen = oldline.
              oldlinelen = STRLEN( oldline ).
              addspaces = datalen - oldlinelen.
              CONTINUE.
            ELSE.
            Fill up new table line
              newline+newlinelen(linepos) = oldline(linepos).
              ASSIGN newline TO .
              newrow = 'X'.
            Save the remainder of old table to the new table line
              IF linepos < datalen.
                oldlinelen = STRLEN( oldline ).
                addspaces = datalen - oldlinelen.
                CLEAR newline.
                newline = oldline+linepos.
              ELSE.
                CLEAR newline.
              ENDIF.
            ENDIF.
          ENDLOOP.
        Write the last line to the table
          IF newrow = 'X'.
            APPEND INITIAL LINE TO xdatatab ASSIGNING .
    Next I call FM 'CONVERT_RTF_TO_ITF' to get the document in SAPScript format:
        Convert the RTF format to SAPScript
          CALL FUNCTION 'CONVERT_RTF_TO_ITF'
            EXPORTING
              header            = dochead
              x_datatab         = xdatatab
              x_size            = xsize
            IMPORTING
              with_tab_e        = withtab
            TABLES
              itf_lines         = itf_table
            EXCEPTIONS
              invalid_tabletype = 1
              missing_size      = 2
              OTHERS            = 4.
    This returns the document still containing the mail merge fields which needs to be filled in:
          LOOP AT itf_table INTO itf_line.
            WHILE itf_line CS '«'.
              startpos = sy-fdpos + 1.
              IF itf_line CS '»'.
                tokenlength = sy-fdpos - startpos.
              ENDIF.
              token = itf_line+startpos(tokenlength).
              REPLACE '_' IN token WITH '-'.
              ASSIGN (token) TO .
              ENDIF.
              MODIFY itf_table FROM itf_line.
            ENDWHILE.
          ENDLOOP.
    And finally I use FM 'CONVERT_ITF_TO_ASCII' to convert the SAPScript to text. I set the line lengths to 60, since that's a good length to format emails to.
        Convert document to 60 char wide ascii document for emailing
          CALL FUNCTION 'CONVERT_ITF_TO_ASCII'
            EXPORTING
              formatwidth       = 60
            IMPORTING
              c_datatab         = asciidoctab
              x_size            = documentsize
            TABLES
              itf_lines         = itf_table
            EXCEPTIONS
              invalid_tabletype = 1
              OTHERS            = 2.
    And then the text document gets passed to FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' as the email body.

  • How at send a Word document as an email attachment from an ABAP program?

    Hi all,
    i got request to develop background run program which check which staff is due CONFIRM and able to attach confirmation form (Microsoft Word file) to HR and CC staff manager as recipients.
    I try almost all relevant FM but still face problem below, please assist.
    1) FM SO_DOCUMENT_REPOSITORY_MANAGER
    - A window pops up requesting Recipient email ids. I couldn't get the window suppressed.
    2) FM SO_NEW_DOCUMENT_ATT_SEND_API1
    - Since the attachment is a pre-formatted Word Document and not an Excel or Text document, couldn't process the contents into the internal table (most sample in forum is Excel not word)
    Appreciate ABAP folks who have sample code attach a word file will help on this.
    Thanks and regards,
    Felicek

    Hi ,
    sorry for my request but I have to send an e-mail with word attachment and I would appreciate if someone could give the code for
    the first part of this link: http://www.divulgesap.com/blog.php?p=ODI=
    (I mean 'ZDIV_SEND_EMAIL' ) . The problem is that I have to load in an internal table the file word (by using "open dataset in binary
    mode" I suppose ) and then pass this table to a FM or a method for sending e-mail with this file WORD but I 'm facing some
    problems....  any suggestion would be very appreciated ... I'm in a "impasse"  ! It's seems there is no way out !!!
    Thanks in advance
    Andrew

  • How to use both At USER-COMMAND and AT LINE-SELECTION in one abap program

    I am trying out a program where I need to use both line selection and user command events in one program. Suggest me how to do it.

    USE the okcode 'PICK'. (I mean add a 'PICK' in the GUI staus or the menu.) When ever u use both the events u have to use PICK to trigger the at line selection.
    U just need to add the PICK in the GUI status and ofcourse write code in the program.
    AT LINE-SELECTION.
    CASE sy-ucomm.
    WHEN 'PICK'.
    write:/ 'HELLO WORLD'.
    ENDCASE.

  • Change Validation to complete document level

    SAP experts,
    In tcode F-65 the business is using account assignment model to post recurring entries by filling in the template. Here it has a validation "Amount is Zero - line item will be ignored" at the Line item level. Business wants this validation to be changed from Line item level to the whole document level (at the time of save).
    The message no. is -- FX090
    "Amount is Zero - line item will be ignored"
    How can I change this validation settings?... please help asap.
    Thanks in advance.

    Dear Sameer,
    You would need to implement it at header level.
    For example in IMG under
    Financial Accounting -> Accounts Receivables and Accounts Payable -> Business Transactions -> Posting with alternative Reconciliation accounts -> Carry out and check document settings -> Validation in Accounting Documents.
    You can see some of the validations are implemented at item level and some at header level.
    Regards,
    Naveen.

  • BAPI_ACC_INVOICE_RECEIPT_POST, Accounting Documents grouped?

    Hi there,
    Hope I'm posting this in the right place. There is a custom program which reads the file from AL11 and then uses BAPI_ACC_INVOICE_RECEIPT_POST to create the invoices.
    It's creating the invoices but when we view them at tcode KSB1, the drill down of the accounting documents are wrong.
    Normally a drill down will be a single Accounting Document, Cost Center and etc right? but I'm able to view ALL the accounting documents created.
    Is it configuration or the program error?
    Thanks for the advice.

    Answered in another post. Thanks.
    BAsically I just removed entries from OBJ_TYPE, OBJ_KEY and OBJ_SYS

  • GET A TERMS OF CONTRACT THROUGH ACCOUNT DOCUMENT

    Hellow Gurus,
    I would like to take this opportunity to say thank you for everybody for all contribuitions.
    I will ask a help again to ask how i can get the terms stored and accounted in a contract using only the account document (Number of FI). I need an BAPI or BADI or who know the relationship between masters data.
    Very respectfully,

    Table Relationship:
    BSEG (FI Line Item Table)>VICNCN(Contract Master Table)>VITMRH (Contract Term Data)
    Hope this helps.
    Thanks.

  • Connect document set with document library

    Suppose you have a document set and a document library and they both have a column "PersonalID".
    How is it possible to connect a document set with a document library where you only see the documents with the same value in "PersonalID"?

    Hi Cameron,
    I created two content types where one is the parent of the other.
    I tried to use the filter but I can't choose any option. they are all greyed out.
    If I want to use connection on my document set properties web part, it's impossible. "Connections" is greyed out and I can't check it in the properties of the web part. If I check the box and save it, it's unchecked when I re-edit the web part.
    If I go to my list web part, I can't connect with another list, only with the image of the document set. "Send Row of Data To" > Image.
    I can't use "Get filter values from"...
    any tips/ideas?

Maybe you are looking for

  • Grinding noise when my HP LaserJet Pro 400 color MFP M475 calibrates

    When my HP LaserJet Pro 400 color MFP M475 recalibrates, I get a grinding or gear slipping noise.  Any idea how to fix it or what to look for? This question was solved. View Solution.

  • Major slow down after installing mountain lion

    ....just my bought my new Mac last Christmas ,coming from Windows was a major change,everything was fast, then a few days ago I upgraded from OS Lion to Mountain Lion and now everything slow down a lot. Everything a try to open from internet browsers

  • MRKO  - Consignment and Pipleline Settlement

    Hi friends, User got this error when he is running MRKO. Received error message F5727 (see below) regarding limited number of transactions per settlement. Please alter process to allow for up to 9999 records per settlement -I do not want to increase

  • How to run R12 Oracle E-Business Suite Pre-install Patches Report

    Hi. I have downloaded, unzipped this report as per R12 Oracle E-Business Suite Pre-install Patches Report [Video] (Doc ID 1448102.1) What then? The instructions say Unzip the file, extracting the entire contents, which creates the "EBS_12.1_Preinstal

  • Can I disable display of titles & blue bar during movie playlist playback?

    During movie playback from a playlist, my AppleTV briefly displays the name of each movie it encounters in the bottom left corner of the screen. At the same time, the blue scroll bar briefly appears. Most of the time I like this behavior, but is ther