Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create ALV Grid.

Former Member
0 Likes
573

Hi all,

Is it possible to create ALV Grid\List in this format,

June Jul Aug Sep .............

Sales Off

Sales Grp

Order Grp

Order #

If this is possible how can it be done.

Thanks,

Prashanth

Message was edited by:

Prashanth KR

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
541

WHAT I CAN UNDERSTAND

COL1 JUNE JULY AUG SEP

SALES GR <VALUE OF JUNE>< VALUE OF JULY>...<VALUE OF SEP>.

THIS KIND IS NOT POSIIBLE IN ALV.

BUT YOU CAN DO ONE THING DECLARE INTTABLE

SALES(20),

JULY,

AUG,

SEP,

LIKE THAT IN THE FIRST COLOUMN TAKE THE VALUE LIKE 'SALES GR' IN JUNE JULY AUG SEP FIELD TAKE THE VALUE YOU WANT TO SHOW IN ASINGLE ROW. AND NOW SHOW THE ITAB IN ALV.

REGARDS

SHIBA DUTTA

5 REPLIES 5
Read only

Former Member
0 Likes
542

WHAT I CAN UNDERSTAND

COL1 JUNE JULY AUG SEP

SALES GR <VALUE OF JUNE>< VALUE OF JULY>...<VALUE OF SEP>.

THIS KIND IS NOT POSIIBLE IN ALV.

BUT YOU CAN DO ONE THING DECLARE INTTABLE

SALES(20),

JULY,

AUG,

SEP,

LIKE THAT IN THE FIRST COLOUMN TAKE THE VALUE LIKE 'SALES GR' IN JUNE JULY AUG SEP FIELD TAKE THE VALUE YOU WANT TO SHOW IN ASINGLE ROW. AND NOW SHOW THE ITAB IN ALV.

REGARDS

SHIBA DUTTA

Read only

p291102
Active Contributor
0 Likes
541

Hi,

kindly check this coding for the subheading and sub total.

REPORT YMS_TESTALV .

TYPE-POOLS: SLIS.

DATA: REPID LIKE SY-REPID,

X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,

IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

L_LAYOUT type slis_layout_alv,

  • x_events type slis_alv_event,

it_events type slis_t_event with header line. "SLIS_T_EVENT.

DATA: BEGIN OF ITAB OCCURS 0,

VBELN LIKE VBAK-VBELN,

POSNR LIKE VBAP-POSNR,

MALE type i,

female type i,

  • PLANE(10),

  • ACTUAL(10),

  • PLANE1(10),

  • ACTUAL1(10),

END OF ITAB.

START-OF-SELECTION.

REPID = SY-REPID.

SELECT VBELN POSNR FROM VBAP UP TO 20 ROWS INTO TABLE ITAB.

X_FIELDCAT-FIELDNAME = 'VBELN'.

X_FIELDCAT-SELTEXT_L = text-020. "'Planned cost'.

X_FIELDCAT-TABNAME = 'ITAB'.

X_FIELDCAT-COL_POS = 1.

X_FIELDCAT-OUTPUTLEN = 10 .

APPEND X_FIELDCAT TO IT_FIELDCAT.

CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'POSNR'.

X_FIELDCAT-SELTEXT_L = text-053. "'Actual cost '.

X_FIELDCAT-TABNAME = 'ITAB'.

X_FIELDCAT-COL_POS = 2."1.

APPEND X_FIELDCAT TO IT_FIELDCAT.

CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'MALE'.

X_FIELDCAT-SELTEXT_L = 'MALE'.

X_FIELDCAT-TABNAME = 'ITAB'.

X_FIELDCAT-COL_POS = 3.

APPEND X_FIELDCAT TO IT_FIELDCAT.

CLEAR X_FIELDCAT.

X_FIELDCAT-FIELDNAME = 'FEMALE'.

X_FIELDCAT-SELTEXT_L = TEXT-T01. "'FEMALE'.

X_FIELDCAT-TABNAME = 'ITAB'.

X_FIELDCAT-COL_POS = 3.

APPEND X_FIELDCAT TO IT_FIELDCAT.

CLEAR X_FIELDCAT.

it_events-NAME = SLIS_EV_TOP_OF_PAGE.

it_events-FORM = 'TOP_OF_PAGE'.

APPEND iT_EVENTS.

CLEAR it_events .

L_LAYOUT-NO_COLHEAD = 'X'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = REPID

IS_LAYOUT = L_LAYOUT

IT_FIELDCAT = IT_FIELDCAT

it_events = it_events[]

TABLES

T_OUTTAB = ITAB

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

  • IF SY-SUBRC <> 0.

*

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

FORM TOP_OF_PAGE.

*-To display the headers for main list

FORMAT COLOR COL_HEADING.

WRITE: / SY-ULINE(143).

WRITE: / SY-VLINE,

(8) 'LAST YEAR' ,

  • SY-VLINE,

(10) ' ' ,

SY-VLINE,

  • (19) 'CURRENT YEAR'(020) centered,

(19) 'CURRENT YEAR'(020),

sy-vline.

WRITE: / SY-VLINE,

(8) 'PLANE'(053) ,

SY-VLINE,

(8) 'ACTUAL'(054) ,

SY-VLINE,

(8) 'MALE'(056) ,

sy-vline,

(9) 'FEMALE'(057) ,

sy-vline.

FORMAT COLOR OFF.

**

ENDFORM.

Thanks,

Shankar

Read only

Former Member
0 Likes
541

Hey Thanks Guys,

But i would need to dislay in the format that i have mentioned only so i have thought of Classical Report and then have an interactive report to that.

Prashanth

Read only

Former Member
0 Likes
541

Hi prasanth,

It is possible to create the output in ALv, you require.

You need to build the internal table dynamically

Refer the link below to create dynamic internal table.

http://www.sap-img.com/ab030.htm

Regards

Rusidar S

Read only

0 Likes
541

Hi Rusidar,

Even if we create Internal Table Dynamically how can we create grid or list with horizontal and vertical labels as i have mentioned. Pleas elet me know if it possible.

Thanks,

Prashanth