Need to display Subtotal text and total text in ALV
HI,
I need help.
I am displaying subtotal and total for cost column which is group by Project type column
My problem is i am able to display the subtotal and total values but not able to display the 'Subtotal' and 'Total' text on that respective row.
I have updated lvc_s_sort table as follow.
ls_sort-spos = 1.
ls_sort-subtot = 'X'.
ls_sort-fieldname = 'SUBTOT'.
ls_sort-up = 'X'.
ls_sort-SELTEXT = 'Subtotal'.
ls_sort-spos = 2.
ls_sort-subtot = 'X'.
ls_sort-fieldname = 'PRART'.
ls_sort-GROUP = 'UL'.
ls_sort-up = 'X'.
Please suggest what should be done to display the text.
Regards,
Rachna
You have to use the event SUBTOTAL_TEXT for the ALV.
the field CRITERIA can be used for checking the field.
and field CRIT_TEXT for the sub total text.
I hope you are aware about how to implement the events in ALV using OOP.
Hope this helps you.
Similar Messages
-
ALV Grid Subtotal text and Total text display
Hello ABAPGuru's
I want to display the subtotal and Total texts. alv grid program runing on background.
Regards
Sweety(Sri)Hello Neil,
Here I have attached my routines.anyway my confusion. I have wrote the routine subtotal_text .but i am not passing ALV GRID FM.
*& Form eventtab_build
&---- This is used to get the list of events
---- <--RI_EVENTS Internal table
FORM eventtab_build CHANGING ri_events TYPE slis_t_event.
Structure for event handling.
DATA: rs_event TYPE slis_alv_event.
Returns table of possible events for a list type.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = ri_events. " Table of events to perform
Read the internal table with the TOP_OF_PAGE and move the
form name to the internal table
READ TABLE ri_events
WITH KEY name = slis_ev_top_of_page INTO rs_event.
IF sy-subrc = 0.
MOVE c_formname TO rs_event-form. " Form name
MODIFY ri_events FROM rs_event
INDEX sy-tabix. " Top of page event
ENDIF.
READ TABLE ri_events
WITH KEY name = slis_ev_end_of_page INTO rs_event.
IF sy-subrc = 0.
MOVE c_form_eop_name TO rs_event-form. " Form name
MODIFY ri_events FROM rs_event
INDEX sy-tabix. " Top of page event
ENDIF.
READ TABLE ri_events
WITH KEY name = slis_ev_subtotal_text INTO rs_event.
IF sy-subrc = 0.
MOVE c_formname_subtotal_text TO rs_event-form. " Formname
MODIFY ri_events FROM rs_event
INDEX sy-tabix. " Top of page event
ENDIF.
*&-- Delete all unneeded events:
DELETE ri_events WHERE form IS INITIAL.
ENDFORM. " eventtab_build
*& Form SUBTOTAL_TEXT
text
--> p1 text
<-- p2 text
FORM SUBTOTAL_TEXT USING ep_subtot_line TYPE type_data
e_event_data TYPE slis_subtot_text.
IF NOT e_event_data-criteria IS INITIAL.
E_EVENT_DATA-DISPLAY_TEXT_FOR_SUBTOTAL = 'Account Total'.
ENDIF.
ENDFORM. "SUBTOTAL_TEXT
*& Form initialise_layout
Initialise Layout
FORM initialise_layout .
i_layout-colwidth_optimize = c_x.
i_layout-group_change_edit = c_x.
*i_layout-subtotals_text = ' a'.
i_layout-detail_popup = c_x.
i_layout-zebra = c_x.
i_layout-no_vline = 'X'.
i_layout-no_hline = 'X'.
i_layout-totals_text = 'Account Total'.
ENDFORM. " initialise_layout
Call the function module to display the report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_program
i_callback_top_of_page = 'TOP_OF_PAGE' "Top Of Page
is_layout = i_layout
it_fieldcat = i_fieldtab
it_sort = i_sort
it_events = i_events " Events
is_print = i_print
i_default = c_x
i_save = c_save
is_variant = v_variant
TABLES
t_outtab = i_data
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.
Regards
Sweety (Sri) -
Regarding subtotal text and total text
Hi All,
can any body provide example program for ALV total text and subtotal text both using REUSE_ALV_GRID_DISPALY. and
using OOPS.
@@@MODERATOR:: Please dont lock my threads.I have been searching since 2 days for this example and i tried with the provided examples .but they are not worked out ::
FOr your information :
Some of the links i searched in SDN:
http://wiki.sdn.sap.com/wiki/display/ABAP/ALVDisplayTotalTextOrSubtotalText
Re: SubTotal Text in ALV?
http://wiki.sdn.sap.com/wiki/display/ABAP/ALVStandardSumTotalOr+SubtotalHi Naveen,
If you are looking for specific Subtotal text in ALV Grid, then i think it is not possible.
You can use SORT table to get sub-totals based on the columns that you display.
Generally the record existing on the column based on which you sort the table, appears as the sub-total text automatically.....
You can try giving Subtotal text in the LAYOUT as well and pass the layout to the ALV function module.
Best Regards,
Ram. -
My subtotal and total text in ALV list does not show...
Hello Experts,
Please see my code below on what I am doing wrong. I want to display the subtotal and total text in my ALV list.
CLEAR gs_layout.
gs_layout-colwidth_optimize = 'X'.
gs_layout-zebra = 'X'.
gs_layout-subtotals_text = 'Subtotal'.
gs_layout-totals_text = 'Total'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = gs_layout
it_fieldcat = gt_fieldcat
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = gt_sort
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
it_events = gt_events
* IT_EVENT_EXIT =
is_print = gs_print
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = lt_output_fin
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.Use on Thread. Don't Cross post. and Follow the Rules.
-
Display short, medium, and long text in a query
Hi all, we have a requirement to display the short, medium, and long text of an info-object in our queries. Currently, it seems that you can only select one text lenght at a time but not all three of them together. Aside from creating texts as attributes, is there a way to display all of the texts of an info-object?
For example, we have internal orders with 3 texts. When we run the query, we need to see the order number, then the short text, medium text, and long text. Is this possible?
thanks
Kory Squireyeah you are right, we can get all the texts as attributes. Other than that you can only get any one of them.
-
Display header text and item text in smartform
Hi all,
I have to display header text and item text of PO in smartform BBP_SUSPO.
So how to do that.. I have to use 'read_text' Fm or directly i can get values from any table ???
Thanks in advance.
Regards,
Anagha DeshmukhHi Amit,
I have used inculde text that is avalable in smartforms to display header & Item text in this way
For header :
Text Name Header guid
Text Object BBP_PD
Text ID HTXT
Language EN
For Item:
Text Name Item Guid
Text Object BBP_PD
Text ID ITXT
Language SY-LANGU
U can used this attributes in read_text function mdule also.
Thanks & Regards,
Anagha Deshmukh -
Purchase requisition - Header Texts and Item Texts
Hi,
In Creating Purchase requisition if we enter the Header note text and Item text, in which table these texts will be stored.
Regards,
RamHi,
To see any text go to the detail of that text you will have a magnify button below that text click there you will get the stand text editor open.
Click on GOT->Header it will give the information you need to get this text via function module 'READ_TEXT' they are sored in STXH.
Points if find this helpful
Regards,
Yakub Shah -
ALV: how to display only subtotals and total rows in the output
ALV: how to display only subtotals and total rows in the output
i am getting output
i am getting subtotals for respective fields
but i want to display only subtotals and totals rows in the output
i have tried the
totals_only parameter in slis_layout_alv
but it is not working.hi,
For TOTAL
For the amount field / quantity field in the field catalog give DO_SUM = 'X' for WHOLE total
For SUBTOTAL
For subtotal you will have to create an internal table sort..Let's say you want to do subtotal for each customer..
DATA: lt_sort type SLIS_T_SORTINFO_ALV,
ls_sort type slis_sortinfo_alv.
CLEAR ls_sort.
ls_sort-spos = 1.
ls_sort-fieldname = 'Give the field name that you do the sum'.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
APPEND ls_sort TO lt_sort.
fieldcatalog-do_dum = 'X'.
for subtotals
WA_SORT-FIELDNAME = 'ERSDA'.
WA_SORT-SPOS = '2'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOTAL = 'X'.
APPEND WA_SORT TO IT_SORT.
Refer
http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e056d52611d2b468006094192fe3/content.htm
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/doesnt-function-event-subtotal_text-in-alv-713787
regards,
Prabhu
reward if it is helpful -
Short Text and Long Text for WBS
HI All,
I am working on Interface Project where I need to enter Short description and long text for a WBS with external text.
Let me know if any FM Module is exist for same where I can Put this Short Description and Long Text seprately for a WBS Element.
Regards,
Atul R. RajmaneHi Atul,
I think you can enter short description & long text seprately for a WBS while creating entire struture of project in PS only. I don't think other than PS you will be able to enter short & long text for individual WBS.
Regards,
Sandeep -
Header Text and Item Text for Sales Order
Hi,
Can any one help me on Header Text and Item Text............ ASAP.
<b>STXH & STXL</b>
TDOBJECT :
TDID:
TDNAME :
Regards,
Raghunath.SHi Raghunath,
Go to the text <b>in plain page mode</b>, and then you do via the menu '<b>GoTo</b>' -> '<b>Header</b>' and you get the parameters you need ( object, name, id, ...).
Repeat this operation for each text.
<u>Tips :</u> If you want to handle those text, use FM : READ_TEXT, EDIT_TEXT, and SAVE_TEXT...
Hope this helps,
Erwan -
SAP SCRIPT Header text and Item text not printing in customized PO
Hello Experts,
I have copied the standard MEDRUCK to ZMEDRUCK and customized the form according to the requirement.
I want to print the header text and Item text in my form.
For Header text I have used :
/: INCLUDE &EKKO-EBELN& OBJECT EKKO ID F01
Problem 1: The text what I enter in header text is flowing only when I hit on print preview without saving the form. Once I save the SAP SCRIPT and click on print preview the field is appearing blank. I also tried to print the form, but the field is appearing blank even on the print out.
Problem 2: For item text the field is concatenation of EBELN & EBELP. Can anyone suggest me how to concatenate and fetch the text in item text.Hi,
Im getting an error in my subroutine pool for i_xtline which is to fetch ITEM TEXT., It says its not a in any internal table nor defined as data. How can I proceed further. I have pasted my code below. Please check and revert ASAP
PROGRAM ZMEDRUCK_SUBP1.
TABLES: EKPO, EKKO.
FORM fetch_table_data TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
data xname like THEAD-TDNAME.
data i_xtline like xtline.
clear i_xtline.
refresh i_xtline.
CONCATENATE EKPO-ebeln EKPO-ebelp INTO v_item_text.
MOVE v_item_text to ITEMTXT.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = F01
language = EN
name = ITEMTXT
object = EKPO
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
tables
lines = i_xtline
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. -
PO Header Texts and item texts
Dear Experts
PO header texts and item texts are stored in which table. please tell me the table name.
Here i have configured PO version management. in that i want to control some sensitive fields change only version management will get triggered. it is done through for this i have configured the sensitive fields in PO Print relevant changes. in that config the PO header texts and item texts table and field name is not exist.
Now i have change the PO through me22n in header texts version management is triggered for this. i want to control this if some body change the po header texts and item texts version management should not triggered.
is it possible.
Regards
Anand.Hai,
Try this table STXH.
Get the required information(input) for the function module 'READ_TEXT'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'ST'
LANGUAGE = sy-langu
NAME = thead-tdname
OBJECT = 'TEXT'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
if sy-subrc eq 0.
loop at lines.
wa_HEADER_TEXTS-TEXT_FORM = lines-TDFORMAT.
wa_HEADER_TEXTS-TEXT_LINE = lines-TDLINE.
append wa_HEADER_TEXTS to lt_tmp_HEADER_TEXTS.
endloop.
Better take the help of abaper.
With Regards,
Jaheer -
was able to edit text and add text and now does not allow me to do anything - Except purchase the software again.Can't find an answer to this anywhere.
Use Adobe Acrobat, not Adobe Reader.
-
hi,
In which table item texts and header texts avialable.
Edited by: Ramesh villa on Apr 11, 2009 4:49 PMDear,
For any queries (simple) recommended to search on group by entering simple search words of your quenry. You will find maximum solved questions.
Re: PO header and item texts
Regards,
Syed Hussain. -
Creation of short text and long text?
Hi,
We create short text by using oe_fnd_attachments_pub.create_short_text_document and oe_fnd_attachments_pub.add_attachment API and to create long text we use fnd_documents_pkg.insert_row .
Why is it that we have different approaches for creation of short text and long text?
I know that oe_fnd_attachments_pub.add_attachment is used to attach a short text to some entity,but then why we dont do the same for long text?
Please lemme knw urgently ...
Thanks and Regards
AmarThanks for the help,
I looked into the document and i got to know few things as to how short and long text are created, but can u tell when the records are inserted into fnd_attached_documents, because i can see that records are inserted into fnd_attached_short_text and fnd_attached_long_text, fnd_documents but i dont see any insertion into fnd_attached_documents, can u lemme knw how and when it is done?
Maybe you are looking for
-
Why doesn't iCal remember alarm settings for to-dos?
In iCal on Tiger, something I appreciated was that when I set an alarm for a "to-do" item, it remembered the last several choices I had made for alarms. This made setting an alarm quick, as I often use the same settings. However, with Leopard (at lea
-
I recieved a phishing email from amazon.
I recieved a phishing email from amazon. I opened it on my ipod and entered information (stupid, I know). I didn't realize it was a scam. Apparently it is some kind of trojan virus. Is my ipod safe? What should I do now?
-
Hi All, Looking for some help with what should be an easy question. I am running an Infoset Query (Ad-hock) to extract the Building address where an employee as worked since being defined in SAP. When I run the query, it collects and shows the
-
Delays in applet-servlet communication via serialization
The application that I am developing requires the applet to communicate with a servlet. It works fine except that it seems to send the data in spurts. The servlet seems to wait for good time before it sends out the next batch. It also seems that the
-
From where can I buy this book? Oracle Backup & Recovery
Oracle Backup & Recovery: Expert secrets for using RMAN and Data Pump http://www.rampant-books.com/book_1002_rman_backup_recovery.htm No answers on Google or Amazon