on 08-01-2016 9:48 AM
Hi Experts,
One of our clients is running SAP Business One, Version for SAP HANA. They have an Annual Production Report which shows the amount of Item Gruops produced (Kgs) per month in a certain year. This is a simple query output; it shows Item Groups received for the month of January=1
However, I would like some guidance on how to achieve this below. Group Name and Summmed Quantities are tranposed to Columns
Kind Regards,
Pascale.
Solved
Decided to create crosstabs using crystal reports. It produced the intended report
Learn more about crosstabs here:
Kind Regards,
Pascale.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try below logic.......
DATA: T_NEWTABLE TYPE REF TO DATA,
T_NEWLINE TYPE REF TO DATA,
*t_fldcat TYPE slis_t_fldcat_alv,
T_FLDCAT TYPE LVC_T_FCAT,
WA_IT_FLDCAT TYPE LVC_S_FCAT,
WA_COLNO(2) TYPE N,
WA_FLNAME(5) TYPE C.
FIELD-SYMBOLS: <T_DYNTABLE> TYPE STANDARD TABLE, "Dynamic internal table name
<T_DYNTABLE_FINAL> TYPE STANDARD TABLE,
<FS_DYNTABLE> TYPE ANY, "Field symbol to create work area
<FS_FLDVAL> TYPE any . "Field symbol to assign values
WA_COLNO = SY-TABIX .
WA_IT_FLDCAT-FIELDNAME = S_EKGRP-LOW."WA_FLNAME.
WA_IT_FLDCAT-DATATYPE = 'P'."'DMBTR'..
WA_IT_FLDCAT-INTTYPE = 'P'.
WA_IT_FLDCAT-DECIMALS = '2'.
WA_IT_FLDCAT-COL_POS = WA_COLNO.
APPEND WA_IT_FLDCAT TO T_FLDCAT.
SORT T_FLDCAT BY FIELDNAME.
DELETE ADJACENT DUPLICATES FROM T_FLDCAT COMPARING FIELDNAME.
SORT T_FLDCAT BY COL_POS.
* Create dynamic internal table and assign to FS
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = T_FLDCAT
IMPORTING
EP_TABLE = T_NEWTABLE.
ASSIGN T_NEWTABLE->* TO <T_DYNTABLE>.
* Create dynamic work area and assign to FS
CREATE DATA T_NEWLINE LIKE LINE OF <T_DYNTABLE>.
ASSIGN T_NEWLINE->* TO <FS_DYNTABLE>.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.