Industries Training & Education Partnership Developer Center Lines of Business University Alliances Events & Webinars Innovation Log On Join Us Hi, Guest Search the Community Activity Communications Actions Browse Average User Rating (12 ratings) 0 Tweet 7 0 Tweet 7 created by Thomas Weiss on Feb 2, 2010 10:50 AM, last modif ied by Thomas Weiss on Oct 30, 2013 2:34 PM This is the PDF Version of the development weblog series on SDN published in 2007 that gave an introduction to ABAP newbies who want to learn how to develop simple programs in ABAP. This PDF file does not contain the few weblogs of the original series that explained how to install and administrate the ABAP demo version and how to import and export programs. View Document 13550 Views Topics: abap Tags: beginner, how_to Introduction to ABAP Development Share 0 Like Share 0 Like 20 Comments Like (0) Jairo Franchi Mar 30, 2012 2:53 PM Hi there, I'm trying to run the problem example Y_SELECT_F_FLIGHT but it is not running, it is this way: REPORT Y_SELECT_F_FLIGHT. DATA: itab_flight TYPE STANDARD TABLE OF sflight, wa_flight TYPE sflight. SELECT * FROM sflight INTO TABLE itab_flight WHERE carrid = 'LH' AND seatsmax < 250. LOOP AT itab_flight INTO wa_flight. WRITE: wa_flight-mandt. WRITE wa_flight-carrid. WRITE wa_flight-connid. WRITE wa_flight-fldate. WRITE wa_flight-price. WRITE wa_flight-currency. WRITE wa_flight-planetype. WRITE wa_flight-seatsmax. WRITE wa_flight-seatsocc. WRITE wa_flight-paymentsum. WRITE wa_flight-seatsmax_b. WRITE wa_flight-seatsocc_b. WRITE wa_flight-seatsmax_f. WRITE wa_flight-seatsocc_f. SKIP. ENDLOOP.
Please help me.
Thanks. Like (0) KRISHNA MUDUNURI Mar 30, 2012 3:12 PM (in response to Jairo Franchi) Same code i have excuted it is giving the out . Check the table sflight has any data or not in your system. Krishna Chaitanya Mar 30, 2012 3:22 PM (in response to Jairo Franchi) Hi Jairo It is working fine. May I know which error your getting in your system. Regards Chaitanya Version 4 Like (0) Like (0) Jairo Franchi Mar 30, 2012 3:35 PM (in response to Krishna Chaitanya) I'm getting no error Chaitanya, I just run it and nothing happens, it's odd. I'm new here and I was reading this document to learn more, but in this example I think that missed more information. Like (3) Phillip Morgan Mar 30, 2012 3:27 PM (in response to Jairo Franchi) In case the tables are empty, use this report: SAPBC_DATA_GENERATOR to fill them. Like (0) Jairo Franchi Mar 30, 2012 3:36 PM (in response to Phillip Morgan) How can I verify if the table has information Philip ? I clicked on the table name, it opened, but appears just each field of the table. I sorry, but I think that I do not know how to use this report SAPBC_DATA_GENERATOR, I just include it to this code ? Thanks. Like (0) Krishna Chaitanya Mar 30, 2012 3:39 PM (in response to Jairo Franchi) Hi Jairo Let me know onething. what do you want exactly from this example.
Regards Chaitanya Like (1) Krishna Chaitanya Mar 30, 2012 3:43 PM (in response to Jairo Franchi) Hi Jairo that report is simply fetching data from database table and displaying in output. which sap system you are using! try in IDES systemm definitely it will work or else try with another table like Scarr, spfli....etc. Regards Chaitanya Like (0) Jairo Franchi Mar 30, 2012 3:53 PM (in response to Krishna Chaitanya) Yes Krishna, but the output with the information is not being shown. I'm using here the Netweaver Trial. The first example that is just writing some text works, I think that is probably the table as you have said here, probably it does not have information. I thought that as the table already comes on the system, it would come already filled. Like (1) Nikhil Chandra Mar 30, 2012 3:48 PM (in response to Jairo Franchi) HI Buddy, You are getting the error because the sflight table might not contain any data by default. So you need to fill in the data & you dont have to do it manually just use this transaction BC_DATA_GEN , its not complicated just run this transaction & you'll now how to proceed... And to check wether your table has data in it use transaction SE 16 & type in the table name Like (0) Jairo Franchi Mar 30, 2012 3:50 PM (in response to Nikhil Chandra) Thanks Kikhil, I will try this, but an error should have appeared, should not ? Because I run the code but nothing happens, the output is not showed. Like (0) Nikhil Chandra Mar 30, 2012 3:56 PM (in response to Jairo Franchi) So when you run the program you just see a blank screen ? or the program doesn't execute at all ? Anyways just give it a try, if im right that should fix your problem.. Like (0) Jairo Franchi Mar 30, 2012 4:11 PM (in response to Nikhil Chandra) The program doesn't execute at all Nikhil, if I put a line write 'something' than the screen show the result, but this code, nothing happens. Just a question, I opened the transaction se16 and seems that there isn't any value to the table as you had said, but how I run this transaction BC_DAT_GEN ? Like (0) Nikhil Chandra Mar 30, 2012 4:15 PM (in response to Jairo Franchi) Its just like a normal transaction code, just type it in & hit enter it would take you to a screen where you can see options to fill data into tables like spfli, sflight etc just select the "standard data record" radio button & hit execute... Like (0) Jairo Franchi Mar 30, 2012 4:33 PM (in response to Nikhil Chandra) Great Nikhil, it worked. The table was empty, that was the problem. Thanks a lot for all your help and everyone here. It is great to have people to count in my ABAP Learning. Thanks and have a good day. Like (1) Nikhil Chandra Mar 30, 2012 5:03 PM (in response to Jairo Franchi) you are most welcome... alwayz happy 2 help... you too have a great day... tc.. Like (0) Rahul Srivastava Jun 13, 2012 6:56 AM (in response to Jairo Franchi) always use tables statement and i think your table SFLIGHT is empty for particular where condition.
Tables:SFLIGHT.
DATA: itab_flight TYPE STANDARD TABLE OF sflight, wa_flight TYPE sflight. SELECT * FROM sflight INTO TABLE itab_flight..................................... etc etc.... Like (0) Thato Aphane Jan 9, 2013 3:38 PM (in response to Rahul Srivastava) Hi use SE11 and type the name of the table "sflight" so you can view the content Syed Hussain Aug 21, 2013 12:14 PM (in response to Rahul Srivastava) Hello Jairo Franchi,
As you have used write : work_area-<Field name>. then again write statment. But there is a concept called chaining. with the help of chaining u can write multiple line using single write statment. It will also increase ur performance. : is chaining operator Note that in case of chaining only the last statment will end with . (period) operator and rest with , Like write:/ wa_flight-mandt, wa_flight-carrid, wa_flight-connid, wa_flight-fldate, wa_flight-price.
so and so.
U can do one more thing for ur better understanding purpose , as in ur case data is not displaying, check the condition like an isplay a message.
IF T itab_flight IS INITAIL. message ' NO Record to display' type 'I'. ELSE. LOOP AT itab_flight INTO wa_flight. WRITE: / wa_flight-mandt, wa_flight-carrid, wa_flight-connid, wa_flight-fldate, wa_flight-price, wa_flight-currency, wa_flight-planetype, wa_flight-seatsmax, wa_flight-seatsocc, wa_flight-paymentsum, wa_flight-seatsmax_b, wa_flight-seatsocc_b, wa_flight-seatsmax_f, wa_flight-seatsocc_f. Follow SCN Site Index Contact Us SAP Help Portal Privacy Terms of Use Legal Disclosure Copyright Like (0) SKIP. ENDLOOP. ENDIF. Like (0) kishore b Jul 11, 2013 4:16 PM thanks