Archive for the ‘ALV’ Category

Here is the abap report program template. I record it in my blog for further reference.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • MySpace
  • Twitter
  • email
  • Identi.ca
  • Print
  • Yahoo! Bookmarks
Thursday, January 7th, 2010 at 14:51 | 0 comments
Categories: ABAP, ALV
Tags:

We may need to display traffic light or some other icons in the ALV output to highlight some lines. Here is an example.

To use icons, you need to use types-pool: icon or include the include file in the program.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • MySpace
  • Twitter
  • email
  • Identi.ca
  • Print
  • Yahoo! Bookmarks
Wednesday, December 30th, 2009 at 21:26 | 2 comments
Categories: ABAP, ALV
Tags: , ,

We can make one or several lines in ALV report selectable according to select mode set in layout structure.

Step 1. Define another field in the output table with type c length 1. This field will be used to record the select status of front end in the backend.

* Data to be displayed
DATA: BEGIN OF gt_data OCCURS 50,
k(10),
a TYPE int1,
mark(1) type c,
END OF gt_data.

Step 2. Set this field name ‘MARK’ to the attribute ‘box_fname’ in layout structure.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • MySpace
  • Twitter
  • email
  • Identi.ca
  • Print
  • Yahoo! Bookmarks
Wednesday, December 30th, 2009 at 14:44 | 0 comments
Categories: ABAP, ALV
Tags: ,

The column length in ALV has a maxmium 128 characters. Note 857823 has the detail. Below is the detail from SAP.

Symptom
Entries in cells of the type CHAR or string are truncated after 128 characters in the SAP GUI.
Other terms
ALV Grid Control (cl_gui_alv_grid), function module (Full-screen) Grid (Reuse_alv_grid_display, SAPLSLVC_FULLSCREEN), SAPGUI, back end, front end

Reason and Prerequisites
The data table that is sent to the frontend only allows character values with the length 128.

Solution
This is the standard system behavior and cannot be changed.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • MySpace
  • Twitter
  • email
  • Identi.ca
  • Print
  • Yahoo! Bookmarks
Wednesday, December 30th, 2009 at 13:45 | 0 comments
Categories: ABAP, ALV
Tags: ,

This is an example about hierarchical sequential list report. It retrieve header and item information of purchase order and display them in a hierarchical way.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • MySpace
  • Twitter
  • email
  • Identi.ca
  • Print
  • Yahoo! Bookmarks
Wednesday, December 16th, 2009 at 23:11 | 0 comments
Categories: ABAP, ALV
Tags: ,

If the field in ALV output table is for currency or quantity, we need to do some effort to display it in our ALV. you must assign these fields to a currency or unit. There are three ways how you can do this in the field catalog:

* Reference to a Currency or Unit Field
* Value or Unit for the Entire Column
* Format the value field manually

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • MySpace
  • Twitter
  • email
  • Identi.ca
  • Print
  • Yahoo! Bookmarks
Wednesday, December 16th, 2009 at 22:57 | 0 comments
Categories: ABAP, ALV
Tags: ,

In previous article, we have already set alv editable, but we still need to validate the input data as well as save the input data to the database. In another case, we also need to change according to user’s event.

As we can now make our alv Grid editable we may require controlling input data. The alv Grid has events data_changed and data_changed_finished. The former method is triggered just after the change at an editable field is perceived. Here you can make checks for the input. And the second event is triggered after the change is committed. You can select the way how the control perceives data changes by using the method register_edit_event. You have two choices:

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • MySpace
  • Twitter
  • email
  • Identi.ca
  • Print
  • Yahoo! Bookmarks
Tuesday, December 8th, 2009 at 23:02 | 0 comments
Categories: ABAP, ALV

Sometimes, we need to make our ALV editable. SAP has already provide table control to modify table data(previously we use loop step instead). But ALV can provide more functionality to support sort, total,filter, etc.

As far as the edit feature is concerned, a cell of the alv grid control can have the following states:

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • MySpace
  • Twitter
  • email
  • Identi.ca
  • Print
  • Yahoo! Bookmarks
Tuesday, December 8th, 2009 at 22:49 | 0 comments
Categories: ABAP, ALV
Tags: ,

Business user always request to remove leading zero in the field. There are several methods to do it. But I think below one is the easiest.

When define the field catalog, we set field no_zero with value ‘X’. The ALV runtime will automatic remove the leading zero.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • MySpace
  • Twitter
  • email
  • Identi.ca
  • Print
  • Yahoo! Bookmarks
Saturday, October 17th, 2009 at 22:10 | 0 comments
Categories: ABAP, ALV
Tags: ,

This article deals with event handling in SAP ALV and mechanism behind it. In a nutshell, ALV Grid is an implementation of custom control. You must be very familiar with the dynpro programming. In dynpro programming, we general have two events: PBO and PAI. If user have some actions in the frontend screen, the event PAI will be triggered and program can have different reactions according to different function codes. In the custom control, things become a slight different. It will trigger an specific event, if user does some actions in the frontend. There are two types of event: system event and application event.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Live
  • MySpace
  • Twitter
  • email
  • Identi.ca
  • Print
  • Yahoo! Bookmarks
Saturday, October 17th, 2009 at 12:39 | 0 comments
Categories: ABAP, ALV
Tags: ,