Get the string between li tags, with regular expression
I have a unordered list, and I want to store all the strings between the li tags (<li>.?</li>)in an array:
<ul>
<li>This is String One</li>
<li>This is String Two</li>
<li>This is String Three</li>
</ul>
This is what have so far:
<li>(.*?)</li>
but it is not correct, I only want the string without the li tags.
Thanks.
No one?
Anoyone here experienced with Regular Expression?
Similar Messages
-
Finding td /td tags with regular expressions
hi
first i thought that would be very easy and i used this expression:
String pattern = "<td.*>.*</td>";
but this didn't worke the way i wont. this expression returns hole body which is in between the first <td> and the last </td> tag t
hat means:
<td id=1>(some other tags and text)</td><td id=2>(some other tags and text)</td>
it retruns the whole string and no the two <td id=1>,</td> sections. now i have searched for a wokearound but i didn't finde an useful exaple
can anybody help me?
blub4everIt will work as long as there are no linefeeds in the start tag or the content, and there are no TD elements inside other TD elements. The first concern can be adressed by setting the DOTALL flag: String pattern = "(?s)<td.*?>.*?</td>";But if the tags can be nested, you have a problem: regexes don't handle nesting very well. By the way, you might find this site helpful:
http://www.regular-expressions.info/ -
How to get the difference between two columns in a column group
Hi All,
My first time here and really new to programming. I would like to get the difference between 2 columns that are inside
a column group.
Here is my sample table below: The Column Group is PeriodNumber and can only choose 2. like 1 and 2.. I would like to have a third row which will simply calculate the difference between the amounts in PeriodNumber 1 and 2.
PeriodNumber
Account 1 2
1) Cash 10,000 15,000
2) Receivables 12,000 11,500
3) Equipment 5,000 5,500
Total Assets 27,000 32,000Hi yabgestopa,
From your description, you want to get the difference between two columns in a column group. After testing it in my environment, we can use custom code to achieve your requirement. For more details, you can refer to the following steps:
Copy the custom code below and paste it to your report. (Right-click report>Report Properties>Code)
Dim Shared Num1 As Integer
Dim shared Num2 As Integer
Public Function GetAmount(Amount as Integer, Type as String)
If Type = "1" Then
Num1=Amount
Else
Num2=Amount
End If
Return Amount
End Function
Public Function GetDif()
Return Num1-Num2
End function
Right-click the second column to insert a third column with Outside Group-Right.
Then use the expressions below in the matrix.
=Code.GetAmount(Fields!Amount.Value,Fields!PeriodNumber.Value)
=code.GetAmount(Sum(Fields!Amount.Value),Fields!PeriodNumber.Value)
=Code.GetDif()
The report looks like below.
If you have any questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Getting the difference between 2 dates
Hi,
I am creating a Date object (using today;s day, month and year. hours and minutes come from a config file) and getting the difference between this date and the current date and time.
My code is as follows:
I am passing 07:30 into the method as the parameter aSstart_time.
Calendar newCalendar = Calendar.getInstance(Locale.UK);
SimpleDateFormat dtformat = new SimpleDateFormat("dd-MM-yy HH:mm");
int lIYear = newCalendar.get(newCalendar.YEAR);
int lIMonth = newCalendar.get(newCalendar.MONTH);
int lIDay = newCalendar.get(newCalendar.DAY_OF_MONTH);
String lSstartHrs = aSstart_time.substring(0,aSstart_time.indexOf(":"));
//System.out.println(">>>>>>>>> THE HOURS IS: " + lSstartHrs);
String lSstartMins = aSstart_time.substring(aSstart_time.indexOf(":")+1,aSstart_time.length());
//System.out.println(">>>>>>>>> THE MINS IS: " + lSstartMins);
java.util.Date ldStartTime = new java.util.Date(lIYear,lIMonth,lIDay, Integer.parseInt(lSstartHrs),Integer.parseInt(lSstartMins));
System.out.println("Year: " + lIYear);
System.out.println("Month: " + lIMonth);
System.out.println("Day: " + lIDay);
System.out.println("Hour: " + Integer.parseInt(lSstartHrs));
System.out.println("Min: " + Integer.parseInt(lSstartMins));
System.out.println("The number of milliseconds for current time is: " + newCalendar.getTime().getTime());
System.out.println("The number of milliseconds for 07:30 is: " + ldStartTime.getTime());
System.out.println("calendar time: " + dtformat.format(newCalendar.getTime()).toString());
System.out.println("created time: " + dtformat.format(ldStartTime).toString());
if(newCalendar.getTime().getTime() < ldStartTime.getTime()){
System.out.println("The current time is less than the config time (07:30)");
else{
System.out.println("The time is greater than 07:30");
}When I run this program at 10:06am I get the following output:
Year: 2006
Month: 1
Day: 15
Hour: 7
Min: 30
The number of milliseconds for current time is: 1139997962321
The number of milliseconds for 07:30 is: 61098132600000
calendar time: 15-02-06 10:06
created time: 15-02-06 07:30
The current time is less than the config time (07:30)
The Date.gettime() method should measure the number of milliseconds after 01-01-1970 so the number of milliseconds for the current time (10:06am) should be greater than the number of milliseconds for 07:30. A you can see in the above output this is not the case.
Anybody have any idea why this is happening. Am I using the .gettime() method for the correct purpose.
Any ideas or suggestions would be greatly appreciated.
ThanksIt is beacause Calendar use fully defined year as parameter, so Calendar.set(year + 1900, month, date, hrs, min) is (almost) equivalent to new Date(year, month, date, hrs, min)Example: int year = 85; // old way of specifying a year in a Date
int month = 3;
int date = 12;
int hrs = 12;
int min = 0;
Calendar cal = Calendar.getInstance();
cal.set(year + 1900, month, date, hrs, min);
Date d = new Date(year, month, date, hrs, min);
System.out.println(d);
System.out.println(cal.getTime());You will obtain the same date (except seconds and miliseconds in this case, as they probably won't be zero with Calendar.getInstance(); ) -
How to get the link between mara, ausp, cawn and cawnt tables
hello ABAPERS
i have got a requiremet in that i have to get the relation .
how to get the link between mara, ausp, cawn and cawnt tables and also type how can we get link between char value and char description in cawn and cawnt tables through ausp and mara tables.
I would be very thankful for ur help in advance.
Thanks & Regards.
soniHi,
Sample report using the linkage between tables;
report batch_char no standard page heading
line-size 132
line-count 58(1)
message-id mm.
Report by Batch Characteristic *
Description : Report by Batch Characteristic *
Declaration for Tables
tables: mara, " Material Master
mard, " Storage Location Data for Material
t001w, " Plants/Branches
t001l, " Storage Locations
cabn, " Characteristics
inob. " Link between Internal Number and Object
Declaration for Constants
constants : c_klart like ausp-klart value '023', " Class Type
c_obtab like inob-obtab value 'MCH1', " Database Table
c_flag type c value 'X', " Flag
c_c23 type i value '23', " Ratio
Constants for Ratio Categories
c_13 type p decimals 2 value '13.00', " For Ratio 13
c_1499 type p decimals 2 value '14.99', " For Ratio 14.99
c_15 type p decimals 2 value '15.00', " For Ratio 15
c_1699 type p decimals 2 value '16.99', " For Ratio 16.99
c_17 type p decimals 2 value '17.00', " For Ratio 17
c_1899 type p decimals 2 value '18.99', " For Ratio 18.99
c_19 type p decimals 2 value '19.00', " For Ratio 19
c_2099 type p decimals 2 value '20.99', " For Ratio 20.99
c_21 type p decimals 2 value '21.00', " For Ratio 21
c_2299 type p decimals 2 value '22.99', " For Ratio 22.99
c_23 type p decimals 2 value '23.00', " For Ratio 23
c_g23(4) type c value '>=23', " For Ratio >=23
c_ratio(5) value 'RATIO', " For Ratio
Constants for Storing Selected item field information
c_cursor1(15) value 'I_OUTPUT1-MEINS', " For Selected Base
" Unit of Measure
c_cursor2(15) value 'I_OUTPUT1-MATNR', " For Selected Base
" Material Number
c_cursor3(15) value 'I_OUTPUT1-MAKTX', " For Selected Base
" Material Des.
c_cursor4(15) value 'I_OUTPUT1-CLABS', "For Selected Base
" Stock Value
c_cursor5(15) value 'I_OUTPUT1-ATFLV', " For Selected Base
" Char.Value (Ratio)
c_cursor6(5) value 'C_G23'.
Declaration for Global Variables
data : g_exit type c, " Flag
g_clabs1(16) type c, " Quantity
g_clabs(18) type c, " Quantity
g_cursor(15) type c, " Cursor field name
g_matnr type mara-matnr, " Material Number
g_werks type mchb-werks, " Plant
g_atinn(30) type c. " Character.
Declaration for Internal tables
Internal table to hold Batch Stock data
data : begin of i_mchb occurs 0,
matnr like mchb-matnr, " Material Number
werks like mchb-werks, " Plant
lgort like mchb-lgort, " Storage Location
charg like mchb-charg, " Batch Number
clabs like mchb-clabs, " Stock Value
meins like mara-meins, " Unit of measure
atflo like ausp-atflv, " Char.Value (Ratio)
atflv like ausp-atflv, " Char.Value (Ratio)
end of i_mchb.
Internal table to hold Secondary List data
data : begin of i_mchb1 occurs 0,
werks like mchb-werks, " Plant
matnr like mchb-matnr, " Material Number
lgort like mchb-lgort, " Storage Location
charg like mchb-charg, " Batch Number
atinn like ausp-atinn, " Char.Value
clabs like mchb-clabs, " Stock Value
atflo like ausp-atflv, " Char.Value (Ratio)
atflv like ausp-atflv, " Char.Value (Ratio)
end of i_mchb1.
Internal table to get the Plant Name
data : begin of i_plant occurs 0,
werks like t001w-werks, " Plant
name1 like t001w-name1, " Name
end of i_plant.
Internal table to get the Material Description
data : begin of i_makt occurs 0,
matnr like makt-matnr, " Material
maktx like makt-maktx, " Description
end of i_makt.
Internal table to hold AUSP data
data : begin of i_ausp occurs 0,
objek like ausp-objek, " Object No
atinn like cabn-atinn, " Characteric value
atflv like ausp-atflv, " Characteristic Value
end of i_ausp.
Internal table to hold output data
data : begin of i_output occurs 0,
atinn like cabn-atinn, " Characteric value
werks like mchb-werks, " Plant
matnr like mchb-matnr, " Material Number
atnam like cabn-atnam, " Characteristic
atflv like ausp-atflv, " Char.Value (Ratio)
name1 like t001w-name1, " Plant Description
maktx like makt-maktx, " Material Description
clabs like mchb-clabs, " Stock Value
meins like mara-meins, " Base Unit of Measure
end of i_output.
Internal table to hold final Output data
data : begin of i_output1 occurs 0,
atinn like cabn-atinn, " Characteric value
werks like mchb-werks, " Plant
matnr like mchb-matnr, " Material Number
atnam like cabn-atnam, " Characteristic
atflv(32) type c, " Char.Value (Ratio)
name1 like t001w-name1, " Plant Description
maktx like makt-maktx, " Material Description
clabs like mchb-clabs, " Stock Value
meins like mara-meins, " Base Unit of Measure
end of i_output1.
Selection screen
selection-screen begin of block b1 with frame title text-001.
select-options: s_werks for t001w-werks obligatory, " Plant
s_lgort for t001l-lgort, " Stor.Location
s_matnr for mara-matnr obligatory, " Material No
s_atinn for cabn-atinn. " Character.
selection-screen end of block b1.
At selection screen
at selection-screen.
Validation of Selection Screen Fields
perform validate_screen.
Start of selection
start-of-selection.
Get the Material and Batch Stock data from MARA and MCHB Tables
perform get_mat_stock_data.
Get the Material Group Text and Plant Name from T023T and T001W Tables
perform get_plant_grp_data.
Append the data into final Output Internal Table after getting the
Characteristic Values data from INOB and AUSP Tables
perform append_final_data.
Processing if the Characteristics contain 'RATIO'
perform collect_ratio.
End-of-Page
end-of-page.
write /1(125) sy-uline.
End of selection
end-of-selection.
if g_exit <> c_flag.
Display the Report Output data
perform display_report.
endif.
Top-of-Page
top-of-page.
Write the Report and Column Headings
perform get_headings.
at line-selection
at line-selection.
if sy-lsind = 1.
perform display_batch.
endif.
Top of page during line-selection
top-of-page during line-selection.
perform heading_seclist.
Form validate_screen
Validation of Selection Screen fields
form validate_screen.
Validation of Plant
clear t001w.
if not s_werks[] is initial.
select werks
into t001w-werks
from t001w
up to 1 rows
where werks in s_werks.
endselect.
if sy-subrc <> 0.
message e899 with 'Enter Valid Plant'(002).
endif.
endif.
Validation of Material Number
clear mara.
if not s_matnr[] is initial.
select matnr
into mara-matnr
from mara
up to 1 rows
where matnr in s_matnr.
endselect.
if sy-subrc <> 0.
message e899 with 'Enter Valid Material'(003).
endif.
endif.
Validation of Storage Location
clear t001l.
if not s_lgort[] is initial.
select lgort
into t001l-lgort
from t001l
up to 1 rows
where lgort in s_lgort.
endselect.
if sy-subrc <> 0.
message e899 with 'Enter Valid Storage Location'(004).
endif.
endif.
Validation of Characteristic Value
clear cabn.
if not s_atinn[] is initial.
select atinn
into cabn-atinn
from cabn
up to 1 rows
where atinn in s_atinn.
endselect.
if sy-subrc <> 0.
message e899 with 'Enter Valid Characteristic Value'(005).
endif.
endif.
Validation of Plant, Material and Storage Location
clear mard.
select matnr werks lgort
into (mard-matnr, mard-werks, mard-lgort)
from mard
up to 1 rows
where matnr in s_matnr and
werks in s_werks and
lgort in s_lgort.
endselect.
if sy-subrc <> 0.
message e899 with 'No Data found for the Selection Criteria'(006).
endif.
endform. "validate_screen
*& Form get_headings
Write the Report and Column Headings
form get_headings.
data: l_repid type sy-repid.
l_repid = sy-repid.
call function 'Y_STANDARD_HEADING'
exporting
repid = l_repid
heading1 = sy-title.
write:/1(125) sy-uline.
format color col_heading on.
write : /1 sy-vline, 2(18) 'Material Number'(008) centered,
20 sy-vline, 21(40) 'Material Description'(011) centered,
61 sy-vline, 62(22) 'Ratio'(009) centered,
84 sy-vline, 85(18) 'Quantity'(010) centered,
103 sy-vline, 104(20) 'Base Unit of Measure'(015) centered,
125 sy-vline.
write:/1(125) sy-uline.
format color off.
endform. "get_headings
*& Form get_mat_stock_data
Get the Material and Batch Stock data from MARA and MCHB Tables
form get_mat_stock_data.
clear: i_mchb,i_output, i_output1.
refresh: i_mchb,i_output, i_output1.
select a~matnr " Material Number
b~werks " Plant
b~lgort " Storage Location
b~charg " Batch Number
b~clabs " Stock Value
a~meins " Base Unit of Measure
into table i_mchb
from mara as a inner join mchb as b
on amatnr eq bmatnr
where b~matnr in s_matnr and
b~werks in s_werks and
b~lgort in s_lgort.
if sy-subrc <> 0.
g_exit = c_flag.
message s899 with 'No Data found for the Selection Criteria'(006).
stop.
endif.
sort i_mchb by matnr werks lgort charg.
endform. " get_mat_stock_data
*& Form get_plant_grp_data
Get the Material Group Text and Plant Name from T023T and T001W
form get_plant_grp_data.
if not i_mchb[] is initial.
Get the Plant Description from t001w Table
clear i_plant.
refresh i_plant.
select werks " Plant
name1 " Name
into table i_plant
from t001w
for all entries in i_mchb
where werks = i_mchb-werks.
Get the Material Description from MAKT Table
clear i_makt.
refresh i_makt.
select matnr " Material number
maktx " Material Description
into table i_makt
from makt
for all entries in i_mchb
where matnr = i_mchb-matnr and
spras = sy-langu.
sort i_plant by werks.
delete adjacent duplicates from i_plant comparing werks.
sort i_makt by matnr.
delete adjacent duplicates from i_makt comparing matnr.
endif.
endform. "form get_plant_grp_data.
*& Form append_final_data
Append the data into final Internal Table
form append_final_data.
data : l_matbatch(28),
l_tabix like sy-tabix.
if not i_mchb[] is initial.
loop at i_mchb.
l_tabix = sy-tabix.
clear l_matbatch.
concatenate i_mchb-matnr i_mchb-charg into l_matbatch.
move-corresponding i_mchb to i_output.
Get the Plant Description from i_plant Table
read table i_plant with key werks = i_mchb-werks binary search.
if sy-subrc = 0.
i_output-name1 = i_plant-name1.
endif.
Get the Material Description from i_makt Table
read table i_makt with key matnr = i_mchb-matnr binary search.
if sy-subrc = 0.
i_output-maktx = i_makt-maktx.
endif.
Get the Characteristic Values data from INOB and AUSP Tables
clear inob.
select single cuobj from inob
into inob-cuobj
where klart = c_klart and
obtab = c_obtab and
objek = l_matbatch.
if sy-subrc = 0.
select objek
atinn
atflv
from ausp
into table i_ausp
where objek = inob-cuobj and
atinn in s_atinn and
klart = c_klart.
sort i_ausp by objek atinn.
loop at i_ausp.
clear cabn.
select single atinn atnam from cabn
into (cabn-atinn,cabn-atnam)
where atinn = i_ausp-atinn.
if sy-subrc = 0.
If the ratio value is between 13-14.99, display 13
if cabn-atnam cs c_ratio.
if i_ausp-atflv between c_13 and c_1499.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_13.
If the ratio value is between 15-16.99, display 15
elseif i_ausp-atflv between c_15 and c_1699.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_15.
If the ratio value is between 17-18.99, display 17
elseif i_ausp-atflv between c_17 and c_1899.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_17.
If the ratio value is between 19-20.99, display 19
elseif i_ausp-atflv between c_19 and c_2099.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_19.
If the ratio value is between 21-22.99, display 21
elseif i_ausp-atflv between c_21 and c_2299.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_21.
If the ratio value is greater than or equal to 23, display 23
elseif i_ausp-atflv >= c_23.
i_mchb-atflo = i_ausp-atflv.
i_mchb-atflv = c_23.
endif. " Condition for RATIO values
else. " If characteristic does contain RATIO
i_mchb-atflv = i_ausp-atflv.
endif.
i_output-atinn = cabn-atinn.
i_output-atnam = cabn-atnam.
i_output-atflv = i_ausp-atflv.
i_mchb1-matnr = i_mchb-matnr.
i_mchb1-werks = i_mchb-werks.
i_mchb1-lgort = i_mchb-lgort.
i_mchb1-charg = i_mchb-charg.
i_mchb1-clabs = i_mchb-clabs.
i_mchb1-atinn = i_ausp-atinn.
i_mchb1-atflo = i_mchb-atflv.
i_mchb1-atflv = i_ausp-atflv.
append : i_output, i_mchb1.
clear i_mchb1.
modify i_mchb index l_tabix transporting atflo atflv .
endif.
endloop.
endif.
endloop.
endif.
Checking whether the table is filled or not
if not i_output[] is initial.
sort i_output by atinn werks matnr atflv.
else.
g_exit = c_flag.
message s899 with 'No Data found for the Selection Criteria'(006).
endif.
Delete the records where RATIO is less than 13.
delete i_output where atnam cs c_ratio and atflv lt c_13.
endform. "append_final_data
*& Form display_report
Display the Report Output data
form display_report.
data: l_tabix like sy-tabix.
loop at i_output1.
l_tabix = sy-tabix.
At new Characteristic
at new atinn.
read table i_output1 index l_tabix.
format color 1 intensified on.
write: /1 sy-vline, 2(20) 'Characteristic Name:'(007),
23(40) i_output1-atnam,
125 sy-vline.
format color off.
format color 4 intensified on.
write: /1 sy-vline, 2(20) 'Plant Name :'(022),
23(4) i_output1-werks, 29(30) i_output1-name1,
125 sy-vline.
format color off.
write /1(125) sy-uline.
endat.
clear: g_clabs, g_clabs1.
format color col_normal.
write :/1 sy-vline, 2(18) i_output1-matnr,
20 sy-vline, 21(40) i_output1-maktx,
61 sy-vline.
if i_output1-atflv = c_c23.
write: 62(22) c_g23 centered.
else.
shift i_output1-atflv left deleting leading space.
write: 62(22) i_output1-atflv centered.
endif.
write: 84 sy-vline,
103 sy-vline,
110(5) i_output1-meins.
If the quantity value is negative
if i_output1-clabs ge 0.
write: 85(18) i_output1-clabs unit i_mchb-meins,
125 sy-vline.
else.
i_output1-clabs = - i_output1-clabs.
write i_output1-clabs unit i_mchb-meins to g_clabs1.
condense g_clabs1.
concatenate '(' g_clabs1 ')' into g_clabs separated by space.
write: 85(18) g_clabs right-justified,
125 sy-vline.
endif.
format color off.
hide : i_output1.
new-line.
At end of material
at end of matnr.
sum.
move : i_output1-matnr to g_matnr.
format color 3 intensified on.
write /1(125) sy-uline.
write :/1 sy-vline, 2(25) 'Total for Material :'(012),
28(18) g_matnr.
if i_output1-clabs ge 0.
write: 85(18) i_output1-clabs unit i_mchb-meins,
125 sy-vline.
else.
i_output1-clabs = - i_output1-clabs.
write i_output1-clabs unit i_mchb-meins to g_clabs1.
condense g_clabs1.
concatenate '(' g_clabs1 ')' into g_clabs separated by space.
write: 85(18) g_clabs right-justified,
125 sy-vline.
endif.
write: 125 sy-vline.
format color off.
write /1(125) sy-uline.
endat.
At end of plant
at end of werks.
sum.
move : i_output1-werks to g_werks.
format color 3 intensified off.
write :/1 sy-vline, 2(25) 'Total for Plant :'(013),
28(4) g_werks.
if i_output1-clabs ge 0.
write: 85(18) i_output1-clabs unit i_mchb-meins,
125 sy-vline.
else.
i_output1-clabs = - i_output1-clabs.
write i_output1-clabs unit i_mchb-meins to g_clabs1.
condense g_clabs1.
concatenate '(' g_clabs1 ')' into g_clabs separated by space.
write: 85(18) g_clabs right-justified,
125 sy-vline.
endif.
format color off.
write /1(125) sy-uline.
endat.
At end of characteristic
at end of atinn.
read table i_output1 index l_tabix.
sum.
format color 3 intensified on.
write :/1 sy-vline, 2(25) 'Total for Characteristic:'(014),
28(25) i_output1-atnam.
if i_output1-clabs ge 0.
write: 85(18) i_output1-clabs unit i_mchb-meins,
125 sy-vline.
else.
i_output1-clabs = - i_output1-clabs.
write i_output1-clabs unit i_mchb-meins to g_clabs1.
condense g_clabs1.
concatenate '(' g_clabs1 ')' into g_clabs separated by space.
write: 85(18) g_clabs right-justified,
125 sy-vline.
endif.
format color off.
write /1(125) sy-uline.
endat.
endloop.
endform. " display_report
*& Form DISPLAY_BATCH
Display the batch details for the seclected material *
form display_batch.
Get the batch details for the selected material
get cursor field g_cursor.
if g_cursor = c_cursor1 or
g_cursor = c_cursor2 or
g_cursor = c_cursor3 or
g_cursor = c_cursor4 or
g_cursor = c_cursor5 or
g_cursor = c_cursor6.
format color 3.
write: /1 sy-vline,
2(17) 'Material Number :'(020),
20(17) i_output1-matnr,
94 sy-vline.
format color off.
write /1(94) sy-uline.
loop at i_mchb1 where matnr = i_output1-matnr and
atinn = i_output1-atinn and
atflo = i_output1-atflv.
format color col_normal.
shift i_mchb1-charg left deleting leading '0'.
write :/1 sy-vline, 2(16) i_mchb1-lgort centered,
18 sy-vline, 19(17) i_mchb1-charg centered,
36 sy-vline.
if i_output1-atnam cs c_ratio.
write: 37(29) i_mchb1-atflv
exponent 0 decimals 2 centered.
else.
write : 37(29) i_mchb1-atflv
exponent 0 decimals 0 centered.
endif.
write : 66 sy-vline, 67(27) i_mchb1-clabs unit i_mchb-meins,
94 sy-vline.
format color off.
endloop.
write /1(94) sy-uline.
else.
message s899 with 'Invalid cursor position'(016).
exit.
endif.
endform. " DISPLAY_BATCH
*& Form HEADING_SECLIST
Write the Column Headings for Interactive Report
form heading_seclist.
write /1(94) sy-uline.
format color col_heading on.
write :/1 sy-vline, 2(16) 'Storage Location'(021),
18 sy-vline, 19(17) 'Batch Number'(017) centered,
36 sy-vline, 37(29) 'Characteristic Value'(018) centered,
66 sy-vline, 67(27) 'Quantity'(019) centered,
94 sy-vline.
write /1(94) sy-uline.
format color off.
endform. " HEADING_SECLIST
*& Form COLLECT_RATIO
Display the Characteristic ratio data
form collect_ratio.
loop at i_output.
clear g_atinn.
i_output1-atinn = i_output-atinn.
i_output1-atnam = i_output-atnam .
i_output1-werks = i_output-werks.
i_output1-name1 = i_output-name1.
i_output1-matnr = i_output-matnr.
i_output1-maktx = i_output-maktx.
i_output1-clabs = i_output-clabs.
i_output1-meins = i_output-meins.
call function 'CONVERSION_EXIT_ATINN_OUTPUT'
exporting
input = i_output-atinn
importing
output = g_atinn.
if g_atinn cs c_ratio.
If the ratio value is between 13-14.99, display 13
if i_output-atflv between c_13 and c_1499.
i_output1-atflv = c_13.
If the ratio value is between 15-16.99, display 15
elseif i_output-atflv between c_15 and c_1699.
i_output1-atflv = c_15.
If the ratio value is between 17-18.99, display 17
elseif i_output-atflv between c_17 and c_1899.
i_output1-atflv = c_17.
If the ratio value is between 19-20.99, display 19
elseif i_output-atflv between c_19 and c_2099.
i_output1-atflv = c_19.
If the ratio value is between 21-22.99, display 21
elseif i_output-atflv between c_21 and c_2299.
i_output1-atflv = c_21.
If the ratio value is greater than or equal to 23, display 23
elseif i_output-atflv >= c_23.
i_output1-atflv = c_23.
endif.
write i_output1-atflv to i_output1-atflv .
else.
write i_output-atflv to i_output1-atflv exponent 0 decimals 0.
endif.
collect i_output1.
clear i_output1.
endloop.
sort i_output1 by atinn werks matnr atflv.
endform. " COLLECT_RATIO
Reward if useful..
Regards,
Anji -
How do you get the integer of a number with more than 10 digits
I can't seem to be able to get the integer of a number with more than 10 digits.
ex:
integer(12345678901.3) returns -539222987 when it should really return 12345678901
Thanks for the help
(I'm on director 11 at the moment)You can write a Parent script to represent Big Integers. I wrote some code to get you started. It consist of two classes - "BigInt" and "Digit". At this point you can only add two "BigInts" and print out the value with a toString() function. Note that you pass a String to the "BigInt" constructor.
In the message window you could enter something like:
x = script("BigInt").new("999999999999")
y = script("BigInt").new("100000000000000000004")
z = x.add(y)
put z.toString()
And the output window will show:
-- "100000001000000000003"
Here are the two Parent scripts / Classes
-- Digit
property val
property next
on new me, anInt
val = anInt
next = 0
return me
end new
-- BigInt
property Num
property StringRep
on new me, aString
Num = script("Digit").new(Integer(aString.char[aString.length]))
curNum = Num
repeat with pos = aString.length - 1 down to 1
curNum.next = script("Digit").new(Integer(aString.char[pos]))
curNum = curNum.next
end repeat
return me
end new
on add me , Num2
curNum = Num
curNum2 = Num2.Num
result = curNum.val + curNum2.val
if result > 9 then
carry = 1
else
carry = 0
end if
result = result mod 10
sum = script("Digit").new(result)
curSum = sum
curNum = curNum.next
curNum2 = curNum2.next
repeat while curNum.ObjectP AND curNum2.ObjectP
result = curNum.val + curNum2.val + carry
if result > 9 then
carry = 1
else
carry = 0
end if
result = result mod 10
curSum.next = script("Digit").new(result)
curSum = curSum.next
curNum = curNum.next
curNum2 = curNum2.next
end repeat
repeat while curNum.ObjectP
result = curNum.val + carry
if result > 9 then
carry = 1
else
carry = 0
end if
result = result mod 10
curSum.next = script("Digit").new(result)
curSum = curSum.next
curNum = curNum.next
end repeat
repeat while curNum2.ObjectP
result = curNum2.val + carry
if result > 9 then
carry = 1
else
carry = 0
end if
result = result mod 10
curSum.next = script("Digit").new(result)
curSum = curSum.next
curNum2 = curNum2.next
end repeat
StringRep = ""
me.makeString(sum)
return me.script.new(StringRep)
end add
on toString me
StringRep = ""
me.makeString(Num)
return StringRep
end toString
on makeString me, digit
if not digit then
return
end if
me.makeString(digit.next)
put String(digit.val) after StringRep
end makeString -
Query to get the difference between 2 totals from 2 different queries
I wanted to know if it is possible to get the difference between 2 totals from 2 different queries. I would explain with an example:
1st query - Select sum(homepass) from table 1
2nd query – select sum(homepass) from table2
Is it possible to display the difference like-
Select sum(homepass) from table 1 - sum(homepass) from table2
I know the above query would gives syntax error but is there a better way or a trick to get the above task accomplished from a single query.
I hope, my question is clear.
Please revert with the reply to my query.
Regardstomernitin wrote:
Try this one also:
WITH adtn1
AS
SELECT 110 val1 FROM dual UNION ALL
SELECT 100 FROM dual UNION ALL
SELECT 90 FROM dual UNION ALL
SELECT 10 FROM dual
adtn2
AS
SELECT 10 val2 FROM dual UNION ALL
SELECT 20 FROM dual UNION ALL
SELECT 30 FROM dual UNION ALL
SELECT 100 FROM dual
SELECT(Sum(a1.val1)-Sum(a2.val2)) Diff FROM adtn1 a1,adtn2 a2;
let me know if you still have any doubt.
Um.... I don't think so. Not with the cartesian join between a1 and 2. -
What's the difference between XI basis and regular basis?
I am an SAP basis admin for years.
Now my corp starts to use XI.
What is the difference between XI basis and regular basis if there is any?
Thanks!Hi,
No difference... Basis is Basis (Technical consultant)... According to me its just terminology changed. i.e. SAP Administrator instead of SAP basis.
For XI you may need to additionally control the Java stack administartion along with ABAP stack.
Please go thourgh the below link to know about SAP NetWeaver Administrator, then you may compare with regular Basis activities
http://help.sap.com/saphelp_nw70/helpdata/en/7e/c82c42be6fde2ce10000000a1550b0/frameset.htm
Also
Refer - PI/XI administartion study material links
PI Administration, monitoring document
Thanks
Swarup -
Get the string until first space
hi,
can anyone provide an example how to get the string until the first space?
i mean if the value is :
this is an example
how to get only the word "this" (before the very first space) by select?
thanks in advance,There are several methods to achieve this:
SELECT SUBSTR(t.col1, 1, INSTR(t.col1 || ' ', ' ') - 1)
FROM (SELECT 'this is an example' col1
FROM dual) t
; or in 10g using regular expressions:
SELECT REGEXP_SUBSTR(t.col1, '^[^ ]+')
FROM (SELECT 'this is an example' col1
FROM dual) t
; C. -
Trying to Get the "Difference" Between Two Tracks
What I am trying to accomplish is this: I have an audio track of a voiceover with a music bed beneath it. I also have the bed music by itsself, without the voiceover. I want only the voice portion. Is there a way that I can "cancel out" the music portion or get the difference between the two tracks (just the voice portion)? It seems that there should be some means of doing this, but for the life of me I cannot figure out how to do it!
Any advice?If it's exactly the same music track, then as long as you line it up sample-accurate and the levels co-incide, you can do a simple subtractive process. You need both files available, trimmed to length. Open them both in Edit View, and copy one of them to the clipboard. Open the other, and select Mix-paste, and use the 'invert' option. That will effectively subtract one from the other, with the difference being your vocal.
Have to tell you though that the chances of getting this spot on are amazingly low... any errors at all leave you with bleed-through, about which you can do nothing. -
How to get the difference between these two dates
Hello Friends,
I need to get the difference between these two fields which store dates but with varchar2 data types
SELECT pac.segment1, pac.segment2 emp_no, pac.segment3 NAME,
pac.segment4 POSITION, pac.segment5 start_date, pac.segment6,
pac.segment7
FROM per_analysis_criteria pac, fnd_id_flex_structures_vl ffs
WHERE ffs.id_flex_structure_code = 'Employee Rejoin'
AND ffs.id_flex_num = pac.id_flex_num
AND TO_CHAR (TO_DATE (pac.segment7, 'YYYY/MM/DD HH24:MI:SS'))
- TO_CHAR (TO_DATE (pac.segment6, 'YYYY/MM/DD HH24:MI:SS')) > 1;
my query is something like this...
am trying to find the difference between the last two columns but with not much luck..
can some one suggest me a solution pleaseSELECT pac.segment1, pac.segment2 person_id, pac.segment3 NAME,
papf.employee_number, paaf.supervisor_id, pac.segment4 POSITION,
pac.segment5 start_date, pac.segment6, pac.segment7,
papf2.email_address,
( TO_DATE (TO_CHAR (pac.segment7), 'DD-MON-YYYY HH:MI:SS AM')
- TO_DATE (pac.segment6, 'DD-MON-YYYY HH:MI:SS AM')
+ 1
) difference,
POST.email_address
FROM per_analysis_criteria pac,
apps.fnd_id_flex_structures_vl ffs,
per_all_people_f papf,
per_all_assignments_f paaf,
per_all_people_f papf2,
(SELECT email_address, person_id
FROM per_all_people_f
WHERE person_id IN (
SELECT person_id
FROM per_all_assignments_f
WHERE position_id IN (SELECT position_id
FROM per_positions
WHERE NAME LIKE 'HR Manager.704.')
AND TRUNC (SYSDATE) BETWEEN effective_start_date
AND effective_end_date)
AND TRUNC (SYSDATE) BETWEEN effective_start_date AND effective_end_date
AND business_group_id = fnd_profile.VALUE ('PER_BUSINESS_GROUP_ID')) POST
WHERE ffs.id_flex_structure_code = 'Employee Rejoin'
AND TO_CHAR (papf.person_id) = pac.segment2
AND ffs.id_flex_num = pac.id_flex_num
AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date
AND papf.effective_end_date
AND papf.current_employee_flag = 'Y'
AND papf.person_id = paaf.person_id
AND TRUNC (SYSDATE) BETWEEN paaf.effective_start_date
AND paaf.effective_end_date
AND papf.person_id = paaf.person_id
AND papf2.person_id = paaf.supervisor_id
AND paaf.primary_flag = 'Y'
AND TRUNC (SYSDATE) BETWEEN papf2.effective_start_date
AND papf2.effective_end_date
AND papf2.current_employee_flag = 'Y'
and ( TO_DATE(to_char(pac.segment7), 'DD-MON-YYYY HH:MI:SS AM')-TO_DATE (pac.segment6, 'DD-MON-YYYY HH:MI:SS AM')+1) >1
last line is giving me the error pls suggest a solution -
What is the difference between sales order with picking and without picking
hi friends,
i would like to know what is the difference between sales order with picking and without picking.
thanks
skrishnanHello,
Picking refers to preparing the right quantity and quality of goods for shipping on schedule as required by the customer.
Once picking is configured, SAP Sd automatically generates picking lists and picking labels which can be tagged to the relevant goods. SAP can be configured to ensure that picked quantity is confirmed before goods are issued. This can be done using transaction code VSTK. In T-code VSTK, picking confirmations can be set, which ensure that goods picked for delivery are in accordance with picking slips.
Picking thus helps in monitoring each item using the picking status. Picking is normally done in SAP SD by a shipping clerk.
Prase -
How to get the string's byte length?
I have some string,I want to get the string's byte length,how
can do it?
for example:
<cfoutput>#len('hihi,这是测试')#</cfoutput>
output is 9
I want to get the byte length is 14, how can i get it?
Thanks.>> Fair cop. I didn't realise that asc() returned the
codepoint rather than the
> actual character code.
>
> and what would be the difference?
Oh, sorry, whatever the term is (I'm crap with jargon). The
value returned
by asc() for those chars was only two bytes (ie: four hex
digits). I
didn't realise there was more to it than that, and that
2-byte value maps
to some other THREE byte value. I need to do some reading...
> that's what both cf & java counted as the length.
CHARACTER length, sure. No-one's disputing that. On the other
hand,
no-one's asking about it, either.
> by adding a BOM you've already effected the encoding,
which may or may not
> match the original. so you still don't know how many
bytes were in the original
> string.
[groan]
Yes, that's a reasonable strawman there. I was only putting
it in a file
so I could save it and check the number of bytes occupied by
the data.
Clearly... CLEARLY... the OP is not asking for a character
length of that
string. They've said as much.
I copy and pasted the string from their post, and used it as
a
demonstration of how "nine" is not the right answer for the
BYTE LENGTH of
that string. Whether or not the original string was UTF-8,
UTF-16 or
special-marmoset-encoding, it almost certainly was NOT in a
fictitious kind
encoding in which each of those particular characters only
occupied one
byte each, which would mean that "nine" is the correct answer
to the
question.
When I copied those characters from either the web browser
for from my
text-based news agent, notepad identified them (and rendered
them
correctly) as UTF-8, so I'm fairly confident they ARE UTF-8.
Of course
this could be down to some intermediary encoding (pasting
them in to the
original posting, for example, via some encoding-transforming
mechanism),
but Occam's Razor suggests the original question was from a
UTF-8 POV.
But maybe we should quit speculating and ask the OP. Unless
they've
buggered off in despair of how drawn out all this is getting.
For which I
would not blame them.
Adam -
It is possible to get the new mac book air with the european keyboard in the USA?
It is possible to get the new mac book air with the european keyboard in the USA?
super keyword is used when there is inheritance (class extending other class). In your particular case, super keyword doesn�t make sense, since there isn�t inheritance between A and B. You can use the INT field by an instance of A class.
a keyword like "parent" does not exist in java. -
Hi, I have a late 2011 MacBook Pro but cant get the mirroring function to work with Apple TV. I've got the most recent Software 10.7.5 but cant see the mirroring icon or turn this on. I'm able to mirror from my Ipad but not my Mac, any thoughts?
Welcome to the Apple Support Communities
AirPlay Mirroring is supported on your Mac, but it needs OS X Mountain Lion (10.8). See > http://support.apple.com/kb/HT5404
You have two possibilities:
1. Make a backup, open App Store and purchase Mountain Lion to upgrade to this OS X. Then, you will find the AirPlay Mirroring icon at the top right of the display, on the menu bar, or on System Preferences > Displays.
2. Keep OS X Lion and use AirParrot > http://www.airparrot.com
Both options work properly, but I recommend AirPlay Mirroring as it doesn't need a third-party program
Maybe you are looking for
-
How to execute an expression which is in a string
hi i am facing one interesting problem i want to evaluate an expression like sin^2 (theta) * cos^2 (phi) which i am getting in string object something like expression entered by an user and i want to evaluate it in a program how do i do that i mean h
-
Migration to new 3TB Time Machine/Time Capsule?
From an earlier posting, I think A Silverstone asked for a step-by-step procedure. I have a similar issue I would like a procedure(s) on. Actually two identical issues. 1. I wish to purchase Apples new 3TB tower Airport/Time Machine to replace a 1TB
-
How do I get key navigation to work in Labview PDA?
I want to be able to press a key on my Windows CE device and toggle a boolean control on my application. However, when I set the key navigation for the control to toggle with F1, it doesn't work? What am I doing wrong?
-
TS2570 All I get is gray screen on start up
All I get is gray screen in start up
-
I'm trying to run reports across multiple client computers that have data on 2-3 partitions per Mac. Is there anyway ARD can report to me data across partitions and not just the current partition the Mac is on? What I have to do now is restart into