Calculating the total in alv and displaying the date
Hi,
I am trying to calculate the totals of netwr and fkimg in a report but the following coding cannot giv me the right answer so if there is anyone with the solution for this problem may you please help me out and how can i display the date on my report......here is my coding:
REPORT Z_DAILY_STOCK_NEW.
TYPE-POOLS: SLIS.
TABLES
TABLES: vbrk, kna1,vbrp,vbap,vbak, sflight.
ALV FIELDS
DATA: it_fieldcat TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: w_cnt LIKE sy-tabix.
total ref to data.
t_alv LIKE TABLE OF s_error WITH HEADER LINE.
DATA: gr_layout TYPE slis_layout_alv,
gr_tab_group TYPE slis_t_sp_group_alv,
gr_repid LIKE sy-repid,
gr_events TYPE slis_t_event,
gr_print TYPE slis_print_alv,
gr_user TYPE slis_formname VALUE 'USER_COMMAND'.
SELECTION SCREEN
SELECT-OPTIONS:
s_werks FOR vbrp-werks,
s_auart FOR vbak-auart.
DEFINITION OF AN INTERNAL TABLE
DATA: begin of i_stocktab occurs 0,
kunag LIKE vbrk-kunag,
name1 LIKE kna1-name1,
ort01 LIKE kna1-ort01,
inco1 LIKE vbrk-inco1,
vkgrp LIKE vbrp-vkgrp,
fkimg LIKE vbrp-fkimg,
netwr LIKE vbrk-netwr,
end of i_stocktab.
START OF SELECTION
SELECT vbrkkunag kna1name1 kna1ort01 vbrkinco1 vbrp~vkgrp
vbrpfkimg vbrknetwr
FROM kna1 inner join vbrk on kna1kunnr EQ vbrkkunrg
inner join vbak on kna1kunnr EQ vbakkunnr
inner join vbrp on vbrkvbeln EQ vbrpvbeln
INTO i_stocktab
WHERE vbrp~werks IN s_werks
AND vbak~auart IN s_auart.
APPEND i_stocktab.
ENDSELECT.
*DATA tb_alv TYPE i_stocktab WITH HEADER LINE.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM build_event.
PERFORM build_print.
PERFORM calc_total.
PERFORM display_alv_report.
FORM build_fieldcatalog.
w_cnt = 1.
it_fieldcat-fieldname = 'KUNAG'.
it_fieldcat-seltext_m = 'Soldtp'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
it_fieldcat-key = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'NAME1'.
it_fieldcat-seltext_m = 'Name'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'ORT01'.
it_fieldcat-seltext_m = 'City'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'INC01'.
it_fieldcat-seltext_m = 'Incoterms'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'VKGRP'.
it_fieldcat-seltext_m = 'Sales Group'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'FKIMG'.
it_fieldcat-seltext_m = 'Invoiced Qty'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
*it_fieldcat-do_sum = 'x'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'NETWR'.
it_fieldcat-seltext_m = 'Invoiced Value'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
it_fieldcat-do_sum = 'x'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
ENDFORM.
FORM build_layout.
gr_layout-no_input = 'X'.
gr_layout-colwidth_optimize = 'X'.
gr_layout-totals_text = 'Totals: '(201).
gr_layout-detail_popup = 'X'.
ENDFORM.
FORM build_event.
DATA i_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = gr_events[].
READ TABLE gr_events WITH KEY name = slis_ev_user_command
INTO i_event.
if sy-subrc = 0.
MOVE gr_user TO i_event-form.
APPEND i_event TO gr_events.
endif.
ENDFORM.
*FORM calc_total.
LOOP AT it_fieldcat into wa_fieldcat
WHERE fieldname EQ 'FKIMG' OR
fieldname EQ 'NETWR'.
wa_fieldcat-do_sum = 'X'.
wa_fieldcat-datatype = 'QUAT'.
modify it_fieldcat from wa_fieldcat.
ENDLOOP.
*ENDFORM.
FORM build_print.
gr_print-reserve_lines = '2'.
gr_print-no_coverpage = 'X'.
ENDFORM.
FORM calc_total.
DATA: total type ref to data,
subtotal1 type ref to data.
field-symbols <fkimg> like sflight.
field-symbols <netwr> like sflight.
call method grid1-> get_subtotals
importing
ep_collect00 = subtotal
ep_collect01 = total.
assign total to <fkimg>.
assign total to <netwr>.
ENDFORM.
*& FUNCTION ALV DISPLAY
FORM display_alv_report.
gr_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = gr_repid
I_CALLBACK_USER_COMMAND = slis_ev_user_command
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE' " see FORM
IS_LAYOUT = gr_layout
IT_FIELDCAT = it_fieldcat[]
IT_SPECIAL_GROUPS = gr_tab_group
I_SAVE = 'X'
IT_EVENTS = gr_events
IS_PRINT = gr_print
TABLES
t_outtab = i_stocktab
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM.
FORM top-of-page.
*ALV Header deaclarations
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
t_line LIKE wa_header-info,
ld_lines TYPE i,
ld_linesc TYPE c.
*Title
wa_header-typ = 'H'.
wa_header-info = 'Report for daily Stock Returns'.
APPEND wa_header TO t_header.
CLEAR wa_header.
*Total No. Records Selected
DESCRIBE TABLE i_stocktab LINES ld_lines.
ld_linesc = ld_lines.
CONCATENATE 'Total No. of Records Selected:' ld_linesc
INTO t_line SEPARATED BY space.
wa_header-typ = 'A'.
wa_header-info = t_line.
APPEND wa_header TO t_header.
CLEAR: wa_header, t_line.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
ENDFORM.
Try This
REPORT z_daily_stock_new.
TYPE-POOLS: slis.
* TABLES
TABLES: vbrk, kna1,vbrp,vbap,vbak, sflight.
* ALV FIELDS
DATA: it_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: w_cnt LIKE sy-tabix.
* total ref to data.
* t_alv LIKE TABLE OF s_error WITH HEADER LINE.
DATA: gr_layout TYPE slis_layout_alv,
gr_tab_group TYPE slis_t_sp_group_alv,
gr_repid LIKE sy-repid,
gr_events TYPE slis_t_event,
gr_print TYPE slis_print_alv,
gr_user TYPE slis_formname VALUE 'USER_COMMAND'.
* SELECTION SCREEN
SELECT-OPTIONS:
s_werks FOR vbrp-werks,
s_auart FOR vbak-auart.
* DEFINITION OF AN INTERNAL TABLE
DATA: BEGIN OF i_stocktab OCCURS 0,
kunag LIKE vbrk-kunag,
name1 LIKE kna1-name1,
ort01 LIKE kna1-ort01,
inco1 LIKE vbrk-inco1,
vkgrp LIKE vbrp-vkgrp,
fkimg LIKE vbrp-fkimg,
netwr LIKE vbrk-netwr,
END OF i_stocktab.
* START OF SELECTION
SELECT vbrk~kunag kna1~name1 kna1~ort01 vbrk~inco1 vbrp~vkgrp
vbrp~fkimg vbrk~netwr
FROM kna1 INNER JOIN vbrk ON kna1~kunnr EQ vbrk~kunrg
INNER JOIN vbak ON kna1~kunnr EQ vbak~kunnr
INNER JOIN vbrp ON vbrk~vbeln EQ vbrp~vbeln
INTO i_stocktab
WHERE vbrp~werks IN s_werks
AND vbak~auart IN s_auart.
APPEND i_stocktab.
ENDSELECT.
*DATA tb_alv TYPE i_stocktab WITH HEADER LINE.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM build_event.
PERFORM build_print.
PERFORM calc_total.
PERFORM display_alv_report.
* FORM build_fieldcatalog *
FORM build_fieldcatalog.
w_cnt = 1.
it_fieldcat-fieldname = 'KUNAG'.
it_fieldcat-seltext_m = 'Soldtp'.
it_fieldcat-emphasize = 'X'.
it_fieldcat-key = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'NAME1'.
it_fieldcat-seltext_m = 'Name'.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'ORT01'.
it_fieldcat-seltext_m = 'City'.
it_fieldcat-col_pos = w_cnt.
it_fieldcat-emphasize = 'X'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
* w_cnt = w_cnt + 1.
* it_fieldcat-fieldname = 'INC01'.
* it_fieldcat-seltext_m = 'Incoterms'.
* it_fieldcat-emphasize = 'X'.
* APPEND it_fieldcat TO it_fieldcat.
* CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'VKGRP'.
it_fieldcat-seltext_m = 'Sales Group'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
it_fieldcat-fieldname = 'FKIMG'.
it_fieldcat-seltext_m = 'Invoiced Qty'.
it_fieldcat-emphasize = 'X'.
it_fieldcat-ref_tabname = 'VBRP' .
it_fieldcat-ref_fieldname = 'FKIMG' .
it_fieldcat-do_sum = 'X' .
* *it_fieldcat-do_sum = 'x'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
w_cnt = w_cnt + 1.
clear it_fieldcat .
it_fieldcat-fieldname = 'NETWR'.
it_fieldcat-seltext_m = 'Invoiced Value'.
it_fieldcat-emphasize = 'X'.
it_fieldcat-ref_tabname = 'VBRP' .
it_fieldcat-ref_fieldname = 'NETWR' .
it_fieldcat-do_sum = 'X' .
* it_fieldcat-do_sum = 'x'.
APPEND it_fieldcat TO it_fieldcat.
CLEAR it_fieldcat.
ENDFORM.
* FORM build_layout *
FORM build_layout.
gr_layout-no_input = 'X'.
gr_layout-colwidth_optimize = 'X'.
gr_layout-totals_text = 'Totals: '(201).
gr_layout-detail_popup = 'X'.
ENDFORM.
* FORM build_event *
FORM build_event.
DATA i_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = gr_events[].
READ TABLE gr_events WITH KEY name = slis_ev_user_command
INTO i_event.
IF sy-subrc = 0.
MOVE gr_user TO i_event-form.
APPEND i_event TO gr_events.
ENDIF.
ENDFORM.
*FORM calc_total.
* LOOP AT it_fieldcat into wa_fieldcat
* WHERE fieldname EQ 'FKIMG' OR
* fieldname EQ 'NETWR'.
* wa_fieldcat-do_sum = 'X'.
* wa_fieldcat-datatype = 'QUAT'.
* modify it_fieldcat from wa_fieldcat.
* ENDLOOP.
*ENDFORM.
FORM build_print.
gr_print-reserve_lines = '2'.
gr_print-no_coverpage = 'X'.
ENDFORM.
* FORM calc_total *
FORM calc_total.
DATA: total TYPE REF TO data,
subtotal1 TYPE REF TO data.
* FIELD-SYMBOLS <fkimg> LIKE sflight.
* FIELD-SYMBOLS <netwr> LIKE sflight.
* CALL METHOD grid1-> get_subtotals
* IMPORTING
* ep_collect00 = subtotal
* ep_collect01 = total.
* ASSIGN total TO <fkimg>.
* ASSIGN total TO <netwr>.
ENDFORM.
*& FUNCTION ALV DISPLAY
FORM display_alv_report.
gr_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gr_repid
i_callback_user_command = slis_ev_user_command
i_callback_top_of_page = 'TOP-OF-PAGE' " see FORM
is_layout = gr_layout
it_fieldcat = it_fieldcat[]
it_special_groups = gr_tab_group
i_save = 'X'
it_events = gr_events
is_print = gr_print
TABLES
t_outtab = i_stocktab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM.
* FORM top-of-page *
FORM top-of-page.
*ALV Header deaclarations
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
t_line LIKE wa_header-info,
ld_lines TYPE i,
ld_linesc TYPE c.
*Title
wa_header-typ = 'H'.
wa_header-info = 'Report for daily Stock Returns'.
APPEND wa_header TO t_header.
CLEAR wa_header.
*Total No. Records Selected
DESCRIBE TABLE i_stocktab LINES ld_lines.
ld_linesc = ld_lines.
CONCATENATE 'Total No. of Records Selected:' ld_linesc
INTO t_line SEPARATED BY space.
wa_header-typ = 'A'.
wa_header-info = t_line.
APPEND wa_header TO t_header.
CLEAR: wa_header, t_line.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
ENDFORM.
Similar Messages
-
Can't back-up new iMac with fusion HD. The back-up proceeds to within 10% of the total storage needed and then the "of" number increases. I suspect there is a problem with backing up the fusion drive. We have a new 3 TB time Capsule. I tried excluding different parts of the software from the back-up but it didn't make any difference. I even tried exluding "invisible items" to no avail. Any ideas?
When you setup the wireless and ethernet in the computer.. ipv6 will be on automatic.. this is wrong for the latest TC firmware and airport utility. http://support.apple.com/kb/TS4597
Go to the wireless and ethernet setup in preferences and change ipv6 to link local.
Once you do the big backup by ethernet the wireless will function fine for incremental.. it is obviously not estimating the size correctly..
A full back-up on the iMac would be about 650 GB. The partial updates that I have been trying start out at 115MB and keep growing indefinitely. The original back-up never finished nor have any of the follow-up attempts.
The first estimate should be the full backup but it will keep growing as the backup advances.. I would also delete any inprogress files to make sure it is not messing up .. delete even a sparsebundle if there is one for the imac on the TC and start afresh once you have ethernet connection.
See A10 here.
Pondini may have some other clues there to give you an idea of why the backup is slow or not finishing.. there is a lot of issues with TM when it decides not to work. -
The Problem/s
1. I am unable to sync my iPhone 4S with my Mac Book Pro, either by cable, wifi or bluetooth
2. iTunes will initiall open and briefly identifies the iPhone in the Device section in iTunes.
3. When iTunes starts to read the iPhone (displaying the spinning wheel), it immediately then quits and
4. Opens a 'dialogue box' which displays the message "iTunes Quit Unexpectedly"
5 The dialoge box offers the following button options to:-
'Show Details'
The 'Show Details' button will open and display a list of the 'Problem Details and System Configeration'. To the average user the information is useless, as one doesn't know what to look for to solve the problem. This is a long and detailed report (too long to include in this message), which includes information such as:-
Crashed Thread: 20
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000006f0
'OK'
The 'Ok' button simply quits and closes the dialogue box
'Reopen'
The 'Reopen' button will again reopen iTunes, briefly showing that it is trying to read the iPhone in the Devices section, but then returns again to display the same dialogue box.
Other Information
1. iTunes will still start normally once the USB cable is removed from the Mac book Pro, but crashes again once the USB cable is reattached to the computer
Any advice or help offered would be greatly appreciated.
Sincerely
Rob
Message was edited by: RobmanricoHi there anaqeed,
I would recommend taking a look at the troubleshooting steps found in the article below.
Issues installing iTunes or QuickTime for Windows
http://support.apple.com/kb/ht1926
-Griff W. -
hi,
I have created a custom list in my sharepoint :
List1 name: employeedepartment -
Title empdepartment
A D1
B D2
C D3
List2 name: employeedetails
emptitle empname empdepartment(lookup) --> from the list "employeedepartment"
x Ram D1
y Robert D2
z Rahim D3
My task is to create a custom webpart that will be for searching this employee details by entering emptitle
For this, i have created a visual webpart using visual studio 2010, my webpart will be like this:
emptitle ---> TextBox1 Button1--> Text property : Search
empname---> TextBox2
empdepartment--> DropDownList1
For this, i wrote the code as follows:
protected void Button1_Click(object sender, EventArgs e)
using (SPSite mysite = new SPSite(SPContext.Current.Site.Url))
using (SPWeb myweb = mysite.OpenWeb())
SPList mylist = myweb.Lists["employeedetails"];
SPQuery query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + TextBox1.Text.ToString() + "</Value></Eq></Where>";
SPListItemCollection myitems = mylist.GetItems(query);
if (myitems.Count > 0)
foreach (SPListItem item in myitems)
string a1 = Convert.ToString(item["empname"]);
string a2 = Convert.ToString(item["empdepartment"]);
TextBox2.Text = a1; // displaying properly
//DropDownList3.SelectedIndex = 1;
It is showing the list item in textbox according to the item entered in the textbox1... But I am stuck to show in the dropdown list.
Suppose, if i enter X in textbox and click on search, then dropdownlist need to show D1,
for Y --> D2 and for Z-> D3... like that.
What code do i need to write in the button_click to show this...
Please don't give any links...i just want code in continuation to my code.Hi,
Since you have got the data you want with the help of SharePoint Object Model, then you can focus on how to populate values and set an option selected in the Drop Down List.
With the retrieved data, you can populate them into the Drop Down List firstly, then set a specific option selected.
Here is a link will show how to populate DropDownList control:
http://www.dotnetfunda.com/articles/show/30/several-ways-to-populate-dropdownlist-controls
Another link about select an item in DropDownList:
http://techbrij.com/select-item-aspdotnet-dropdownlist-programmatically
Best regards
Patrick Liang
TechNet Community Support -
Validate the XML tag value and display the Binding data in XDP
Hi,
I am new to Adobe Life Cycle.... and i am working on the following requirement and XML file is enclosed...
1. Need to validate the XML value of <pp> with condition
2. Basing on the value of <pp>, need to display the <ct> values in text field
If i simply bind, it takes the values from top of array and display..
Please suggest how to restrict the binding values basing on the condition.
Thanks
MadhuHi Paul,
Thank you for quick respose.
The solution which you have give me not excatly looking for.... working for the solution in alternative methods...
Regards
madhu -
My screen just locked up and displayed the following pattern. Any ideas why?
Hello,
My computer went to sleep and when I awoke it and opened up safari browser, the screen locked up and displayed the attached pattern on my screen. I could still use the mouse but couldn't click on anything. I had to reboot.
Any ideas what could be wrong?If it will repeat after restart - hardware problems. Most probably memory.
Anyway run Apple Hardware Test -
So I have been using my iPad for a few months now and I recently noticed that the time display next to the playlist name in the music app that is supposed to display the total song count and time of a playlist is way off. I have a 25 song playlist that is around 2 hours on my computer appears as 2003 minutes on my iPad. It's a smart playlist limited to 25 songs if that makes any difference. Is this happening to anyone else? Any help would be appreciated!
Greetings,
First make an iCal backup, File > Export > Archive.
Remove the following to the trash and restart your computer:
Home > Library > Caches
Home > Library > Calendars > Calendar Cache, Cache, Cache 1, 2, 3, etc. (Do not remove Sync Cache or Theme Cache)
Home > Library > Preferences > com.apple.ical (There may be more than one of these. Remove them all.)
__NOTE: Removing these files will remove any shared (CalDAV) calendars you may have access to. You will have to re-add those calendars to iCal > Preferences > Accounts.
Once the computer is back up and running open iCal and test.
Hope that helps. -
Display the total number of rows for the report in OBIEE 11g
Hi, In obiee 11g, the pagination will be 1-25. Is there any possiblity in obiee to show the total rows count next to pagination. Ex: if the result contains 120 rows. it should display after the pagination
Records 1-25. Total of Records : 120
Is there any way we can display the total number of rows for the report.
Kindly help me.. Its very urgent requirement.
MAny Thank in advacneCheck this http://obiee100.blogspot.com/2011/07/display-total-number-of-records-in.html
and
http://docs.oracle.com/cd/E28280_01/bi.1111/e10544/appsql.htm#CHDCDIDA
You have to go something like as suggested in previous link.
Mark as correct/helpful -
Totas and sub totals in ALV grid display
Hi all,
how can I get the total for an integer field in internal table. I am using the following code, but unable to display the total. Can anyone give the reason for the same.
Thank you,
Usha
REPORT ZTEST_SUB .
TABLES : vbak.
TYPE-POOLS: slis.
SELECT-OPTIONS : s_vkorg FOR vbak-vkorg,
s_kunnr FOR vbak-kunnr,
s_vbeln FOR vbak-vbeln.
SELECTION-SCREEN : SKIP,
BEGIN OF LINE,
COMMENT 5(27) v_1 FOR FIELD p_max.
PARAMETERS p_max(2) TYPE n DEFAULT '2' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
DATA: ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
DATA: BEGIN OF gt_vbak OCCURS 0,
vkorg LIKE vbak-vkorg,
kunnr LIKE vbak-kunnr,
vbeln LIKE vbak-vbeln,
test type I,
END OF gt_vbak.
START-OF-SELECTION.
PERFORM f_read_data.
loop at gt_vbak.
gt_vbak-test = 1.
modify gt_vbak.
endloop.
PERFORM f_display_data.
FORM f_read_data.
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
FROM vbak UP TO p_max ROWS WHERE
kunnr IN s_kunnr AND
vbeln IN s_vbeln AND
vkorg IN s_vkorg.
ENDFORM.
FORM f_display_data.
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = 'VBAK'.
ls_fieldcat-ref_FIELDname = &2.
ls_fieldcat-do_sum = &3.
ls_fieldcat-cfieldname = &4.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
ls_sort-subtot = &2.
ls_sort-group = '*'.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA: ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
m_fieldcat 'VKORG' 'VKORG' '' ''.
m_fieldcat 'KUNNR' '' '' ''.
m_fieldcat 'VBELN' '' '' ''.
m_fieldcat 'TEST' '' 'X' ''.
m_sort 'VKORG' ''.
m_sort 'KUNNR' ''.
m_sort 'VBELN' ''.
m_sort 'TEST' 'X'.
ls_layout-cell_merge = 'X'.
LS_LAYOUT-WINDOW_TITLEBAR = 'test window'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = ls_layout
IT_FIELDCAT = lt_fieldcat
IT_SORT = lt_sort
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = gt_vbak
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.
endform.hi
REPORT ZTEST_SUB .
TABLES : vbak.
TYPE-POOLS: slis.
SELECT-OPTIONS : s_vkorg FOR vbak-vkorg,
s_kunnr FOR vbak-kunnr,
s_vbeln FOR vbak-vbeln.
SELECTION-SCREEN : SKIP,
BEGIN OF LINE,
COMMENT 5(27) v_1 FOR FIELD p_max.
PARAMETERS p_max(2) TYPE n DEFAULT '2' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
DATA: ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
DATA: BEGIN OF gt_vbak OCCURS 0,
vkorg LIKE vbak-vkorg,
kunnr LIKE vbak-kunnr,
vbeln LIKE vbak-vbeln,
test type I,
END OF gt_vbak.
START-OF-SELECTION.
PERFORM f_read_data.
loop at gt_vbak.
gt_vbak-test = 1.
modify gt_vbak.
endloop.
PERFORM f_display_data.
FORM f_read_data.
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
FROM vbak UP TO p_max ROWS WHERE
kunnr IN s_kunnr AND
vbeln IN s_vbeln AND
vkorg IN s_vkorg.
ENDFORM.
FORM f_display_data.
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = 'VBAK'.
ls_fieldcat-ref_FIELDname = &2.
ls_fieldcat-do_sum = &3.
ls_fieldcat-cfieldname = &4.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
ls_sort-subtot = &2.
ls_sort-group = '*'.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA: ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
m_fieldcat 'VKORG' 'VKORG' '' ''.
m_fieldcat 'KUNNR' '' '' ''.
m_fieldcat 'VBELN' '' '' ''.
m_fieldcat 'TEST' '' 'X' ''.
m_sort 'VKORG' ''.
m_sort 'KUNNR' ''.
<b> m_sort 'VBELN' 'X'.</b>
*m_sort 'TEST' 'X'.
ls_layout-cell_merge = 'X'.
LS_LAYOUT-WINDOW_TITLEBAR = 'test window'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = ls_layout
IT_FIELDCAT = lt_fieldcat
IT_SORT = lt_sort
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = gt_vbak
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.
endform.
Message was edited by: Ashok Parupalli -
Problem in placing the background in ALV Grid display
I have created one image of the business flow, and it have to be displayed in the background of ALV grid display.
For this I have gone to T.Code <b>OAER</b> , Given class name as <b>PICTURES</b> , Class type as <b>OT</b> , Object Key <b>BACKGROUND</b>, clicked on the triangle of Standard Doc , then double click on screen, and finally uploaded the background into SAP.
In the function module <b>REUSE_ALV_GRID_DISPLAY</b> I passed this background to the parameter I_BACKGROUND_ID.
It is working fine, and I was able to see the back ground in my program.
(developed in IDES)
But the same is not working in my development client, will some one suggest be the reason for the problem. Please kindly help me out from this problem.hello Dinesh,
I have created the object key in the development client itself and used in the grid display of the same client. i am not understanding where the problem is, any how thank you very much for your responce. if you have any other solution please let me know.
Thank you -
Wan to add push button in the output of ALV Grid display.
Hi Friends,
I wan to add a Push button in the output of ALV GRID display with STANDARD ikons.
How to copy standard ikons of GRID output.
How to apply the copied status into my code.
Regards,
VijiHi,
Goto SE41, create a pf-status for your alv report program.
On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.
Delete the unwanted buttons and also you can add new buttons if reqd.
Activate pf-status --> and apply in alv program.
Now to apply this pf-status in your alv report follow code:-
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_rep_id " report id
i_callback_pf_status_set = 'PF' " for PF-STATUS
i_callback_user_command = 'USER_COMMAND' " for User-Command
is_layout = wa_layout " for layout
it_fieldcat = it_field " field catalog
it_sort = it_sort " sort info
TABLES
t_outtab = it_final " internal table
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 pf
* SUB-ROUTINE PF IS USED TO SET THE PF-STATUS OF THE SCREEN
* ON WHICH THE ALV GRID IS DISPLAYED
* -->RT_EXTAB
FORM pf USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZTG_STAT'. "<--pass pf-status name here
ENDFORM. "pf
*& Form USER_COMMAND
* SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
* AND EXECUTE THE APPROPIATE CODE
* -->LV_OKCODE used to capture the function code
* of the user-defined push-buttons
* -->L_SELFIELD text
FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
* assign the function code to variable v_okcode
lv_okcode = sy-ucomm.
* handle the code execution based on the function code encountered
CASE lv_okcode.
WHEN '<function_code>'. "<--to handle user actions
ENDCASE.
ENDFORM. "USER_COMMAND
Hope this helps you.
Regards,
Tarun -
How can I remove u0091*u0092 s and display the amount
My coding
T1 TOTAL,,,,,,®UD-SWABZ& ®UD-SWNES&
Doubt :
REGUD-SWNES is the value coming from structure REGUD,
But the value is coming as **********70.250,92
But I need to display as 70.250,92
How can I remove * s and display the amount ?Not sure why it is coming like that. Is the field length big enough?
I guess, you could try....
translate REGUD-SWNES using '* '.
condense REGUD-SWNES no-gaps.
But again, I have no clue as to why you are seeing this.
Regards,
Rich Heilman -
I am trying to build a basic TCL skeleton script that reads a remote SNMP OID and displays the value on the screen.
I don't want it to be an EEM Event, I just want to run it from the (tcl)# prompt.
So I guess I'm asking if you can use cli_exec and other commands in the "namespace import ::cisco::eem::*" in a normal non-EEM script - can I do that?
This is the error I get:
OTN.159(tcl)#source flash:TCL_SNMP_Remote_Read.tcl
invalid command name "::cisco::eem::event_register_none" ^
% Invalid input detected at '^' marker.
What am I missing?
================= TCL_SNMP_Remote_Read.tcl ==============================
::cisco::eem::event_register_none
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
if [catch {cli_open} RESULT]
{ error $RESULT $errorInfo }
else { array set cli1 $RESULT }
if [catch {cli_exec $cli1(fd) "snmp get v2c 192.168.1.100 public timeout 1 oid 1.3.6.1.2.1.1.1.0" } RESULT]
{ error $RESULT $errorInfo }
else { set SnmpSysDesc $RESULT }
if [catch {cli_close $cli1(fd) $cli1(tty_id)} RESULT] {
error $RESULT $errorInfo
puts $SnmpSysDesc
=========================================================================
In the sho-run config I have:
event manager directory user policy "flash:/"
event manager session cli username "cisco"
Any help to get me started would be greatly appreciated!
TimIf you don't want an EEM policy, then don't use any of the EEM constructs. Instead, all you need is this:
set output [exec "snmp get v2c 192.168.1.100 public timeout 1 oid 1.3.6.1.2.1.1.1.0"]puts $output -
Want to open a new browser window and display the html file in locale disk.
Hi,
I want to open a new browser window and display the html file in local drive. The below html applet work in local system successfully. But i deploy the same in web server (Tomcat) and try the same in client machine it does not work. Please help.
Note:
The class below fileopen.FileOpen.class i make it as a jar and put it in jre\ext folder at the client machine.
------------------------------------FileOpen.html(Tomcat)-----------------------------------------------------
<html>
<body >
<applet code="OpenFile.class" archive="loadfile.jar" width="100" height="100">
<param name="path" value="file://c:/open.html" />
</applet>
</body>
</html>
-------------OpenFile.java in server(Tomcat)--------------------------------------------
public class OpenFile extends Applet implements ActionListener{
String path = "";
fileopen.FileOpen open = null;
Button b = null;
public void init(){
path = getParameter("path");
b = new Button("Open");
b.addActionListener(this);
add(b);
public void actionPerformed(ActionEvent ae){
try
open = new fileopen.FileOpen(this,path);
catch (Exception e){
e.printStackTrace();
-------------------------------------------FileOpen.java /Client JRE/ext----------------------------------------------------
package fileopen;
public class FileOpen
AppletContext context = null;
URL url = null;
public FileOpen(Applet applet,String path)
try
if(null != applet){
context = applet.getAppletContext();
if (null != path)
url = new URL(path);
context.showDocument(url, "_blank");
}catch(Exception ex)
ex.printStackTrace();
Please help to solve this issue very urgent.
Thanks in advance.
By,
Saravanan.K.zzsara wrote:
I want to open a new browser window and display the html file in local drive. ...Did you ever pause to consider how ridiculous that is?
The best audience for applets is people off the internet. 'People off the internet' might be using a computer that has no (what was it?) 'open.html' in the root of the C: drive. In fact (shock horror) they may not even be running Windows, and would therefore probably have no 'C:' drive at all.
If you do not intend to distribute this to people off the web, an application makes a lot more sense, but even then, you cannot rely on the document being there unless you 'put it there' (during installation, for instance).
As the other poster intimated, applets can load documents off the local disk as long as they are trusted. Here is an example*, but note that it is not so rash as to presume any particular path or file, and instead leaves it to the user to choose the document to display.
* The short code can be seen at SDNShare on the [Defensive Loading of Trusted Applets|http://sdnshare.sun.com/view.jsp?id=2315] post.
On the other hand, a sandboxed applet can load any document coming from its own server via URL, or get showDocument(URL) to work. In that case, the JRE must recognize that the URL is from its own server, so the best way to form URLs for applet use is via the URL constructor
new URL(getDocumentBase(), "path/to/open.html");That is how I form the URL in this [ sandboxed example of formatting source|http://pscode.org/fmt/sbx.html?url=/jh%2FHelpSetter.java&col=2&fnt=2&tab=2&ln=0]. Of course, in this case the applet loads the document, then parses the text to draw the formatted version, but the point is that an URL produced this way will work with showDocument(URL).
I am pretty sure showDocument() in an applet off the internet will work with an URL pointing to a foreign (not its own) server, but it will not be able to load documents off the end user's local disks.
I suggest a couple of things.
- Try to express this problem in terms of what feature it is that you want to offer the end user. Your question jumps directly to a bad strategy for achieving ..who knows what? An example of a feature is "Shows the applet 'help' files on pressing F1".
- A good way to indicate interest in a solution is to offer [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] to match that interest.
Edit 1:
..and please figure out how to use the CODE tags.
Edited by: AndrewThompson64 on Sep 12, 2008 11:14 PM -
We are developing a Plugin with the specific purpose to display the URL to which any link redirect to on any website.
This URL should appear in the pop up when the user right clicks and selects the "show URL" option in the context menu.
Can some one please help us either to find such plugin (except firebug) or guide us how to develop such a plugin.Look for related articles here: <br />
http://developer.mozilla.org/en/
Maybe you are looking for
-
This problem has been occuring intermittently over the last few months and I thought it was resolved with an iTunes update. It later reappeared so I updated to the latest software and still no go. Itunes will also freeze if I pull up the "de-author
-
Flash Player isn't visible on web page
After recently updating the Flash Player on my computer with the latest version, the player is no longer visible on many web pages; all that is visible is a blank white box. I've never had trouble with the player in the past. This problem seems restr
-
I have an old QuickSilver G4 Power Mac which is mostly a music player now, but it randomly restarts for no apparent reason. The weirdest thing is I've unplugged everything to see if there's a conflict with a device, and it won't even reboot unless th
-
I posted a similar topic a few weeks ago and I had marked it as solved because I had an individual VI running this block of code that worked. However, once I implemented it into my VI, it stopped working and I have no idea why. What it's supposed to
-
Hi, 1. Can a SAP script form be renamed? 2. How to change the Development class attached to a form? Thanks. Pankaj