Problem with an ALV of an standar query
Hi:
I made a copy of an standar Query. The asked me to add a column the user can modify. I see that it uses the function REUSE_ALV_GRID_DISPLAY. I modify the attribute
it_fieldcat-INPUT = 'x' but when i continue executing the function it continue like output. I send an example of my registrer of it_fieldcat. If somebody can help me if i have to put another parameter would be great. Thanks.
row_pos= 0
col_pos= 0
fieldname= MARAV-MATNR
tabname=
ref_fieldname= MATNR
ref_tabname= MARAV
currency=
cfieldname=
ctabname =
quantity =
qfieldname=
quantity unit=
qtabname =
roundfieldname =
roundtabname =
round = 0
decimals =
decimalstabname =
decimals_out=
text_fieldname =
exponent =
key =
icon=
symbol=
checkbox=
just=
lzero= X
no_zero=
edit_mask=
emphasize =
fix_column =
do_sum =
no_out =
tech =
outputlen = 000018
offset = 000000
seltext_l =
seltext_m =
seltext_s =
reptext_ddic =
ddictxt= L
rollname= MATNR
datatype = CHAR
inttype =
ddic_outputlen = 000000
intlen = 000018
lowercase =
key_sel = X
no_sum =
sp_group =
reprep = X
input = X
hotspot =
Hello,
Try this example.. BCALV_TEST_GRID_EDIT_02
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'ALV_T_T2'
changing
ct_fieldcat = gt_fieldcat.
loop at gt_fieldcat into gs_fieldcat.
<b>if gs_fieldcat-fieldname = 'CARRID'.</b>
<b> gs_fieldcat-edit = 'X'.</b>
modify gt_fieldcat from gs_fieldcat index sy-tabix.
endif.
if gs_fieldcat-fieldname = 'CONNID'.
gs_fieldcat-edit = 'X'.
modify gt_fieldcat from gs_fieldcat index sy-tabix.
endif.
call method my_grid->set_ready_for_input
exporting
i_ready_for_input = 1.
Hope it helps
Madhavi.
Similar Messages
-
Problem with printing ALV lists
Hey Guys,
I have a problem with printing ALV lists ,
I created a report with several ALV lists (not grids) on the same screen but when i attempt to print the report
it prints each alv list on a different page..so if i have 3 alv lists in the same report it will print the report on 3 pages
How can i print them all in one page?
Thanks in advance
Noha Salah.Hey Max,
I tried setting the Layout-list_append before my block_list_append function call
And setting the is_print-NO_NEW_PAGE , it printed the 3 lists on one page the only problem i have
is that the lists are truncated and the list formats has totally been messed up..how can i restore them back
to their original format? -
Facing problem with a date column in select query
Hi,
I am facing problem with a date column. Below is my query and its fainling with " invalid number format model" .
Query: SELECT *
FROM EMP
WHERE trunc(LAST_UPDATED) >= to_date(to_char(22-05-2009,'dd-mm-yyyy'),'dd-mm-yyyy')
LAST_UPDATED column is "DATE" data type.
Please help me ThanksRadhakrishna Sarma wrote:
SeánMacGC wrote:
WHERE LAST_UPDATED >= to_date('22-05-2009','dd-mm-yyyy');
You do not need the TRUNC here in any case.
I don't think so. What if the user wants only data for 22nd May and the table has records with date later than 22nd also? In that case your query willl not work. In order for the Index to work, I think the query can be written like this I think Sean is right though. Use of TRUNC Function is quiet useless based on the condition given here, since the to_date Function used by OP will always point to midnight of the specified date, in this case 22-05-2009 00:00:00.
Regards,
Jo
Edit: I think Sean proved his point... ;) -
Problem with logical database DDF in ABAP query
Hi All,
I have created an ABAP query via the transaction SQ01 using the logical database DDF to retrieve customer master data from tables KNA1 & KNB1. The selection screen used is the screen 903 of the logical database DDF. But now the problem is that when I execute the query, I am getting a blank value in the tax code4(KNA1-STCD4) field though there is value in the KNA1 table for this particular field. This field was added to the table by means of a customizing include. Can anyone suggest a way to get around this problem so that I can view the content of the field STCD4 in the query.
Thanks and regards,
Sarath.I think it's not used by DDF.
so you must check it with:
check kna1-bran1 in s_bran1.
A. -
Problem with virtual Key Figure in a query
Hi Experts,
I would like to share my problem with the virtual key figure in a query:
I have a query with a virtual key figure and when I eject the query by analyzer, the result sometimes is displayed and sometimes is not displayed (is equal to 0), with the same initials values. And when I eject the query by RSRT always display the result for the virtual key figure.
Why don't always display the result?
Thanks a lotHi,
I think that the problem is the level of support package. We have BI AddOn 7.X (based on 7.20) support package 0.
What do you think?
Regards -
Mapping Problem with 2 ALV Tables after sorting
Hi,
I have a context node INCIDENTS with a sub-node SUB_INCIDENTS.
The sub-node is filled via a Supply Function.
Both nodes are displayed in separate ALV Grids on the same view, which works pretty well.
The only problem I face is when I try to sort one of the ALVs, then I get an error "The node specified in mapping ( SUB_INCIDENTS) could not be found ".
I have no clue how to solve that, already tried to fill the sub-node with the ALV standard function "ON_STD_FUNCTION_AFTE", no effect.
Does anybody can imagine what might be the reason?
Best regards, Steffen
Edited by: Steffen Weber on Aug 27, 2008 2:55 PMIn general, having two ALVs for parent and then a sub node is not supported. Here is a section from the online help that describes what happens when a sort occurs on the parent node in ALV:
Important Exception: Sorting
Here ALV has to use the entire dataset so that the data records can be arranged in the new order. For this purpose, the ALV component temporarily takes control of the internal data table and invalidates the corresponding context node of your application during this time. This ensures that the application cannot access the context node while the ALV component is editing the internal data table.
Once the internal data table has been resorted, ALV rebuilds the context node, releases it again for the application, and displays the data accordingly.
This ensures that the internal data table is never copied. This is important because large volumes of data would considerably impact performance and memory space.
When you are planning your application, note the following side-effects of this mechanism:
● When the context node is invalidated, information about current selections, and in particular the lead selection, is lost.
● If your application has created subnodes for the context node, (master-detail scenario), these subnodes are lost as soon as the ALV component invalidates the context node. If the application then tries to access the subnodes, a runtime error occurs.
Because of the invalidation that is described here, the subnode leadselection is lost and is invalidated as well. This leads to the error you are encountering. -
Problem with printing ALV - repetitive page breaks
Hi,
I have a problem with ALV during printing or print preview. First, let me describe the situation. My requirement was to have a page break for every Material Number. This was working fine already. However, the user had a change of heart and decided he didn't want to have a page break for every material. Now, they wanted only one page for all materials.
I thought this was easy to do since I only needed to comment out the SORT (and all codes related to SORT) table that was used to create the page-break. Thing is, it's not working anymore. Although I was able to display one table only, the old page breaks still appear! For example, if there were 7 materials before, therefore, 7 page breaks with 7 blocks of internal tables. Now, only 1 full internal table is displayed while the other 6 are empty! Please help me how to get rid of the other tables or page breaks.
I hope this is clear. Thanks. I appreciate all the help I can get.Amit,
Using sort option.
Do one thing. Just create one ALV program with SORT options anf GROUP = '*'.
Now go to output and save the Variant. Print the report.
with out sort option and variant.
Now come back and Delete the sort options , activate the code.
And see the output. Choose the variant which you created beofre. and print the report.
See both the case. it triggeres the same output. you just copy paste it and un comment the commented sort code
Just test with this code,
REPORT zalv_total_sub.
TYPE-POOLS: slis.
INCLUDE <icon>.
DATA: layout TYPE slis_layout_alv .
DATA: BEGIN OF it_flight OCCURS 0,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
seatsmax LIKE sflight-seatsmax,
seatsocc LIKE sflight-seatsocc,
END OF it_flight.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fieldcat.
DATA: it_sort TYPE slis_t_sortinfo_alv,
wa_sort LIKE LINE OF it_sort.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'IT_FLIGHT'
i_inclname = sy-repid
CHANGING
ct_fieldcat = it_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.
SELECT carrid
connid
fldate
seatsmax
seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_flight
wa_fcat-do_sum = 'X'.
MODIFY it_fieldcat FROM wa_fcat TRANSPORTING do_sum
WHERE fieldname = 'SEATSOCC' .
CLEAR wa_fcat.
*wa_sort-fieldname = 'CONNID'.
*wa_sort-up = 'X'.
*wa_sort-group = '*'.
*wa_sort-subtot = 'X'.
*APPEND wa_sort TO it_sort.
*CLEAR wa_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_save = 'X'
i_callback_user_command = 'USER_COMMAND'
is_layout = layout
it_fieldcat = it_fieldcat
it_sort = it_sort
TABLES
t_outtab = it_flight
EXCEPTIONS
program_error = 1. -
hai ,
I have problem with my interactive alv ,
when i double click the line item the same line item is displaying for all the selections ..
LASS lcl_event_handler IMPLEMENTATION.
METHOD on_double_click.
find out selected line (double click)
READ TABLE i_fd INTO w_fd INDEX e_row-index.
IF sy-subrc NE 0.
MESSAGE i075(bc412). " <-- internal error
EXIT.
ENDIF.
"CLEAR i_popup.
LOOP AT i_trdt INTO w_trdt WHERE deal_number = w_fd-rfha .
IF sy-tabix GT 1.
CLEAR w_trdt-deal_number.
ENDIF.
APPEND w_trdt TO i_popup.
ENDLOOP.
CLEAR : w_fd , w_trdt .
IF i_popup IS NOT INITIAL .
CREATE OBJECT ref_container
EXPORTING
parent =
container_name = 'CONTAINER1'
style =
lifetime = lifetime_default
repid =
dynnr =
no_autodef_progid_dynnr =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CREATE OBJECT ref_alv
EXPORTING
i_shellstyle = 0
i_lifetime =
i_parent = ref_container
i_appl_events = space
i_parentdbg =
i_applogparent =
i_graphicsparent =
i_name =
i_fcat_complete = space
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
PERFORM form_layout.
PERFORM f_cat.
CALL METHOD ref_alv->refresh_table_display.
CALL METHOD g_alv->refresh_table_display.
ENDIF.
CALL METHOD g_alv->refresh_table_display.
CLEAR i_popup.
ENDMETHOD. "on_double_click
ENDCLASS. "lcl_event_handler IMPLE
Regards,
K,Vinay KumarHi,
Try..
READ TABLE i_fd INTO w_fd INDEX es_row_no-index.
Hope it helps you.
Murthy -
Problem with different execution paths in hierarchical query
Hello,
I have problems with the following query:
SELECT DISTINCT P.ID FROM PRODUCTELEMENTIMPL P WHERE ( ( LABEL = 'SomeLabel' AND PRODUCTELEMENTTYPE = 'SomeText' AND ( STATE = 'created' OR STATE = 'stored' OR STATE = 'archived' OR STATE = 'archivedRestored' ) ) ) START WITH P.ID = 42 CONNECT BY PRIOR P.ID = P.PARENT
We have two databases (an Oracle 10g XE and Oracle10g Enterprise). In the XE Database the query is executed very fast, but in the main installation it takes minutes. If I "explain" the query I get two different execution paths:
The fast:
ID PARENT_ID LEVEL SQL Kosten Anzahl Zeilen
0 - 1 SELECT STATEMENT 20 49
1 0 2 HASH UNIQUE 20 49
2 1 3 FILTER - -
3 2 4 CONNECT BY WITH FILTERING - -
4 3 5 TABLE ACCESS BY INDEX ROWID PRODUCTELEMENTIMPL (TABLE) - -
5 4 6 INDEX UNIQUE SCAN SYS_C0072201 (INDEX (UNIQUE)) 2 1
6 3 5 NESTED LOOPS - -
7 6 6 BUFFER SORT - -
8 7 7 CONNECT BY PUMP - -
9 6 6 TABLE ACCESS BY INDEX ROWID PRODUCTELEMENTIMPL (TABLE) 19 49
10 9 7 INDEX RANGE SCAN PRODUCTELEMENTIMPL_IDX1 (INDEX) 3 49
11 3 5 TABLE ACCESS FULL PRODUCTELEMENTIMPL (TABLE) 19 49
Slow:
ID PARENT_ID LEVEL SQL Kosten Anzahl Zeilen
0 1 SELECT STATEMENT 1 1
1 0 2 HASH UNIQUE 1 1
2 1 3 FILTER
3 2 4 CONNECT BY WITHOUT FILTERING
4 3 5 TABLE ACCESS BY INDEX ROW 3 1
ID PRODUCTELEMENTIMPL (TABLE)
5 4 6 INDEX UNIQUE SCAN SYS_C0 2 1
020528 (INDEX (UNIQUE))
6 3 5 TABLE ACCESS FULL PRODUCT 6628 1100613
ELEMENTIMPL (TABLE)
Any ideas how to avoid this full table scan?
bye
Roland SpatzeneggerHello,
thank you for your replies. The indices and table schemas are the "same", but only the content for the tables was mirrored.
We made some tests with dropping and/or analyzing the tables, but it didn't change anything.
The main problem is that the query takes 33s in the productive environment for searching in a couple of rows. At the moment it's faster to make
SELECT DISTINCT P.ID, P.STATE FROM PRODUCTELEMENTIMPL P WHERE ( ( LABEL = 'SomeLabel' AND PRODUCTELEMENTTYPE = 'SomeText' ) ) START WITH P.ID = 42 CONNECT BY PRIOR P.ID = P.PARENT
and to test in the application if the state-values match ;-)
If I add the hint /*+ no_filtering */ in the test environment, I get the same "slow" execution path as in the production environment. So the question is, what prevents the filtering in "connect by"?
(I think in the fast version it filters only the results of the hierarchical query, in the slow version it first filters the whole table and joins/merge it with the hierachical result).
bye
Roland Spatzenegger -
Problem with the ALV after sending the mail
Good Morning Experts
I have a small issue with the ALV. I have a program, which has to sent email. In My program initially I am displaying basic list in the alv and user can navigate to secondary list also, by clicking on a contract number in the basic list.
I gave a tool button in the tool bar to the user in the basic list, to send the mail. When the user clicks on the I have to send the mail both the lists, basic list and seconday list in the mail as separate attachments.
Mail is going fine and later if the user chooses to see any contract in detail(Secondary List), that time ALV giving dump with message type X. And it is stopping some where in the ALV code
call method cl_gui_cfw=>get_subscriber_by_id
exporting shellid = p_handle-shellid
exceptions others = 1.
if sy-subrc = 0.
</B>message X007 with p_handle-clsid.<B>
endif.
If anybody having an Idea, how to resolve it, please tell me.
Thanks in Advance
PraveenPlease find the code for user_command form and sending the mail. Please look into this advice me if anything wrongly I coded.
*& Form user_command
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
IF r_ucomm EQ '&IC1' OR r_ucomm EQ 'SHOW'.
REFRESH: it_all[],
it_fcat1[],
it_sort[].
LOOP AT it_final INTO wa_final WHERE select EQ 'X' OR xblnr EQ rs_selfield-value.
LOOP AT it_bsid INTO wa_bsid WHERE xblnr EQ wa_final-xblnr AND zuonr IS INITIAL.
wa_all = wa_bsid.
wa_all = wa_bsid.
wa_all-booked = wa_bsid-dmbtr.
IF wa_bsid-augdt IS NOT INITIAL AND wa_bsid-augbl IS NOT INITIAL.
wa_all-paid = wa_bsid-dmbtr.
ENDIF.
wa_all-amtr = wa_all-booked - wa_all-paid.
APPEND wa_all TO it_all.
CLEAR: wa_all,
wa_bsid.
ENDLOOP.
LOOP AT it_bsad INTO wa_bsad WHERE xblnr EQ wa_final-xblnr AND zuonr IS INITIAL.
wa_all = wa_bsad.
wa_all-booked = wa_bsad-dmbtr.
IF wa_bsad-augdt IS NOT INITIAL AND wa_bsad-augbl IS NOT INITIAL.
wa_all-paid = wa_bsad-dmbtr.
ENDIF.
wa_all-amtr = wa_all-booked - wa_all-paid.
APPEND wa_all TO it_all.
CLEAR: wa_all,
wa_bsad.
ENDLOOP.
ENDLOOP.
SORT it_all BY xblnr.
PERFORM fill_fcat2.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = 'Report to display selected contracts'
is_layout = wa_layout1
it_fieldcat = it_fcat1[]
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_SORT = it_sort[]
i_default = 'X'
i_save = 'A'
is_variant = wa_variant
TABLES
t_outtab = it_all[]
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.
ENDIF.
CASE r_ucomm.
WHEN 'BACK1' OR 'EXT1'.
PERFORM exit IN PROGRAM saplslvc_fullscreen.
WHEN '&F12' or 'CANCEL'.
PERFORM exit IN PROGRAM saplslvc_fullscreen.
WHEN 'MAIL'.
PERFORM prepare_mail.
ENDCASE.
ENDFORM. "user_command
*& Form prepare_mail
text
--> p1 text
<-- p2 text
FORM prepare_mail .
DATA:
l_lay TYPE pri_params-paart,
l_line TYPE pri_params-linct,
l_cols TYPE pri_params-linsz,
l_val TYPE c,
i_spno TYPE tsp01-rqident,
i_lines TYPE i,
i_bin TYPE i,
i_pack_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_recivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
i_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_docdata LIKE sodocchgi1,
i_excel LIKE solisti1 OCCURS 0 WITH HEADER LINE.
i_pos type i.
TYPES:
t_pripar TYPE pri_params,
t_arcpar TYPE arc_params.
"Work areas
DATA:
lw_pripar TYPE t_pripar,
lw_arcpar TYPE t_arcpar,
w_no_of_bytes TYPE i.
l_lay = 'X_65_255'.
l_line = 65.
l_cols = 255.
"Read, determine, change spool print parameters and archive parameters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_archive_parameters = lw_arcpar
in_parameters = lw_pripar
layout = l_lay
line_count = l_line
line_size = l_cols
no_dialog = 'X'
IMPORTING
out_archive_parameters = lw_arcpar
out_parameters = lw_pripar
valid = l_val
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
*l_val eq space
IF sy-subrc = 0.
lw_pripar-prrel = space.
lw_pripar-primm = space.
NEW-PAGE PRINT ON
NEW-SECTION
PARAMETERS lw_pripar
ARCHIVE PARAMETERS lw_arcpar
NO DIALOG.
ENDIF.
DATA: ls_prnt TYPE slis_print_alv.
ls_prnt-print = ''.
ls_prnt-prnt_title = 'X'.
ls_prnt-no_coverpage = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = 'Report to display collection pattern on Clearing Date'
is_layout = wa_layout
it_fieldcat = it_fcat[]
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'PF_STATUS_SET'
IT_SORT = it_sort[]
i_default = 'X'
i_save = 'A'
is_variant = wa_variant
TABLES
t_outtab = it_final[]
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.
WRITE 'Test program to generate and download as PDF'.
NEW-PAGE PRINT OFF.
CALL FUNCTION 'ABAP4_COMMIT_WORK'.
i_spno = sy-spono.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = i_spno
no_dialog = 'X'
IMPORTING
pdf_bytecount = w_no_of_bytes
pdf_spoolid = w_pdf_spoolid
btc_jobname = w_jobname
btc_jobcount = w_jobcount
TABLES
pdf = it_pdf.
LOOP AT it_pdf INTO wa_pdf.
IF w_pos = 34170.
PERFORM attach.
ENDIF.
w_stuff+w_pos(134) = wa_pdf.
ADD 134 TO w_pos.
ENDLOOP.
IF NOT ( w_stuff IS INITIAL ).
PERFORM attach.
ENDIF.
CLEAR wa_pdf.
PERFORM fill_receivers TABLES i_recivers.
PERFORM fill_contents TABLES i_contents.
DESCRIBE TABLE i_contents LINES i_lines.
READ TABLE i_contents INDEX i_lines.
CLEAR i_pack_list-transf_bin.
i_pack_list-head_start = 1.
i_pack_list-head_num = 1.
i_pack_list-body_start = 2.
i_pack_list-body_num = i_lines.
i_pack_list-doc_type = 'RAW'.
APPEND i_pack_list.
CLEAR i_pack_list.
*u2022 Attachment (pdf-Attachment)
CONCATENATE p_date6(2) p_date4(2) p_date+0(4) INTO w_date1 SEPARATED BY '.'.
DESCRIBE TABLE it_att LINES i_lines.
READ TABLE it_att INTO wa_att INDEX i_lines.
i_pack_list-transf_bin = 'X'.
i_pack_list-head_start = '1'.
i_pack_list-head_num = '0'.
i_pack_list-body_start = '1'.
i_pack_list-body_num = i_lines.
i_pack_list-doc_type = 'PDF'.
i_pack_list-obj_name = 'Renewal List'.
CONCATENATE 'Report to display outstanding premium' 'Executed on' w_date1 INTO i_pack_list-obj_descr SEPARATED BY space.
i_pack_list-obj_descr = 'Exchange Rates uploaded to the database'.
i_pack_list-obj_langu = 'E'.
i_pack_list-doc_size = i_lines * 255.
APPEND i_pack_list.
CLEAR i_pack_list.
REFRESH: it_pdf[].
CLEAR wa_pdf.
REFRESH: it_all[],
it_fcat1[],
it_sort[].
LOOP AT it_final INTO wa_final.
LOOP AT it_bsid INTO wa_bsid WHERE xblnr EQ wa_final-xblnr AND zuonr IS INITIAL.
wa_all = wa_bsid.
wa_all-booked = wa_bsid-dmbtr.
IF wa_bsid-augdt IS NOT INITIAL AND wa_bsid-augbl IS NOT INITIAL.
wa_all-paid = wa_bsid-dmbtr.
ENDIF.
wa_all-amtr = wa_all-booked - wa_all-paid.
APPEND wa_all TO it_all.
CLEAR: wa_all,
wa_bsid.
ENDLOOP.
LOOP AT it_bsad INTO wa_bsad WHERE xblnr EQ wa_final-xblnr AND zuonr IS INITIAL.
wa_all = wa_bsad.
wa_all-booked = wa_bsad-dmbtr.
IF wa_bsad-augdt IS NOT INITIAL AND wa_bsad-augbl IS NOT INITIAL.
wa_all-paid = wa_bsad-dmbtr.
ENDIF.
wa_all-amtr = wa_all-booked - wa_all-paid.
APPEND wa_all TO it_all.
CLEAR: wa_all,
wa_bsad.
ENDLOOP.
ENDLOOP.
NEW-PAGE PRINT ON
NEW-SECTION
PARAMETERS lw_pripar
ARCHIVE PARAMETERS lw_arcpar
NO DIALOG.
ENDIF.
SORT it_all BY xblnr.
PERFORM fill_fcat2.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = 'Report to display selected contracts'
is_layout = wa_layout1
it_fieldcat = it_fcat1[]
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
it_sort = it_sort[]
i_default = 'X'
i_save = 'A'
is_variant = wa_variant
TABLES
t_outtab = it_all[]
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.
NEW-PAGE PRINT OFF.
CALL FUNCTION 'ABAP4_COMMIT_WORK'.
i_spno = sy-spono.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = i_spno
no_dialog = 'X'
IMPORTING
pdf_bytecount = w_no_of_bytes
pdf_spoolid = w_pdf_spoolid
btc_jobname = w_jobname
btc_jobcount = w_jobcount
TABLES
pdf = it_pdf.
LOOP AT it_pdf INTO wa_pdf.
IF w_pos = 34170.
PERFORM attach1.
ENDIF.
w_stuff+w_pos(134) = wa_pdf.
ADD 134 TO w_pos.
ENDLOOP.
IF NOT ( w_stuff IS INITIAL ).
PERFORM attach1.
ENDIF.
CLEAR wa_pdf.
DESCRIBE TABLE it_att LINES i_lines.
ADD 1 TO i_lines.
DESCRIBE TABLE it_att1 LINES i_bin.
READ TABLE it_att1 INTO wa_att INDEX i_bin.
DESCRIBE TABLE it_att LINES i_lines.
READ TABLE it_att INTO wa_att INDEX i_lines.
i_pack_list-transf_bin = 'X'.
i_pack_list-head_start = '1'.
i_pack_list-head_num = '0'.
i_pack_list-body_start = i_lines.
i_pack_list-body_num = i_bin.
i_pack_list-doc_type = 'PDF'.
i_pack_list-obj_name = 'Renewal List-Details'.
CONCATENATE 'Outstanding Premium-Details' w_date1 INTO i_pack_list-obj_descr SEPARATED BY space.
i_pack_list-obj_descr = 'Exchange Rates uploaded to the database'.
i_pack_list-obj_langu = 'E'.
i_pack_list-doc_size = i_bin * 255.
APPEND i_pack_list.
CLEAR i_pack_list.
APPEND LINES OF it_att1 to it_att.
i_docdata-obj_name = 'Renewal List'.
CONCATENATE 'Oustanding Premium' 'as on' w_date1 INTO i_docdata-obj_descr SEPARATED BY space.
CONDENSE i_docdata-obj_descr.
i_docdata-obj_langu = 'E'.
i_docdata-obj_prio = '1'.
i_docdata-no_change = 'X'.
i_docdata-sensitivty = 'F'.
i_docdata-doc_size = ( i_lines - 1 ) * 255 + STRLEN( wa_att ).
***Data for Header
i_header-line = 'Header'. APPEND i_header.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = i_docdata
commit_work = 'X'
TABLES
packing_list = i_pack_list[]
object_header = i_header
contents_bin = it_att[]
contents_txt = i_contents[]
receivers = i_recivers[]
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ELSE.
MESSAGE 'Document Sent' TYPE 'S'.
ENDIF.
ENDFORM. " prepare_mail
Thanks
Praveen -
Problem with a Currency field in Adhoc Query - HR
Hi,
I have an Adhoc query that uses Custom infotype fields (Z infotype and z fields).
The currncy field also has a reference field in the infotype (of type waers).
Wehen we try to get the ouput of the Adhoc Query it gives following error:
The report cannot be generated because the internal description is invalid or incomplete, or because the selection screen is too large.
Regenerate the assigned InfoSet, and read the log. If the InfoSet is OK, make sure that at least one field is given as output.
If you used the 'Refresh' icon to start the query, use the 'Output' menu option to execute the query. This gives you a full screen display of the data.
If an output was generated, the query cannot work with actual data in the construction view. In this case, always use the 'Output' function to execute the query.
I have already tried a number of solutions:
1> Regenerate the infoset...
2> make the field as an additional field and write my own code for it (the error comes before the code as i kept a breakpoint but it stopped before that)
if i add other fields of this infoset instead of this field, then those appear in the output.
Any solutions ??
thanks in advance,
AnujHi,
Is the problem not clear or no one has an answer?
Please reply with some suggestions..
Regards,
Anuj. -
Urgent : Problem with Editable ALV Grid for Quantity and Currency Fields
Hi All,
I am using Editable ALV Grid display and have quantity and value as editable fields in the display.
When user changes these values these values are not changing properly .
For the quantity field the domain is MENG13 with 3 deciamal places and here if we enter 500 it takes it as 0.500 .
The same problem is for the currency field. Here the Domain is WERT7 with 3 decimal places.
Here also it takes last 2 digits after decimal places by default.
Please advice how to get proper values in this case from ALV editable fields.
Thanks and Regards
Harshad
Edited by: Harshad Rahirkar on Dec 25, 2007 7:39 AMfor all the currency field , it will display like that only.
u have to manipulate uin program before displaying.
if they are giving 500, in program multiply with 100 and move it to table.
when u are getting from table, divinde and display.
this is what I am doing.
Reward if helpfull. -
Hi All,
I am using the method set_table_for_first_display for ALV Editable. After entering the values on the alv screen the values are not getting reflected unless press enter or should come out of my last cell to reflect the changes.
I have used the mc_evt_enter and mc_evt_modified.
I need to trigger the change data event with out coming out of my last cell and pressing the enter bubtton.
This should happen atleast while pressing the save button or as soon as we modify the value in the cell.
Please suggest me the code to trigger this.
Thanks & Regards,
Raghuveer Kumar K.Hi,
i HAVE ENCOUNTERED THE SAME PROBLEM BUT I DID WITH THE FOLLOWING SOLUTION.
Add a Save button on the container and add the save functionality.
Just add the following class methods
CLASS-METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object ,
handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
then in implementation of the above methods declared class.
METHOD handle_toolbar.
DATA:
lw_toolbar TYPE stb_button.
CLEAR lw_toolbar.
lw_toolbar-function = 'SAVE'.
lw_toolbar-icon = 'ICON_DETAIL'.
lw_toolbar-butn_type = '0'.
lw_toolbar-text = 'SAVE'.
APPEND lw_toolbar TO e_object->mt_toolbar.
when user clicks save modify the internal table that contians the data.
Regards and Best wishes. -
Problem with Time-dep hierarchy in BEx Query
Hi,
I have a workbook that consists of 3 queries. All the 3 queries uses heriarchy and hierarchy node variables on 0CUST_SALES. The hierarchy is time-dep. 2 of the queries returns the output and 1 of them just displays "No applicable data found" for some of the nodes. I checked the hierarchy table and the date range for the nodes are in the range (01/01/2010 - 12/31/9999), the leafs have the range as 01/01/2010 - 06/30/2010. The 3rd query is the actually the summary of the other 2 queries. I checked the queries and found that the field 0CUST_SALES is on the characteristic restriction pane of the filter tab in the incorrect query and in the remainiing 2 its on the default values pane.
Will this be causing the problem in the incorrect query?
There is also a key date derivation type defined in all the queries. Its defined as Basic Time Char with the derivation type as "First day of Period". We are not using any infosets. The quries are on a multiprovider which has only basic infocubes.
Can someone please explain how this works?
Thanks and Regards,
SujaiHi Diogo,
Below is the code I am using in the customer exit.
SELECT * FROM zae_tt_pbuild INTO TABLE gt_pbuild.
IF sy-subrc = 0.
LOOP AT gt_pbuild INTO gs_pbuild.
CONCATENATE '*' gs_pbuild-pbuild '*' into lv_pattern.
ls_range-low = lv_pattern.
ls_range-sign = lc_sign_i.
ls_range-opt = 'CP'.
APPEND ls_range TO e_t_range.
CLEAR: ls_range,
lv_pattern.
ENDLOOP.
ENDIF.
ENDIF.
I have tried using '%' instead of '*' aswell but the result is same.
Thanks,
Rakesh -
Problem with temp space allocation in parallel query
Hello
I've got a query which matches two large result sets (25m+ rows) against each other and does some basic filtering and aggregation. When I run this query in serial it takes about 30 mins and completes successfully. When I specify a parallel degree of 4 for each result set, it also completes successfully in about 20 minutes. However, when I specify that it should be run in parallel but don't specify a degree for each result set, it spawns 10 parallel servers and after a couple of minutes, bombs out from one of the parallel servers with:
ORA-12801: error signaled in parallel query server P000
ORA-01652: unable to extend temp segment by 64 in tablespace TEMPThis appears to be when it is about to perform a large hash join. The execution plan does not change whether the parallel degree is specified or not, and there is several GB of temp space available.
I'm at a bit of a loss as to how to track down specifically what is causing this problem. I've looked at v$sesstat for all of the sessions involved and it hasn't really turned anything up. I've tried tracing the main session and that hasn't really turned up much either. From what I can tell, one of the sessions seems to try to allocate massive amounts of temp space that it just does not need, but I can figure out why.
Any ideas of how to approach finding the cause of the problem?
DavidHello
I've finally resolved this and the resolution was relatively simple - and was also the main thing that Mark Rittman said he did in his article: reduce the size of the hash join.
After querying v$sql_workarea_active I could see what was happening which was that the sum of the temp space for all of the parallel slaves was exceeding the total amount of temp space available on the system. When run in serial, it was virtually at the limit. I guess the extra was just the overhead for each slave maintaining it's own hash table.
I also made the mistake of misreading the exectuion plan - assuming that the data being pushed to the hash join was filtered to eliminate the data that was not of interest. Upon reflection, this was a rather stupid assumption on my part. Anyway, I used sub query factoring with the materialize hint to ensure that the hash join was only working on the data it should have been. This significantly reduced the size of the hash table and therefore the amount of temp space required.
I did speak to oracle support and they suggested using pga_aggregate_target rather than the separate *area_size parameters. I found that this had very little impact as the problem was related to the volume of data rather than whether it was being processed in memory or not. That said, I did try upping the hash_area_size for the session with some initial success, but ultimately it didn't prove to be scalable. We are however now using pga_aggregate_target in prod.
So that's that. Problem sorted. And as the title of Mark Rittman's article suggests, I was trying to be too clever! :-)
HTH
David
Maybe you are looking for
-
Open Sans Condensed not rendering right
Hi community I'm building a website using (partially) Google webfont 'Open Sans Condensed'. Also my website is in Greek. In Chrome and Firefox the font is rendered correctly, in Safari it's not rendered at all. On the iPad & iPhone (tested in Chrome
-
Annoying problem when downloading packages
The problem started some time ago. When downloading packages, pacman only downloads a few packages at a time and errors out on the remaining ones with the "Service not available, closing control connection" message. If I try again, it will download t
-
Hi All, I am very new to OIM,i have added some fields to self-registration form in OIM Admin console, now i want to map those fields to LDAP to populate the values to the server. Can anybody help me on this pls. Thanks, Kishore.
-
ICal Syncing using iCloud.
Can you sync two iPads to iCal using iCloud. It works on all my other devices except my second iPad. I want to be able to add a calendar item to my iPad that I use and have it update my wifes iPad. They are both signed in to iCloud with the same ID
-
Live Capture of Multiple Angles
Hi, a bunch of us students are attempting to produce a "live" TV show. Basically, we'll be at a live music festival, and we want to be interviewing bands backstage and air it within 30 minutes or so. This is very similar to what the BBC did with Glas