Display schedule qty - Month wise in ALV Grid
Hi Experts,
I have a requirement to display the schedule line quantities month wise in ALV Grid. The columns sholud be dynamic columns based on the input date range. I got some idea about how to create dynamic ALV but it is not clear to implement in my requirement.
Please Guide me in achiving the same.
Example:
Jan 2011 Feb 2011 March 2011
100 2000 300
Thanks&Regards,
Karthik
Hi.,
Create field catalog dynamically as like this.,
select-options s_date for sy-datum.
data: n type i,
count type i,
cnt type string,
field type string,
descr type string.
DATA: m TYPE t247-mnr,
month_name type char10,
m1 type i.
n = s_date-high+4(2) - s_date-low+4(2) . " getting number of months
m1 = s_date-low+4(2).
m = m1.
n = n + 1.
DO n TIMES. " building field catalog dynamically
m = m + 1.
count = count + 1.
cnt = count.
concatenate 'FIELD' cnt into field.
CALL FUNCTION 'ISP_GET_MONTH_NAME' " FM to get month name
EXPORTING
LANGUAGE = sy-langu
MONTH_NUMBER = m
IMPORTING
* LANGU_BACK =
LONGTEXT = month_name .
concatenate month_name s_date-low+0(4) into descr separated by ''.
wa_fieldcat-col_pos = count.
wa_fieldcat-row_pos = '1'.
wa_fieldcat-fieldname = field.
wa_fieldcat-seltext_m = descr.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
ENDDO.
After this create dynamic table using,
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = t_fldcat
IMPORTING
ep_table = t_newtable.
then loop the internal table and assign the component to final internal table,.
like .,
CONCATENATE 'FIELD' index INTO fieldvalue. " do same like fieldcatalog
ASSIGN COMPONENT fieldvalue OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
<fs_fldval> = wa-fieldvalue.
hope this helps u.,
Thanks & Regards,
Kiran
Similar Messages
-
Display information on Month wise
We have one requirement and we need to display the Month wise information on the report (Sysdate - 1, sydate -2 ....etc)
for example today is 08 Sept 2011 In template level we need to display below
Sept 2011 Aug 2011 Jul 2011 Jun 2011 May 2011 Apr 2011
Please let me know if it's possible to do in RTF Template.Pull all the required date and data from DB using queries,.
-
How to display -ve sign before amount in ALV grid
Hi,
I want to display -ve numbers in an ALV grid. But the sign always appear at the end of the number. Is there any option with which I can display -ve sign before the number.
Regards,
DeeptiHi,
<b>You can refer to below threads:</b>
ALV - negative sign in the front
Prefix Negative sign in type P field in an ALV report
Or
USe Function Module <b>CLOI_PUT_SIGN_IN_FRONT</b>, may be this works in your case.
<b>Reward if helpful</b>
Rgds -
Display of "Average Values Text in ALV grid"
Hi
I use ALV grid to display the fields from a table. I have 15 columns. I need to do average for four columns.
In the field catalog i did a do_sum for those fields.
When the ALV grid is displayed I get average values for these columns.
Eg. Let suppose the grid looks like
Field1 Field2 Field3 Field4 Field5 Field 6.
vendor1 18 22 6 17 28
vendor1 54 11 16 62 28
vendor1 33 21 26 79 18
35 18 16 52 24
My requirement is I need to display the text "AVERAGE VALUES" . ( I need something like this.)
Field1 Field2 Field3 Field4 Field5 Field 6.
vendor1 18 22 6 17 28
vendor1 54 11 16 62 28
vendor1 33 21 26 79 18
Average values 35 18 16 52 24
Could someone help me in this?
Thanks & Regards
KavithaHello,
you can use event subtotal_text of ALV_GRID.
Regards,
Pedro Santos -
Display more than 255 charecters in alv grid
Hi,
I am trying to display the more than 255 harvesters in alv grid(Editable alv). But it is accepting 255 characters only. actually my string length is 2048 (file path).
How to display the more than 255 characters sting in alv grid. If any one know this please provide that logic.Hi,
Check this also
REUSE_ALV_GRID_DISPLAY maximum length
Re: how to display the data in the alv layout more than 255 characters -
Displaying the field symbol result in ALV GRID
hi.
I have a requirement to display the field symbol in ALV GRID. I am getting a error 'FIELD SYMBOL NOT YET BEEN ASSIGNED' when i am calling the 'REUSE ALV GRID DISPLAY'. Can any one help me out..I have a requirement that i have to display all the GL indicators as a field.
For that i have created a dynamic internal table so that based upon the GL indicators available in the database table i can create a dynamic internal table with GL indicators as the fieldnames.
Now i want to populate the corresponding amount with respect to the GL indicators in the dynamic internal table.
For ex.
I have a database table as follows:
Vendor Id GL indicators Amount
1000 A 2000
1000 S 3000
I have to created a field symbol as follows
Vendor Id A S
1000 2000 3000.
Now my requirement is that i want this values to be displayed in ALV GRID.
At the point of calling REUSE ALV GRID DISPLAY i am getting the error field symbol is not yet been assigned.. -
Display 2 rows per entry with ALV Grid
Hi Experts,
I need to display the results of a report with ALV Grid. The Problem is: I need to display the resultdata (some numbers etc..) in one row and then add a second row with the longtext.
The ALV should look somthing like this:
resultdata1 resultdata2 resultdata3
longtext1
resultdata1 resultdata2 resultdata3
longtext1
resultdata1 resultdata2 resultdata3
longtext1
Can anyone of you give me hint on how to do that?
(The row_pos and col_pos ind the fieldcat do not do the trick )
Thanx
Felixhi ,
You can do this
resultdata1 resultdata2 resultdata3
longtext1
resultdata1 resultdata2 resultdata3
longtext1
resultdata1 resultdata2 resultdata3
longtext1
Create two internal table .
one for : resultdata1 resultdata2 resultdata3
second for longtext1
see that both tables have matching primary key .
then can match the data and append in another third table .
regards
Deepak. -
Hi all,
I have my data in the table as date wise. I need to sum this data in month wise.
Can anyone tell me how to do it. Is their any fm to do it or any sample pgm of this kind.
For ex my output should be like this :
field1 field2 Month1 Month2 Month3 Month4 ..
Waiting for reply,
Regards,
Priyahi priya,
First of all sort the whole set of values as per date wise into an internal table.
Sort the table as per the date .
CONCATENATE PR_MONTH '01' INTO W_FIRST_DATE.
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = W_FIRST_DATE
IMPORTING
LAST_DAY_OF_MONTH = W_LAST_DATE
EXCEPTIONS
DAY_IN_NO_DATE = 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.
W_DATE = W_FIRST_DATE.
With this try to determine the first and last days of the month
From where u want to start .
Capture the month field from date field into pr_month.
Set the first date of the month to 01 like 02/01/2006
Suppose u had 02/02/2006 as the first occurance of the date then
U r trying to determine the first date and last date of ur feb month for the year 2006 .
Now 02/01/2006 and 02/28/2006 are determined by this process .
Set date_low = 02/01/2006 .
Date_high = 02/28/2006.
Now into ur select statement capture the fields between 02/01/2006 and 02/28/2006 just like range .
U can use select between or range
,so this covers all the fields for feb ,
Use collect on ur final output table which will give u the final sum values.
Now next field is say 03/10/2006 , then use the same process to capture the values .
Itab say is containg date fields
Logic is
Loop at itab.
Month = itab-date+(x)
At new month.
Perform operation .
Endat.
Endloop. -
Can we display only sub totals on the alv grid output
hi,
can we display only the subtotals calculated on the grid display.it should display all the data it shpuld display only the subtotals of it.
if yes can any one please give me the code for
will be awarded with points.Hi Raju
You can do that
When you are doing fieldcatalog,comment ws_fieldcat-do_sum = 'x'.
if you comment that it wont display totals.
use sort
i_sort type slis_alv...
clear ws_sort.
ws_sort1-spos = '1'<position of field>
ws_sort-fieldname = 'matnr'.
ws_sort-up = 'x'.
append ws_sort to i_sort.
pass this i_sort to FM -
How to display sign in left side in ALV Grid Function module?
Hi,
How to Dispaly sign in left side for amount fields in ALV GRID function module?
Ex : Amount = 1234-
I want to dispaly it as -1234.
Is there any option in ALV Grid function module?Hi sreedhar,
Use FM 'CLOI_PUT_SIGN_INFRONT'
it will giv the value like '-1234' if u pass '1234-'.
DATA : v_field(17).
MOVE v_amount to v_field.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = v_field.
MOVE v_field to v_amount.
OR
FORM change_sign changing var type c.
if var LT 0.
shift var right deleting trailing '-'.
shift var left deleting leading ' '.
concatenate '-' var into var.
else.
shift var left deleting leading ' '.
endif.
ENDFORM.
reward pts if it helps.
Edited by: venkat reddy on Jan 2, 2008 7:19 AM -
How to display three months data in ALV grid control
Hi
Thanks for all.I have tried now it is working but as per requirement month name and cumulative total will display like this format.cumulative total means month1amount+ month2amount+month3amount.And one more thing month range will change some times means sometimes i will give January date to march date and sometimes i will give July date to October date. but date range is same means between dates range is three months.
please tell me how to display.
GAS PRESSURE WELDING COST EFFECTIVENESS Dec-11 Cummulativetotal
Sr. No Item Unit Rate Qty Amount
GAS PRESSURE WELDING COST EFFECTIVENESS Jan-12
Sr. No Item Unit Rate Qty Amount
GAS PRESSURE WELDING COST EFFECTIVENESS Feb-12
Sr. No Item Unit Rate Qty Amount
Thanks & Regards,
Vasu.
Moderator message: only one thread per issue, please.
Edited by: Thomas Zloch on Feb 20, 2012Hi
Thanks for all.I have tried now it is working but as per requirement month name and cumulative total will display like this format.cumulative total means month1amount+ month2amount+month3amount.And one more thing month range will change some times means sometimes i will give January date to march date and sometimes i will give July date to October date. but date range is same means between dates range is three months.
please tell me how to display.
GAS PRESSURE WELDING COST EFFECTIVENESS Dec-11 Cummulativetotal
Sr. No Item Unit Rate Qty Amount
GAS PRESSURE WELDING COST EFFECTIVENESS Jan-12
Sr. No Item Unit Rate Qty Amount
GAS PRESSURE WELDING COST EFFECTIVENESS Feb-12
Sr. No Item Unit Rate Qty Amount
Thanks & Regards,
Vasu.
Moderator message: only one thread per issue, please.
Edited by: Thomas Zloch on Feb 20, 2012 -
Output will display in 2 saparate pages usiing ALV GRID
Hi All,
I am presently working in ALV_GRID Functionality.
The client requierment is "First G/L account line items (open, cleared or all) will be displayed and then the summary sheet will be displayed in a separate page
Can any one please conform that how to write logic for summary sheet.that will be display after the line items in saparate page.
Thanks,
SridharHello Sridhar,
You have can use the following ALV functions for this purpose:
FM: REUSE_ALV_BLOCK_LIST_INIT
FM: REUSE_ALV_BLOCK_LIST_APPEND (Multiple ITAB's )
FM: REUSE_ALV_BLOCK_LIST_DISPLAY
Please find the example:
TYPE-POOLS : slis.
TABLES : mara,
makt.
SELECT-OPTIONS : mat FOR mara-matnr.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr,
maktx LIKE makt-maktx,
matkl LIKE mara-matkl,
mtart LIKE mara-mtart,
END OF itab.
DATA : BEGIN OF itab1 OCCURS 0,
mtart LIKE mara-mtart,
count TYPE i,
END OF itab1.
DATA : BEGIN OF itab1_col OCCURS 0,
mtart LIKE mara-mtart,
count TYPE i,
END OF itab1_col.
DATA : t_fcat1 TYPE slis_t_fieldcat_alv,
t_fcat2 TYPE slis_t_fieldcat_alv,
wa_fcat TYPE slis_fieldcat_alv,
t_eve TYPE slis_t_event,
wa_eve TYPE slis_alv_event,
t_layout TYPE slis_layout_alv.
DATA : v_repid LIKE sy-repid,
t_mat LIKE mara-matnr.
DEFINE create_fcat.
clear wa_fcat.
wa_fcat-fieldname = &1.
wa_fcat-seltext_l = &2.
wa_fcat-outputlen = &3.
append wa_fcat to t_fcat1.
END-OF-DEFINITION.
START-OF-SELECTION.
PERFORM get_data.
PERFORM dis_data.
*& Form get_data
text
FORM get_data.
SELECT amatnr bmaktx amtart amatkl INTO CORRESPONDING FIELDS OF TABLE itab
FROM mara AS a INNER JOIN makt AS b ON
amatnr = bmatnr
WHERE a~matnr IN mat.
LOOP AT itab.
itab1-mtart = itab-mtart.
itab1-count = 1.
APPEND itab1.
ENDLOOP.
SORT itab1 BY mtart.
LOOP AT itab1.
MOVE-CORRESPONDING itab1 TO itab1_col.
COLLECT itab1_col.
ENDLOOP.
ENDFORM. "get_data
*& Form dis_data
text
FORM dis_data.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid.
REFRESH t_fcat1.
CLEAR t_fcat1.
REFRESH t_eve.
wa_eve-name = 'TOP_OF_PAGE'.
wa_eve-form = 'TOP_OF_PAGE1'.
APPEND wa_eve TO t_eve.
create_fcat:
'MATNR' 'Material' '10',
'MAKTX' 'Material Description' '40',
'MTART' 'Type' '10',
'MATKL' 'Group' '10'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = t_layout
it_fieldcat = t_fcat1
i_tabname = 'ITAB'
it_events = t_eve
TABLES
t_outtab = itab.
REFRESH t_fcat1.
CLEAR t_fcat1.
REFRESH t_eve.
wa_eve-name = 'TOP_OF_PAGE'.
wa_eve-form = 'TOP_OF_PAGE2'.
APPEND wa_eve TO t_eve.
create_fcat:
'MTART' 'Type' '10',
'COUNT' 'Total' '5'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = t_layout
it_fieldcat = t_fcat1
i_tabname = 'ITAB1_COL'
it_events = t_eve
TABLES
t_outtab = itab1_col.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
ENDFORM. "dis_data
*& Form top_of_page1
text
FORM top_of_page1.
FORMAT COLOR COL_POSITIVE.
WRITE:/ 'First Block'.
FORMAT COLOR OFF.
ENDFORM. "top_of_page
*& Form top_of_page2
text
FORM top_of_page2.
FORMAT COLOR COL_NEGATIVE.
WRITE /5 'Second Block'.
FORMAT COLOR OFF.
ENDFORM.
Reward If Helpful.
Regards
Sasidhar Reddy Matli. -
Display data column wise in alv
my problem is i want to display data in column wise in alv grid display
for example it will display
Name1 Amount
GTS 12000
TSL 8970
MJB 4678
but i want like:
GTS TSL MJB
12000 8970 4678
Edited by: jadav_avani on Nov 15, 2010 8:33 AM
Moderator Message: Search for available information.
Edited by: kishan P on Nov 15, 2010 1:50 PMmy problem is i want to display data in column wise in alv grid display
for example it will display
Name1 Amount
GTS 12000
TSL 8970
MJB 4678
but i want like:
GTS TSL MJB
12000 8970 4678
Edited by: jadav_avani on Nov 15, 2010 8:33 AM
Moderator Message: Search for available information.
Edited by: kishan P on Nov 15, 2010 1:50 PM -
Report display will be 2010,2011 year wise display and 2012 Month display
Hi,
I want to Create Report, output will be 2010,2011 year wise display, 2012,2013 month wise display and Fiscal year quarter display, all are display based on input value of Fiscal year data, please anyone guide me, How to do?
Thanks,
NandishHi,
How to assign KF to Time Characteristics,My report dsplay will be like this, For example
Input Fiscal YEAR=2010 to 2013
Material 2010 2011 APR.2012 to MARCH 2013
Quantity A1 200 300 * *
Quantity A2 300 400 * *
Also Display quarter wise display. How to do
Thanks,
Nandish -
To display a popup message alongwith ALV grid
Hi Experts,
I have a requirement where I need to display data using ALV Grid. Also, in case there are any errors encountered during the data extraction I need to inform the user about it by using either a popup message or a status message stating that he needs to check the error log. To display the error log I have provided a push button which will take the user to another screen where he can see all the errors encountered.
Can anyone please let me know as to how to accomplish the task of displaying a status message alongwith a ALV grid display?
Looking forward to your reply.
-Warm regards,
Prajakta K.use exception handling and pop up.........
try following in grid..
*--Exception handling
ENDIF .
ENDIF .
WHEN 'EU' .
READ TABLE gt_list INDEX ls_selected_row-row_id .
IF sy-subrc = 0 .
CALL FUNCTION 'ZPOPUP_CONV_CURR_AND_DISPLAY'
EXPORTING monun = 'EU'
quant = gt_list-paymentsum.
ENDIF .
ENDCASE .
ENDFORM .
Maybe you are looking for
-
C++ tab delimited file to array
Converting a large tcl project into c++ and i am struggling with the simplest tasks. For example, i used to create array of data from my file using the following method. .debug.t insert end "Reading Well Data\n" ; update set fileId [open data/$wellda
-
How to fix the position of JInternalFrames added in JFrame.
Hay Frnds, I am having a problem. I have a JFrame ,in which i have added five JInternalFrames. My problem is that i want to fix the position of thaose Internal frames so that user cant move them from one place to other. Is there any way to fix there
-
Backbase: Amazing rich interfaces
Came across this small European company called Backbase http://www.backbase.com in a popular industry rag http://www.infoworld.com/article/05/08/08/32TCback_1.html The demos on their website are very very slick. No page refreshes, very continuous, re
-
Drawing anime on Adobe Photoshop cs4 without a tablet?
i'm seriously losing my patience with Photoshop bc i can't even draw the outline of an eye without having it all broken and curved. i use the mouse pad thing so its harder for me to focus it. Are there any tutorials or tips that you can share with me
-
Quiero cambiarle mi sofware a Mi black berry 9000