1 / 10

ERP I1, Session 6

ERP I1, Session 6. Working with Data. A data model. A table. Types and tables. show_wa  TYPE  yshows , show_tab  TYPE HASHED TABLE OF  yshows WITH  UNIQUE KEY id , room_wa  TYPE  yroom ,. Inserting into tables. show_wa -id  =  1. show_wa -title =  'Shrek  1'.

kyros
Télécharger la présentation

ERP I1, Session 6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ERP I1, Session 6 Working with Data

  2. A data model

  3. A table

  4. Types and tables show_wa TYPE yshows, show_tab TYPE HASHED TABLE OF yshows WITH UNIQUE KEY id, room_wa TYPE yroom,

  5. Inserting into tables show_wa-id = 1. show_wa-title = 'Shrek 1'. show_wa-author = 'William Sheik'. INSERTshow_wa INTO TABLE show_tab. TRY.DELETE FROM yshows.INSERTyshows FROM TABLE show_tab   CATCH cx_sy_open_sql_db. MESSAGE 'Database error.' TYPE 'E'. ENDTRY.

  6. Reading from tables TYPES: BEGIN OF program,       title TYPE c LENGTH 50,playing_date TYPE d,playing_time TYPE t,       room TYPE c LENGTH 50,END OF program. DATA: program_wa TYPE program.

  7. Reading from tables (cont.) SELECTs~title sch~playing_date sch~playing_time r~name AS room r~seats FROMyshows AS s INNER JOIN yschedule AS sch ONsch~show_id = s~idINNER JOIN yroom AS r  ONsch~room_id = r~idINTO CORRESPONDING FIELDS OF program_wa.WRITE: / program_wa-title,  program_wa-playing_date,  program_wa-playing_time,  program_wa-room. ENDSELECT.

  8. Creating objects DATA: room TYPE REF TO ycl_room, room = yca_room=>agent->create_persistent(i_id = 1i_name = 'Theatre 1'i_seats = 500 ). COMMIT WORK.

  9. Reading objects DATA: query_manager TYPE REF TO if_os_query_manager,query TYPE REF TO if_os_query,agent TYPE REF TO if_os_ca_persistency,result TYPE osreftab, query_manager = cl_os_system=>get_query_manager( ). query = query_manager->create_query(  i_filter = 'SEATS >= PAR1' ). agent = yca_room=>agent. result = agent->get_persistent_by_query(  i_query = query i_par1 = 500 ).

  10. Looping through the result DATA:obj TYPE REF TO object,      room TYPE REF TO ycl_room, LOOP AT result INTO obj. room ?= obj.name = room->get_name( ).seats = room->get_seats( ).WRITE: / name, seats. ENDLOOP.

More Related