- Creating dynamic ALV with dynamic editable columns and dynamic colors to the columns based on condition
- Adding PF-Status, Header and Footer in ALV using class CL_SALV
- Hiding the print info of the ALV list in the spool
- Create, Modify and Delete entries dynamically from any custom table by using Object Oriented ALV
- Coloring of the cells in the F4 help of ALV
- Printing a line after every subtotaling in ALV
- Increasing the width of the spool when using ALV List
- Simple interactive ALV Tree calling ALV list display
- Display text 'Total' in ALV using Object Oriented Programming
- ALV with user-defined menu on toolbar
- Simple ALV Tree report (6-levels)
- Interactive ALV report using OOPS
- ALV with editable F4
- ALV Styles in Field catalogue using OOPS
- ALV drag and drop functionality on its rows
- ALV with user-defined buttons on toolbar
- Add custom sub-menu in ALV Context menu
- Editable Field catalogue for ALV display
- ALV code for simple hierarchical sequential list display (single child)
- ALV with EDIT and SAVE functionality
- Display subtotal text in ALV grid
- Demo program on interactive ALV using REUSE_ALV_GRID_DISPLAY
- Dropdown list in ALV
- ALV in a Pop up window and ALV in a dialog box
- ALV Interface Check
- Displaying ALV on the Selection Screen
- Changing Font style in ALV
- Dynamic ALV List generation
- Simple ALV report with its output transposed (rows as columns and columns as rows)
- Problem with ALV Grid Top-of-Page - How to print more than 60 characters?
- Printing ALV list with Page Numbers
- Printing Subtotals at the end of an ALV List
- Highlighting only a particular cell instead of entire row in ALV Grid
- Demo program on ALV Blocked list display
- Displaying Lights (Red, Green, Yellow) in ALV
- Working with ALV Layout variant
- Sample ALV Grid program using the function module REUSE_ALV_GRID_DISPLAY
- Displaying Logo in ALV
- Building Interactive ALV list using 'REUSE_ALV_LIST_DISPLAY'.
- Demo program to color particular row or column or cell of an ALV list using 'REUSE_ALV_LIST_DISPLAY'
- Demo program to color the contents of a field based on a condition using 'REUSE_ALV_LIST_DISPLAY'
- Highlighting the visited record on the basic list (ALV) on pressing BACK button in the secondary list using 'REUSE_ALV_LIST_DISPLAY'.
- Colored Excel output (Multiple Colors, Bold and others) using ALV
- Achieving Page Breaks using ALV Grid
- Demo program on ALV Tree Control
- Excluding a column from ALV Display using CL_SALV_TABLE Class.
- Displaying the data in various languages using ALV
- Working with Multiple dynamic internal tables
Tuesday, June 28, 2011
ALV Tutorials
Tutorials on LSMW
1. Uploading Vendor Master Data using Direct Input Method
2. Uploading Vendor Master Data using Recording Method
3. Migrating Customer data along with relationships (CRM)
4. Step-By-Step Guide for LSMW using ALE/IDOC Method
5. Uploading Purchase Info records using IDOC Method
6. Migration of Bank data using BAPI in LSMW
7. Using BAPI in LSMW (Uploading PO data)
8. Uploading Material Master data using BAPI method
9. Uploading Material Master data using Recording Method
10. Update Customer Master records using Batch Input
11. Uploading Material Master records using Direct Input Method
12. Differences between LSMW and BDC
13. Copying LSMW object from one client to another
14. When Standard BAPI has to be modified for using in LSMW
15. Using routines and exception handling in LSMW
17. Uploading long text for Material Master 'Purchase Order Text"
18.Handling multiple recordings in LSMW
19. Creating Normal program (BDC, ALV Report) by using LSMW in non-development clients
Tutorials on BAPI
- One more example on step-by-step creation of a BAPI (in elaborated steps)
- Step-by-step creation of a BAPI with necessary screenshots.
- A real-time example on using BAPI (Complete program)
- Standard BAPI change / Function Group enhancement procedure
- Create Customer Quotation (BAPI_QUOTATION_CREATEFROMDATA2 ) with BAPI Extension
- Parking a Document in FI using BAPI
- Creating Sales Scheduling Agreement with Extensions using BAPI
Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro)
- Building a simple application using Web Dynpro for ABAP
- Displaying Text box and radio buttons using "Web Dynpro for ABAP"
- Implementing enhancements in a view
- Creating a Web Dynpro ALV application in 30 easy steps
- Calling an URL on click of a button
- Exporting internal table contents to Excel file
- Deleting a row from the Web Dynpro table
- Sorting a table column in a Web Dynpro application
- ALV Table with Business Graphics
- Usage of Modal Dialog Box in Web Dynpro Component
- OVS help in the Web Dynpro application
- Usage of ALV Function elements and making a column editable
- Using Select-Options in Web Dynpro application
- Reusability of components in Web Dynpro for ABAP
- Using an ALV with Dynamic Context Nodes in Web Dynpro
- Dynamic Modification UI Hierarchy
- Navigation from one View to other View along with parameters using Plugs with out using Component Controller context
- Calling a Web Dynpro application from another Web Dynpro application
- Using Supply Function method in Web Dynpro
- Pop up a screen when a specific event has been triggered
- Creating Business Graphs in Web Dynpro
- Creating Transaction Code for Web Dynpro Applications
- Dynamic views in a Window
- Demo scenario on Adobe Forms using ABAP Web Dynpro Part 1
- Demo scenario on Adobe Forms using ABAP Web Dynpro Part 2
- Demo on inserting a logo using ABAP Web Dynpro
- Displaying an image or logo in Web Dynpro application without using MIME object
- Building Tree structure in Web Dynpro application and Calling another Web Dynpro application on clicking the nodes
- Demo on displaying list box with the option for se...
- Uploading Excel sheet using Web Dynpro for ABAP
- Enable/Disable & Show/Hide UI Elements during runtime in Web Dynpro for ABAP
- Working with roadmap UI element
- Getting started with Floor Plan Manager
- Translations in Web Dynpro for ABAP
- Passing values from one Web Dynpro application to another Web Dynpro application
- Programming dynamic ALV in ABAP Web Dynpro
- Dynamically selecting the view from the browser through Web Dynpro application parameter
- Creating layout from an existing PDF file and capture the values into Web Dynpro attributes
- Enhancing Standard Web-dypnro Component
- Scenario on making input enabled table using Web Dynpro for ABAP
- Using Tab strips in Web Dynpro for ABAP
- Dropdown by Index using ALV in Web Dynpro for ABAP
- Reading Component controller’s context node from view without mapping in Web Dynpro for ABAP
- Integrating WD Application with Microsoft Sharepoint
- Totals and Subtotals in ALV Web Dynpro
- How to search Web Dynpro component for a particular method or statement?
- OVS multiple value selection
- Freely Programmed Value Help in the WebDynpro application
- Steps for creating a Web Dynpro Component for Adobe interactive Forms using the Enumerated Drop Down Box
- Creating static table with 5 empty rows in interactive form using Web Dynpro ABAP
- Using Progress indicator UI Element at Table Control
- Opening SAP Transaction Code in SAP GUI Window from WebDynpro through URL (Transactional iView)
- Demo on Web Dynpro Configurator
eCATT (extended Computer Aided Test Tool)
- What is eCATT and why eCATT?
- Differences between CATT and eCATT
- eCATT Prerequisites
- eCATT vs Mercury QTP
- Creating a simple eCATT test script for MM02 transection
- Starting eCATT with TCD Recording method
- Starting eCATT with SAP GUI Recording method
- Creating a simple eCATT test script using ABAP Object
- Parameterization in eCATT
- Testing "Creation of a Sales Order"
- Integration script to create a sales order as well as delivery
- Debugging in eCATT
Userexits/BADIs
Enhancement Framework
- Picking material description from custom table in the SAP Sales Order (VA01 and VA02) using enhancement framework
- Setting the screen elements as mandatory in the transaction DP95 using Enhancement Framework
- Scenario on Enhancement Framework
- Restrict the modification of Delivery item texts - Using Implicit enhancement technique
BADIs
- BADI implementation for transaction FB60
- BADI implementation for transaction CS01
- Adding a field (material group) in the layout of Batch Information Cockpit (BMBC)
- Fallback class in a BADI
- Step by Step guide on BADI with Filter implementation
- SStep by Step guide on BADI Multiple use implementation
- Defining and implementing a BADI (step-by-step with screenshots)
- Defining and implementing BADI (With better screenshots)
- Understanding Business Add-ins (BADI)
- Filtering the work items in the SAP inbox using BADI
- Implementing the BADI for the transactions VL02 & MM02
- Exercise on BADI
User Exits/Screen Exits/Menu Exits
- Printing Attachments Of Work Order Via IW32
- Adding Fields to CJI3 Report
- Screen Exit for Notification Header (TCode: IW21) and show the custom fields in standard report for notifications (IW28, IW29)
- Automatically filling the field "Payment Terms" and disable the same while creating PO using the transaction ME22N
- Modifications to the SAP standard menu
- Working with Menu Exits
- Adding custom fields to the transaction CS01,CS02 and CS03 (Bill of Materials)
- Adding custom fields to the Purchase Order transaction ME22N
- Implementing Screen Exits for the transaction MIGO
- Implementing Screen Exit for the transaction CO01
- Changing the description of the standard SAP fields
- Implementing Screen Exit in "CJ01"
- Adding a custom screen in XD01
- Implementing Screen Exit for MM01/MM02/MM03
- How to implement a screen exit to a SAP Standard transaction
- Finding user exits using a TCode
- Working with User Exits
- Implementing Field Exit for the transaction MK01
- Adding custom fields using EEWB Transaction
Business Transaction Events (BTE)
- Scenario on triggering a BTE when a vendor is changed (Transaction FK02)
- Adding custom fields to the FI report FBL5N using BTEs
- E-mail EFT Remittance using BTE
Others
- Step by step procedure to enhance the BP using BDT
SAP Query
- Creating Ad Hoc query (HCM related infoset query)
- Developing SAP Query for Task List Data Extraction
- Transport of SAP Query objects
- Setting the Expiry date in SAP Query
- SAP Query for getting hourly background job status
- Building an SAP Query using ABAP Code
- Development of Basic List Query using SAP Query
- Configuration for SAP Query
- Working with infosets/User Groups/Query in detail
- What is SAP Query? Purpose and Advantages of SAP Query?
Step-by-step Tutorials
Business Server Pages (BSP)
- Building a simple BSP Application
- Building a simple BSP Application to retrieve Material information
- A Simple BSP application to select a range of Sales Document and Display the result on the next Page
- Providing F4 help in the BSP Application
- Providing list box in the BSP Application
- Using controller in BSP Application
- Building interactive BSP Application
- Displaying table contents on the BSP Application
- Navigating and data transfer between different pages
- Create Server-Side Cookies
- Create Client-Side Cookies
- Simple BSP Application Using HTMLB components on TableView, group by Radiobutton and Dropdown list box
- BSP Application using a Tree
- BSP Application using MVC Architecture - Displaying Business Partner data using a BAPI
- BSP Application using Date Navigator Control
- BSP Application using Tabstrip
- Creating a simple BSP Application using AJAX
- Simple BSP application to Create, Modify and Delete the database entries
- Resume application using BSP
- XML generation from BSP
- Simple BSP Application to validate the date fields in Front end using JAVASCRIPT.
- BSP application to download the table contents into excel sheet
- Steps to integrate Business Server pages (BSP) with ADOBE FLEX
Integrating SAP data (R/3 or BW Data) with the BO-Xcelsius (Business Objects) using BSP
- Part 1: SAP BSP + BO-Xcelsius (Excel XML Maps Connection)
- Part 2: SAP BSP + BO-Xcelsius (web Service Connection)
- Part 3: SAP BSP + BO-Xcelsius (XML Data Connection)
- Consuming Web Service with WSDL file through BSP
Step-by-step Tutorials
Tutorials on Object Oriented Programming(ABAP)
- Getting started with Adobe Forms with a simple exercise
- Create table
- Create table using subform
- Using Alternative in Adobe Forms
- Using Text Modules in Adobe Forms
- Value help in Adobe interactive forms
- Making subform behave as table and data part as body row
- Using Where conditions to relate header and item tables in Adobe forms
- Demo on Nested tables
- Achieving Control levels functionality in Adobe Forms.
- Calculating Page-wise Sub-Totals and Grand Total in Adobe forms
- Including the Standard Texts (SO10) and any other Long Texts in the Adobe Forms
- Scenario on displaying logo, background image and fetching data from multiple tables
- Printing Address using Business Address Services (BAS)
- Printing Address without using Business Address Services (BAS)
- Configuring the Adobe Forms / Smart forms / SAP Script to the output type in NACE
- Demo on Adobe interactive forms using WebDynpro for ABAP Part 1
- Demo on Adobe forms using WebDynpro for ABAP Part 2
- Printing labels using Adobe Forms
- Migration of an SAP Smart form to Adobe Form
- Using Multiple Master and Body pages
- Sending an Adobe form as an attachment in an email
- Uploading a PDF file in an Adobe Form offline scenario
- Sending an Adobe form as an attachment in an email
- Offline scenario to download an adobe form using Web Dynpro for ABAP.
- Offline scenario to upload a filled-in adobe form using Web Dynpro for ABAP
- Using Web Services in Adobe Forms
- Achieving Conditional-breaks in Adobe Forms
- Online Scenario - Travel Request Form
- Steps for creating a Web Dynpro Component for Adobe interactive Forms using the Enumerated Drop Down Box
- Upload Photos/images into custom table & Print in Adobe form
- Adding rows dynamically in a table using interactive Adobe Forms
- Hiding a Field Using Javascript in Adobe Form based on the condition
- Sending Adobe forms as “PDF” attachment using Email Submit Button
- Custom Dialog Box Message while Saving the Adobe Form without filling the Mandatory Fields
- Digital signature in Adobe forms
- Validation of date and calculation of the number of days between two dates using Java Script
- Quick testing for Adobe Forms
Adobe Interactive Forms Tutorials
- Getting started with Adobe Forms with a simple exercise
- Create table
- Create table using subform
- Using Alternative in Adobe Forms
- Using Text Modules in Adobe Forms
- Value help in Adobe interactive forms
- Making subform behave as table and data part as body row
- Using Where conditions to relate header and item tables in Adobe forms
- Demo on Nested tables
- Achieving Control levels functionality in Adobe Forms.
- Calculating Page-wise Sub-Totals and Grand Total in Adobe forms
- Including the Standard Texts (SO10) and any other Long Texts in the Adobe Forms
- Scenario on displaying logo, background image and fetching data from multiple tables
- Printing Address using Business Address Services (BAS)
- Printing Address without using Business Address Services (BAS)
- Configuring the Adobe Forms / Smart forms / SAP Script to the output type in NACE
- Demo on Adobe interactive forms using WebDynpro for ABAP Part 1
- Demo on Adobe forms using WebDynpro for ABAP Part 2
- Printing labels using Adobe Forms
- Migration of an SAP Smart form to Adobe Form
- Using Multiple Master and Body pages
- Sending an Adobe form as an attachment in an email
- Uploading a PDF file in an Adobe Form offline scenario
- Sending an Adobe form as an attachment in an email
- Offline scenario to download an adobe form using Web Dynpro for ABAP.
- Offline scenario to upload a filled-in adobe form using Web Dynpro for ABAP
- Using Web Services in Adobe Forms
- Achieving Conditional-breaks in Adobe Forms
- Online Scenario - Travel Request Form
- Steps for creating a Web Dynpro Component for Adobe interactive Forms using the Enumerated Drop Down Box
- Upload Photos/images into custom table & Print in Adobe form
- Adding rows dynamically in a table using interactive Adobe Forms
- Hiding a Field Using Javascript in Adobe Form based on the condition
- Sending Adobe forms as “PDF” attachment using Email Submit Button
- Custom Dialog Box Message while Saving the Adobe Form without filling the Mandatory Fields
- Digital signature in Adobe forms
- Validation of date and calculation of the number of days between two dates using Java Script
- Quick testing for Adobe Forms
ABAP Interview Questions
- SAP ABAP Technical Questions ( Data Dictonary )
- SAP ABAP Real Time Questions
- SAP ABAP Reports Questions
- SAP ABAP Internal Tables Questions
- SAP Scripts and Smart Forms Questions
- SAP ABAP Scripts Question and Answers Part 1
- SAP ABAP Scripts Question and Answers Part 2
- SAP ABAP Scripts Question and Answers Part 3
- SAP ABAP Scripts Question and Answers Part 4
- SAP ABAP Scripts Question and Answers Part 5
- SAP ABAP Scripts Question and Answers Part 5
- SAP ABAP Scripts Question and Answers Part 6
- SAP ABAP Scripts Question and Answers Part 7
- SAP ABAP BDC Programs Questions 1
- SAP ABAP BDC Programs Questions 2
- SAP ABAP BDC Programs Questions 3
- SAP ABAP Report Programming Questions 1
- SAP ABAP Report Programming Questions 2
- SAP ABAP Report Programming Questions 3
- SAP ABAP Report Programming Questions 4
- SAP ABAP Report Programming Questions 5
- SAP ABAP Report Programming Questions 6
- SAP ABAP Report Programming Questions 7
- SAP ABAP BDC , LSMW, Conversions Questions
- SAP ABAP Written Test Questions
- Sample Test Questions on SAP ABAP Programming
- Part 1
- Part 2
- Part 3
- Part 4
- Part 5
- Part 6
- 100 SAP ABAP Interview Questions
- SAP ABAP Technical Interview Questions( Data Dicto...
- SAP ABAP Certification Questions
- SAP ABAP Questions with Answers
SAP Enterprise Portals (EP)
- Basics of Enterprise Portal development using Java
- Viewing the solution manager documents on ESS or on web by deploying the same as a link
- Create and Export Transport request in Enterprise Portal
- Role Transfer from Enterprise Portal to SAP
- Role Transfer from SAP to Enterprise Portal
- Running multiple versions of NWDS in one PC
- Reuse Java Dictionary Types in Web Dynpro Development Components
Tutorials on SAP-ABAP
- Scheduling Background jobs
- Converting an XML file with many hierarchy levels to ABAP format
- FTP file transfer in Background
- Understanding "Coverage Analyzer"
- Understanding "Checkpoint Group"
- Understanding ABAP Unit
- Downloading report output into Excel using OLE
- Dynamic SELECT statement
- Displaying 3D Graphs in ABAP
- Creating a dynamic selection screen on a report
- Creating a Function Module
- Downloading file on to the application server
- Demo on Interactive reporting (One more example)
- Developing a simple interactive report
- A real-time example on sending PDF file as an email (Complete program)
- HR Infotype Creation
- Creation of a Dynamic Internal table
- Creation of a Number Range Object
- Download data from tables with user defined delimiters
- Create / Modify / Delete records in any table from CSV file
- ABAP Performance Standards
- Differences between LSMW and BDC
- MESSAGE XXXX RAISING XXXX. What is this?
- Debugging Update Task and Back-ground Task
- System debugging - Explained in detail
Updating Material Master long text (BASIC DATA TEXT, INSPECTION TEXT and INTERNAL COMMENT) - Calling an RFC function module from one system to another
- Object oriented programming (OOP) explained with an example
- Creating F1 helps with ease
- Dynamic Variant in a report
- Working with Menu Painter
- The Features of ABAPTM New Editor - Part 1
- The Features of ABAPTM New Editor - Part 2
- Displaying Graphics using ABAP Program
- Using Sorted table and Index while processing internal tables
- Implementing events in Table Maintenance
- Handling favorites in ABAP Workbench
- Calling a web service in ABAP that validates an email id
- Creation of a web service in SAP
- Changing the text "Sales Order" to "Billing Request" in the transactions VA01, VA02 and VA03
- Understanding SQL Trace
- ABAP Performance Tuning Checklist
- ABAP Programming standards
- E-mailing the background jobs
- Creating a Transaction Variant
- Performance Tuning using Parallel Cursor
- Scheduling a background job by triggering an event
- Creating Dynamic Patterns
- Custom Parameter-id Creation
- Display images (like company logo) on the selection-screen
- Creating Dynamic variant using table TVARV
- Dynamic Selection Screen (Drop downs, pushbuttons, radio buttons, icons)
- Adding custom context menu in classical list
- Convert internal table data into HTML using Function Modules
- Convert internal table data into HTML with out using Function Modules
- PDF Viewer
- Program to Upload or Download a report along with ...
- Download/Upload a program along with PF-Status, Text elements, documentation and others
- Using Code Templates
- Issue billing document output in XML format
- Include translations in a transport request
Creating a Tabstrip on the selection screen
Tutorials on SAP Data Dictionary
- Automatically populating the search hlep values into different fields on the selection screen by using search help exit
- Providing multiple selection options in Search help
- Creating a projection view
- Comparison of Transparent, Pool and Cluster tables
- Adding new values in Standard Domain
- Creation of a table pool and pooled table
- Row level locking of database tables
- Creation of a View cluster
- Creation of a Logical Database
- Working with Table Maintenance Generator
- Creating a secondary index
- Creating Search helps (Elementary and collective)
- Creating a structure in ABAP Dictionary
- Creating a Transparent Table
Friday, June 3, 2011
Scheduling Background jobs
Objective: Scheduling a background job in SAP R/3. These document intents to provide steps which can be done even by an end user to prepare a Job.
Main Steps:
1. Change screen layout of stock report as per the requirement.
2. Create variant to run the stock report (MB52) via Job.
3. Access transaction code SM36 to create the Job.
4. Monitor the Job and check the spool
5. Access SAP Business Work place to check the Spool.
Step1: Create Screen layout
Assumption: Go to transaction MB52 and enter the value of the Plant (let’s say 1000).
Step : Create Variant along with the layout which we have created in previous step.
Press F4 on the layout field in initial screen and then press save.
After selecting the layout here please click on save.
Step: Please mention the variant name as per your choice and also mention the description.
You may also mark the check box protect variant for the field plant and layout though its not mandatory.
Save
Step: Finding the program name for transaction code MB52
Now please notice the Program name RM07MLBS.
Step: Log in transaction code SM36.
Mention the Job name as ZDaliystk_MB52_1000.
Press enter to get the below screen
Click on the ABAP program and mention the program and also select the variant name which was created in initial steps.
Click on check and save
Step : Now click on the start condition button.
In this step we are giving the frequency of running the job. As already mentioned the Job needs to run daily basis.
click on the period values button and also mark the period check box as the job has to run every day.
Click on the spool recipient button
Just press enter and save to get the message that job is in release status
Monitor and check the output of job. Access transaction code SM37.
Also mention the Job name
execute and check the spool.
click on the type
Step: Here we are with the results which is list of stock in our case
Converting an XML file with many hierarchy levels to ABAP format
This example shows how we can convert an XML file with many hierarchy levels to ABAP format.
Copy and paste the following code in notepad and save it as test.xml file.
Save the XML file which in desktop or some other path
0000000000038491 ZEU_MATMAS 004 000000000000010003 005 E promo pack normal EN
Here we can see that the root node is ZEU_MATMAS03 which is the main structure containing all other structures.
It contains IDOC structure which in turn contains E1MARAM and EDI_DC40 structures within.
EDI_DC40 contains DOCNUM and MESTYP fields.
E1MARAM contains E1MAKTM structure and MSGFN and MATNR fields.
In SAP we have to create corresponding structures to store this data from XML to ABAP.The main structure contains many deep structures.
So in ABAP dictionary we first create the structure ZIDOC_TEST which contains Structures ZEDIDC40 and Z1EMARAM_TEST1.
ZIDOC_TEST structure contains ZE1MARAM_TEST1 and ZEDIDC40 structures within.
ZEDIDC40 contains DOCNUM and MESTYP fields.
ZE1MARAM_TEST1 contains E1MAKTM structure and MSGFN and MATNR fields.
The structures Z1EMARAM_TEST1 and ZEDIDC40 are also created as shown in the below slides.
This is the structure of ZEDIDC40 - Control record with fields DOCNUM and MESTYP..
The structure ZE1MARAM_TEST1 contains the following fields MSGFN and MATNR.Also a deep structure E1MAKTM.
E1MAKTM Structure is a standard dictionary structure we are using directly with the fields MSGFN,SPRAS,MAKTX and SPRAS_ISO.
The following ABAP program converts the given input XML file to ABAP format.
TYPE-POOLS abap.
*Input file contents as string.XML file path where we saved the file. *Here it is saved in desktop.
*Input file with path as constantCONSTANTS gs_file TYPE string VALUE 'C:\Documents and Settings\Administrator\Desktop\test1.xml'.
*This is the structure type for the data from the XML file
TYPES: BEGIN OF ts_zeu_matmas03,
idoc TYPE ZIDOC_TEST, “ZIDOC_TEST structure we created in SE11
END OF ts_zeu_matmas03.
* Table for storing the XML content from file
DATA: gt_itab TYPE STANDARD TABLE OF char2048.
* Table and work areas for the data from the XML file
DATA: gt_zeu_matmas03 TYPE STANDARD TABLE OF ts_zeu_matmas03,
gs_zeu_matmas03 TYPE ts_zeu_matmas03.
* Result table that contains references
* of the internal tables to be filled
DATA: gt_result_xml TYPE abap_trans_resbind_tab,
gs_result_xml TYPE abap_trans_resbind.
* For error handling
DATA: gs_rif_ex TYPE REF TO cx_root,
gs_var_text TYPE string.
* Get the XML file from your client
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = gs_file
CHANGING
data_tab = gt_itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Fill the result table with a reference to the data table.
* Within the XSLT style sheet, the data table can be accessed with
* "IDOC_GET".
GET REFERENCE OF gt_zeu_matmas03 INTO gs_result_xml-value.
gs_result_xml-name = 'IDOC_GET'.
APPEND gs_result_xml TO gt_result_xml.
* Perform the XSLT stylesheet
TRY.
CALL TRANSFORMATION z_xml_idoc
SOURCE XML gt_itab
RESULT (gt_result_xml).
In this part of the code
Z_XML_IDOC should be created in XSLT Editor and write code for that as follows:-
We can go there by double clicking on Z_XML_IDOC.Create it and after copying this code activate it.
XSLT is a language is used to convert XML from one format to another format.
Copy paste the following code in XSLT editor :-
Some rules which were applied for conversion to XSLT are:-
IDOC_GET is used to get the data from IDOC.In the XML file the main node is IDOC which has E1MARAM and EDIDC_40 which in turn contains MSGFN,MATNR and E1MAKTM and EDIDC_40 contains MSGFN and DOCNUM respectively.
The same type of structure which is used in our program needs to be filled.In our program EDIDC_40 is used as ZEDIDC40 and E1MARAM is used as ZE1MARAM_TEST1.
The basic template is already filled when we enter the XSLT editor.
We use IDOC_GET to use the IDOC data.We should use the tags to be filled in the hierarchy structure as we declared it in the program.To use the values we need to use the structures in the XML file.Use the corresponding path to access the values.
After transformation the gt_zeu_matmas03 is filled which can be used for displaying.
-
*Come back to ABAP editor and copy this code for error handling.
CATCH cx_root INTO gs_rif_ex.
gs_var_text = gs_rif_ex->get_text( ).
MESSAGE gs_var_text TYPE 'E'.
ENDTRY.
*Display the file contents on screen.
IF sy-subrc = 0.
LOOP at gt_zeu_matmas03 INTO gs_zeu_matmas03.
WRITE: gs_zeu_matmas03-idoc-zedidc40-docnum, “document no
/ gs_zeu_matmas03-idoc-zedidc40-mestyp, “message type
/ gs_zeu_matmas03-idoc-ze1maram_test1-msgfn,”message function
/ gs_zeu_matmas03-idoc-ze1maram_test1-matnr,”material no
*all fields of E1MAKTM segment
/ gs_zeu_matmas03-idoc-ze1maram_test1-e1maktm-msgfn,
/ gs_zeu_matmas03-idoc-ze1maram_test1-e1maktm-spras,
/ gs_zeu_matmas03-idoc-ze1maram_test1-e1maktm-maktx,
/ gs_zeu_matmas03-idoc-ze1maram_test1-e1maktm-spras_iso.
ENDLOOP.
ENDIF.
We can see the values filled in the heirarchy structure of IDOC as follows:-
Execute the ABAP program and we get the file contents displayed as below.So we have converted the given XML File to a structure and display the contents.
Final output of the program is:-
Automation Testing
- Manual and Automation testing Challenges
- What you need to know about BVT (Build Verification Testing)
- BVT types
- Learning basics of QTP automation tool and preparation of QTP interview questions
- QuickTest Pro - QTP Functional testing tool review
- Tips you should read before automating your testing work
- Choosing Automation tool for your organization
Blog Archive
-
▼
2011
(392)
-
▼
June
(22)
- ALV Tutorials
- Tutorials on LSMW
- Tutorials on BAPI
- Web Dynpro for ABAP (Step by step procedure for we...
- eCATT (extended Computer Aided Test Tool)
- Userexits/BADIs
- SAP Query
- Business Server Pages (BSP)
- Tutorials on Object Oriented Programming(ABAP)
- Adobe Interactive Forms Tutorials
- ABAP Interview Questions
- SAP Enterprise Portals (EP)
- Tutorials on SAP-ABAP
- Tutorials on SAP Data Dictionary
- Scheduling Background jobs
- Converting an XML file with many hierarchy levels ...
- FTP file transfer in Background
- Understanding "Coverage Analyzer"
- Understanding "Checkpoint Group"
- Understanding ABAP Unit
- Downloading report output into Excel using OLE
- Dynamic SELECT statement
-
▼
June
(22)