What is the problem in this code (problem in select query)
Just need your help in solving one issue. In the below code one query which is highlighted
Select statement not working means cursor directly goes to the endselect .means these two statements not executed.
CLASS cl_abap_container_utilities DEFINITION LOAD.
CALL METHOD cl_abap_container_utilities=>read_container_c
I am attaching that code with this mail. Please do the needful help.
*& Report ZEOU_RG1 *
REPORT zeou_rg1 LINE-SIZE 400.
Purpose : RG1 Report driver
Remarks :
constants
INCLUDE j_2icons.
type declerations
INCLUDE j_2isdef.
table definitions and internal tables
INCLUDE j_2iddef.
INCLUDE <icon>.
DATA: $plant TYPE bp_addr_typ,
$lincnt LIKE sy-linct,
m_date LIKE j_1ipart2-budat,
m_chapid LIKE j_1iexcdtl-chapid,
m_matform LIKE j_1irg1-matform,
m_bedrate LIKE j_1irg1-bedrate,
tot_op_bal LIKE j_1irg1-menge,
tot_qty_mnfr LIKE j_1irg1-menge,
tot_total_qty_mnfr LIKE j_1irg1-menge,
tot_remv_home LIKE j_1irg1-menge,
tot_remv_hval LIKE j_1irg1-exbas,
tot_remv_expr LIKE j_1irg1-menge,
tot_remv_eval LIKE j_1irg1-exbas,
tot_remv_expb LIKE j_1irg1-menge,
tot_remv_othr LIKE j_1irg1-menge,
tot_remv_opur LIKE j_1irg1-menge,
tot_duty_amt LIKE j_1irg1-exbed,
tot_cb_fr LIKE j_1irg1-exbed,
tot_cb_br LIKE j_1irg1-exbed.
DATA: t_rg1_cons TYPE rg1_typ OCCURS 0 WITH HEADER LINE.
FIELD-SYMBOLS: <x_extrctdata> TYPE c,
<x_rg1> TYPE rg1_typ,
<x_part1typ> TYPE part1_typ.
DATA : it_j_1iexchdr TYPE j_1iexchdr OCCURS 0 WITH HEADER LINE,
wa_j_1iexchdr TYPE j_1iexchdr,
it_j_1iexcdtl TYPE j_1iexcdtl OCCURS 0 WITH HEADER LINE,
wa_j_1iexcdtl TYPE j_1iexcdtl.
selection screen
PARAMETERS: p_exgrp LIKE j_1iexchdr-exgrp OBLIGATORY MEMORY ID j2i,
p_stdate LIKE sy-datum OBLIGATORY,
p_endate LIKE sy-datum OBLIGATORY.
*SELECTION-SCREEN SKIP 1.
*SELECTION-SCREEN BEGIN OF BLOCK 4 WITH FRAME TITLE TEXT-001.
*SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN POSITION 01.
*PARAMETERS: P_INDI RADIOBUTTON GROUP 57F4 DEFAULT 'X'.
*SELECTION-SCREEN COMMENT (25) TEXT-002.
*SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN POSITION 01.
*PARAMETERS: P_CONS RADIOBUTTON GROUP 57F4.
*SELECTION-SCREEN COMMENT (25) TEXT-003.
*SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN END OF BLOCK 4.
INITIALIZATION.
AT SELECTION-SCREEN.
SELECT SINGLE *
FROM j_1iexgrps
WHERE j_1iexcgrp = p_exgrp.
IF sy-subrc NE 0.
MESSAGE e399(8i) WITH p_exgrp.
ENDIF.
*check company code
SELECT SINGLE *
FROM t001k
WHERE bwkey = j_1iexgrps-j_1iwerks.
IF sy-subrc NE 0.
MESSAGE e518(8i) WITH 'the' 'plant' j_1iexgrps-j_1iwerks.
ENDIF.
<b>START-OF-SELECTION.
CLEAR: j_1irg1, j_2icomp.
retrieve layout name and details
SELECT SINGLE *
FROM J_2ILAYCTR
WHERE BUKRS = T001K-BUKRS
AND REGISTER = C_RG1
AND LAYOUTNR = 1.
IF SY-SUBRC NE 0.
MESSAGE E635(8I) WITH T001K-BUKRS C_RG1.
ENDIF.
SET COUNTRY 'IN'.
REFRESH t_reciepts.
report driver logic
SELECT *
FROM j_2iextrct
WHERE exgrp = p_exgrp
AND budat >= p_stdate
AND budat <= p_endate
AND register = c_rg1
ORDER BY budat keyid.
assign J_2IEXTRCT-EXTRCTDATA to <x_extrctdata> casting.
assign T_RG1 to <x_rg1> casting.
<x_rg1> = <x_extrctdata>.
CLASS cl_abap_container_utilities DEFINITION LOAD.
CALL METHOD cl_abap_container_utilities=>read_container_c
EXPORTING
im_container = j_2iextrct-extrctdata
IMPORTING
ex_value = t_rg1
EXCEPTIONS
illegal_parameter_type = 1
OTHERS = 2.
MOVE J_2IEXTRCT-EXTRCTDATA TO T_RG1.
APPEND t_rg1.
ENDSELECT.
DESCRIBE TABLE t_rg1 LINES $lincnt.
IF $lincnt = 0.
MESSAGE e548(8i) WITH p_stdate p_endate.
ENDIF.</b>
PERFORM PLANT_AND_EXCISE_DTLS USING P_WERKS.
PERFORM plant_and_excise_dtls USING j_1iexgrps-j_1iwerks.
MOVE : 'ZJ_2I_RG1' TO j_2ilayctr-layoutname.
SORT t_rg1 BY chapid matnr cpudt .
open form
PERFORM open_form USING j_2ilayctr-layoutname j_2ilayctr-noofcopies "J_2ILAYCTR-LAYOUTNAME
j_2ilayctr-outdevice true.
process extract data and write
IF P_INDI = 'X'.
PERFORM get_data_and_write.
ELSEIF P_CONS = 'X'.
PERFORM RG1_PRINT_CONS.
PERFORM GET_DATA_AND_WRITE_CONS.
ENDIF.
close form
PERFORM close_form.
F O R M S
INCLUDE j_2ilayo.
*& Form GET_DATA_AND_WRITE
Purpose : Logic to print RG1 report
FORM get_data_and_write.
DATA: save_matnr LIKE mara-matnr.
CLEAR: j_1irg1, j_2icomp, save_matnr.
SELECT * FROM j_1iexchdr INTO TABLE it_j_1iexchdr
WHERE exgrp = p_exgrp
AND budat >= p_stdate
AND budat <= p_endate.
SORT it_j_1iexchdr BY cpudt docno.
LOOP AT it_j_1iexchdr.
SELECT * FROM j_1iexcdtl INTO wa_j_1iexcdtl
WHERE docno = it_j_1iexchdr-docno.
APPEND wa_j_1iexcdtl TO it_j_1iexcdtl.
ENDSELECT.
ENDLOOP.
clear wa_j_1iexcdtl.
SORT it_j_1iexcdtl BY chapid matnr cpudt docno.
LOOP AT t_rg1.
CLEAR: j_1irg1, j_2icomp.
assign header fields
j_2icomp-stdate = p_stdate.
j_2icomp-endate = p_endate.
IF save_matnr NE t_rg1-matnr.
fill header line with matnr, description, chapterid and unit
j_1irg1-chapid = t_rg1-chapid.
mara-matnr = t_rg1-matnr.
marav-maktx = t_rg1-maktx.
mara-meins = t_rg1-meins.
save_matnr = t_rg1-matnr.
IF sy-tabix NE 1.
j_2icomp-new_page = true.
ELSE.
j_2icomp-new_page = false.
ENDIF.
ELSE.
j_2icomp-new_page = false.
ENDIF.
PERFORM write_form USING element-spac function-set
typ-body window-main .
determine line to display viz. manufacture entry/removal entry
IF t_rg1-matform = c_packed.
j_2icomp-rg1_p_l = c_packed.
ELSEIF t_rg1-matform = c_loose.
j_2icomp-rg1_p_l = c_loose.
ENDIF.
j_1irg1-cpudt = t_rg1-cpudt.
j_2icomp-op_qty = t_rg1-op_bal.
j_2icomp-mf_qty = t_rg1-qty_mfr.
j_2icomp-to_qty = t_rg1-total.
j_2icomp-cl_fin = t_rg1-cl_bal_fn.
j_2icomp-cl_bon = t_rg1-cl_bal_bn.
j_2icomp-remarks = t_rg1-remarks.
j_2icomp-h_menge = t_rg1-h_menge.
j_2icomp-h_value = t_rg1-h_value.
j_2icomp-e_menge = t_rg1-e_menge.
j_2icomp-e_value = t_rg1-e_value.
j_2icomp-e_menge_bn = t_rg1-e_menge_bond.
j_2icomp-o_menge = t_rg1-o_menge.
j_2icomp-o_purpose = t_rg1-o_purpose.
j_2icomp-o_pur_meng = t_rg1-o_pur_menge.
j_1irg1-bedrate = t_rg1-bedrate.
j_1irg1-exbed = t_rg1-bedamt.
j_2icomp-cl_fin = t_rg1-cl_bal_fn.
j_2icomp-cl_bon = t_rg1-cl_bal_bn.
j_2icomp-remarks = t_rg1-remarks.
READ TABLE it_j_1iexcdtl WITH KEY cpudt = t_rg1-cpudt
chapid = t_rg1-chapid
matnr = t_rg1-matnr.
IF sy-subrc = 0.
get duties for issues only.
IF t_rg1-rcptissrsn = 'IPD'
OR t_rg1-rcptissrsn = 'IWD'
OR t_rg1-rcptissrsn = 'IDH'
OR t_rg1-rcptissrsn = 'IDE'
OR t_rg1-rcptissrsn = 'IWE'
OR t_rg1-rcptissrsn = 'IWT'
OR t_rg1-rcptissrsn = 'IWO'.
READ TABLE it_j_1iexchdr WITH KEY exnum = t_rg1-rdoc1
trntyp = 'DLFC'
cpudt = t_rg1-cpudt.
READ TABLE it_j_1iexcdtl WITH KEY docno = it_j_1iexchdr-docno
cpudt = it_j_1iexchdr-cpudt
trntyp = 'DLFC'
matnr = t_rg1-matnr.
docyr = it_j_1iexchdr-docyr
IF IT_j_1iexchdr-expind <> 'B'
and it_j_1iexchdr-expind <> 'U'
and it_j_1iexchdr-expind <> 'D'
and it_j_1iexchdr-expind <> 'N'
AND T_RG1-h_menge > 0.
and it_j_1iexchdr-expind IS INITIAL.
IF it_j_1iexchdr-censtat = 'P'.
wa_j_1iexcdtl-ecs = it_j_1iexcdtl-ecs.
ENDIF.
IF it_j_1iexchdr-censtat = 'C'.
wa_j_1iexchdr-exbed = it_j_1iexchdr-exbed.
wa_j_1iexchdr-ecs = it_j_1iexchdr-ecs.
wa_j_1iexchdr-censtat = it_j_1iexchdr-censtat.
wa_j_1iexchdr-cpudt = it_j_1iexchdr-cpudt.
wa_j_1iexcdtl-rgplaser = it_j_1iexcdtl-rgplaser.
wa_j_1iexcdtl-rg23aser = it_j_1iexcdtl-rg23aser.
ENDIF.
ENDIF.
endif.
ENDIF.
PERFORM write_form USING element-d function-append
typ-body window-main .
CLEAR : wa_j_1iexchdr, wa_j_1iexcdtl.
ENDLOOP.
ENDFORM. " GET_DATA_AND_WRITE
*& Form GET_DATA_AND_WRITE_CONS
text *
--> p1 text
<-- p2 text
FORM get_data_and_write_cons.
DATA: save_chapid LIKE j_1iexcdtl-chapid.
CLEAR: j_1irg1, j_2icomp, save_chapid.
LOOP AT t_rg1_cons.
CLEAR: j_1irg1, j_2icomp.
assign header fields
j_2icomp-stdate = p_stdate.
j_2icomp-endate = p_endate.
IF save_chapid NE t_rg1_cons-chapid.
fill header line with chapterid
j_1irg1-chapid = t_rg1_cons-chapid.
save_chapid = t_rg1_cons-chapid.
IF sy-tabix NE 1.
j_2icomp-new_page = true.
ELSE.
j_2icomp-new_page = false.
ENDIF.
ELSE.
j_2icomp-new_page = false.
ENDIF.
PERFORM write_form USING element-spac function-set
typ-body window-main .
determine line to display viz. manufacture entry/removal entry
IF t_rg1_cons-matform = c_packed.
j_2icomp-rg1_p_l = c_packed.
ELSEIF t_rg1_cons-matform = c_loose.
j_2icomp-rg1_p_l = c_loose.
ENDIF.
j_1irg1-cpudt = t_rg1_cons-cpudt.
j_2icomp-op_qty = t_rg1_cons-op_bal.
j_2icomp-mf_qty = t_rg1_cons-qty_mfr.
j_2icomp-to_qty = t_rg1_cons-total.
j_2icomp-cl_fin = t_rg1_cons-cl_bal_fn.
j_2icomp-cl_bon = t_rg1_cons-cl_bal_bn.
j_2icomp-remarks = t_rg1_cons-remarks.
j_2icomp-h_menge = t_rg1_cons-h_menge.
j_2icomp-h_value = t_rg1_cons-h_value.
j_2icomp-e_menge = t_rg1_cons-e_menge.
j_2icomp-e_value = t_rg1_cons-e_value.
j_2icomp-e_menge_bn = t_rg1_cons-e_menge_bond.
j_2icomp-o_menge = t_rg1_cons-o_menge.
j_2icomp-o_purpose = t_rg1_cons-o_purpose.
j_2icomp-o_pur_meng = t_rg1_cons-o_pur_menge.
j_1irg1-bedrate = t_rg1_cons-bedrate.
j_1irg1-exbed = t_rg1_cons-bedamt.
j_2icomp-cl_fin = t_rg1_cons-cl_bal_fn.
j_2icomp-cl_bon = t_rg1_cons-cl_bal_bn.
j_2icomp-remarks = t_rg1_cons-remarks.
PERFORM write_form USING element-d function-append
typ-body window-main .
*for grand totals
tot_remv_hval = tot_remv_hval + t_rg1_cons-h_value.
tot_remv_eval = tot_remv_eval + t_rg1_cons-e_value.
tot_duty_amt = tot_duty_amt + t_rg1_cons-bedamt.
ENDLOOP.
*for grand totals
j_2icomp-amount1 = tot_remv_hval.
j_2icomp-amount2 = tot_remv_eval.
j_2icomp-amount3 = tot_duty_amt.
PERFORM write_form USING element-t function-append
typ-body window-footer.
ENDFORM. " GET_DATA_AND_WRITE_CONS
*& Form RG1_PRINT_CONS
text *
--> p1 text
<-- p2 text
FORM rg1_print_cons.
DATA : first_time VALUE on.
SORT t_rg1 BY chapid cpudt.
LOOP AT t_rg1.
IF first_time = on.
m_chapid = t_rg1-chapid.
m_date = t_rg1-cpudt.
m_matform = t_rg1-matform.
m_bedrate = t_rg1-bedrate.
first_time = off.
ENDIF.
IF m_chapid <> t_rg1-chapid.
PERFORM chapid_break.
ELSEIF m_date <> t_rg1-cpudt.
PERFORM date_break.
ENDIF.
Accumulate totals
tot_op_bal = tot_op_bal + t_rg1-op_bal.
tot_qty_mnfr = tot_qty_mnfr + t_rg1-qty_mfr.
tot_total_qty_mnfr = tot_total_qty_mnfr + t_rg1-total.
tot_remv_home = tot_remv_home + t_rg1-h_menge.
tot_remv_hval = tot_remv_hval + t_rg1-h_value.
tot_remv_expr = tot_remv_expr + t_rg1-e_menge.
tot_remv_eval = tot_remv_eval + t_rg1-e_value.
tot_remv_expb = tot_remv_expb + t_rg1-e_menge_bond.
tot_remv_othr = tot_remv_othr + t_rg1-o_menge.
tot_remv_opur = tot_remv_opur + t_rg1-o_pur_menge.
tot_duty_amt = tot_duty_amt + t_rg1-bedamt.
tot_cb_fr = tot_cb_fr + t_rg1-cl_bal_fn.
tot_cb_br = tot_cb_br + t_rg1-cl_bal_bn.
ENDLOOP.
PERFORM chapid_break.
ENDFORM. " RG1_PRINT_CONS
*& Form DATE_BREAK
text *
--> p1 text
<-- p2 text
FORM date_break.
CLEAR t_rg1_cons.
t_rg1_cons-chapid = m_chapid.
t_rg1_cons-cpudt = m_date.
t_rg1_cons-op_bal = tot_op_bal.
t_rg1_cons-qty_mfr = tot_qty_mnfr.
t_rg1_cons-total = tot_total_qty_mnfr.
t_rg1_cons-h_menge = tot_remv_home.
t_rg1_cons-h_value = tot_remv_hval.
t_rg1_cons-e_menge = tot_remv_expr.
t_rg1_cons-e_value = tot_remv_eval.
t_rg1_cons-e_menge_bond = tot_remv_expb.
t_rg1_cons-o_menge = tot_remv_othr.
t_rg1_cons-o_pur_menge = tot_remv_opur.
t_rg1_cons-bedamt = tot_duty_amt.
t_rg1_cons-cl_bal_fn = tot_cb_fr.
t_rg1_cons-cl_bal_bn = tot_cb_br.
t_rg1_cons-matform = m_matform.
t_rg1_cons-bedrate = m_bedrate.
APPEND t_rg1_cons.
tot_op_bal = 0.
tot_qty_mnfr = 0.
tot_total_qty_mnfr = 0.
tot_remv_home = 0.
tot_remv_hval = 0.
tot_remv_expr = 0.
tot_remv_eval = 0.
tot_remv_expb = 0.
tot_remv_othr = 0.
tot_remv_opur = 0.
tot_duty_amt = 0.
tot_cb_fr = 0.
tot_cb_br = 0.
m_date = t_rg1-cpudt.
m_matform = t_rg1-matform.
m_bedrate = t_rg1-bedrate.
ENDFORM. " DATE_BREAK
*& Form CHAPID_BREAK
text
--> p1 text
<-- p2 text
FORM chapid_break.
PERFORM date_break.
m_chapid = t_rg1-chapid.
ENDFORM. " CHAPID_BREAK
hi rakesh,
in your first select single * statement you have given WHERE BUKRS = T001K-BUKRS..but at the point of execution, what will be the value stored in t001k-bukrs...i doubt it will be initial....so, store bukrs in a variable or hardcode it.....
in the second select, you hve not given any target work area for the into class...that's y your subrc is 4...specify a target area, where you want the data to be stored...
Similar Messages
-
What's the point of this code?
Hi, I'm getting an error in a program.
So I went to look in the code where the error is displayed.
And I found this:
z_nbjr = sy-datum - z_fromdt.
if z_nbjr > 1.
message is displayed.
Now, z_fromdt is the value TVARV-LOW for 'ZVDL_VBUK_LAST_RUN', and the message that is displayed is 'Please rebuild index file ZVDL_VBUK'.
Can anyone explain to me what is the point of this? What is TVARV-LOW?
And why do they make this check? And how do I rebuild the index file?>
christophe latinne wrote:
> Can anyone explain to me what is the point of this? What is TVARV-LOW?
> And why do they make this check? And how do I rebuild the index file?
As Pushpraj has already pointed out correctly, TVARV is where the variants are stored. It's rather strange that you've never seen fields like LOW and HIGH, because they're also used in the ABAP range tables (see Help for command RANGES).
Since this is all your custom development, we, unfortunately, cannot know what is the point of all this. I'm guessing that the message to "rebuild the index" is also custom and, therefore, you would need to find a documentation for the program in question or ask your colleagues what this could mean. Also check if there is a long text available for the message (although I doubt that).
Most likely it's some kind of an internal process of running some other program. -
What is the error in this code
hi everone
I write this code in push button
declare
x varchar2(222);
begin
x:=get_application_property(:system.mode);
message(x);
end;
to know the system mode
but the resullt was exeception ora-06502simple write
x := :system.mode;
or
message(:system.mode);
message(:system.mode);Best way to resolve the issue is always check Forms online help first -
What is the cause of this syncing problem?
Increasingly I am getting the message, "Waiting for iPod" whenever I connect my 2nd gen iPod Shuffle to my iBook. This typically happens when I dock my iPod or shortly afterward. Then when I eject my iPod from iTunes, it still appears in the Finder. When I attempt to eject it using the Finder, I get the message, "The disk 'IPOD' is in use and could not be ejected. Try quitting the application and try again." Then I have to quit iTunes altogether to avoid getting the dreaded "Device Removal" message. Some times it takes several attempts to get a clean doc, sync and eject.
This has been happening over the past couple of versions of iTunes. I noticed that the latest version, 9.03 (15) was supposed to fix this problem. It hasn't improved the situation at all. I have followed other suggestions on the Apple website such as plugging my dock directly into either of my iBook's USB ports, but that doesn't make any difference. This is getting quite irritating. It's also happened occasionally when I've docked my iPod Touch.
What do you think is going on?
-BillFirst part of your question:
Error Message
%CFT_API-3-CFT_ERRMSG_NO_MEMORY: [chars] [chars] [dec]
Explanation
The system was unable to supply the requested memory for flow processing to continue
Recommended Action
Reduce other system activity to ease
memory demands. If conditions warrant,
upgrade to a larger memory configuration.
link:
www.cisco.com/c/en/us/td/docs/ios/system/messages/guide/sm_cn02.pdf
Pretty generic, but its a start, the process in question is cft_flow_lookup.
This may be an indication of a deeper resource issue. -
What's the error in this code?
I keep getting an error message at "line 1 column 97" which is the letter "i" in the second "if."
begin if :P23_START_DATE is null or :P23_START_DATE = ' ' then :P23_START_DATE:= '01-JAN-2001';
if :P23_END_DATE = is null or :P23_END_DATE = ' ' then
:P23_END_DATE = '31-DEC-2099';
select 'http://apexdevapp1.ci.raleigh.nc.us:7777',
user_name, count(ID) total
FROM eba_ver2_cust_activity
where ACTIVITY_DATE <= to_char(to_date(:P23_END_DATE,'dd-mon-yyyy'),'dd-mon-yyyy')
and ACTIVITY_DATE >= to_char(to_date(:P23_START_DATE,'dd-mon-yyyy'),'dd-mon-yyyy')
group by
user_name,
'http://apexdevapp1.ci.raleigh.nc.us:7777'
end;
Honestly, I don't see where the problem is. Help me please.
Steve "the n00b" in Raleigh NCackness wrote:
You could forgo the IF statements altogether by doing using NVL and TRIM this:
begin
select
'http://apexdevapp1.ci.raleigh.nc.us:7777',
user_name, count(ID) total
FROM eba_ver2_cust_activity
where ACTIVITY_DATE BETWEEN NVL(TRIM(:P23_START_DATE), '01-JAN-2001') AND NVL(TRIM(:P23_END_DATE), '31-DEC-2099');
group by
user_name,
'http://apexdevapp1.ci.raleigh.nc.us:7777';
end;
also you can simplify the GROUP BY by
begin
select
MAXX('http://apexdevapp1.ci.raleigh.nc.us:7777') URL,
user_name, count(ID) total
FROM eba_ver2_cust_activity
where ACTIVITY_DATE BETWEEN NVL(TRIM((:P23_START_DATE), '01-JAN-2001') AND NVL(TRIM((:P23_END_DATE), '31-DEC-2099');
group by
user_name;
end;Ackness, I tried your first suggestion, and got this when I applied the changes.
1 error has occurred
Failed to parse SQL query:
BEGIN SELECT 'http://apexdevapp1.ci.raleigh.nc.us:7777', user_name, count(ID) total FROM eba_ver2_cust_activity where ACTIVITY_DATE BETWEEN NVL(TRIM(:P23_START_DATE), '01-JAN-2001') AND NVL(TRIM(:P23_END_DATE), '31-DEC-2099'); group by user_name, 'http://apexdevapp1.ci.raleigh.nc.us:7777'; end
ORA-06550: line 5, column 115: PLS-00103: Encountered the symbol "" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe
Certain queries can only be executed when running your application, if your query appears syntactically correct, you can save your query without validation (see options below query source).
I can't for the life of me figure out where the invalid character is after "begin." All I can see is a blank character. Thanks for your help.
Steve "the n00b" -
What is the wrong in this code
*& Report ZTESTTEST
REPORT ztesttest LINE-SIZE 256.
TYPE-POOLS: slis.
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE ,
<dyn_wa>,
<dyn_field>.
FIELD-SYMBOLS: <dyn_table1> TYPE STANDARD TABLE ,
<dyn_wa1>,
<dyn_field1>.
DATA: alv_fldcat TYPE slis_t_fieldcat_alv,
it_fldcat TYPE lvc_t_fcat.
TYPE-POOLS : abap.
DATA : it_details TYPE abap_compdescr_tab,
wa_details TYPE abap_compdescr.
DATA :itab TYPE abap_component_tab.
* CLASS cl_my_structure DEFENITION
CLASS cl_my_structure DEFINITION.
PUBLIC SECTION.
METHODS: x.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS. "cl_my_structure DEFENITION
* CLASS cl_my_structure IMPLEMENTATION
CLASS cl_my_structure IMPLEMENTATION.
METHOD x.
WRITE 'HI'.
ENDMETHOD. "x
ENDCLASS. "cl_my_structure IMPLEMENTATION
DATA : ref_descr TYPE REF TO cl_abap_structdescr.
DATA: new_table TYPE REF TO data,
new_line TYPE REF TO data,
wa_it_fldcat TYPE lvc_s_fcat.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text .
PARAMETERS: p_table(30) TYPE c DEFAULT 'T001'.
SELECTION-SCREEN END OF BLOCK b1.
* Get the structure of the table.
ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).That depends on what you want it to do. Do you want it to write "Hi"? If so...
report ztesttest line-size 256.
*type-pools: slis.
*field-symbols: <dyn_table> type standard table ,
* <dyn_wa>,
* <dyn_field>.
*field-symbols: <dyn_table1> type standard table ,
* <dyn_wa1>,
* <dyn_field1>.
*data: alv_fldcat type slis_t_fieldcat_alv,
* it_fldcat type lvc_t_fcat.
*type-pools : abap.
*data : it_details type abap_compdescr_tab,
* wa_details type abap_compdescr.
*data :itab type abap_component_tab.
* CLASS cl_my_structure DEFENITION
class cl_my_structure definition.
public section.
methods: x.
protected section.
private section.
endclass. "cl_my_structure DEFENITION
* CLASS cl_my_structure IMPLEMENTATION
class cl_my_structure implementation.
method x.
write 'HI'.
endmethod. "x
endclass. "cl_my_structure IMPLEMENTATION
*data : ref_descr type ref to cl_abap_structdescr.
*data: new_table type ref to data,
* new_line type ref to data,
* wa_it_fldcat type lvc_s_fcat.
data: o_ref type ref to cl_my_structure.
selection-screen begin of block b1 with frame title text .
parameters: p_table(30) type c default 'T001'.
selection-screen end of block b1.
start-of-selection. "<-- YES, YOU NEED THIS.
create object o_ref .
call method o_ref->x.
* Get the structure of the table.
*ref_descr ?= cl_abap_typedescr=>describe_by_name( p_table ).
Regards,
RIch Heilman -
What is the ploblem with this code?
class lol
Connection con;
ResultSet rs;
String query="";
String scno,bcrcno,prno,prdt,billamt,misamt,miscd,reconchg;
lol()
try{
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String ServerName="127.0.0.1";
String portnum="1521";
String sid="GRC";
String url="jdbc:oracle:thin:@"+ServerName+":"+portnum+":"+sid;
con = DriverManager.getConnection(url,"scott"," tiger");
con.setAutoCommit(true);
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
query="select ptscno,ptbcrno,ptprno,to_char(ptprdt,'yyyy-mm-dd'),ptblamt,ptmisamt,ptmisamtcd,ptreconchg from payment";
rs=stmt.executeQuery(query);
while(rs.next())
java.sql.Date myDate = new java.sql.Date(System.currentTimeMillis());
rs.updateDate(4, myDate);
System.out.println(myDate);
rs.updateRow();
con.commit();
con.close();
}catch(Exception e)
System.out.println("connection failed :"+e);
public static void main(String lol[])
new lol();
thanq in advance,
stalinthat was just a simple code,
all other fields are updating except the Date field where i use updateDate method.
please explain or show me some example to update the date filed.
thanq in advance.
stalin. -
What is the error with this code ??
i'm trying to execute the following AS3 code:
var itemsArr:Array = new Array ();
var i:int;
var loaderAds:URLLoader = new URLLoader();
loaderAds.load(new URLRequest("ads.txt"));
loaderAds.addEventListener(Event.COMPLETE, completeHandlerAds);
function completeHandlerAds(eventAds:Event):void {
var loaderAds:URLLoader = URLLoader(eventAds.target);
var varsAds:URLVariables = new URLVariables(loaderAds.data);
itemsArr = varsAds.names.split(";");
for (i = 0; i < (itemsArr.length); i++) {
trace("itemsArr, Processing: " + itemsArr[i]);
var loaderProps:URLLoader = new URLLoader();
loaderProps.load(new URLRequest(itemsArr[i]+".txt"));
loaderProps.addEventListener(Event.COMPLETE, completeHandlerProps);
trace("one: " + itemsArr[i]);
function completeHandlerProps(eventProps:Event):void {
trace("two: " + itemsArr[i]);
}// end of fn for props
}//end of "for" loop of ads names
}//end of fn for ads names
But i get the following output:
adsNames Array: ad0,ad1
adsNames, Processing: ad0
ad0
adsNames, Processing: ad1
ad1
null
TypeError: Error #2007: Parameter name must be non-null.
at flash.display::DisplayObject/set name()
at MethodInfo-279()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
null
TypeError: Error #2007: Parameter name must be non-null.
at flash.display::DisplayObject/set name()
at MethodInfo-279()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
As you see, the "red text" is errors, Can you tell me the reason for it ?
And also, tracing "itemsArr[i]" in the second time, always give "null", also in the first time, it give the correct value, Why ?the red text not appear after i posted the topic, but you can see the errors on the output
and, you've to create to text files, first called "ads.txt" and put in it "names=ad0;ad1"
second one called "ad0.txt" and put anything in it, and another called "ad1.txt" and put anything in it
all these files should be in the same dir of flash file -
What's the problem in this code
import java.lang.reflect.*;
import java.awt.*;
class ABC
public Integer i;
ABC()
public void setInt(Integer t)
i = t;
public class SampleName {
public static void main(String[] args)
ABC g1 = new ABC();
g1.setInt(new Integer(10));
printFieldNames(g1);
static void printFieldNames(Object o) {
Class c = o.getClass();
Field[] publicFields = c.getDeclaredFields();
for (int i = 0; i < publicFields.length; i++)
try {
Object ref = publicFields.get(c);
System.out.println(" ref.toString() : " + ref.toString());
}catch(Exception e)
e.printStackTrace();
What is the problem with this code,at run time Iam getting this exception
java.lang.IllegalArgumentException: object is not an instance of declaring class
How can we get the value of field of an objectNow it got this exception
java.lang.IllegalAccessException
at java.lang.reflect.Field.get(Native Method)That's strange - I didn't! ;-)
Are you running exactly the same code as the code you posted (except for the one line I said to change)? -
Please tell me what is the problem with this code
Hai,
Iam new to Swings. can any one tell what is the problem with this code. I cant see those controls on the frame. please give me the suggestions.
I got the frame ,but the controls are not.
this is the code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ex2 extends JFrame
JButton b1;
JLabel l1,l2;
JPanel p1,p2;
JTextField tf1;
JPasswordField tf2;
public ex2()
setDefaultCloseOperation(EXIT_ON_CLOSE);
setTitle("Another example");
setSize(500,500);
setVisible(true);
b1=new JButton(" ok ");
p1=new JPanel();
p1.setLayout(new GridLayout(2,2));
p2=new JPanel();
p2.setLayout(new BorderLayout());
l1=new JLabel("Name :");
l2=new JLabel("Password:");
tf1=new JTextField(15);
tf2=new JPasswordField(15);
Container con=getContentPane();
con.add(p1);
con.add(p2);
public static void createAndShowGUI()
ex2.setDefaultLookAndFeelDecorated(true);
public static void main(String ar[])
createAndShowGUI();
new ex2();
}import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ex2 extends JFrame
JButton b1;
JLabel l1,l2;
JPanel p1,p2;
JTextField tf1;
JPasswordField tf2;
public ex2()
setDefaultCloseOperation(EXIT_ON_CLOSE);
setTitle("Another example");
b1=new JButton(" ok ");
p1=new JPanel();
p1.add(b1);
p2=new JPanel();
p2.setLayout(new GridLayout(2,2));
l1=new JLabel("Name :");
l2=new JLabel("Password:");
tf1=new JTextField(15);
tf2=new JPasswordField(15);
p2.add(l1);
p2.add(tf1);
p2.add(l2);
p2.add(tf2);
Container con=getContentPane();
con.add(p1, BorderLayout.NORTH);
con.add(p2, BorderLayout.CENTER);
pack();
setVisible(true);
public static void createAndShowGUI()
ex2.setDefaultLookAndFeelDecorated(true);
public static void main(String ar[])
createAndShowGUI();
new ex2();
} -
Vector, what is the problem with this code?
Vector, what is the problem with this code?
63 private java.util.Vector data=new Vector();
64 Vector aaaaa=new Vector();
65 data.addElement(aaaaa);
74 aaaaa.addElement(new String("Mary"));on compiling this code, the error is
TableDemo.java:65: <identifier> expected
data.addElement(aaaaa);
^
TableDemo.java:74: <identifier> expected
aaaaa.addElement(new String("Mary"));
^
TableDemo.java:65: package data does not exist
data.addElement(aaaaa);
^
TableDemo.java:74: package aaaaa does not exist
aaaaa.addElement(new String("Mary"));Friends i really got fed up with this code for more than half an hour.could anybody spot the problem?I can see many:
1. i assume your code snip is inside a method. a local variable can not be declare private.
2. if you didn't import java.util.* on top then you need to prefix package on All occurance of Vector.
3. String in java are constant and has literal syntax. "Mary" is sufficient in most of the time, unless you purposly want to call new String("Mary") on purpose. Read java.lang.String javadoc.
Here is a sample that would compile...:
public class QuickMain {
public static void main(String[] args) {
java.util.Vector data=new java.util.Vector();
java.util.Vector aaaaa=new java.util.Vector();
data.addElement(aaaaa);
aaaaa.addElement(new String("Mary"));
} -
Deactivation of Photoshop CS3 leads to an error 1914:1 what ist the solution for this problem
hello
I try to deactivate photoshop CS3 on my win XP system. When I try this I get the error code 1914:1 . This says there are no activations. But when I try to activate it on the new WIN 7 system
I get the message to many activations. What is the soltion for this problem?Contact support by web chat.
Mylenium -
Adobe X PDF files converted to jpg, edited and converted back to PDF have ragged, unclear text. I didn't have this problem with Acrobat 9 standard. What is the remedy for this. If this is the best I can expect, I won't be able to use X standard.
I can't imagine any worse workflow than converting to JPEG to edit text, then back to PDF. Text in a PDF is a vector thing, smooth at all resolutions. And JPEG is made for photos. EVERY conversion to JPEG and back loses quality but how much loss there is will vary.
If you must go to an image format, try PNG. -
I have always been able to import pictures from camera to iphoto without a problem. Now, for some unknown reason our iMac and Mac Laptop will not import pictures from camera to iphoto 9 or 11...what is the fix to this problem? It will only accept import from a CD.
I have always been able to import pictures from camera to iphoto without a problem. Now, for some unknown reason our iMac and Mac Laptop will not import pictures from camera to iphoto 9 or 11...what is the fix to this problem? It will only accept import from a CD.
-
@I have my Adobe ID and the Adobe Digital Editions. But when I download an EPUB-ebook, I don´t see the ebook or "My Digital Editions-Bibliothek".What is the solution for this problem?
how can we solve the problem?
I have my adob.e ID, downloaded Adobe Digital Editions.
Whren I download EPUB-ebooks and want to use
Digital Editions, nothing happens and appears!??
Please give me a short feedback and help
Maybe you are looking for
-
Ipod cannot be synced, unknown error (-50)
I receive the above error when I try to get my new (less then 7 days) 30gb ipod to sync my pictures from iphoto. If i disable the iphoto option i can sync everything else OK. I've also treid restoring the ipod (twice) and still no luck. One thing I'v
-
(Easy-to-understand information please!)
-
10.4.6 logs into Console only
Hi, I've jsut done a clean install of Server 10.4 then updated to 10.4.6 now when I log in I get taken straight to Console mode, no GUI - how can I stop this?? help!
-
I anm trying to load quickbooks for mac on my pro,put it will not open and run when i drag icon to luanchpad ,from desktop it wont run at all .how do I get the software to load on my drive
-
Dear All, Can anybody provide me a query for Item wise outstanding. My client sells mechinary by taking some advance at the time of installation. The remaining payment will be divided into 30 days and 60 days. In aging i an not getting Item wise outs