Need to calculate result using Macros
Dear All,
We are in BI.7.I'm new to VBA macros.I had inserted 2 reports in one work book and my requirement is need to do some calculations based on result1 and result2 , out put has to be displayed after 2 results.
Eg:
Workbook contains 2 reports ( tables 1 and 2) as follows:
Result 1 :
Table
Company code Qty
C1 100
C2 200
Result 2 :
Table
Company code Amount
C1 1000
C2 5000
Need to generate 3rd Table based on result1 and result 2 as follows
Final result
Table
Company code Price
C1 10 ( Result2. amount / Result1.Qty)
C2 25
My question is in which event I have to write the logic to get final result.
Thanks in advance.
Thanks and regards,
Raju
Hi Raju,
How are you?
Nice to hear this kind of issues. Please could you provide the issue solution details.
Thanks
Ram G
Similar Messages
-
How to use macro 'TIMESHIFT_FORWARDS'
Hi experts,
I can't get appropriate result using macro 'TIMESHIFT_FORWARDS()'. Please advise how to use this function.
I would like to shift key1 data by offset in Key2. I've tried like below two but never works.
Step(2008/10 to 2008/12)
ActionBox
TIMESHIFT_FORWARDS(
Area(Key1 which is Sales Quantity)
Area(Key2 which is Offset)
Step(2008/10 to 2008/12)
Key1 (2008/10)
TIMESHIFT_FORWARDS(
Area(Key1 which is Sales Quantity)
Area(Key2 which is Offset)
Please adivise if you ever tried this.Hi Anha,
Your syntax is not correct. Here is how it should be:
Step(2008/10 to 2008/12)
ActionBox
TIMESHIFT_FORWARDS(
Area{(Key1 which is Sales Quantity)(2008/10);(Key1 which is Sales Quantity)(2008/12)}
Area{(Key2 which is Offset)(2008/10);(Key2 which is Offset)(2008/12)}
In the above syntax, replace { by [ and { by ]. [ stands for tag link in this forum.
In case you are still in doubt, refer to the planning book 9AEXAMPLES in macro workbench ( /sapapo/advm)
Hope this helps -
I am a business man, and in many times a need a very important tool which I think an iphone should have which is some sort of app which will allow you to make changes to any xls file(Excel file).
I find apps that allow me to see and open these files but do not allow changing numbers on files with Macros.
A example is when you have a xls file using macros like in a simulator.
You have to change the values according to different client and it just doesn`t allow you.
I think iphone is a very decent phone but I just think that apple should povide this option to all users which would definately be alot happier.
I work at a finance company and need to use finance simulators with Macros.
Can you have an app that allows me to do this?Since Excel is a microsoft product, they would have to make the app.
"So why does apple even open these files when they belong to Microsoft?"
You prefer, since Apple does not make excel, that they not make it possible to even view an excel file?
Odd take. All or nothing? -
can't burn dvd that plays on dvd player. seems to be in file format. do i need extra software? using iMovie and final cut pro trail..both same result. have macbook pro 2012
NStrange wrote:
... confused about which video format(s) to use (e.g.: SWF, MPEG4, etc.), and whether or not I should use 3rd party compression software (e.g.: Sorenson Squeeze, Compression Master, etc.) along with / in addition to Final Cut Express (among other similar issues)...
FC/e is based upon the Quicktime-engine; so, on 'Export using QT', you'll get all codecs & settings.
but which one..
due to sheer popularity, YouTube became a 'standard' - I'm happy with the convenience, YT and the 'embed'-code offers - excellent quality, automatic adjusted to the watchers connection&hardware.
my export settings are 720p, h264, 6MBit/sec - gives a - imho! - superb quality.
(example of a 'screen-test' from my latest project CLICK )
for creating so-called 'flash video'/.flv, you need 3rd party apps.
Sorenson Squeeze is more of an pro-tool, .. you need some background knowledge to get noticeable 'better' quality.
.. and the question is: are you willing to pay $.$$$ for that 0.x% more quality .. ? does your source offers such a 101% quality, which needs such affords?
if bandwidth is an issue, because you're hosting on your own servers, consider the free codec xh264, you can install as a free QT-plug-in.. with low or super-low bitrates, it offers a superior quality compared to h264 ... -
I am trying to use macro express and adobe acrobat 9 profession keeps shutting down, why is this happening? I tried to run as administrator already as well on both Macro Express and in Adobe and it still keeps shutting down.
same problem, it's been happening to me for a week or two now i'm thinking about backing up my documents and just wiping it completely, see if that works. Has anyone else tried this? I'm loosing time and have already lost a good few hours of work as it just crashes randomly. need help!!!
- saving these threads on my favourites cause i'm about to crash . . . -
I need help. I use a Sony camera (HDR CX560) bought in US with NTSC as standard. I live in Europe and would like to burn a DVD for my Blue-Ray player showing it on my PAL TV.
The footage is 1080i, 1920x1080, 29,97 fps.
I have tried several different ways of achieving good results, but with no luck:
1. Editing in Final Cut Pro with original specs (1080i, 29,97). The result showing in FCP viewer is not perfect, but quite good. A little bit of stuttering and a bit blury pictures. I have tried "Send to Compressor...", selected MPEG-2 for DVD in Compressor (customized to 16:9 TV format). The process stops after a minute - a file is being created, but only the first 30 seconds of the movie is visible. I also tried Share>Export file using Compressor settings. The file created does not have acceptable quality, mostly bescause of very disturbing stripes. I also tried Share>Master file but the output is not good enough (using codec Apple ProRes422 (HQ) - same stripes.
2. Editing in Final Cut Pro with european standard (1080i, 25i). The result in FCP viewer is good with one exception - a lot of stuttering images while panning. I tried all the output/share alternatives mentioned above, with poor result.
I use OS X 10.8.3, Final Cut Pro X 10.0.8 and Compressor 4.0.7
Can anyone help?pnils wrote:
. Created a project with the original settings (1080i, 1920x1080, 29,97 fps).
FCP is usually pretty bullet proof in handling formats – and most of the time letting it set the project properties is the best way.
From what you've said about the camera and the footage, you shouldn't encounter any potential problems until after you export and start the standards conversion.
Create another project. When the new project dialogue window appears, make sure the settings are set to automatic (video properties set by first clip). Take one of the 1080i 60 clips and edit it to the timeline to set those properties. Export that clip as a test. If it plays smoothly, and it should, proceed to delete the clip from the project and paste the problem sequence to the new project. Delete all project render files and event render files. Now export (don't bother to re-render).
Post back with results.
Russ -
Need example report program using PNPCE LDB in SAP HR
Need example report program using PNPCE LDB in SAP HR.
and how to create a report category in sap hr for using it as cutomised selection screen.Hi,
Go through the following links, i hope it will help you.....
/people/alvaro.tejadagalindo/blog/2006/02/19/how-to-deal-with-hr-payroll-reports
http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/893908#
A sample prog with LDB PNP
*& Report ZH_REPT_PAYMENT *
report zh_rept_payment line-size 80 no standard page
heading.
tables: pernr, " Standard Selections for HR Master Data Reporting
pcl1, " HR Cluster 1
pcl2, " HR Cluster 2
pa0009,
PA9001,
PA9006,
pa0002,
pc260 , " Cluster Directory for Payroll Results
bnka .
Infotypes
infotypes: 0001. " Organizational Assignment
Declaration of Internal Tables
data : bnka1 like bnka occurs 0 with header line .
data: begin of t_int_rep occurs 100,
bankl like pc209-bankl, " Bank Number
zlsch like pc209-zlsch, " Payment method
pernr like pernr-pernr, " Employee Number
ename like pernr-ename, " Employee Name
bankn like pc209-bankn, " Bank Account Number
betrg like pc209-betrg, " Amount to be transfered
zweck like pa0009-zweck, " Purpose
end of t_int_rep.
data: begin of int_rep occurs 100,
bankl like pc209-bankl, " Bank Number
zlsch like pc209-zlsch, " Payment method
pernr like pernr-pernr, " Employee Number
ename like pernr-ename, " Employee Name
bankn like pc209-bankn, " Bank Account Number
betrg like pc209-betrg, " Amount to be transfered
zweck like pa0009-zweck, " Purpose
begda like pa0009-begda, "Begin date
end of int_rep.
Declaration of Data Variables
data: ws_betrg like pc209-betrg, " BT Amount
w_val like spell occurs 0 with header line,
int_rep1(6), " TYPE I, " Employee Number
cnt type i value 0, " Counter
calcmolga like t500l-molga value '40', " Country Grouping
v_id(15),
calc_currency like t001-waers value 'INR'. " Currency
data : ctr type i,
dt_merge like pa0009-begda.
data: ws_totemp(6) type c,
ws_totamt(20) type c,
r_mth(9) type c,
ws_fpbeg(6) type c,
ws_fpend(6) type c,
ws_mthyr(6) type c,
ws_mthyr_r(14) type c,
r_mth_t(3) type c,
ws_amt(8) type c,
ws_bankl(14) type c,
ws_date(6) type c,
amount_word(500),
total_page type i,
pages type i,
remain type i.
data begin of i_spell.
include structure spell .
data end of i_spell .
data : c_molga type t500l-molga value '40',
c_banks type bnka-banks value 'IN'.
Standard Includes
include rpc2cd09. "Cluster CD data definition
include pc2rxin0.
include rpc2rx09.
include rpppxd00. " Data Definition buffer PCL1/PCL2
include rpppxd10. " Common Part buffer PCL1/PCL2
include rpppxm00. " Buffer Handling RoutinePCL1/PCL2
include zrpc2rox2. " Data Definition POCLSTERS (not J,K,U)
Selection Screen
selection-screen begin of block b1 with frame title text-001.
parameter: pa_mth(2) type c default sy-datum+4(2) obligatory,
pa_year(4) type c default sy-datum(4) obligatory,
p_bankl like pc209-bankl, " Bank Number
p_zlsch like pc209-zlsch. " Payment method
selection-screen end of block b1.
save_calc_currency = calc_currency.
count_top = 0.
get_pernr_flag = 0.
Top-Of-Page
top-of-page.
perform convert_month using pa_mth(2) r_mth.
ws_mthyr_r = r_mth.
concatenate ws_mthyr_r pa_year into ws_mthyr_r separated by space.
SKIP 5.
skip 1.
skip 4.
if int_rep-bankl eq ' '.
if int_rep-zlsch eq 'C' or int_rep-zlsch eq 'E' or
int_rep-zlsch eq ' '.
write: /1(85) 'CHEQUE PAYMENT STATEMENT'(047) centered.
elseif int_rep-zlsch eq 'L'.
write: /1(85) 'DEMAND DRAFT STATEMENT'(047) centered.
endif.
else.
write: /1(85) 'BANK TRANSFER STATEMENT'(002) centered.
endif.
skip.
write: /34 ws_mthyr_r,
62 'Page :'(008),69(2) sy-pagno intensified off,
' Of ',78(2) pages intensified off.
clear pages.
read table bnka1 with key bankl = int_rep-bankl .
if sy-subrc = 0.
if int_rep-zlsch eq 'T'.
write:/03(10) 'Bank Name : ', bnka1-banka.
write:/03(10) 'Branch : ', bnka1-brnch.
write:/03(10) 'Address : ', bnka1-stras.
endif.
endif.
skip.
write:/1(80) sy-uline.
write: /1 sy-vline, 2(5) 'Sl.No'(002),
7 sy-vline, 8(8) 'Emp.No.'(003),
16 sy-vline,17(35) 'Employee Name'(004).
*--added for Demand Draft
if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
write : 47 sy-vline, 48(15) 'Payable at'(005).
else.
write : 47 sy-vline,48(15) 'Account No.'(005).
endif.
write: 63 sy-vline,64(16) 'Amount'(006),
80 sy-vline.
write:/1(80) sy-uline.
end-of-page.
write:/1(80) sy-uline.
write:/2 'Printed on ', sy-datum.
Start-of-selection.
start-of-selection.
*perform h_headr.
ctr = 0.
set margin 5.
call function 'RP_GET_CURRENCY'
exporting
molga = calcmolga
importing
waers = calc_currency
exceptions
others.
if sy-subrc ne 0.
calc_currency = 'DEM'.
calc_currency = save_calc_currency.
endif.
get pernr.
cd-key-pernr = pernr-pernr.
perform import_cluster.
get_pernr_flag = 1.
check : ocd-version-molga eq calcmolga.
The table 'tabpernr' is filled with the personnel numbers
and is used after selection is finished.
move-corresponding pernr to tabpernr.
append tabpernr.
The table 'tab_rgdir' is filled
loop at rgdir.
rx-key-pernr = pernr-pernr.
unpack rgdir-seqnr to rx-key-seqno.
perform int_tab. "fill tab_rgdir
perform import_bt.
perform validate.
endloop.
End of Selection
end-of-selection.
*perform h_headr.
perform convert_date_a using pa_mth r_mth_t.
sort int_rep by bankl zlsch pernr betrg descending.
delete adjacent duplicates from int_rep
comparing bankl zlsch pernr .
sort int_rep by bankl zlsch bankn . "PERNR.
loop at int_rep.
at new bankl.
select single * into bnka1 from bnka
where banks = c_banks and
bankl = int_rep-bankl .
append bnka1.
clear bnka1.
endat.
endloop.
for Demand Draft - purpose added
loop at int_rep.
concatenate pa_year(4) pa_mth(2) '01' into dt_merge.
select single * "zweck into int_rep-zweck
from pa0009 where
pernr = int_rep-pernr and
bankl = int_rep-bankl and
zlsch = int_rep-zlsch
and begda <= dt_merge and
endda >= dt_merge .
if sy-subrc = 0.
int_rep-zweck = pa0009-zweck.
modify int_rep.
endif.
endloop.
*-for DD and Chq sorted by PAyable at and EMPNO wise
if p_zlsch = 'T' .
sort int_rep by bankl zlsch bankn . "PERNR.
else. "added for "payable at" for DD/Chq
else.
sort int_rep by zweck pernr . "PERNR.
endif.
*delete adjacent duplicates from int_rep.
t_int_rep] = int_rep[.
loop at int_rep.
*-for page of page no.
total_page = 0.
loop at t_int_rep where bankl = int_rep-bankl
and zlsch = int_rep-zlsch.
total_page = total_page + 1.
endloop.
pages = total_page div 25.
remain = total_page mod 25.
comment bcoz its adding one extra page no.
done as on 29/11/2004
if remain > 0.
pages = pages + 1.
endif.
**-end
at new bankl.
ctr = 0 .
new-page.
endat.
at new zlsch.
ctr = 0 .
new-page.
endat.
clear v_id.
select single natio
into pa0002-natio
from pa0002
where pernr eq int_rep-pernr.
*-testing......for soma
if ctr > 24.
ctr = 0 .
write:/1(80) sy-uline.
new-page .
endif.
ctr = ctr + 1 .
cnt = cnt + 1.
pack int_rep-pernr to int_rep1.
write:/1 sy-vline, 2(3) cnt intensified off,
7 sy-vline, 9(6) int_rep1 intensified off,
16 sy-vline,17(35) int_rep-ename intensified off .
if ( int_rep-zlsch = 'l' or int_rep-zlsch = 'L' ).
write : 47 sy-vline,48(15) int_rep-zweck intensified off.
else.
write:
47 sy-vline,48(15) int_rep-bankn intensified off .
endif.
write: 63 sy-vline,64(16) int_rep-betrg
intensified off currency 'INR',
80 sy-vline.
ws_betrg = ws_betrg + int_rep-betrg.
*-testing......for soma
skip.
write :
/1 sy-vline, 7 sy-vline ,16 sy-vline ,47 sy-vline,63 sy-vline,80
sy-vline .
*-end testing......for soma
at end of zlsch.
if int_rep-bankl = ' '.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = ws_betrg
importing
amt_in_words = amount_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
w_val-word = amount_word.
concatenate 'INR.' w_val-word into w_val-word
separated by space.
write:/1(80) sy-uline.
write: /1 sy-vline, 7 'Total transfer:'(009),
64(16) ws_betrg intensified off currency 'INR',
80 sy-vline.
write:/1(80) sy-uline.
write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
80 sy-vline.
write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
80 sy-vline.
write:/1(80) sy-uline.
clear: ws_betrg,cnt.
skip 2.
write: /2 'Prepared by :'(010), '_______________'(013),
45 'Checked by :'(011),'_______________'(013).
skip 2.
write: /2 'Printed On ', sy-datum,
45 'Approved by :'(012),'_______________'(013).
clear sy-pagno.
endif.
endat.
at end of bankl.
if int_rep-bankl ' '.
call function 'HR_IN_CHG_INR_WRDS'
exporting
amt_in_num = ws_betrg
importing
amt_in_words = amount_word
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
w_val-word = amount_word.
concatenate 'INR.' w_val-word into w_val-word
separated by space.
write:/1(80) sy-uline.
write: /1 sy-vline, 7 'Total transfer:'(009),
64(16) ws_betrg intensified off currency 'INR',
80 sy-vline.
write:/1(80) sy-uline.
write: /1 sy-vline, 3 w_val-word+0(76) intensified off,
80 sy-vline.
write :/1 sy-vline, 10 w_val-word+76(70) intensified off,
80 sy-vline.
write:/1(80) sy-uline.
clear: ws_betrg,cnt.
skip 2.
write: /2 'Prepared by :'(010), '_______________'(013),
45 'Checked by :'(011),'_______________'(013).
skip 2.
write: /2 'Printed on ', sy-datum,
45 'Approved by :'(012),'_______________'(013).
clear sy-pagno.
NEW-PAGE.
endif.
endat.
endloop.
End of Page
end-of-page.
write: /2 'Prepared by :'(010), '_______________',
45 'Checked by :'(011),'_______________'.
*& Form IMPORT_CLUSTER
Importing Data from Cluster *
form import_cluster.
sy-subrc = 0.
rp-imp-c2-cd.
if sy-subrc eq 0.
if cd-version-number ne ocd-version-number.
endif.
endif. " SY-SUBRC EQ 0
endform. " IMPORT_CLUSTER
*& Form INT_TAB
Filling internal table tab_rgdir form int_tab.
*Fill internal table tab_rgdir.
move-corresponding rgdir to tab_rgdir.
tab_rgdir-pernr = pernr-pernr.
append tab_rgdir.
endform. " INT_TAB
*& Form IMPORT_bt
Import Values from Bank Transactions Table (BT) form import_bt.
rp-init-buffer.
RP-IMP-C2-RX.
rp-imp-c2-in.
if rp-imp-in-subrc eq 0.
if in-version-number ne oin-version-number.
write: / 'Schlüssel des Clusters RX:'(015),
rx-key-pernr, rx-key-seqno.
write: / 'The imported version of the cluster'(016), 'RX',
'is not current'(017).
write: / 'Imported version :'(018),
oin-version-number.
write: / 'Current version of cluster :'(019),
in-version-number.
stop.
else.
sy-subrc = 0.
endif.
else.
sy-subrc = 8.
write: /
'Inconsistencies between cluster directory and directory for'(020).
write: /
'No payroll results found for data in cluster directory'(021).
write : /
'Please contact hotline to solve the current problem'(022).
endif.
ws_fpbeg(2) = versc-fpbeg+4(2).
ws_fpbeg+2(4) = versc-fpbeg(4).
ws_fpend(2) = versc-fpend+4(2).
ws_fpend+2(4) = versc-fpend(4).
ws_mthyr(2) = pa_mth.
ws_mthyr+2(4) = pa_year.
check ws_mthyr = ws_fpbeg.
check ws_mthyr = ws_fpend.
loop at bt. "from pc209
int_rep-pernr = pernr-pernr.
int_rep-ename = pernr-ename.
int_rep-bankl = bt-bankl.
int_rep-bankn = bt-bankn.
int_rep-betrg = bt-betrg.
int_rep-zlsch = bt-zlsch.
append int_rep.
endloop.
IF P_BANKL ' ' AND P_ZLSCH ' '.
DELETE INT_REP WHERE BANKL P_BANKL.
ELSEIF P_BANKL = ' ' AND P_ZLSCH ' '.
DELETE INT_REP WHERE ZLSCH P_ZLSCH.
ELSEIF P_BANKL ' ' AND P_ZLSCH = ' '.
DELETE INT_REP WHERE BANKL P_BANKL.
ENDIF.
endform. " IMPORT_BT
*& Form CONVERT_MONTH
Fetching Month Text form convert_month using mth t_mth.
case mth.
when '01'.
t_mth = 'January'(023).
when '02'.
t_mth = 'February'(024).
when '03'.
t_mth = 'March'(025).
when '04'.
t_mth = 'April'(026).
when '05'.
t_mth = 'May'(027).
when '06'.
t_mth = 'June'(028).
when '07'.
t_mth = 'July'(029).
when '08'.
t_mth = 'August'(030).
when '09'.
t_mth = 'September'(031).
when '10'.
t_mth = 'October'(032).
when '11'.
t_mth = 'November'(033).
when '12'.
t_mth = 'December'(034).
endcase.
endform. " CONVERT_MONTH
*& Form CONVERT_DATE_A
Fetching Month Text * form convert_date_a using mth_t t_mth_t.
case mth_t.
when '01'.
t_mth_t = 'Jan.'(035).
when '02'.
t_mth_t = 'Feb.'(036).
when '03'.
t_mth_t = 'Mar.'(037).
when '04'.
t_mth_t = 'Apr.'(038).
when '05'.
t_mth_t = 'May.'(039).
when '06'.
t_mth_t = 'Jun.'(040).
when '07'.
t_mth_t = 'Jul.'(041).
when '08'.
t_mth_t = 'Aug.'(042).
when '09'.
t_mth_t = 'Sep.'(043).
when '10'.
t_mth_t = 'Oct.'(044).
when '11'.
t_mth_t = 'Nov.'(045).
when '12'.
t_mth_t = 'Dec.'(046).
endcase.
endform. " CONVERT_DATE_A
*& Form VALIDATE
text
--> p1 text
<-- p2 text form validate .
if p_bankl <> ' ' and p_zlsch ' '.
delete int_rep where bankl p_bankl.
elseif p_bankl = ' ' and p_zlsch ' '.
delete int_rep where zlsch p_zlsch.
elseif p_bankl ' ' and p_zlsch = ' '.
delete int_rep where bankl p_bankl.
endif.
endform. " VALIDATE
check this weblog.....
/people/dj.adams/blog/2003/11/13/food-for-thought-ldbs-and-abap-objects
Also , check the following link too.
http://www.datamanagementgroup.com/Resources/Articles/Article_1005_2.asp
Regards,
Harish -
Need some hints on using dbms_crypto
Hello,
I need some hints on using the dbms_crypto package to generate some password for the OID userpassword attribute. The passwordstring is stored in a format {CRYPT}dasdasdawdww, {SHA}jfsklefjskldjkdlkldf, {MD4}dfdsfgsdgdfewwe or {MD5}fsdfsdadsgdfg where the keyword in the curly brackets describes the encryption methods. I think CRYPT means DES, SHA means SHA-1.
The key for the DES encryption for UNIX password authentification is in the first 2 letters of the encrypted string. I wanna have an encryption function which encrypts the clear type passwords in the right format like this perl script:
#!/bin/perl
print crypt($ARGV[0],"HS");
#: crypt.pl Test123 # program fetch
HSF0Sx2zdrLoQ
Regards
HolgerHello,
meanwhile I made some investigations on the Problem
I tried this code:
DECLARE
input_string VARCHAR2 (200) := 'Test123';
output_string VARCHAR2 (200);
encrypted_raw RAW (2000); -- stores encrypted binary text
decrypted_raw RAW (2000); -- stores decrypted binary text
num_key_bytes NUMBER := 256/8; -- key length 256 bits (32 bytes)
key_bytes_raw RAW (32); -- stores 256-bit encryption key
encryption_type PLS_INTEGER := -- total encryption type
DBMS_CRYPTO.ENCRYPT_DES
+ DBMS_CRYPTO.CHAIN_CBC
+ DBMS_CRYPTO.PAD_PKCS5;
BEGIN
DBMS_OUTPUT.PUT_LINE ( 'Original string: ' || input_string);
key_bytes_raw := UTL_I18N.STRING_TO_RAW ( 'HS' );
encrypted_raw := DBMS_CRYPTO.ENCRYPT
src => UTL_I18N.STRING_TO_RAW (input_string, 'AL32UTF8'
typ => encryption_type,
key => key_bytes_raw
-- The encrypted value "encrypted_raw" can be used here
DBMS_OUTPUT.PUT_LINE ( 'Encrypted string: ' || encrypted_raw);
decrypted_raw := DBMS_CRYPTO.DECRYPT
src => encrypted_raw,
typ => encryption_type,
key => key_bytes_raw
DBMS_OUTPUT.PUT_LINE ('Decrypted string: ' || UTL_I18N.RAW_TO_CHAR (decr
ypted_raw, 'AL32UTF8'));
DBMS_OUTPUT.PUT_LINE ('Encrypted Char string: ' || UTL_I18N.RAW_TO_CHAR
(encrypted_raw, 'AL32UTF8'));
END;
/and got these error messages:
ERROR at line 1:
ORA-28234: key length too short
ORA-06512: at "SYS.DBMS_CRYPTO_FFI", line 3
ORA-06512: at "SYS.DBMS_CRYPTO", line 10
ORA-06512: at line 15In the next try:
DECLARE
input_string VARCHAR2 (200) := 'Test123';
output_string VARCHAR2 (200);
encrypted_raw RAW (2000); -- stores encrypted binary text
decrypted_raw RAW (2000); -- stores decrypted binary text
num_key_bytes NUMBER := 256/8; -- key length 256 bits (32 bytes)
key_bytes_raw RAW (32); -- stores 256-bit encryption key
encryption_type PLS_INTEGER := -- total encryption type
DBMS_CRYPTO.ENCRYPT_DES
+ DBMS_CRYPTO.CHAIN_CBC
+ DBMS_CRYPTO.PAD_PKCS5;
BEGIN
DBMS_OUTPUT.PUT_LINE ( 'Original string: ' || input_string);
key_bytes_raw := UTL_I18N.STRING_TO_RAW ( 'HS12345678901234' );
encrypted_raw := DBMS_CRYPTO.ENCRYPT
src => UTL_I18N.STRING_TO_RAW (input_string, 'AL32UTF8'
typ => encryption_type,
key => key_bytes_raw
-- The encrypted value "encrypted_raw" can be used here
DBMS_OUTPUT.PUT_LINE ( 'Encrypted string: ' || encrypted_raw);
decrypted_raw := DBMS_CRYPTO.DECRYPT
src => encrypted_raw,
typ => encryption_type,
key => key_bytes_raw
DBMS_OUTPUT.PUT_LINE ('Decrypted string: ' || UTL_I18N.RAW_TO_CHAR (decr
ypted_raw, 'AL32UTF8'));
DBMS_OUTPUT.PUT_LINE ('Encrypted Char string: ' || UTL_I18N.RAW_TO_CHAR
(encrypted_raw, 'AL32UTF8'));
END;
/I got some results which have nothing in common with the perl script:
Original string: Test123
Encrypted string: DE5668CD7762074C
Decrypted string: Test123
Encrypted Char string: ?h?bL
PL/SQL procedure successfully completed.Come to think of it I doubt if DBMS_CRYPTO is the right way to solve my problem. Any further hints?
Regards Holger -
How to use macro's functionality in a programe...?
hi,
i am siva,
i am new to abap,
i am not having clarity on how to use macro in a programe,
please send me any source code of a programe which
contain functionality of macros..?
and explain functionality of macros...?
i any of u know answer..
please send me source code of a programe that use macros...?
reguars,
siva.Hi,
<u>Macros:</u>
If you want to reuse the same set of statements more than once in a program, you can include
them in a macro. For example, this can be useful for long calculations or complex WRITE
statements. You can only use a macro within the program in which it is defined, and it can only
be called in lines of the program following its definition.
The following statement block defines a macro <macro>:
DEFINE <macro>.
<statements>
END-OF-DEFINITION.
You must specify complete statements between DEFINE and END-OF-DEFINITION. These
statements can contain up to nine placeholders (&1, &2, ..., &9). You must define the macro
before the point in the program at which you want to use it.
Macros do not belong to the definition part of the program. This means that the DEFINE...ENDOF-
DEFINITION block is not interpreted before the processing blocks in the program. At the
same time, however, macros are not operational statements that are executed within a
processing block at runtime. When the program is generated, macro definitions are not taken
into account at the point at which they are defined. For this reason, they do not appear in the
overview of the structure of ABAP programs [Page 44].
A macro definition inserts a form of shortcut at any point in a program and can be used at any
subsequent point in the program. As the programmer, you must ensure that the macro
definition occurs in the program before the macro itself is used. Particular care is required if you
use both macros and include programs, since not all include programs are included in the syntax
check (exception: TOP include).
To use a macro, use the following form:
<macro> [<p1> <p2> ... <p9>].
When the program is generated, the system replaces <macro> by the defined statements and
each placeholder &i by the parameter <pi>. You can use macros within macros. However, a
macro cannot call itself.
Ex:
DATA: RESULT TYPE I,
N1 TYPE I VALUE 5,
N2 TYPE I VALUE 6.
DEFINE OPERATION.
RESULT = &1 &2 &3.
OUTPUT &1 &2 &3 RESULT.
END-OF-DEFINITION.
DEFINE OUTPUT.
WRITE: / 'The result of &1 &2 &3 is', &4.
END-OF-DEFINITION.
OPERATION 4 + 3.
OPERATION 2 ** 7.
OPERATION N2 - N1.
The produces the following output:
The result of 4 + 3 is 7
The result of 2 ** 7 is 128
The result of N2 - N1 is 1
Here, two macros, OPERATION and OUTPUT, are defined. OUTPUT is nested in
OPERATION. OPERATION is called three times with different parameters. Note how
the placeholders &1, &2, ... are replaced in the macros.
Regards,
Bhaskar -
Disk needs to be repaired using the recovery HD
Hello,
I have received an error when running disk utility that says, "This disk needs to be repaired using the Recovery HD." This issue has popped on a couple of times on my previous MacBooks and maybe once on my current one.
I have followed the suggested protocol (restart + command + r), and I choose disk utilities from the menu at start-up. I have both verified and repaired the disk (my HD), and disk utility says there are no errors; however, when I do a normal restart and run disk utilities again, I get the error message This disk needs to be repaired" again. I have cycled through this process and each time verify and repair disk on the Recovery HD indicates that nothing is wrong while verifying the disk on normal startup results in the same error. I computer has also been laggy.
Any help would be appreciated.
Thankscomputer has also been laggy
When you have the problem, note the exact time: hour, minute, second.
These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
Launch the Console application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
The title of the Console window should be All Messages. If it isn't, select
SYSTEM LOG QUERIES ▹ All Messages
from the log list on the left. If you don't see that list, select
View ▹ Show Log List
from the menu bar at the top of the screen.
Each message in the log begins with the date and time when it was entered. Scroll back to the time you noted above.
Select the messages entered from then until the end of the episode, or until they start to repeat, whichever comes first.
Copy the messages to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
The log contains a vast amount of information, almost all of it useless for solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
Please don't indiscriminately dump thousands of lines from the log into this discussion.
Please don't post screenshots of log messages—post the text.
Some private information, such as your name, may appear in the log. Anonymize before posting. -
Need to calculate the area of a vector shape in Illustrator CS6
Hi All,
I need to calculate the area of vector graphics we are designing for a vinyl window sticker. I've read a couple of previous threads, and all the solutions provided either don't work (using cmd, option, shift F12 to open debugging menu to get area), or are beyond my level of experience (doing a build of the Telegraphics Path Area Filter). Does anyone have any solutions, or know how to access the debugging menu/window other than using cmd, shift, option F12....I couldn't even find it in the Shortcut Keys preferences). Thanks!Jacob
It worked very well - great stuff!. I am a physician and I am working on cardiac MRI.. such as calculating the heart function using slices of heart images in systole and diastole (when the heart is squeezed or full of blood).
.. we can write a little medical paper comparing really pricey software (GE, Siemens, Medis you name it..) with this method for people with not too many pennies in their pocket. The advantage of using Illustrator is that you can blow up the images up to the point of loosing resolution, and trace the margins of the heart with an accuracy that would make any GE guy cry for his mama..
I thought even a cm further.. for simple-minded people (such as physicians for example) one would like a way to input the area of one slice directly into an equation. For example would be a way to create a routine that would take the number of the area of one slice and input it in this equation? Such as to create a little square where you put the slice, you trace it and then the program takes that number and pitches it in the equation without you writing it down on a paper.
thanks again!
Avi -
Why we should use Macros if we have function Module
Why we should use Macros if we have function Module and what is the Advantage of Macros than function Module
Moderator Message: Interview-type questions are not allowed.
Edited by: kishan P on Oct 7, 2010 2:22 PMPut it this way... if you have blueprints for a car you wouldn't want to produce only one car, would you? You would want to produce as many as needed. In another example, you don't want to be able to use only 1 window in Windows. Each window has common features but have different values. That's the purpose of non-static entities
However, there are instances that you want to have only one value for something. That's when you use static entities.
Get it? =) -
Calculate result in the query output
Hi,
Consider the case below:
Order Item SalesAgent Quantity Price
555 10 SA1 10 100
SA2 10 100
SA1 20 200
In this case the correct result is (Quantity = 30 (1020) & Price = 300 (100200))
This is as one item can have multiple Sales Agent but the price for each sales agent still reflects the total price for that item (same for quantity). So just to sum up gives the wrong result (100+100 is incorrect, total should be only 100).
If I use calculate result as last value then for the total order it takes only 100.
How can I set a result row for the above case such that it show result as 300. (Price and Quantity are KFs)
Thank you,
samHi Sam,
Could you put the copied portion using the Code button while posting, so that its easy to understand.
Regards -
Bex Query Calculate Result as Ranked
Hi
i have a Bex Query that i am using to design crystal report....
Data output of query is
Country...$....Rank
US.......100...2
UK........200...1
CA........50....3
Rank is copy of "$" and used option "Calculate Result as " Ranked list in Property of Bex Query Designer.
so when i run the Bex Analyzer the rank shows up as 1,2,3
i am using the same bex query in Crystal report, and when i run crystal reports
the rank shows up as 50, 100,200 etc.
why does the rank 1,2,3 doesnot show up in crystal report
what is the other approach to use ranking in Crystal reportHi;
We can use the sort order function in ascending format on Rank object in the crytsal. Please try thgis option
Thanks
Afzal -
When using iPhoto can I remove some of the default options such as faces or flagged etc. from the left bar. There are more bits than I need for my basic use.
Hello Susan,
Not sure if I have fully understood your question but have you tried ...
iPhoto > iPhoto help > browse help > view and organise. Perhaps this touches on some of your needs.
Usually, best results for questions come from posting to the forum directly related to the question, in this case iPhoto. That tends to find the gurus
Would you like me to ask the hosts to relocate your question?
Maybe you are looking for
-
Charging IPOD SHUFFLE on a Windows 98 computer
Alright, my Ipod was purchased 2 days ago and I uploaded my music to it yesterday off of my friends computer(Win XP).. But my problem here is when i charge it on this computer that doesnt have Itunes or anything iPod related the orange light blinks c
-
Can an intel core duo 2Ghz iMac handle a 12Mbps internet connection?
Is a 12 Mbps internet connection speed too fast for an Intel core duo 2 GHz Imac?
-
UI Element with Mulitple selection
Hi, How can I select multiple data from any list box like as we do in SAP GUI.
-
Running Firefox causes a physical memory dump.
Every time I try to run the latest version of Firefox on Windows 7 I get a BSOD that shows a physical memory dump with messages like "bad_pool_header" or "system_service_exception." This happens even if I run Firefox in safe mode with all plugins dis
-
bonjour, voici mon probleme, en fait on a acheter un minimac a 2 avec un collegue qui ne parle pas un mot de francais, comme convenu apres son depart, je recupere le mac et la OH surprise, dans internationnal, quand je selectionne francais, ca marche