XSD VALIDATION IN ABAP PROGRAM

Hi,
I have a requirement where in a report i am picking xml file from the presentation server (desktop) and then i am parsing the xml file using FM "SMUM_XML_PARSE" (first i use FM SCMS_BINARY_TO_XSTRING and then SMUM_XML_PARSE). after using the function SMUM_XML_PARSE i get the xml data in my internal table and then my report uses that data for some processing. This all is working fine .
My issue is that how do i do a XSD VALIDATION for the xml file that i am reading . I would have liked to do a xsd validation after i import the xml file and throw error if the xml file is not as per its xsd.As i am not using any middleware technology like XI/ WTX which have XSD validation functionality i am not sure how to achieve this in abap program.

Hi,
I think you're right, iXML can only validate DTD via its if_ixml_parser->set_validating method (you can find this information in SAP SDN article "ABAP XML Mapping", as of release 6.10, I couldn't find any other reference saying that xsi:noNamespaceSchemaLocation is supported since then).
By looking at SDN, I saw an external link about XSD to DTD conversion via XSLT (http://crism.maden.org/consulting/pub/xsl/xsd2dtd.xsl), but I don't have any idea if it works. On another thread, people used OS command to do XML/XSD validation, but didn't describe what they ran exactly (anyway, that means using any external tool).
Sandra

Similar Messages

  • Can i use XSD / XML in Abap Programs

    Hi friends
    I need to validate a xml file against xsd file. Can i validate it in abap program?
    Best Regards.
    P

    Hi Pedro,
    Simple transformations, or ST, is a proprietary SAP programming language that describes the transformation of ABAP data to XML (serialization) and from XML to ABAP data (deserialization).
    Check this out...
    Simple Transformations - SAP Library
    Regards,
    Raj
    <dead link corrected>
    Message was edited by: Manish Kumar

  • XSD validation in ABAP

    Hi folks.
    Is it possible to validate a message using a XSD (in XI) using ABAP Classes / functions instead of JAVA (and BPM)? Like mandatory fields, field types, etc etc
    Thanks in advance.
    Best regards.
    Valter Oliveira.

    hey valter,
    you can do that in any language you want.
    The point is that you already have delivered java APIs for xsd validation (actually, xsd validation is performed as standard by compliant SAX/DOM parsers).
    For ABAP, you'd probably need to develop this API from scratch.
    The advantage of Java is not its speed or resource-consuming: it is just that everything is already developed on Java. lol
    Regards,
    Henrique.

  • XSD Validation with ABAP XML Parser?

    Hello there,
    i'm loading xml files into a R/3 System. This all works fine with the standard XML Parser.
    The XML Files are based on a .xsd structure that is assigned to each file with a external link.
    To be sure that the xml document conforms to this .xsd structure i would like to check against it.
    For that i would like to hold a .xsd structure string in my abap programm.
    How can this be accomplished? Is this possible anyway?
    Greetings and many thanks.
    Kay

    check out the class
    CL_XML_SCHEMA
    Regards
    Raja

  • XML validation against XSD Schema in ABAP

    Hi colleagues,
    I'm looking for a way to validate a XML against a XSD schema in ABAP, without using java or command line or something like that. Is there any way to do this only with ABAP?
    Thanks in advance.
    Regards,
    Guenter

    Hi everyone,
    I'm currently facing the same problem. I need to validate a xml file with an existing xsd schema for some export/import functionality. I just found an ABAP program doing this with a Java fallback. But isn't there a way doing this wihtout using Java but only ABAP? There certainly is, anyone an idea?
    Thank you and regards
    Maximilian

  • 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.

  • How To Call a Broadcasting Template within an ABAP program

    I was wondering if anyone knew how to call the Broadcast template via an ABAP program so it will execute?  The scenario that I have is we are doing validations via BW.  We put the data (for conversion reasons) through validation rules and then load a data target.  From this, there are 2 situations that could occur:
    1) There are errors
    2) There are not any errors
    If #1 is true, then I would like to execute the Query Broadcasting Template that I have created.  If #2 is true, then I would like to execute another process via the ABAP program.  In the past, I was successful using exception reporting via reporting agent, since I was able to call that program but the report did not look good at all.  Please let me know if there is a program that I could call in order to execute this broadcast that I have set up.
    Best Regards,
    Tim

    Hello,
    although this is an old threat, but do you have any hints on how to dynamically change the template when broadcasting?
    kind regards
    Murat

  • ABAP Program to Create TRs in SOLMAN

    Currently, we are creating TRs through SOLMAN_WORKCENTER transaction. It is being done manually by going to 'Change management' Tab in 'SOLMAN_WORKCENTER'->'PROJECTS'(QGATE Project not CHARM)-> TR is being created for a specific project using 'Create Transport Request' button.
    I was wondering, whether this process can be automated, so that developers can directly create a TR, through a web application or email. The frontend application will be creating TR in backend in SOLMAN after some validations.
    I'm trying to write an ABAP program to create TRs in backend in SOLMAN, following the same process, which is being followed now using SOLMAN_WORKCENTER. This program will be called by the frontend application. This way developers can create a TR, without having direct access to SOLMAN.
    I tried to use CL_CTS* classes, but it's not working. Kindly suggest some BAPIs or classes available for it.
    If anybody has already worked in development of a similar solution, kindly share the technical knowhow. Also, please let me know any solutions from SAP available for it.
    Thanks in advance for your help....

    Thanks a lot for responding Guilherme.....
    But, we wanted to add our own validations as per our standards like naming convention of TRs, project to be used etc...
    Otherwise, the TRs created by developers in an incorrect approach, will be very hard to manage.
    That's why I was looking for an ABAP code to create a TR in SOLMAN_WORKCENTER, so that we can add our own validations to it before creating the TR. If the validations fail, it should't create the TR.
    Using the webdynpro link for SOLMAN_WORKCENTER as suggested, some of the functionalities can be controlled by authorizations maybe. But, we'll not able able to add any extra validations required.

  • How to do the Validations in Report Programming?

    How to do the Validations in Report Programming?
    how to do screen Validations and Field Validations if posssible can any one send the code regarding the Validation ....
    Tks
    Durusoju

    AT SELECTION-SCREEN - selscreen_event
    Syntax
      | { ON {para|selcrit} }
      | { ON END OF selcrit }
      | { ON BLOCK block }
      | { ON RADIOBUTTON GROUP radi }
      | { }
      | { ON {HELP-REQUEST|VALUE-REQUEST}
      |   FOR {para|selcrit-low|selcrit-high} }
      | { ON EXIT-COMMAND }.
    Alternatives:
    1. ... OUTPUT
    2. ... ON {para|selcrit}
    3. ... ON END OF selcrit
    4. ... ON BLOCK block
    5. ... ON RADIOBUTTON GROUP radi
    6. ... { }
    7. ... ON {HELP-REQUEST|VALUE-REQUEST} FOR
          {para|selcrit-low|selcrit-high} }
    8. ... ON EXIT-COMMAND
    Effect
    These additions allow individual evaluation of specific elements of the selection screens of the program. The information as to which selection has triggered the event is contained in the system field sy-dynnr.
    Alternative 1
    ... OUTPUT
    Effect
    This event is triggered at the screen event PBO of a selection screen. In the event block, the selection screen can be prepared through assignments to the data objects of parameters and selection criteria and through dynamic screen modifications.
    Note
    The assignments to input fields in the event block AT SELECTION-SCREEN OUTPUT always affect the selection screen and overwrite the user inputs from previous displays of the same selection screen. Assignments in the event blocks LOAD-OF-PROGRAM oder INITIALIZATION, on the other hand, only have an effect at first program start.
    Alternative 2
    ... ON {para|selcrit}
    Effect
    This event is triggered at the screen event PAI of a selection screen if the content of the input field of a parameter para or a line of a selection criterion selcrit was passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or an error message in the event block makes the fields para and selcrit ready for input again.
    No parameter that is defined as a radio button can be specified. For this purpose, the addition ON RADIOBUTTON GROUP is provided.
    Note
    If a user action takes place in the dialog box for the multiple selection of a selection criterion selcrit, the entries of the selection table are passed to the program, line by line. For each line, the event AT SELECTION-SCREEN ON selcrit is triggered.
    Alternative 3
    ... ON END OF selcrit
    Effect
    This event is triggered after the selection table selcrit has been fully passed to the program after a user action in the dialog box for the multiple selection has taken place. In the event block, the entire selection table can be checked.
    Alternative 4
    ... ON BLOCK block
    Effect
    This event is triggered at the screen event PAI of a selection screen if all the input fields of a block block of the selection screen were passed to the ABAP program. In the event block, the user inputs can be checked. Sending a warning or an error message in the event block makes all the fields of the block block ready for input again.
    Alternative 5
    ... ON RADIOBUTTON GROUP radi
    Effect
    This event is triggered at the screen event PAI of a selection screen if all the fields of a radio button group radi of the selection screen were passed to the ABAP program. In the event block, the user input can be checked. Sending a warning or error message in the event block makes all the radion buttons of the block radi ready for input again.
    Note
    The individual fields of a radio button group are not passed individually and do not trigger the event AT SELECTION-SCREEN ON par.
    Alternative 6
    Effect
    The event AT SELECTION-SCREEN itself is triggered as the last event of selection screen processing if all the input values were passed to the program. In this event block, all the user inputs can be checked. Sending a warning or an error message in the event block makes all the screen fields ready for input once again.
    Alternative 7
    ... ON { HELP-REQUEST | VALUE-REQUEST } FOR
        {para|selcrit-low|selcrit-high} }
    Effect
    The two events ON HELP-REQUEST and ON VALUE-REQUEST are triggered at the screen events POH and POV of a selection screen if - for the input field of a parameter para or one of the input fields of a selection criterion selcrit - the field help F1 or the input help F4 was called. Other selection events are not triggered.
    In the event blocks, a self-defined field or input field can be programmed, which overrides any helps possibly defined in the ABAP Dictionary.
    Notes
    These event blocks can only be implemented for fields of the selection screen that are defined in the same ABAP program and not in a possibly linked logical database.
    With the events for the field and input help, no data is transported between the selection screen and the ABAP program. As with general screens, suitable function modules must be used for these. The parameters and selection criteria changed for the input help are transported to the selection screen.
    Alternative 8
    ... ON EXIT-COMMAND
    Effect
    This event is triggered if the user has called one of the functions Back, Exit or Cancel. In the event block, possible clean-up actions can be executed.
    Example
    In these executable programs, a standard selection screen and a further selection screen are defined. In the event blocks AT SELECTION-SCREEN, the inputs in the selection screens can be specially handled using the name p_carrid and the screen number in sy-dynnr.
    REPORT demo_at_selection_screen.
    Global data
    DATA: sflight_tab TYPE TABLE OF sflight,
          sflight_wa  LIKE LINE  OF sflight_tab.
    Selection screens
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECTION-SCREEN BEGIN OF SCREEN 500.
      SELECT-OPTIONS s_conn FOR sflight_wa-connid.
      DATA s_conn_wa LIKE LINE OF s_conn.
    SELECTION-SCREEN END OF SCREEN 500.
    Handling selection screen events
    AT SELECTION-SCREEN ON p_carrid.
      IF p_carrid IS INITIAL.
        MESSAGE 'Please enter a value' TYPE 'E'.
      ENDIF.
      AUTHORITY-CHECK OBJECT 'S_CARRID'
                          ID 'CARRID' FIELD p_carrid
                          ID 'ACTVT'  FIELD '03'.
      IF sy-subrc = 4.
        MESSAGE 'No authorization for carrier' TYPE 'E'.
      ELSEIF sy-subrc <> 0.
        MESSAGE 'Error in authority check' TYPE 'A'.
      ELSE.
        IF sy-ucomm = 'ONLI'.
          CALL SELECTION-SCREEN '0500'.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN.
      IF sy-dynnr = '0500'.
        IF s_conn IS INITIAL.
          MESSAGE 'Please enter values' TYPE 'W'.
        ELSE.
          SELECT *
                 FROM sflight
                 INTO TABLE sflight_tab
                 WHERE carrid = p_carrid AND
                       connid IN s_conn.
          IF sy-subrc <> 0.
            MESSAGE 'No flights found' TYPE 'E'.
          ENDIF.
        ENDIF.
      ENDIF.
    Main program
    START-OF-SELECTION.

  • Structure of ABAP program

    hi SDNs,
               what is the typical structure of an ABAP program?
               thanks and regards,
                   aravind.

    hi
    plz check the structure of ABAP Program under..
    http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
    below the typical structure...
    1.data declaration
    2.selection-screen declartion
    3.data validation
    4.output.
    Cheers
    Abdul Hakim

  • XSD VALIDATION

    Hi,
    I have generated the DOM TREE and this dom tree need to pass through XSD Validate and then the generated (XML) is to go through the XSLT processor.
    I need your suggestion how to go with after generating the DOM TREE.
    Thanks.

    Nice find, Ben. Thanks.
    I've been using jUnit with the XML and XSD support in Java 5. Here's a link, if anyone is looking for a way to do XSD validation from within a Java program:
    http://itunesu-api-java.googlecode.com/svn/branches/xsd-validation/src/test/edu/ asu/itunesu/XsdTest.java
    Dave

  • Ending a process chain with abap program

    Hello friends.
    Can anyone help me please?
    I have a problem with a process chain in BW.
    The process chain is triggered by the MF BP_EVENT_RAISE in an custom MF. While the process chain works, the custom MF is monitoring the chain´s log.
    This process chain have 2 steps:  one is the initial process and the other is a ABAP program. In the abap program there are validations and if exists some error, the program abort and this job (BI_PROCESS_ABAP) is cancelled. The problem is that i have to go to the Tx. RSPC and view the logs fro this chain and in these moment ends th custom MF. In other wors, the MF ciustom ends until i go to the tx RSPC for view the logs.
    I need that the program ends the process chain naturally.
    Thanks for your help.
    Regards.

    Hi,
    You can end a process chain by seeing the variant name and instance name of teh process chain from and finding its corresponding log id,type of process from the table RSPCPROCESSLOG and then executing the standard FM RSPC_PROCESS_FINISH. Here you will have to give the log id,type of process ,vairant name and instance name alongwith the status of the process chain as R to end the process chains.
    If you want to aurtomate it you can do that by creating a Z program which will read LOG ID and teh TYPE of process from table RSPCPROCESSLOG on the basis of variant name and the instance name of the process chain and the execute the function module RSPC_PROCESS_FINISH from inside the program.
    Navesh

  • Calling sets in an ABAP program

    i am working on a validation exit for FI. Is it possible to create sets to group data and call the sets in a ABAP program in a validation exit.
    Any clarification will be appreciated.
    thank you
    Krishna

    Hi,
    you can group data:
    1) in special standard trx. like KDH2
    and read them with table setheader and setleaf
    or (better)
    2) creat your own customer Table to group data with key-fields:
    mandt groupname fieldname fieldvalue
    100     Z001          SAKNR   4711
    100     Z001          SAKNR   4712
    and in your val.-exit you can check values against this table
    A.
    Message was edited by:
            Andreas Mann

  • Assign loading / handling resource to location through ABAP program

    Hello Experts,
    I have a requirement where by I have to assign loading / unloading resource to a location through ABAP program. Need to assign the resource in Resources Tab in TP/VS section. Is there any function module or any method available to this?
    Responses highly appreciated. Thanks in advance
    Regards
    Sandeep Patil

    Hi all
       I have the same requirement for the end user.
      Is it a good idea update active Table of ODS behind an ABAP Program Z?, I understood that you can't have log history... and you can't delete request.. because you will not generate this..
      We actually have one ODS that contain invoices... all the fields that contain the invoice..like material, vendor, etc.. was updated according to ABAp programa that we specify on start routine, each time that we need to update these fields we need to unload fros ODS to PSA and load again with dtp...
      Let me copy more details:
    Actually, we have an DSO that is updated each week, we load the information into different PSA, all of this PSA pass to ODS for one info source and transformation rule, in this transformation rule we have an ABAP rotine that have some validation and assign some values for different fields.
    In this procees everthing look fine, actually If we need to update this information from DSO (that was loaded and the user need to update some fields) we need to download information from DSO to PSA and load again with DTP process, this was fine.
    Actually the user want that this kind of changes will be apply on line, this mean that for example all the invoices that I have actually loaded into DSO need to be analyzed and update according new parameters that they specify in other tables.
    The DSO is standard, and contain three basis tables, active, delta, modified.
    My question is: Is it possible update directly table of active records of DSO with one Z program?? is it a good idea?, We want to discard the option of unload and load information each time that they need to update certain field that are calculated or updated whit the transformation rule or load.
    Than you for your help.

  • Find abap programs

    Hi
    How can we find out that whether there is an abap program written for a paticular query or not.
    I have got a delivery report and the total volume of quantity moved is wrong.The kFigure name is moved quantity.BUt when i double click on it in the query it shows a box in which we come to know that it is geting data from delivery quantity.I want to know how can we now check the data in BW because the query is being supplied by a multi provider.How should i proceed to check where is the problem.is it i BW side or Program or query.
    Will appreciate help.thanks

    Tom,
    One of the challenges of working in BW is investigating data issues. User points out that the numbers are incorrect and you have to find out where the problem is.
    First thing I ask a user is what is the expected value and how is (s)he validating on the R/3 side. Then, I compare the filters that are used on R/3 and the filters that are used in BW query. If they are identical, we proceed with further investigation otherwise we should try to match the filters and see if the results match.
    Then, you have to see which InfoProviders are feeding the MultiProvider. Go the the manage screen of the InfoProvider where this data is stored and look at the InfoProvider contents for the same filters. More than likely it will show what the query is showing.
    From this point, there are many possible paths to choose from based on how data is being loaded. But, I am not sure if you are asking help with fundamental architecture of BW (what are all the objects that lie between a MultiProvider and R/3 extract) or if you a specific question.

Maybe you are looking for

  • Standard text in script

    how to change standard text in script

  • Mac mini with microsoft ipod

    Can I transfer my songs from an old version of ipod that was on a microsoft PC to a new Mac mini

  • MOBILEME PROBLEM

    HOW DO I GET RID OF MOBLEME AND START USING MY OUTLOOK WITHOUT A 2 MINUTE DELAY AND MULTIPLE "CLOSE PROGRAM CLICKS"?

  • TreeSelectionListener  valueChanged() called twice on selecting TreeNode

    Hi All, This is a class which extends JTree class forms a Tree displaying employee information.Listener is written which should find the list of selected Employee nodes of tree component. The method valueChanged() of treeListener is getting called tw

  • How to audit Mac, iCloud, iOS contacts for errors?

    Don't miss Winston Churchhill's Address Book Accounts Basics (with iCloud). On syncing: is there an Applescript or utility that will audit every linked iCloud account, Mac and iOS device for discrepancies between the Contacts databases? I thinking of