At end / At New command
Dear guys, I have following piece of code .Here in field itab_data-inco2 ,why data while printing comes "*****".
I can see values in itab_data-inco2 fetched .but while printing it prints "***************".
code:
SORT ITAB_DATA BY LIFNR EBELN.
LOOP AT ITAB_DATA.
AT NEW LIFNR.
NEW-PAGE.
ENDAT.
AT NEW EBELN.
CLEAR ITEM_CNT.
ENDAT.
ITEM_CNT = ITEM_CNT + 1.
AT END OF EBELN.
ADD 1 TO NUM_CNT.
SUM.
SELECT SINGLE * FROM EKKO
WHERE EBELN = ITAB_DATA-EBELN.
WRITE: /1 ' ',
2 NUM_CNT,
6 ITAB_DATA-EBELN,
18 ITAB_DATA-BSART,
23 ITAB_DATA-BEDAT,
33 ITEM_CNT,
46(13) ITAB_DATA-MENGE,
61(13) ITAB_DATA-NETWR CURRENCY EKKO-WAERS,
76(10) ITAB_DATA-VERKF,
89 ITAB_DATA-ANGNR.
IF ITAB_DATA-ANGNR = 'Y'.
WRITE: 93 ITAB_DATA-IHRAN.
ENDIF.
WRITE: 105 ITAB_DATA-INCO2.
VITEM_CNT = VITEM_CNT + ITEM_CNT.
ENDAT.
These asterixes "***************" come because declaration part of ITAB is wrong, namely fields order. In declaration all key fields must be in front (must go first) in such way that the widest field value goes first, then its "subgroup", then next "subgroups" .Look at this example
Field1 Field2 Field3
A 1 x
A 1 y
A 2 z
B 3 v
B 4 n
B 4 m
Field1 have widest range, within each A, there are subgroups for Field2 , within Field2 there are some subgroups of Field3 . So fields order must be like hierarchy. The most general on left, then more detailed further to the right, and most detailed on the right. There cannot be situations like
A 1
A 1
A 1
B 1 "<- here FIELD 1 will be shown as ********, becuase FIELD2 is more general and should be more detailed
B 4
B 4
Regards
Marcin
Similar Messages
-
Dear All,
How to use AT NEW command in internal table for two fields.
Warm Regards,
N.JainHi
See the following code. It is useful for u.
DATA: BEGIN OF ty_batest,
designation TYPE zba_test-designation,
salary TYPE zba_test-salary,
empno TYPE zba_test-empno,
empname TYPE zba_test-empname,
address TYPE zba_test-address,
END OF ty_batest,
it_batest LIKE TABLE OF ty_batest,
wa_batest LIKE ty_batest.
SELECT * FROM zba_test INTO CORRESPONDING FIELDS OF TABLE it_batest.
SORT it_batest BY designation salary.
LOOP AT it_batest INTO wa_batest.
AT NEW designation.
WRITE: / 'Designation :', wa_batest-designation,
/(35) sy-uline.
ENDAT.
AT NEW salary.
WRITE: / 'Salary : ', wa_batest-salary,
ENDAT.
WRITE: / 'Emp Name : ', wa_batest-empname,
/ 'Emp Number : ', wa_batest-empno,
/ 'Designation : ', wa_batest-designation,
/ 'Address : ', wa_batest-address,
/ 'Salary : ', wa_batest-salary NO-ZERO .
SKIP.
ENDLOOP.
Regards
Bhuvana. -
How to initialize the index with "at new" command ??
Hi All,
I am facing a problem of Initializing the index .
I want to Initialize the Index with the " at new "
command within a loop but its not working.
Otherwise,please tell me the way to put a flag on the first record with " at new " command.
Please provide a solution ASAP.loop at itab.
if sy-index = 1.
set ur flag.
endloop.
check the code below..
LOOP AT lt_citm_b INTO wa_citm_b.
AT NEW vbeln .
CLEAR: wa_temp_output , lt_temp_output[].
ENDAT.
AT LAST.
lv_t = 'X'.
ENDAT.
LOOP AT lt_char INTO wa_char WHERE instance = wa_citm_b-instance.
MOVE: c_d TO wa_temp_output-type,
wa_citm_b-vbeln TO wa_temp_output-vbeln,
wa_citm_b-posnr TO wa_temp_output-posnr,
wa_citm_b-matnr TO wa_temp_output-matnr.
MOVE-CORRESPONDING wa_char TO wa_temp_output.
Special requirement
IF wa_temp_output-atnam = c_itr AND wa_temp_output-atwrt = c_itr03
OR
wa_temp_output-atnam = c_cosr AND wa_temp_output-atwrt = c_osr03.
CLEAR: wa_temp_output-atnam, wa_temp_output-atwrt.
MOVE: c_iorp TO wa_temp_output-atnam,
c_in2-os_nd TO wa_temp_output-atwrt,
'X' TO wa_temp_output-flag.
ENDIF.
*If the characteristic value for PMFREQUENCIE is initial need to pull
*the floating value.
PERFORM fr_get_float TABLES lt_char USING wa_char-atwrt
wa_char-instance
wa_char-atnam
CHANGING wa_temp_output-atwrt.
*To recognize if contract item have extended and standard
*characteristics.
PERFORM fr_ext_std USING wa_temp_output-atnam
CHANGING wa_temp_output-ext
wa_temp_output-std.
APPEND wa_temp_output TO lt_temp_output.
CLEAR: wa_temp_output, wa_char.
ENDLOOP.
SORT lt_temp_output BY vbeln posnr std ext.
AT END OF vbeln.
To translate the data according to the mapping rules
PERFORM fr_translate.
IF lv_t = 'X'.
DESCRIBE TABLE lt_output LINES gv_count.
READ TABLE lt_output INTO wa_output INDEX gv_count.
IF sy-subrc EQ 0.
CLEAR wa_output.
MOVE: c_t TO wa_output-type.
APPEND wa_output TO lt_output.
ENDIF.
ENDIF. -
Hi
getting below error.
SQL> @c:\test_user.sql;
Enter value for username: mapple
old 1: DROP USER UPPER(&&USERNAME) CAS
new 1: DROP USER UPPER(mapple) CASCADE
DROP USER UPPER(mapple) CASCADE
ERROR at line 1:
ORA-00921: unexpected end of SQL command
want to convert the user input into uppercase.
cant we use UPPER() function over here ?
how it can be done ?
With RegardsNo you can't use the UPPER.
Nor do you need it. Oracle will automatically translate all identifiers (table names, column names etc) in uppercase, unless you wrap them in double quotes.
If you insist on using upper case:
set sqlcase upper
will send all of your statements translated to uppercase to the server.
Sybrand Bakker
Senior Oracle DBA -
AT NEW command in ABAP Objects
Hi everyone!
Is there an equivalent of the AT NEW command in abap oo? When I try to use this command inside a BAdi, I get an error message.
Best Regards,
Luís.Hi,
Thank you for your response
Sample code:
LOOP AT c_t_data ASSIGNING variants are no longer supported in the OO context. Use dynamic variants instead.
Regards,
Luís. -
Problem with Front-End Editor (New)
Dear SAP gurus
I tried from transaction se38, selecting options Utilities -> Settings and then selecting Front-End Editor (New) from Abap Editor tab.
When I had old editor setting, I had buttons to do tasks like 'load local file' , 'save as local file' etc.,
But when I changed over to new editor setting, this whole row of buttons are missing.
Can some one please let me know how to get it back but sill use the New Editor.
Your help will be highly appreciated.
Tks
RamMoved elsewhere. "Undo" and others are now just a right-click away, upload/download is somewhere in the "utilities" menu, besides you can just copy/paste from any text file right into the editor.
Just have a look around.
Thomas -
Hi,
Please check the following code
loop at itab1.
loop at itab where id = itab1-id and
werks = itab1-werks.
clear text1.
at new text.
text1 = itab-text.
endat.
write text1.
endloop.
endloop.
say i have text field in itab as
a
b
c for id = itab1-id and
werks = itab1-werks.
for the first text i.e its not going inside the at new command,
its skipping the at new command for text a but for text b it going inside th at new command.
Can anyone tell me what should i do inorder to go to at new command even for the first text.
Thankspreeti,
This is definitely the correct answer. SAP online help says:
<i>You can use control level statements to react to control breaks in internal tables instead of programming them yourself with logical expressions. Within the loop, you must order the AT-ENDAT statement blocks according to the hierarchy of the control levels. If the internal table has the columns <f1>, <f 2>, ...., and if it is sorted by these columns, you must program the loop as follows:
</i>
<i><b>You should not use control level statements in loops where the line selection is restricted by WHERE or FROM and TO. Neither should the table be modified during the loop.
</b>
</i>
Regards,
Clemens
P.S.; Please mark question as answered -
hello gurus,
what are the things which will automatically updated during the month end in new gl..
thanks & regards
hanuchowdary.Only FI-CO reconcilation is done automatically . Rest you have to schedule it through Closing cockpit ( new functionality since ECC 5.0)
-
New command for radius-server source-ports
I am trying to find the new command fro radius-server source-ports 1645-1646 since it appears to be depricated. We use tacacs so we do not have the radius server specified but we do need to put in the ports. Can someone please tell me the new command for radius-server source-ports?
ThanksBoth of the links that Peter posted are interesting and helpful. I would like to take a slightly different approach in answering your question.
In every version of IOS there are certain commands that get inserted into running-config when a particular feature is activated. It looks like in your version the radius-server source-ports is one of those commands. I do not think it is anything that you should be concerned about.
And I do not believe that having the radius-server source-ports command would prevent TACACS from working. I believe that there is likely to be some fault in your configuration. If you would post the aaa parts of the config then maybe we could see what the problem is.
In my experience configuring aaa some of the common problems include not correctly identifying the TACACS server, not having exactly the same key configured on the Cisco device and the TACACS server, not having connectivity to the TACACS server (can the Cisco device ping the server, and can the server ping the device), or errors in the authentication or authorization prameters specified.
Post some information and we will see what we can do.
HTH
Rick -
Can not use Front-End Editor (New) mode in ABAP Editor
Dear,
If i change to Front-End Editor (New) mode, SAP Guide will be pending (cannot do anything on this section).
What is happenning? Pls help.
Thanks,
Quanglv>
Le Vinh Quang wrote:
> It's maybe the last way. But i want to rerolve it firstly.
> If i use other user (operation system). It has no problem. :S
Check other system SAP GUI version and your system GUI version. -
My object won't acknowledge the "new" command.
Okay I have this class called Die that is suppose to simulate a die with the added behaviour that it ceases to operate if 6 is rolled. But that problem is that when ever I try to declare multiple instances of the Die class with the new command the Die objects becomes copies of each other and are not independent. So change to one object alters all the other objects. I don't know why it is doing this. I am including the code of my Die class and my die population class which has the array which I am trying to populate with independent Die objects.
public class Die {
private static int numTosses;
private static boolean alive;
public Die() {
numTosses = 0;
alive = true;
public int getNumTosses() {
return numTosses;
public boolean alive() {
return alive;
public void toss() {
if (alive == true){
numTosses++;
int dieToss = (int)(6*Math.random())+1;
System.out.println("Die toss result " + dieToss);
if (dieToss == 6){
alive = false;
System.out.println("Dead");
public String toString() {
return "Number of Tosses thus far\t" + numTosses;
public class DicePopulation {
//instance variables
private Die []dice;
private int numAlive;
private int numTossesAll;
//constructor
public DicePopulation (int numDice){
dice = new Die[numDice];
numAlive = numDice;
numTossesAll = 0;
for (int i = 0; i<numDice; i++){
dice[i] = new Die();
public int getNumAlive (){
return numAlive;
public int getNumTossesAll (){
return numTossesAll;
public void tossAll (){
for (int i = 0; i<dice.length; i++){
boolean diceStatus = dice.alive();
System.out.println("Die index " + i + " Die Status " + diceStatus);
if (diceStatus == true){
System.out.println("Tossed Die Number " + i);
dice[i].toss();
if (dice[i].alive() == false){
numAlive--;
numTossesAll++;
public String toString (){
return "number times all tossed\t" + numTossesAll + "\tnumber alive\t" + numAlive;Couldn't the problem also be that he has declared
the object "dice" outside if the intialization loop
causing each instance in the array to be a copy?
I know that the static would cause a problem but
couldn't the other be the case as well?Huh?
The declaration of dice seems correct to me, remember our hero here used 'i' as loop variable and you should know that a bracketed 'i' formats text in italics here, so this loop actually readsfor (int k = 0; k < dice.length; k++) {
dice[k] = new Die();
} i.e. no copies ... -
Hi,
I have a doubt concerning new commands. When we add a command to the command list after duplicating a command group , where do we actually code for that command to work. Please forgive me if this doubt is a silly one.
Also when we are doing in this fashion, where do we have to start , ie from the command and go on to the layout set or vice-versa?
Regards
VineethHi Vineeth,
Did you duplicate a command ? this commads is used in collection or resources ?
The command is added in group of commands, and then you assign it to a collection or resource renderer.
Suppose you duplicate new_file command, this command allow you to upload documents. You add it to a command group and then assign it to a collection or in a resource renderer (command groups for folder).
If you assign this command to a resource, it's not going to appear in the context menu.
Don't forget to assign this layout set to the KM Navigatin iview. To test, you can use preview button when you list the layout set.
Patricio. -
I just got iTunes 11.0. From all the previous versions I'm used to being able to return to the beginning of a song by hitting 'enter'. What's the new command for skipping to the head of a song?
Mmmmmm. Works OK for me. I've tried every variation I can think of. Play from playlist, play from library, shuffle on, shuffle off, single song repeat on/off, playlist repeat on/off.
WAIT !! Now I've found it !! It happens when I have the sidebar hidden and play a playlist from the PLAYLIST pane. Hitting Enter then takes me to the FIRST song in the playlist.
WAIT AGAIN !!! In the time it took to write the above, it changed again and works properly. Well properly is not really true. It works if I stay in the PLAYLIST pane. If I switch to the SONGS, ALBUMS or ARTISTS pane, enter does nothing. BUT, if I switch to the GENRES pane, enter starts the first song there. AND, if I've switched away from the PLAYLIST pane and switch back, enter then starts the first song in the playlist.
WOW !! That was a crazy ride. I think we can safely say that there is something awry. -
ABAP front-end editor (new)
Hai All,
In the front-end editor (new) when we type the coding we can see the syntax which is highlighting in the top. how can we get that without entering. in java eclipse, if we give a space that syntax will apply. is there any such fuction in ABAP.here that can be done with the help of TAB button.
-
How to code: "Goto end if previous command not successful" in PL-SQL?
I want to proceed with all the remaining statements in a PL-SQL script only if a certain, previous command was executed sucessfully.
How can I code:
"Goto end if previous command execution not successful"
or even better:
"Goto tag "errorcase" if previous command execution not successful"
If a goto is not possible maybe an if clause is:
if (previous command execution not successful) (
Peteruser559463 wrote:
I though that every command writes its exit code into a central system variable like RETURNCODE or ERRORLEVEL.Not in most languages today. They use exceptions.
What do use return codes are external APIs that one call (as DLLs or shared objects) - such as OpenGL, MAPI, DirectSound, etc.
But inside a language itself, exceptions are the correct and proper way to deal with errors - not return codes.
Maybe you are looking for
-
Just started up my Mac Mini out of the box, using a USB windows keyboard, it will not recognize letters so I am unable to enter serial number. Anything I can do to get the mini mac right out of the box to recognize the windows keyboard? Do I have t
-
Error 4PRC in Apple Hardware Test
Hello, I have a 24" iMac (2.16GHz Core Duo, 1.5GB RAM) from late 2006. A few days ago, the display went black although the power stayed on. I turned it off, and it hasn't been able to boot since then. Whether I try to boot normally, in safe mode, or
-
How to change label color in LabelGraphics script?
I am using ID CS4 and running the LabelGraphics script to label several images in a large document. When I run thre script, the box with the file name is transparent with black type. I would like the box to be white with black type. Is there any way
-
Just downloaded Disney Movies Anywhere App, but it won't launch at all. Any thoughts?
-
How to detect is response deliverred to the client?
Hello everybody... I have problem and don't know how to solve. My server application runs on apache tomcat 5.5, and deals with some important data transactions. After getting the request, server has 5 sec. to send response, after that clients will cl