Sorting numbers using itab(urgent)
hi,
i want to sort the number using itab. i am writting the code as follows. but i am not getting itab sorted asending? pl. tell me why????
Data: itab2 type table of string with header line.
if IT_BOM1-LABST < IT_BOM1-MENGE.
ITAB2 = MIN.
append itab2.
ELSE.
itab2 = w_shortb.
append itab2.
ENDIF.
if itab2[] is not initial.
sort itab2 ascending.
endif.
read table itab2 index 1.
If sy-subrc = 0.
Write:/ 'The minimum batch is', itab2.
endif.
numb = itab2.
write :/ numb.
when i am debugging then itab not showing sorted in ascending
Hi Samir,
what about a slim solution?
data:
lt_mng type sorted table of mard-labst
with unique key table line,
lv_menge like line of lt_mng.
insert:
IT_BOM1-LABST into table lt_mng,
IT_BOM1-MENGE into table lt_mng,
w_shortb into table lt_mng.
read table lt_mng into lv_mng index 1.
Write:/ 'The minimum batch is', lv_mng.
Regards,
Clemens
Similar Messages
-
Sorting numbers stored in variables
I'm completely new at java and would like some help with a certain problem.
I have 5 numbers, num1, num2, num3, num4, and num5.
I have them stored in variables as listed. I'd like to know, is there a way to sort them using array.sort or would I have to use another method?I have 5 numbers, num1, num2, num3, num4, and num5.
I have them stored in variables as listed. Are you saying you have 5 different ints declared like
int num1, num2, etc.or an int[] with length 5?
I'd like
to know, is there a way to sort them using array.sort
or would I have to use another method?If they are stored in an array you can use http://java.sun.com/j2se/1.5.0/docs/api/java/util/Arrays.html#sort(int[])
to sort them. -
Sorting numbers Zen Mozaic EZ 100
!Sorting numbers Zen Mozaic EZ 00= Hi, I have a Creative Zen Mozaic EZ 00, and I use this player primary for <span class="Apple"><span class="Apple">Audiobook.
<span class="Apple"><span class="Apple">I have a problem when I transfer more than book to my player.
<span class="Apple"><span class="Apple">?
<span class="Apple"><span class="Apple">When I use the Albums, alle the files are not sorted, why isn't is sorted using the filename.
<span class="Apple"><span class="Apple">?
<span class="Apple"><span class="Apple">The only solution I have found, is using all tracks, here the files are sorted in filename order.
<span class="Apple"><span class="Apple">?
<span class="Apple"><span class="Apple">How do I sort the files in folders or Albums.
<span class="Apple"><span class="Apple">?
<span class="Apple"><span class="Apple">Kind regards,
<span class="Apple"><span class="Apple">KennethHi,
Did you transfer the audiobook using Audible Manager? -
How to round numbers using javascript in Adobe Acrobat Pro?
How to round numbers using java script in Adobe Acrobat Pro?
For example:
1.2 becomes 1.0
1.7 becomes 2.0
Thank you.Assuming you've already set the field to a Number format category and limited it to one digit to the right of the decimal, you can use the following custom Validate script:
// Custom Validate script
event.value = Math.round(event.value);
More info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/roun d -
I have pdf file with 500 pages created from AutoCad file. In all pages, I have different document numbers.The file is not editable in pdf. How to change all the document numbers using "Comment" feature? Any alternate method? alternate method? I have Adobe Acrobat X Pro and Windows -7 platform.
Yes, I just want to cover up all the pages for those particular area of document numbers.
Nothing sensitive about it. I just want to show the correct document numbers on all pages in print out.
So, I wanted to cover up by comments, but commenting on each page will be difficult. So, I wanted to comment the same on all pages. -
Query on sorting XML using XSLT and getting the same XML as output !
Hi,
Looking for one information regarding sorting XML using XSLT , with the sorted XML as output. For eg. my XML is :
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="sort1.xsl"?>
<levelone>
<child ID="1" sort="5">
<name>Paul</name>
</child>
<child ID="2" sort="1">
<name>Adam</name>
</child>
<child ID="3" sort="2">
<name>Will</name>
</child>
</levelone>
and XSL :
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/levelone">
<xsl:copy>
<xsl:apply-templates>
<xsl:sort select="@sort"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="child">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
This does the sort based on Name. But I want to get the same xml as output with the name sorted. Eg.
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="sort1.xsl"?>
<levelone>
<child ID="2" sort="1">
<name>Adam</name>
</child>
<child ID="1" sort="5">
<name>Paul</name>
</child>
<child ID="3" sort="2">
<name>Will</name>
</child>
</levelone>
Any pointers will be highly appreciated.
- ThanksDon't you want <xsl:sort select="name"/> rather than <xsl:sort select="@sort"/>?
-
Sorting technique used by oracle for "order by" clause.
Hi All,
it could be very help to me if you provide some information about sorting technique used by oracle engine for order by clause.
Issue i am facing :
Table : xx
Line Date
1 05-06-2013 00:00:00
2 05-06-2013 00:00:00
when we query above table using order by date, it is returning line 2 prior to line 1. we would like to know why it is returning line 2 first?
Regards,
Ram>
it could be very help to me if you provide some information about sorting technique used by oracle engine for order by clause.
>
Well ok - but be warned that many people wind up being sorry they ask that question. Hopefully Hemant's answer is what you really wanted.
See 'Linguistic Sorting and String Searching' in the Oracle® Database Globalization Support Guide
http://docs.oracle.com/cd/B28359_01/server.111/b28298/ch5lingsort.htm
Sorting will be controlled by the settings of NLS_LANGUAGE, NLS_SORT and NLS_COMP.
Here is the doc page for NLS_SORT
http://docs.oracle.com/cd/B28359_01/server.111/b28298/ch3globenv.htm#i1008393
>
NLS_SORT specifies the type of sort for character data. It overrides the default value that is derived from NLS_LANGUAGE.
NLS_SORT contains either of the following values:
NLS_SORT = BINARY | sort_name
BINARY specifies a binary sort. sort_name specifies a linguistic sort sequence.
>
And the one for NLS_COMP
http://docs.oracle.com/cd/B28359_01/server.111/b28298/ch3globenv.htm#i1008458
>
The value of NLS_COMP affects the comparison behavior of SQL operations.
You can use NLS_COMP to avoid the cumbersome process of using the NLSSORT function in SQL statements when you want to perform a linguistic comparison instead of a binary comparison. When NLS_COMP is set to LINGUISTIC, SQL operations perform a linguistic comparison based on the value of NLS_SORT. A setting of ANSI is for backward compatibility; in general, you should set NLS_COMP to LINGUISTIC when you want to perform a linguistic comparison. -
CALL transaction using itab aswell as skip the first screen
Hi All,
I am doin BDC for some Ztransaction and i am that transaction using CALL TRANSACTION... but i want to skip the first screen of the Ztransaction as well as pass the Itab .. mode .. update and message table.... how can i do it...
CALL TRANSACTION Z... USING iTAB UPDATE DATE MODE A message bdcmsgcoll AND skip THE FIST SCREEN.. how to acheive it....PERFORM BDC_DYNPRO TABLES BDCDATA
USING 'SAPLBPT1' '0100'.
*PERFORM BDC_FIELD TABLES BDCDATA
USING 'BDC_CURSOR'
'BCONTD-BPCONTACT'.
*PERFORM BDC_FIELD TABLES BDCDATA
USING 'BDC_OKCODE'
'/00'.
*PERFORM BDC_FIELD TABLES BDCDATA
USING 'BCONTD-BPCONTACT'
V_CONTRACT.
the above code /recording call the first screen 100 which i dont want...
below code / recording is for screen 200 which i want to appear directly when i call the transaction....
skipping the first screen 100..
PERFORM BDC_DYNPRO TABLES BDCDATA
USING 'SAPLBPT1' '0200'.
PERFORM BDC_FIELD TABLES BDCDATA
USING 'BDC_OKCODE'
'=SAVE'
PERFORM BDC_FIELD TABLES BDCDATA
USING 'BCONTD-PARTNER'
V_GPART.
PERFORM BDC_FIELD TABLES BDCDATA
USING 'BCONTD-ADDINFO'
V_ZONE. "ZONE(S,N,E,E,NE)
PERFORM BDC_FIELD TABLES BDCDATA
USING 'BDC_CURSOR'
'EENO_DYNP-ZEILE(01)'.
PERFORM BDC_FIELD TABLES BDCDATA
USING 'EENO_DYNP-ZEILE(01)'
V_LOG. "MESSAGE
CALL TRANSACTION 'BCT1' USING BDCDATA
MODE MODE UPDATE UPDATE
MESSAGES INTO IT_BDCMSGCOLL. -
HOW TO KNOW SORT KEY USED IN CURRENT HOLIDAY CALENDAR
Hi Experts,
Could you please let me know how to know the sort criteria used in current Holiday calendar??
Any easiest method please let me know.
I know one way which is going to Public holidays and see where used but if there is any other way please do let me know.
Regards,
VamshiHello,
Sort Key :Helps to group together all public holidays valid for a country. It is a 3 character key and I recommend its naming convention to be Znn where nn stands for country grouping. Hence, the sort keys for public holidays for Australia, India, New Zealand will be as shown below:
Australia - Z13
India - Z40
New Zealand - Z43
Read this blog for more info
http://scn.sap.com/docs/DOC-52366
Thanks -
How to Add two numbers using RFC in WD abap
Dear Experts,
I have to add the two numbers using RFC.
I have created the RFC and by using create -> service call i have include that RFC in my WD abap Program.. After that i don't know how to link the input view and to display the result in another view...
Please help me..
Thank you.This is the third thread that you have posted on this same question. This is also your second warning that such activity is not allowed in the SCN forums. Please return to your original thread if you wish to post a follow up question.
Beacause this is a duplicate thread it will be locked. -
Defining sort criteria using vb6 and CR XI
using vb6 and cr XI and I am trying to provide the user with the capability of defining sort options using options defined on a VB6 form. The sample code I've found as described below doesn't seem to allow me to change the sort criteria by field name
'General Declarations
Dim CRXDatabaseField As CRAXDRT.DatabaseFieldDefinition
Private Sub Form_Load()
Set CRXDatabaseField = CRXReport.Database.Tables.Item(1).Fields.Item(8)
CRXReport.RecordSortFields.Item(1).Field = CRXDatabaseField
I would like the user to select an option to sort by say Client and then provide this information to the report like I could with CR 7 as follows
crReport.SortFields(0) = "+{Horse.Location}"
Thanks for any help
GerryHi Gerry,
Have a look to [Sample codes|https://boc.sdn.sap.com/codesamples] and [Dev Library|https://boc.sdn.sap.com/developer/library]
Hope that helps!!
Regards,
Shweta -
Hi all,
Is it possible to sort JTable using keyboard? There is a key to get the focus to a column header by clicking the key F8. I don't find any key to sort the table based on the column which is in focus. Is there any solution for this?
Thanks,
GaneshYou miss the point of that link, there is no need to write any custom code.
I have already tried to implement Keyboard listener of JTableHeader which must be similar to using Key Bindings.You should NOT use a KeyListener, Swing was designed to use KeyBindings
The problem I am facing is that I am unable to find the column which got the key strokeYou don't have to write any code, the functionality you want is already supported with a Key Binding. Just use the "space" key.
If you don't like the space key, then you can assign the Action to any other KeyStroke. The link shows you how to do that in 3-4 lines of code. -
Can we sort LOV using personalization
Hi All,
In OAF, can we sort LOV using personalization?
Any inputs are appreciated..
Thanks
gt990Hi,
You can set the Sort Allowed property through personalization.
Regards,
Gyan -
Defining sort order using parameter fields
Post Author: vandersee
CA Forum: General
I've created a report, the contents of which is sorted depending on a parameter selected (method used is as described in the help topic entitled "Defining sort order using parameter fields". Is it possible to vary the Sort Direction (ascending/descending) using parameters also, so that if I choose to sort by field A it will be ascending, but descending if I choose to sort by field B?Post Author: V361
CA Forum: General
You can create a Parameter {?Sort Order} make it a string, and add items A to Z and Z to A and a formula and sort the group using the formula.
Group Expert, select the group, select options, check use a formula as group sort order
if {?Sort Order} = "A to Z" then crAscendingOrder else crDescendingOrder
And your group will sort based on what is selected in the parameter. -
RMA with reference to Serial Numbers using oe_order_pub.process_order
Hi,
Can any one pls let me know how to create RMA with reference to Serial Numbers using oe_order_pub.process_order API.
Thanks,
Praveen
Edited by: user11186474 on Feb 19, 2010 6:00 AMWe need to pass the following parameters when doing RMA with reference to Serial numbers.
l_line_tbl (1).return_reason_code := 'WRONG PRODUCT';--RETURN REASON CODE
l_line_tbl (1).reference_line_id :=390744;--Sales order Line ID
l_line_tbl (1).reference_header_id :=193001;--Sales Order Header ID
l_line_tbl(1).return_context := 'SERIAL';--REFERENCE TYPE
l_line_tbl(1).return_attribute1 := '215990';--ITEMID FOR RMA
l_line_tbl(1).return_attribute2 := 'RMA_TEST-9';--SERIALNUMBER
Thanks,
Praveen
Maybe you are looking for
-
How to find out the missing records
Dear all, I feel that there is some Inconsistent records between R/3 and the extracted records BI for the data source 2LIS_03_BF. some of the records may not be updated through delta.. Is this possible? as we have created Zkey figures to capture the
-
Sample abap program to create XML files
Hi friends, IS there is a sample abap program to create an XML file. regards kaushik
-
A D300-Work Orange (And My Apology To Adobe)
For a long time now, I've been noticing the reds in my D300 photographs have been kinda orangy. And, I incorrectly thought Lightroom was the problem, and even got a little uppity about it on this forum, if you can imagine. After further consideration
-
Dummy (memory) variables
hello experts, i am new to bpc & script logic.(sap nw 7.0 bpc). i need to use dummy variables to temporarly store values, i've tried to use the prefix ' # ' but not helping it. do you have any suggestions? thanks in advance. petercan
-
B480 Microphone doesnt work, maybe?
I have a Lenovo B480.I dont know if this computer has microphone or not.can anyone help me with that? Moderator Note; subject edited; system type added