ABAP Dictionary

March 24, 2018 | Author: Aniruddha Jha | Category: Database Index, Data Type, Object (Computer Science), Method (Computer Programming), Databases


Comments



Description

ABAP Dictionary (SE11) • Introduction Data Dictionary is an interface to data that is independent of platform. It uses database to store everything(business data, programs, screen, screen program('dynpros'), menus and other elements). • Three types of tables in the data dictionary o Every field of a table in the Data Dictionary corresponds to a real field in the database. So, all the tables in the Data Dictionary are called transparent tables. A transparent table has one-to-one relationship with a database table (same table name; same field name; same number of fields). o Pooled tables (small tables like VIEWS ) holds customizing data from many database tables and they have many -to-one relationship with a database table . For one database table, there are many tables in the dictionary ( with different table name; different field names and different number of fields). Each pooled table contains table description. Many pooled tables are stored together in a database table called a table pool which holds system data. You create table definition for a table pool. When activated, an associated single table will be created in the database. Then you can defines pooled tables and assign the pooled tables to the table pool. o A Clustered table holds data from a few very large tables (like joining tables on common part of primary key). It has many-to-one relationship with a database table. Many clustered tables are stored in a single database table called a table cluster. o (Pooled tables and clustered tables are usually used only by SAP) • Create table definition(3 steps) o Define table name ( table name begins with y or z) o Define data elements for a field (data element name begins with y or z) ƒ Enter domain name (if the domain name exists) Enter field labels (for labeling input fields) ƒ Enter on-line documentation ( F1 help) Define a domain for a field (domain name begins with y or z) ƒ short text (required) ƒ data type ƒ data length ƒ output length(optional) (domain and data elements are re-usable) ƒ o o Data types in ABAP dictionary • Contains global data type o Can create global data types in ABAP Dictionary (Data types defined in ABAP program are mostly local variables) • 23 Predefined ABAP Dictionary types are built from ABAP data types: ABAP data type (L=Length specified in the domain) n(6) c(L) c(3) c(5) p((L+2)/2) d(8) p((L+2)/2) f (8) Predefined ABAP Dictionary types (data types used in domain) ACCP Accounting period YYYYMM CHAR Character CLNT Client CUKY Currency key; referenced by a CURR field CURR Currency field is stored as DECIMALS m [NO-SIGN] DATS Date field YYYMMDD stored as CHAR(8) -- a data element DEC Decimal FLTP Floating numbers with 8-byte accuracy i i i c(1) c(L) x(L) n(L) x(2) p((L+2)/2) x(L) t(6) c(L) string xstring c(L) INT1 1 byte integer. Whole number <=255 INT2 2 byte integer. Only for length field before LCHR or LRAW INT4 4 byte integer. Whole number with plus or minus signs LANG Language key LCHR Long character string. Must be preceded by an INT2 field. LRAW Long byte string. Must be byte an INT2 field NUMC Character Strings containing only digits. PREC Accuracy of QUAN field QUAN Quantity field. Points to units fields with type UNIT RAW Uninterrupted byte sequence TIMS Time field (HHMMSS), sorted as CHAR(6) VARC Long character string(not supported after Release 3.0) STRING Character string of variable length(not elementary type) RAWSTRING Byte sequence of variable length (not elementary type) UNIT Unit key for a QUAN field DATA TYPES IN ABAP • • • Elementary types Structure Internal tables (array) Elementary types (Predefined ABAP data types) a) Numeric • • • • type i (whole numbers; initial value is 0; 4 bytes long; range: -2,147,483,648 to 2,147,483,647) e.g. data: customerNumber type i, loopCounter type i, wordLength type i value 15. type f (floating-point numbers; initial value is 0: 8 bytes long; range: -1E**-307 to 1E308) e.g. data: f1 type f, f2 type f, f3 type f. f1 = 2. f2 = '-16.34567'. f3 = '-75E03'. • • type p (packed number; initial value is 0; 8 bytes long; 15 to 31 digits) e.g. data: price type p decimals 2, packed_16(16) type p. b) Alphanumeric • • • type n (numeric string; initial value is 00...0; 1 byte per digit; range: 1 to 65535) e.g. data vendorNumber type n "numeric text vendorNumber= '12345'. type c ( character string; initial value is blank one byte per character; range: 1 to 65535) not for screen field type d (date YYYYMMDD. one byte per digit range: 1 to 65535) • xstring (hexadecimal code. initial value is 000000 6 bytes long. 8 bytes long. data xstring(2) type x value 'F089'. initial value is x'00' . " 77 onCharacter pic x(1) value 'B'. data: name(25) type c. initial value is 00000000. initial value is empty. language(2) value 'ABAP' " AB is stored in language type string (character string. " 77 flag pic x(1).• • • • e. flag.digits per byte • . dd/mm/yyyy in Europe " You can set your own date format from Layout button write today. range: 0 to any characters) -. fixed-length digits) • type x (hexadecimal code.not for screen field e. " Get today from system's variable sy-datum data today type d. " 77 name pic x(25).g. " 2 hex. fixed-length digits) e. " mm/dd/yyyy in US.g. " 77 city pic x(25). city (25). oneCharacter value 'B'. range: 0 to any characters) -. initial value is empty.g. • • type t (time HHMMSS. end of student. data: begin of student. areaCode(3) type n.a data element (semantic info. move student to professor. . types: begin of phoneNumber. student-id = 123456789.g. name(25). phone(10).. 1. data: maxReservations • type maxNumberOf Seats. countryCode(3) type n.USER-DEFINED DATA TYPES • Elementary type e.2..g. " student record structure id(9) type n. . o e.) -. student-phone = '4166576622'.Structured type o component with a name (including another structure-nested structure) -. constants: " cannot change constants collegeName(6) type c value 'Humber'. maxNumberOfSeats type i value 30. student-name = 'Tanya Davis'. data professor like student.predefined Dictionary type -.g. Complex type . field label. e.a table type (array) o e.g. help text.a structure type (record structure) -. e.number(7) type n. TABLES TYPE • • e. begin of employee. name(25) type c. data employee type personalData occurs 300.g. "sequential table customerStandardTable type standard table of customer with non-unique key id.g. data: employees type employee occurs 200. id(9) type n. cellPhone type phoneNumber occurs 2. phone(10). id (9) type n. data: "work area . end of phoneNumber. end of personalData.2.1. array structure ACCESS TYPE ( o Use index to access lines or access by key in certain kinds of internal tables (arrays) STANDARD TABLE OR INDEXED TABLE o Mostly access by index o Access by non-unique key via sequential search o e. end of Employee. types: begin of customer. data customersArray like customer occurs 100. data begin of personalData. • • • LINE TYPE o defines attributes of individual fields i.g. name(25) type c. name(25). end of customer. e. wa_customer type customer, "internal table myCustomerStandardTable customersStandardTable, tableIndex type type sy-tabix. * Read first customer read table myCustomerStandardTable into wa_customer index 1. • SORTED TABLE OR INDEXED TABLE o Access by index o Mostly access by unique key via binary search Data: " sflight is a database table name wa_sflight type sflight, mySflightSortedTable type sorted table of sflight with unique key carrid connid fldate. select * from sflight into corresponding fields of table mySflightSortedTable. • HASHED TABLE o access by unique key only types: begin of customer, id type student-id, name type student-name, phone type student-phone, end of customer, customerHashedTable type hashed table of customer with unique key id. data: wa_customer type customer, myCustomerHashedTable type customerHashedTable . parameters: pa_id type student-id. select name, phone from student into corresponding fields of table myCustomerHashedTable. read table myCustomerHasedTable with table key id = pa_id into wa_customer. check sy-subrc = 0. write:/ wa_city-name, wa_city-phone. FIND ACCESS TYPE OF AN INTERNAL TABLE AT RUNTIME DESCRIBE TABLE internalTableName KIND charfield • • • • key definition (key fields) key type (unique or non-unique key) (table type is not specified) Reference type (pointer) Type and Uses of Lock Objects in SAP How many types of lock objects? How to create Lock objects? What is the main use of it in real time? Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database. SAP Provide three type of Lock objects. - Read Lock(Shared Locked) protects read access to an object. The read lock allows other transactions read access but not write access to the locked area of the table - Write Lock(exclusive lock) protects write access to an object. The write lock allows other transactions neither read nor write access to the locked area of the table. - Enhanced write lock (exclusive lock without cumulating) works like a write lock except that the enhanced write lock also protects from further accesses from the same transaction. You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK. Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode. Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes. Technicaly: When you create a lock object System automatically creat two function module. 1. ENQUEUE_<Lockobject name>. to insert the object in a queue. 2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM. A Short Tutorial on User Exits Content Author: Abhishek User exits 1. Introduction 2. How to find user exits 3. Using Project management of SAP Enhancements 1. Introduction User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module. The naming standard of function modules for functionmodule exits is: EXIT_<program name><3 digit suffix> The call to a functionmodule exit is implemented as: CALL CUSTOMER.-FUNCTION <3 digit suffix> Example: The program for transaction VA01 Create salesorder is SAPMV45A If you search for CALL CUSTOMER-FUNCTION i program SAPMV45A you will find ( Among other user exits): CALL CUSTOMER-FUNCTION '003' exporting xvbak = vbak xvbuk = vbuk xkomk = tkomk importing lvf_subrc = lvf_subrc tables xvbfa = xvbfa xvbap = xvbap xvbup = xvbup. The exit calls function module EXIT_SAPMV45A_003 2. How to find user exits Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT If you know the Exit name, go to transaction CMOD. Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter. You will now come to a screen that shows the function module exits for the exit. 3. Using Project management of SAP Enhancements We want to create a project to enahance trasnaction VA01 - Go to transaction CMOD - Create a project called ZVA01 - Choose the Enhancement assign radio button and press the Change button In the first column enter V45A0002 Predefine sold-to party in sales document . Note that an enhancement can only be used i 1 project. If the enhancement is already in use, and error message will be displayed Press Save Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit. Now the function module is displayed. Double click on include ZXVVAU04 in the function module Insert the following code into the include: E_KUNNR = '2155'. Activate the include program. Go back to CMOD and activate the project. Goto transaction VA01 and craete a salesorder. select single * from tstct where sprsl eq sy-langu and tcode eq p_tcode. if sy-subrc eq 0. if trdir-subc eq 'F'. select single * from tadir where pgmid = 'R3TR' and object = 'FUGR' and obj_name eq enlfdir-area. endif. move : tadir-devclass to v_devclass.sap-img. . move : tadir-devclass to v_devclass. select single * from tfdir where pname = tstc-pgmna. endif. data : v_devclass like tadir-devclass. format color col_positive intensified off. select single * from tadir where pgmid = 'R3TR' and object = 'PROG' and obj_name = tstc-pgmna. write:/(19) 'Transaction Code . 45(50) tstct-ttext. tables : tstct.'. Also a drill down is possible which will help you to branch to SMOD. parameters : p_tcode like tstc-tcode obligatory. Written by : SAP Basis. enlfdir. trdir. 20(20) p_tcode. ABAP Programming and Other IMG Stuff http://www.Note that Sold-to-party now automatically is "2155" Finding the user-exits of a SAP transaction code * * * * * * * * * * Finding the user-exits of a SAP transaction code Enter the transaction code in which you are looking for the user-exit and it will list you the list of user-exits in the transaction code. select * from tadir into table jtab where pgmid = 'R3TR' and object = 'SMOD' and devclass = v_devclass. select single * from trdir where name = tstc-pgmna. if sy-subrc ne 0. tables : tstc. modsapt. data : jtab like tadir occurs 0 with header line. data : field1(30). skip. select single * from tstc where tcode eq p_tcode. modact. select single * from enlfdir where funcname = tfdir-funcname. format color col_heading intensified on. tfdir. if not jtab[] is initial. write:/(95) sy-uline.com report zuserexit no standard page heading. tadir. format color col_normal intensified off. endloop. *---End of Program What is User Exits? The following document is about exits in SAP :The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications. set parameter id 'MON' field sy-lisel+1(10). write:/ 'No of Exits:' . and menus within standard R/3 applications. These exits do not contain any functionality. call transaction 'SMOD' and skip first screen. loop at jtab. 2 jtab-obj_name hotspot on. get cursor field field1. sy-tfill. format color col_total intensified on. write:/(95) 'No User Exit exists'. format color col_negative intensified on. skip. endif. SAP creates user exits for specific programs. . select single * from modsapt where sprsl = sy-langu and name = jtab-obj_name. write:/(95) sy-uline. Types of Exits There are several different types of user exits. describe table jtab. write:/(95) sy-uline. 21 sy-vline . else. 95 sy-vline. 2 'Exit Name'. write:/(95) 'Transaction Code Does Not Exist'. else. write:/1 sy-vline.write:/1 sy-vline. Instead. You can hang your own add-on functionality onto these hooks. at line-selection. 22 modsapt-modtext. the customer exits act as hooks. 22 'Description'. endif. format color col_negative intensified on. screens. 95 sy-vline. check field1(4) eq 'JTAB'. 21 sy-vline . Each of these exits acts as hooks where you can attach or "hang" your own add-ons. Function module exits play a role in both menu and screen exits. SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs. The field exit concept lets you create a special function module that contains this logic. Field Exits Field exits allow you to create your own programming logic for any data element in the Dictionary. or business-related processing for any screen field. the system automatically triggers your special routine whenever a user enters a company location number. you can use "RSMODPRF" program to create field exits. These calls have the following syntax: CALL CUSTOMER-FUNCTION ‘001’. conversions. These special entries have function codes that begin with "+" (a plus sign). You assign the special function module to the data element BBBNR. When you activate your field exit. You specify the menu item’s text when activating the item in an add-on project. you use a function module exit to define the actions that should take place once your menu is activated. You can use this logic to carry out checks.6c. You then assign the module to any programs and screens in which users can add new international location numbers.Menu Exits Menu exits add items to the pulldown menus in standard SAP applications. When you add a new menu item to a standard pull down menu. You can use these menu items to call up your own screens or to trigger entire add-on applications. In 4. Function module exits also control the data flow between standard programs and screen exit fields. An example of a user exits :- . Example: The data element BBBNR identifies a company’s international location number. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screen’s flow logic. Function Module Exits Function module exits add functions to R/3 applications. Screen Exits Screen exits add fields to screens in R/3 applications. SAP creates menu exits by defining special menu items in the Menu Painter. You might want to set up your R/3 System so that all international location numbers are larger than 100. What is the difference between SMOD and CMOD? CMOD is the Project Management of SAP Enhancements (i. **** ************************************************************************ ****** SET SCREEN 100. If you search for CALL CUSTOMER-FUNCTION program SAPMV45A you will find ( Among other user exits): . ENDCASE. The code for the function module is written by the developer.-FUNCTION <3 digit suffix> For Example: The program for transaction VA01 Create salesorder is SAPMV45A 1. The naming standard of function modules for function module exits is: EXIT_<program name><3 digit suffix> The call to a functionmodule exit is implemented as: CALL CUSTOMER. but in the include that is implemented in the function module. SMOD contains the actual enhancements and CMOD is the grouping of those SMOD enhancements. ************************************************************************ ****** **** Note that you can write any code that satisfy your needs. The exit is implementerd as a call to a function module. SET SCREEN 0.. LEAVE SCREEN. **** **** And you can test it. You are not writing the code directly in the function module. WHEN 'BACK OR EXIT'. SMOD Enhancements). LEAVE SCREEN.MODULE user_exit_0001 INPUT CASE okcode. WHEN '200'. User exits (Function module exits) are exits developed by SAP. WHEN '100'. **** **** But in this case.e. this was wrote as a sample code for reference sake. CASE sy-dynnr. ENDCASE. Double Click on the exit. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. . Now the function module is displayed.Create a project called ZVA01 . Using Project management of SAP Enhancements You want to create a project to enhance transaction VA01 .Go to transaction CMOD . Enter the exit name and press enter. Double click on include ZXVVAU04 in the . go to transaction CMOD. and error message will be displayed . You will now come to a screen that shows the function module exits for the exit.Press Save . How to find user exits Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT If you know the Exit name. If the enhancement is allready in use. Choose menu Utillities->SAP Enhancements.CALL CUSTOMER-FUNCTION '003' exporting xvbak = vbak xvbuk = vbuk xkomk = tkomk importing lvf_subrc = lvf_subrc tables xvbfa = xvbfa xvbap = xvbap xvbup = xvbup.Press Components. or use this ABAP program to search for user exits :Finding the user-exits of a SAP transaction code 3. Note that an enhancement can only be used for 1 project. The exit calls function module EXIT_SAPMV45A_003 2.Choose the Enhancement assign radio button and press the Change button In the first column enter V45A0002 Predefine sold-to party in sales document . Tip: First try deactivating the field exit once more and then afterwards. Go back to CMOD and activate the project. In practice. a check is run on 2 tables (TDDIR. o If the field exit is to only be active on specific screens. o After activating the function module FIELD_EXIT. o Do not work on different application servers since there may be some delay before the field exit is activated. but is not processed when calling the screen. and the field exit. o Since the field exit is not processed until PAI. 2. Activate the include program. o The profile parameter must be set on all or none of the application servers. o Set profile parameter abap/fieldexit to YES and restart the system. o After transport. Save. activate it again. . field exits are marked as active but will not be processed. Field exit was created with CMOD. The screen is not generated until the transaction is started. leave the transaction on whose screen the field exit is to be executed. Note that Sold-to-party now automatically is "2155" Field exits (SMOD/CMOD) Questions and Answers 1. How is performance affected by setting abap/fieldexit? o If a screen is generated and the profile parameter is set.. check that the screen field does have a reference to a data element. TDDIRS) to see whether a field exit must be generated for the respective field. Goto transaction VA01 and create a salesorder.. In the name of the field exit use the name of the data element and not the field name. o Using SE51 -> Field list.function module Insert the following code into the include: E_KUNNR = '2155'.. the screen load is not generated until the screen is selected after an . an action must be triggered on the screen (Return. check whether you chose the correct program and the correct screen number (take care with subscreens)..). 4. The system variable SY-STEPL is incremented each time. 8. 7.update. it is displayed in the module between LOOP and ENDLOOP. The user should not notice any difference because screen generation is very fast. 5. These can then be analysed there. Can you read the contents of other screen fields in the field exit? o In principle. o Check whether a value is assigned to the field OUTPUT. a function module is called which does not exist (for example FIELD_EXIT_PROGRAMM_@) o This is an error in the kernel which no longer occurs as of 3. When is the field exit called if a conversion exit is attached to the data element ? o The field exit is called after the conversion exit. Although a global field exit is inactive. Can field exits be debugged ? o No. the field exit is called in PAI as often as there are visible fields in the step loop. it is helpful to write interesting variable to the file system using TRANSFER. This means that the INPUT field receives the data in the same format as the ABAP/4 program also receives it.. In addition. 6. it is useful to assign a program and a . As a temporary measure. If a new value is assigned to the field. Field exits must be tested separately in the ABAP/4 Development Workbench. . How does the field exit behave on step loop fields ? o After the user has entered data..0C. What can you do if the field contents are no longer transported to to ABAP/4. it is not possible to make any assumptions about the order in which the field exits will be called in the future. For errors which only occur in the screen environment. 3. This module is also called once for each visible step loop line. Note here that field exits are always called and not only if an entry is made in the field or if the field is empty. every field exit can store its value in the global variables of the function group (TOP) and hence make them available to other field exits. This rule does not apply. If the relation is indirect. 10. .even if they are not ready for input at runtime of the application by LOOP AT SCREEN. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. 9. SAP allows you to predefine these points in your software.screen which do not exist to the field exit and then activate the field exit. This function module must exist for the field exit to work. o If you want to create a field exit for a data element. the data element is not displayed in CMOD. you cannot install field exits on them.e. even if it is invisible.Field exits on check buttons do not work o Field exits are only intended for input fields. If you do not create this function module.Field exit is not executed although it is active. As with customer exits two different views are available: In the definition view.Field exits do not work on selection screens Difference Between BADI and User Exits Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. via an ABAP declaration ( LIKE ). although created. o Fields which do not have the 'Input field' attribute usually do not trigger a field exit. The field exit is designed to allow an extended input check. 12. no field exit can be executed. however. partners. an application programmer predefines exit points in a source that allow specific industry sectors. Since specific industries often require special functions. Field exit is not visible in CMOD. As check buttons count as graphical elements. o Field exits can only be executed for fields that are directly related tothe dictionary. It is therefore only called for input fields . i. but do create one with a suffix. and customers to attach additional software to standard SAP source code without having to modify the original object. 11. a function module is proposed with the name FIELD_EXIT_. Here the field will be always activated. if the field is located within a steploop. Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure. A single Business Add-In contains all of the interfaces necessary to implement a specific task. but instead allow for a multi-level system landscape (SAP. the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available. the system checks in the user master record to see which transactions you are authorized to use. Therefore the appropriate authorization is required before a user can carry out certain actions in the system. as well as country versions.In the implementation view. In contrast to customer exits. industry solutions. An authorization check is implemented for every sensitive transaction. When you log on to the R/3 system. screens. GUIs. In order to better understand the programming techniques behind the Business Add-In enhancement concept. partner. for example). The actual program code is enhanced using ABAP Objects. You do not have to register Business Add-Ins in SSCR. SAP recommends reading the section on ABAP Objects. In addition. If you wish to protect a transaction that you have programmed yourself. and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard. and customer solutions. then you must implement an authorization check. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. Business Add-Ins can be defined according to filter values. Checking User Authorizations in your ABAP Program How to set Authorization to an ABAP Programs? Much of the data in an R/3 system has to be protected so that unauthorized users cannot access it. For example: . This means you have to allocate an authorization object in the definition of the transaction. The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time. SAP guarantees the upward compatibility of all Business Add-In interfaces. All ABAP sources. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value. and the like). In most cases you will be able to use the existing authorization objects to protect your data. The ID parameter specifies an authorization field (in the authorization object). .. ID <authority-field n> FIELD <field value n>.... as.. . The OBJECT parameter specifies the authorization object... at this time only write the Hide statement. But new developments may require that you define new authorization objects and fields.program an AUTHORITY-CHECK... matnr like mara-matnr. Now you are going to display it as. cb_field type char1...... AUTHORITY-CHECK OBJECT <authorization object> ID <authority field 1> FIELD <field value 1>... . end of itab. .. select * .... HIDE: values.... Loop at itab.. The authorization object and its fields have to be suitable for the transaction. write:/ cb_field as checkbox. u want.. Now you fetch the data into the internal table of itab using some query. Create an Internal table as : data: Begin itab occurs 0.. The FIELD parameter specifies a value for the authorization field....... Endloop.. Regarding Runtime creation of Check Boxes For this. ID <authority field 2> FIELD <field value 2>.... Projection views are used to hide fields of a table. This can be done by clicking on some USER Command button.1. for example when you access the database.Now capturing of selected data process. The example below read 50 records at a time from VBAK into an internal table. WRITE:/ 'SELECTED RECORDS:'. AT pf8. " Above counter... read line cnt. ENDIF... if sy-lisel(1) = 'X'. for suppose you're clicking F8 means. A projection view contains exactly one table. cnt = 3.. itab-cb_field. as tabclass = 'VIEW' and VIEWCLASS = 'P'.. What's the purpose of using PACKAGE SIZE in select statement? Package size can be used if you for example only want to finish processing a limited amount of data at a time due to lack of memory. There is no corresponding object in the database for a projection view. This type of data is also defined in DD02L. describe table itab lines VARIABLE NAME.. endif. " Initiate value for Count 3 if you're including page header. cnt = cnt + 1. you only read and write the field contents actually needed.... Then the two internal . The R/3 System maps the access to a projection view to the corresponding access to its base table. IF SY-LSIND = 1. COUNTER = COUNTER .. do VARIABLE NAME times.. enddo. You can also access pooled tables and cluster tables with a projection view. Finding out a projection views In addition to CLUSTER and POOLED tables ABAP forbids joins with projection views... You cannot define selection conditions for projection views. This can minimize interfaces. and selects the corresponding entries from vbap into an internal table. END OF t_report. BEGIN OF t_report.tables can be processed. l_vbak TYPE t_vbak. l_vbap TYPE t_vbap. SELECT vbeln erdat FROM vbak INTO TABLE li_vbak PACKAGE SIZE 50. IF sy-subrc = 0. SELECT posnr matnr meins FROM vbap INTO TABLE li_vbap FOR ALL ENTRIES IN li_vbak WHERE vbeln = li_vbak-vbeln. * Now you have the two internal tables li_vbak and li_vbap filled * with data. posnr LIKE vbap-posnr. li_report TYPE t_report OCCURS 0. vbeln LIKE vbak-vbeln. erdat LIKE vbak-erdat. END OF t_vbak. l_report TYPE t_report. matnr LIKE vbap-matnr. TYPES: BEGIN OF t_vbak. BEGIN OF t_vbap. matnr LIKE vbap-matnr. Remember to reinitialize tha tables before the next read. START-OF-SELECTION. meins LIKE vbap-meins. li_vbap TYPE t_vbap OCCURS 0. erdat LIKE vbak-erdat.remember to reinitialize internal . and the next 50 records from VBAk can be read. * Do something with the data . END OF t_vbap. meins LIKE vbap-meins. vbeln LIKE vbak-vbeln. REPORT z_test. posnr LIKE vbap-posnr. DATA: li_vbak TYPE t_vbak OCCURS 0. * tables ENDIF. then you can use ABAP Memory (i. . when ever you start an application program. So when ever you want to pass data between two internal sessions. export). SAP Memory can also be used to pass data b/w internal sessions. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). or to pass data from one session to another. You can use SAP memory either to pass data from one program to another within a session.e import. The most frequent use of SPA/GPA parameters is to fill input fields on screens ABAP/4 Memory ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. if the data has to be passed b/w two main sessions. The internal session of the called program then replaces that of the calling program. it opens up an internal sessions with in the main session. When comes to SAP memory (also known as global memory).End of Program Difference Between SAP and ABAP Memory Can any one tell me what is the difference between ABAP Memory and SAP Memory? Answers 1:Within a main session. *-. the data needs to be placed in ABAP memory before the call is made. Neelima Answers 2:SAP Memory SAP memory is a memory area to which all main sessions within a SAPgui have access. ENDSELECT. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The program called can then read from the ABAP memory. Data within this area remains intact during a whole sequence of program calls. we can use SAP Memory(SPA/GPA Parameters). If control is then returned to the program which made the initial call. To pass data to a program which you are calling. These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. the same process operates in reverse. The internal session has a memory area that contains the ABAP program and its associated data. or read data from.SAP memory The SAP memory. the ABAP memory. the SAP memory. ENDLOOP. ENDLOOP. Scrolling in Table Control -----Original Message----Subject: Scrolling in Table Control From: Amit Purohit Hey. I have defined a table control and scrolling is not possible in that even if the number of entries exceeds the window height. You can retain or pass data across internal sessions. Its contents are retained across transaction boundaries as well as external and internal sessions. What could I have done wrong ? Thanks in advance. Below is the flow logic which I have attached PROCESS BEFORE OUTPUT. LOOP AT IT1. LOOP AT IT1 CURSOR ZTR0300-CURRENT_LINE. . MODULE STATUS_0300. is available to a user during the entire duration of a terminal session. -----Reply Message----Subject: RE: Scrolling in Table Control From: K. The SET PARAMETER and GET PARAMETER statements allow you to write to. * PROCESS AFTER INPUT. The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to. ABAP/4 memory The contents of the ABAP/4 memory are retained only during the lifetime of an external session (see also Organization of Modularization Units).Hariprasad Try defining the table control lines in PBO. or read from. MODULE USER_COMMAND_0300. Amit. otherwise known as the global memory. Hariprasad Iam sorry. -----End of Reply Message----- Interview Question on BAPI. Thank you for prompt reply. -----Reply Message----Subject: RE: Scrolling in Table Control From: K. ZTR0300-LINES = 100 -----Reply Message----Subject: RE: Scrolling in Table Control From amit. ZTR0300-CURRENT_LINE = 100. ABAP Objects. RFC.PROCESS BEFORE OUTPUT.purohit That worked. PROCESS BEFORE OUTPUT. i have typed ZTR0300-LINES as ZTR0300-CURRENT_LINE in previous mail. Tables Content Author: Rashi agnihotri 1) What is the difference between RFC and BAPI ? What are subclasses and super classes in BAPI and also what are the methods in BAPI ? 2) Is it possible to connect SAP to Non-SAP systems to retrieve data using RFC alone with out using BAPI ? 3) What is the difference between Function module and BAPI ? 4) What are the types of tables? 5) What are pooled table ? 6) What are Hashed Tables ? 7) What are advantages of using ABAP objects? 8) What is the advantage of using ABAP objects in Reports ? . Amit. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. These BAPIs are instance methods. The BAPI Undelete() removes a deletion flag. for example. Cancel ( ) Unlike the BAPI Delete(). These BAPIs should be implemented the same for all business object types. After completing the transaction with a COMMIT WORK. The BAPI GetDetail() is an instance method. a purchase order. Create( ) and CreateFromData! ( ) The BAPIs Create() and CreateFromData() create an instance of an SAP business object type. Change( ) The BAPI Change() changes an existing instance of an SAP business object type. These BAPIs are class methods. The following standardized BAPIs are provided: Reading instances of SAP business objects GetList ( ) With the BAPI GetList you can select a range of object key values. for example. . The Cancel() BAPI is an instance method. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The instance is identified via its key. for example. For example. a standardized BAPI must be used in preference to an individual BAPI.1)BAPI are RFC enabled function modules. the BAPI Cancel() cancels an instance of a business object type. a purchase order. Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag. The BAPI GetList() is a class method. both the orders are saved consistently in the database. after sales order 1 has been created. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. company codes and material numbers. a second sales order 2 is created in the same transaction. GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The BAPI Change () is an instance method. Whenever possible. the second BAPI call must not affect the consistency of the sales order 2. BAPIs that can create. change or delete instances of a business object type The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. the difference between RFc and BAPI are business objects. if. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. .Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. Tables assigned to a table pool or table cluster are referred to as pooled tables or cluster tables. Like database tables. The response time for key access remains constant. regardless of the number of table entries.Methods and Events. Pool table and cluster table are data dictionary table objects sorted table. A cluster also contains a long field (Vardata) that contains the contents of the data fields of the cluster tables for this key. 5)Table pools (pools) and table clusters (clusters) are special table types in the ABAP Dictionary. hashed tables always have a unique key. 3) Each Bapi Object has Interface. RFC can acces the SAP from outside only through BAPI and same is for vice versa access. Table Clusters Several logical data records from different cluster tables can be stored together in one physical record in a table cluster. 2) No it is not possible to connect SAP to Non-SAP systems to retrieve data using RFC alone. These BAPIs are instance methods. 6) Hashed tables This is the most appropriate type for any table where the main operation is key access. The data from several different tables can be stored together in a table pool or table cluster. REPORT Z_1 . Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data. Sample Prog: This does nothing. You cannot access a hashed table using its index. Key Fields. Control information on the structure of the data string is still written at the beginning of the Vardata field. A cluster key consists of a series of freely definable key fields and a field (Pageno) for distinguishing continuation records. Attributes. A table in the database in which all records from the pooled tables assigned to the table pool are stored corresponds to a table pool.Function module has a single bound functionality while a BAPI object can contain many functionalities 4) Transparent table. continuation records are created. The definition of a pool consists essentially of two key fields (Tabname and Varkey) and a long argument field (Vardata). Bapi Function Modules can be attached to these Bapi objects . indexed table and hash table are internal tables. If the data does not fit into the long field. 1. 2. you just have to set the STATUS = S in the attributes view of the main program. ********** ********** Find the Table Name For a Field. se84 or se15 3. look for program RSBDCCUA and run it for any platform say 'WN' for windows or MC for Mac and it will generate list of function codes ********** If you want to protect a program against debugging. If you need to find out the Okcodes for BDC sessions. Report xyz line-size 1023. data: i type hashed table of mara with unique key matnr 7) and 8) ABAP objects are root for your program and reports. Part the cursor at the field and press F1 & F9. I know couple of ways to find the table name for a field. Setting Break point in ABAP. st05 (sql trace). ********** Given a transaction code. ********** How to find out the number of days between a given date.tables: mara. like. how can I find the menu path? In 4. Ex. excluding Saturdays and Sundays and public holidays? . Along with Report statement pass the line-size as 1023. Please note that there are no tcode available to find the path of the IMG transaction. 4. you can used tcode search_sap_menu to find the SAP MENU tcode. ********** Can line-size of abap report large than 255? You can have line-size upto 1023.6c. RANGES seltab for qals-prueflos. tables: qals. write : paramet. => DATE_CONVERT_TO_FACTORYDATE => HR_HK_DIFF_BT_2_DATES ********** How to call one report to another? Here ZREP2 CALLS report ZREP1 when you click on output of report ZREP2. SUBMIT zrep1 VIA SELECTION-SCREEN WITH PARAMET EQ 'Selection 1' WITH SELECTO IN SELTAB WITH SELECTO NE 3 AND RETURN. FORMAT HOTSPOT COLOR 5 INVERSE ON. REPORT ZREP2 NO STANDARD PAGE HEADING. REPORT ZREP1. CASE SY-LILLI. parameter : paramet(18) type c. AT LINE-SELECTION.Try functions. WRITE: 'Selection 1'. SUBMIT zrep1 VIA SELECTION-SCREEN WITH PARAMET EQ 'Selection 1' . / 'Selection 2'. WHEN 4. WRITE: 'Select a Selection!'. / '--------------------'. WHEN 5. SKIP. Improve your home development easily.AND RETURN. • Bp_joblog_read Fetch job log executions filling the structure TBTC5. They belong to standard objects and should never be changed. • Popup_to_confirm_with_message Create a dialog box in which you inform the user about a specific decision point during an action. • Bp_event_raise Trigger an event from ABAP/4 program. SAP R/3 Programming TOP Indeed these powerful ABAP/4 functions are very interesting and can bring some advantages. • Popup_to_decide Create a dialog box in which you require the user between the two processing alternatives. • G_set_get_all_values Fetch values from a set filling the structure RGSB4. or to cancel the action. • Popup_to_confirm_with_value Create a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object. • Popup_to_decide_with_message Create a dialog box in which you inform the user about a specific decision point . • Popup_to_confirm_step Create a dialog box in which you make a question whether the user wishes to perform the step. • Popup_to_confirm_loss_of_data Create a dialog box in which you make a question whether the user wishes to perform a processing step with loss of data. ENDCASE. • Sapgui_progress_indicator Set progress indicator on the left lower corner of the current window. • Rzl_submit Submit a remote report. . • So_spool_read Fetch printer spool according to the spool number informed. • Spell_amount Return the amount in words filling the structure SPELL. The structure SOLI may contain the message. • Rzl_sleep Hang the current application from 1 to 5 seconds. • So_wind_spool_list Browse printer spool numbers according to user informed. • Rs_send_mail_for_spoollist Send messages from ABAP/4 programs to SAPoffice. • Th_saprel Gather information from the current system including upgrade activities. • Sd_print_terms_of_payment Format terms of payment according to base line date and payment terms. • Popup_to_display_text Create a dialog box in which you display a two-line message. • Th_user_list List of logged users filling the structure UINFO.via a diagnosis text. • Rfc_system_info Fetch information from the current instance filling the structure FRCSI. • So_user_list_read List of all users filling the structure SOUD3. • Th_server_list Gather information of all instances filling the structure MSXXLIST. It completes fields from the structure KKS03. . Thus the application server requires only storage capacity to accommodate UNIX. • Ws_download Transfer files from the application server to the frontend.• Th_user_info Information about the current user. • Ws_upload Transfer files from the frontend to the application server. • Ws_file_delete Delete file at the frontend. This makes possible distributed enterprise applications. Swapping and the SAP runtime environment. In order to understand even better this field you should keep in mind those terms. • Ws_excel Download files at the frontend in excel format. CATT (Computer Aided Test Tool) It allows you to combine and automate sequences of repeatable transactions in test procedures. • Ws_volume_get Get the label from a frontend device. It ensures application data integrity for background interfaces. • • • • ALE (Application Link Enabling) It provides integration for separate R/3 systems. Batch Input A technique to input data safely. Application server The application server is used to run the business application programs in the R/3 client/server concept. It pretends to be someone typing. keeping full interaction. • Ws_msg Create a dialog box in which you display an one-line message. and forces you to test systematically. See also direct input. CATT reduces the number of manual tests. • Ws_execute Execute an external program on the presentation server. SAP R/3 Glossary TOP Information Technology has many key words and SAP R/3 has introduced many others. defining input values and expected test results. The application modules are loaded from the data base server to the application server as required. • Th_wpinfo List of work processes filling the structure WPINFO. It completes fields from the structure KKS03. etc. It also controls customizing that has been maintained. The transmission speed is 10 MBit/s.• • • • • • • • • • • • • • • • CCMS (Computer Center Management System) It allows you to monitor. CPI-C (Common Programming Interface-Communications) Common Programming Interface of Communication has been introduced by IBM as a high-level interface to SNA/LU6-2. Client/Server System Client/server systems are structured modularly. Company code The smallest organizational unit for which a complete self-contained set of accounts can be drawn up for purposes of external reporting. The transmission speed is 100 MBit/s. Central System In an R/3 central system. Direct Input A recent technique to input data safely. The suitability of a particular computer type depends on sufficient CPU performance. such as Bull. This involves recording all relevant transactions and generating all supporting documents for legally-required financial statements. Client In commercial. a bridge or a gateway.) and sends the job to an idle work process. EarlyWatch It is a service that entails having your R/3 installation regularly inspected by SAP employees. the communication server must support the TCP/IP protocol over wide area networks. CPI-C has become the subject of the X/Open stardarlization and is used by SAP to facilitate program-to-program communication between R/3 and external system. It ensures application data integrity for background interfaces. in other to ensure high system availability and high data throughput at all time. Dispatcher The system R/3 agent that identifies the type of task (on-line. Software components can also be used in a client/server relationship. CSP A system to help SAP employees to give comprehensive support to their clients. batch. See also batch input. FDDI (Fiber Distributed Data Interchange) It is a local high-speed network with ring topology based on light wave conductors. such as balance sheets and profit and loss statements. a self-contained unit in an R/3 system with separate master records and its owns set of tables. Correction It contains all the objects that a developer has changed or created. Ethernet It is a LAN architecture using bus topology. Computer type The R/3 system supports various computer types of SAP's platform partners. Data base server The data base server stores the SAP application programs and data in the R/3 client/server concept. update. control and configure your R/3 system. with components working in a sender/receiver relationship. Communication Server It provides the connection between local area and wide area networks and may be either a router. IBM and HP. organizational and technical terms. . DEC. It also handles the SAP update program and batch jobs. SAP offers CPI-C libraries based on TCP/IP. both application and data base software are run on one computer. This toolset lets you analyze and distribute client workloads and report on resource consumption for system components. In R/3 installations. Number range A range of numbers that are laid down per file for the assignment of document numbers. FTP (File Transfer Protocol) It is the most commonly used file transmission protocol of the TCP/IP protocol family. Common LANs include Ethernet. Token Ring and FDDI. It is a separate demonstration and education system for speeding up the pilot process.0 onwards. such as TCP/IP and IPX. thus enabling the R/3 to communicate with the Internet. IDoc (Intermediate Document) An IDoc is a data container for data exchange between SAP systems or between an SAP system and an external system. Semaphores When a work process locks a resource. It is also the basic element of communications between customers. It can be internal (carried out automatically by the system) or external (carried out manually by the user). Released from version 3. These LANs support different transport protocols. . IMG (Implementation Management Guide) It is a hierarchical structure that reflects the R/3 component hierarchy and contains every configuration activity. It is used to find possible entries for an input field. ITS (Internet Transaction Server) It links the R/3 application server with one or more Web servers. Kernel It means a standard core previously configured. and SAP. LAN (Local Area Network) It is a network foa a tightly limited area with high level data transmission performance. Another work process that also wants to access it must then wait. Firewall It is a means of controlling access through a public network to a private network. Matchcode A tool for finding specific record. RFC A way to implement communication between application programs via Abap/4 function call. partners. Instance It means application server and each one has its own set of work processes. A set of default parameters delivered with the system. It is normally called user frontend. OSS (Online Service System) SAP's Online Service System offers fast and effective help for R/3 System problems. GUI (Graphic User Interface) A graphical interface used by SAP environment as part of the three tiers. It is made up of search terms. IDES (International Demonstration and Education System) It is a model of an international firm. it sets a semaphore. Repair It contains all the objects that a developer has changed but the originals of the objects are located in another system.• • • • • • • • • • • • • • • • • • Field status Indicator that specifies whether a field can take an entry in the entry screen or if it must be filled. OLE It is a technique introduced by Microsoft to incorporate objects of one application into another. They perform dialog steps in user transactions and carry out updates. identified as the source system. Workflow It consists of time and logical sequence of work items. Rollback segments are too small Before increasing up the rollback segment size you should verify your programs. The receiver station places a confirmation bit into the busy token. TCP/IP It is the most widely used transport protocol for open systems. Some sets are not allowed because they are used by SAP. printing services. As soon as the busy token reaches the sender station again.25 It is a standardized network access protocol for the packet switching network. Short dump Not always the problem is technical. You can also try changing key words according to field names. and so on. Choose Option -> Parameters users. The maximum transmission speed is 64 KBit/s. lock management. Transport It is a request to transport objects from the software development environment. The programming tools are accessed using buttons. Work process Work processes perform the bulk of the processing carried out by SAP systems. They are informed when the system is installed. which are precessed by human agents or mechanical processing units. Workbench The ABAP/4 Workbench. Very often the problem belongs to them. switched lines or packet lines. Token Ring It is a LAN architecture with ring topology. a graphical programming environment. is used to create application programs. WAN (Wide Area Networks) They are normally operated either by the telephone company or by private companies that offer leased lines. This involves a 'free token' which circles the loop picking up transmissions. Transaction SE16 (table contents) does not work properly Make usage of the menu option to regenerate the display program. R/3 clients and servers communicate using TCP/IP. Run the program brarchive with deletion option to release disk space.• • • • • • • • • • SysID A set of three letters or number that identify a system. SAP R/3 Troubleshooting • • • • • TOP System gets stuck It happens mostly when archive area is overloaded. dialogs and windows. . to the specified target system. Field exits are completely ignored Make sure your SAP profile parameter contains the option abap/fieldexit = yes. X. Try to create all SAPoffice users through transaction SO32 (create all SAPoffice users) and review your application data carefully. it is converted back to a free token and sent on to the next station. The transmission speed is 4 MBit/s or 16 MBit/s. It is a well-known command among Systems Administrators. Telnet It provides terminal access to hosts using TCP/IP protocol. Often this client does not have master users. • Adding icons The include «ICON» can be easily used in your programs. It allows you to copy many lines at once and paste them afterwards. Enjoy yourself. user SAP*. Pray might be useful too. Changes have to be done using Oracle tools. After moving the mouse to the left side. Transport area is overloaded The command tp clearold «SysID» cleans up the transport area according to parameters previously set on the plain file TPPARAM. • Special copy and paste Click on the area and press CTRL+Y. Release procedure with classification does not work As a matter of fact you are not the only one to notice it. It has to match the allocated area on tablespaces. Any references should be found. • Direct input logs The transaction BMV0 (direct input logs) shows all direct input logs. and password PASS. • Adding symbols The include «SYMBOL» can be easily used in your programs. Sequences of characters begin and finish with the symbol @.ini under your presentation server. Extended help under windows does not link correctly Check the file sapdoccd. It must be present in the main windows directory and should assign to help files directory. anyone can log into the system using the client 066. Either the command IPCS (UNIX) or showipc «INSTANCE NUMBER» (SAP) show all message queue. • Graphics on SAPscript The program RSTXLDMC can be used to upload graphics (file extension . If it is true. semaphore set and shared memory identifier. Instance does not establish communication Shutdown the whole system and check the Interprocess Communication Facilities. Before using release strategy you should apply all notes on OSS. Even plain files under operating system can contain those strings. Before trying again you have to remove them using the command IPCRM (UNIX) or cleanipc «INSTANCE NUMBER» (SAP).tif on PC files) into individual standard text. All icons can be checked through the transaction ICON. It makes available . SAP R/3 Tips & Tricks TOP • Logging on without being authorized Client 066 usually exists in a SAP system because of EarlyWatch services.• • • • • Files for rollback segments are already enormous Check the rollback segments configuration. It hardly works. • Long messages on footer Click on the message and hold the mouse button. • Filling up an empty date field quickly Strike the key F4 (or click on matchcode symbol) and press ESCAPE. • General command field formats /n Skip to the next record if you are processing one batch input session /bend Cancel a batch input foreground process /nend Close all R/3 sessions and logoff /nxxxx Call the transaction xxxx in the same session /o Generate a session list /oxxxx Call the transaction xxxx in an additional session /i Delete the current session /h Turn the debug mode on /$tab Reset all buffers (for System Administrators) /$sync Synchronize instances buffers (for System Administrators) • Report command field formats %pri %pc %sc p+ Print the current report Download the current report Call the find function Go to the next page . It reports the last objects verified and also the respective values. ORFB (Financial Accounting). and ORKS (Cost Center Accounting). • Deleting cost elements and cost centers Since they have no postings you can use the transaction KA04 for deleting cost elements and KS04 for deleting cost centers. • Setting up module FI/CO without using IMG Almost all parameters can be set using the transactions ORFA (Asset Accounting). • Correction and transport system The transaction SE10 provides the easiest way to manage any request/transport and corrections. • Displaying check object when not authorized Soon after the lock try to access the transaction SU53.a great number of symbols. • Table analyses between two systems The contents of a table between two systems can be checked through the transaction OY19. The current date is automaticly set. ? Have you used "component idx of structure" clause with field groups? ANS:Field symbols:Field groups :3. What should be the approach for writing a BDC program? ANS:STEP 1: CONVERTING THE LEGACY SYSTEM DATA TO A FLAT FILE to internal . What are field symbols and field groups. What is the typical structure of an ABAP/4 program? ANS:HEADER .pp++ p-• Go to the previous page Go to the last page Go to the first page Helpful reports RSCLTCOP Copy tables across clients RSAVGL00 Table adjustment across clients RSINCL00 Extended program list RSBDCSUB Release batch-input sessions automaticly RSTXSCRP Transport SAPscript files across systems RSORAREL Get the Oracle Release RGUGBR00 Substitution/Validation utility RSPARAM Display all instance parameters RSUSR003 Check the passwords of users SAP* and DDIC in all clients RSUSR006 List users last login • Meaning of info structures' first letter A B C D E F G H I S X Pricing Output determination Account determination Material determination Rebates Index Listing and Exclusion Batch determination Profile determination Statistics Statistics extra 1.FOOTER. 2.BODY. Exists with the same structure both in dictionary as well as in database exactly with the same data and fields. structures. What are the problems in processing batch input sessions? How is batch input process different from processing online? ANS:PROBLEMS:i) If the user forgets to opt for keep session then the session will be automatically removed from the session queue(log remains).program name behind it. ii)Pool tables & iii)Cluster tables These are logical tables that are arranged as records of transparent tables. What is the alternative to batch input session? ANS:Call transaction.job class and job steps (JOB SCHEDULING) 8. How many types of tables exists and what are they in data dictionary? ans :4 types of tables i)Transparent tables . STEP 3: DEPENDING UPON THE BDC TYPE i)call transaction(Write the program explicity) ii) create sessions (sessions are created and processed.one cannot use . How to do it? ANS:go to SM36 and create background job by giving job name. What is a batch input session? ANS:BATCH INPUT SESSION is an intermediate step between internal table and database table. STEP 2: TRANSFERING THE FLAT FILE INTO SAP SYSTEM CALLED "SAP DATA TRANSFER".if success data will transfer). 10. 6. What are the different types of data dictionary objects? ans:tables. domains. Data along with the action is stored in session ie data for screen fields. We need to submit the program and the batch session in back ground. to which screen it is passed. ii)if session processing fails data will not be transferred to SAP database table. A situation: An ABAP program creates a batch input session. data elements. 5. Matchcode objects.table CALLED "CONVERSION". views. 11. lock objects. Both Opensql and Nativesql can be used. However if session is processed we may delete it manually. and how next screen is processed. 4. What does an extract statement do in the ABAP program? ANS:Once you have declared the possible record types as field groups and defined their structure. TRANSPARENT TABLE DO EXIST WITH THE SAME STRUCTURE BOTH IN THE DICTIONARY AS WELL AS IN THE DATABASE. DATA ELEMENT : A FIELD IN R/3 SYSTEM IS A DATA ELEMENT. the new extract record is added to the dataset .field length. Can you create a table with fields not referring to data elements? ANS:YES. When the first EXTRACT statement occurs in a program. Can a transparent table exist in data dictionary but not in the data base physically? ANS:. the system creates the extract dataset and adds the first extract record to it. What is the step by step process to create a table in data dictionary? ans:step 1: creating domains(data type. iv)Internal tables . 14.THEY SET ATTRIBUTES SUCH AS DATA TYPE.NO. 13.range). 16.native sql on these tables (only opensql). eg:. What is the advantage of structures? How do you use them in the ABAP programs? ANS:Adv:. step 2: creating data elements(properties and type for a table field).They are not managable directly using database system tools. In each subsequent EXTRACT statement.EXACTLY WITH THE SAME DATA AND FIELDS. 12.ITAB LIKE SPFLI.RANGE. 15.. step 3: creating tables(SE11).here we are referening to a data object(SPFLI) not data element.LENGTH. you can fill the extract dataset using the following statements: EXTRACT <fg>.GLOBAL EXISTANCE(these could be used by any other program without creating it again). 17. What are the domains and data elements? ANS:DOMAINS : FORMAL DEFINITION OF THE DATA TYPES. As soon as the system has processed the first EXTRACT statement for a field group <fg>. If you try to modify one of the field groups afterwards and use it in another EXTRACT statement. the record is filled with the current values of the corresponding fields.At PF. 18. What are the events in ABAP/4 language? ANS:Initialization.Start-of-selection. 23. you fill the extract dataset with records of different length and structure.Get. but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry. What is the meaning of ABAP/4 editor integrated with ABAP/4 data dictionary? ANS:22. What is an interactive report? What is the obvious diff of such report compared with classical type reports? ANS:An Interactive report is a dynamic drill down report that produces the list on users choice. At line-selection. 19. diff:a) THE LIST PRODUCED BY CLASSICAL REPORT DOESN'T allow user to interact with the system . When you extract the data. What is a collect statement? How is it different from append? ANS:If an entry with the same key already exists. the COLLECT statement does not append a new line.end-ofpage. Since you can modify field groups dynamically up to their first usage in an EXTRACT statement.At user-command. What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it? ANS:21. extract datasets provide the advantage that you need not determine the structure at the beginning of the program. You can no longer insert new fields into the field groups <fg> and HEADER.At New. a runtime error occurs. the structure of the corresponding extract record in the extract dataset is fixed. By processing EXTRACT statements several times using different field groups.EXTRACT HEADER.top-of-page.end-of-selection. What is open sql vs native sql? ANS:20. AT FIRST.At LAST.AT END. At selection-screen. Value table will be at domain level checking ex: scarr table is check table for carrid.provide export. What is a function group? ANS:GROUP OF ALL RELATED FUNCTIONS.SE38-in pgm click pattern and write function name. b) ONCE A CLASSICAL REPORT EXECUTED USER LOOSES CONTROL.LOCK OBJECTS. 25.IN INTERACTIVE DRILLING IS POSSIBLE.MATCHCODE OBJECTS. HH:MM:SS 30. 33.exception values.exporting. 26. How do you write a function module in SAP? describe. What is a drill down report? ANS:Its an Interactive report where in the user can get more relavent data by selecting explicitly. 24.tables.modification and updation of records by any user.tables.importing. What happens when a table is activated in DD? ANS:It is available for any insertion.exceptions. calling program .MM.import.funcmodule by assigning attributes. 32. 28.STRUCTURES.VIEWS. ANS:creating function module:called program . 31. Name a few data dictionary objects? //rep// ANS:TABLES.se37-creating funcgrp.the list produced by interactive report allows the user to interact with the system.IR USER HAS CONTROL. How are the date and time field values stored in SAP? ANS:DD. What are the exceptions in function module? ANS:COMMUNICATION_FAILURE SYSTEM_FAILURE 27. What are match codes? describe? ans:- . c) IN CLASSICAL REPORT DRILLING IS NOT POSSIBLE. What is a check table and what is a value table? Check table will be at field level checking.YYYY. SELECT-OPTIONS <SEL> FOR <field>.Selection texts .an input field for 'name' will appear on the selection screen. OPTION. 37. LOW and HIGH. SELECT-OPTIONS allow users to fill an internal table with a range of values.min values provided in selection screens. What are select options and what is the diff from parameters? ANS:select options provide ranges where as parameters do not. For each PARAMETERS or SELECT-OPTIONS statement you should define text elements by choosing Goto . The type of LOW and HIGH is the same as that of <field>. The SIGN field can take the following values: I Inclusive (should apply) E Exclusive (should not apply) The OPTION field can take the following values: EQ Equal GT Greater than NE Not equal BT Between LE Less than or equal NB Not between LT Less than CP Contains pattern GE Greater than or equal NP No pattern. diff:PARAMETERS allow users to enter a single value into an internal field within a report. . For each SELECT-OPTIONS .Change. What transactions do you use for data analysis? ANS:35. What is table maintenance generator? ANS:36. A selection table is an internal table with fields SIGN. Eg:.It is a similar to table index that gives list of possible values for either primary keys or non-primary keys. 34. the system creates a selection table. when the user executes the ABAP/4 program.Text elements .Parameters name(30). SELECT-OPTIONS declares an internal table which is automatically filled with values or ranges of values entered by the end user.You can change the comments on the left side of the input fields by using text elements as described in Selection Texts. What are ranges? What are number ranges? ANS:max. SY-UCOMM. Name a few system global variables you can use in ABAP programs? ANS:SY-SUBRC. display :. SY-LILLI IS ABSOLUTE NO OF LINES FROM WHICH THE EVENT WAS TRIGGERED. and then transport the changes between the SAP Systems and clients in your system landscape. How do you validate the selection criteria of a report? And how do you display initial values in a selection screen? ANS:validate :.. select-options <name> for spfli-carrid. What are internal tables? How do you get the number of lines in an internal table? How to use a specific number occurs statement? ANS:- . 44. What is CTS and what do you know about it? ANS:The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing. see Change and Transport Organizer and Transport Management System. When a program is created and need to be transported to prodn does selection texts always go with it? if not how do you make sure? Can you change the CTS entries? How do you do it? ANS:42.SY-DATUM.38. What is the client concept in SAP? What is the meaning of client independent? ANS:43. 39.SY-LILLI. What are selection texts? ANS:40. 41. Read and follow this documentation when planning your development project. This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Are programs client dependent? ANS:Yes. 45..SYTABIX. For practical information on working with the Change and Transport System..SY-UZEIT..Group of users can access these programs with a client no.Parameters <name> default 'xxx'.SY-DBCNT.by using match code objects. Range tables should be avoided (IN operator) . ii)using SY-DBCNT.Avoid nested SELECTS.the INSERT command is used to define which data fields are assigned to which field group. . 47. They are used for file handling in SAP.i)It is a standard data type object which exists only during the runtime of the program. The data set must be transferred through the network to the applications. There should always be a HEADER field group that defines how the extracted data will be sorted. Some measures that can be taken are: . so reducing the amount OF time and also reduces the network traffic. i)system tools ii)field symbols and field groups. What are interface/conversion programs in SAP? ANS : . iii)The number of memory allocations the system need to allocate for the next record population. 46. eg:. 48. How to find the return code of a statement in ABAP programs? ANS:Using function modules.At runtime. . What are datasets? ANS:The sequential files(ON APPLICATION SERVER) are called datasets. Field groups : A field group combines several fields under one name.Use views defined in the ABAP/4 DDIC (also has the advantage of better reusability). They are used to perform table calculations on subsets of database tables and for reorganising the contents of database tables according to users need.FIELD-SYMBOL <FS> [<TYPE>].the data is sorted by the fields grouped under the HEADER field group.Use field list (SELECT clause) rather than SELECT *. 49.but points to a field which is not known until runtime of the program. A Field Symbol does not physically reserve space for a field. ans:Field Symbols : Field symbols are placeholders for existing fields. How do you take care of performance issues in your ABAP programs? Performance of ABAPs can be improved by minimizing the amount of data to be transferred. CONVERSION : LEGACY SYSTEM TO FLAT FILE. disadv:i)If you donot specify a logical database in the program attributes. 50. What are different tools to report data in SAP? What all have you used? ans:55.and can issue the SELECT command with proper where clause to retrieve the data. iii)meaningful data selection. v)good read access performance while retaining the hierarchical data view determined by the application logic.correct.so the code block associated with an event ends with the next event statement (such as another GET or an END-OF-SELECTION). adv:The programmer need not worry about the primary key for each table. What are the techniques involved in using SAP supplied programs? Do you prefer to write your own programs to load master data? Why? 52. What specific statements do you using when writing a drill down report? ans:AT LINE-SELECTION. Have you used SAP supplied programs to load master data? 51. 53. ii)check functions which check that user input is complete. What are the functional areas? User groups? and how does ABAP/4 query work in relation to these? 57.Because Logical database knows how the different tables relate to each other. ii)There is no ENDGET command. i)An easy-to-use standard user interface.and plausible.AT PF. 54.the GET events never occur. What are the advantages and disadvantages of ABAP/4 query tool? 56. A logical database provides read-only access to a group of related tables to an ABAP/4 program. Is a logical database a requirement/must to write an ABAP/4 query? . What are logical databases? What are the advantages/disadvantages of logical databases? ANS:To read data from a database tables we use logical database.AT USER-COMMAND. INTERFACE : FLAT FILE TO SAP SYSTEM. iv)central authorization checks for database accesses. What are Change header/detail tables? Have you used them? 60. 62.For small errors in data we correct them interactively otherwise modify batch input program that has generated the session or many times even the datafile. 66. How do you set up background jobs in SAP? What are the steps? What are the event driven batch jobs? ans:go to SM36 and create background job by giving job name. Is it possible to run host command from SAP environment? How do you run? 64.59. Layout set is a design document. Does SAP handle multiple currencies? Multiple languages? ans:Yes. What is output determination? .system commands. 69. 61. How do you document ABAP/4 programs? Do you use program documentation menu option? 68. What is a currency factoring technique? 67. What is SAPscript and layout set? ans:The tool which is used to create layout set is called SAPscript. What do you do when the system crashes in the middle of a BDC batch session? ans:we will look into the error log file (SM35).job class and job steps(JOB SCHEDULING) 63. To correct incorrect session we analyize the session to determine which screen and value produced the error. What do you do with errors in BDC batch sessions? ANS:We look into the list of incorrect session and process it again. 70. What are the ABAP/4 commands that link to a layout set? ans:control commands. What kind of financial periods exist in SAP? What is the relavent table for that? 65. What are the include programs? ANS:When the same sequence of statements in several programs are to be written repeadly . The status comprises those elements that are currently needed by the transaction. Is ABAP a GUI language? ANS:Yes. PAI . 78. 77. 74.71. DYNPRO 79. Does SAP has a GUI screen painter or not? If yes what operating systems is it available on? What is the other type of screen painter called? 76.etc. ABAP IS AN EVENT DRIVEN LANGUAGE. menu painter GUI Status .menu bar. 73. Normally how many and what files get created when a transaction program is written? What is the XXXXXTOP program? ans:ABAP/4 program.This event is responsible for processing of screen after the user enters the data and clicks the pushbutton. What are step loops? How do you program pagedown pageup in step loops? ans:step loops are repeated blocks of field in a screen. 75. What are IDOCs? ans:IDOCs are intermediate documents to hold the messages as a container.This event is triggered before the screen is displayed.It is subset of the interface elements(title bar. PBO . ans:The control statements that control the screen flow. ans:dynpro .flow logic + screens.. What is screen flow logic? What are the sections in it? Explain PAI and PBO.standard tool bar.push buttons) used for a certain screen. What are screen painter? menu painter? Gui status? . Overall how do you write transaction programs in SAP? ans:Create program-SE93-create transcode-Run it from command field. 72. 90. How do you find if a logical database exists for your program requrements? ans:SLDB-F4. How do you find the tables to report from when the user just tell you the transaction he uses? And all the underlying data is from SAP structures? ans:Transcode is entered in command field to open the table. How do you find the menu path for a given transaction in SAP? ans:87. What are the general naming conventions of ABAP programs? ANS:Should start with Y or Z.only external subroutines Using 'SUBMIT' statement.PP.etc statements in sap script? ans:yes.Yes.HR. 86. .Windows. Can you use if then else. Can you call a subroutine of one program from another program? ans:.. 84. 80.they are coded in include programs (External programs) and are included in ABAP/4 programs.by pressing F1 on a keyword. What are user exits? What is involved in writing them? What precations are needed? 82. perform . What are the different elements in layout sets? ans:PAGES. 81. What are different ABAP/4 editors? What are the differences? ans:91. How do you get help in ABAP? ans:HELP-SAP LIBRARY.SD. 89.Paragraph.Page windows.Character String. What are the different modules of SAP? ans:FI. What are RFCs? How do you write RFCs on SAP side? 83.Utilities-Table contents-display.MM. 85. 92.Header.CO. What type of variables normally used in sap script to output data? 94. How do you backup sapscript layout sets? Can you download and upload? How? 98. In an ABAP/4 program how do you access data that exists on a presentation server vs on an application server? ans:i)using loop statements.N. What are different data types in ABAP/4? ans:Elementary predefined C. How do you use tab sets in layout sets? 97. userdefined TYPES. ans:fields converted into character type. 101.I. What is difference between session method and Call Transaction? ans:102.93. . What has to be done to the packed fields before submitting to a BDC session. ex: see in intel book page no 35/65 Structured predefined TABLES.T. Setting up a BDC program where you find information from? ans:103. What are presentation and application servers in SAP? ANS:The application layer of an R/3 System is made up of the application servers and the message server. userdefined Field Strings and internal tables. Application programs in an R/3 System are run on application servers. 99.D.F.X. and also with each other. ii)flat 100. How do you number pages in sapscript layout outputs? 95. 96.P. the database. What takes most time in SAP script programming? ANS:LAYOUT DESIGN AND LOGO INSERTION. The application servers communicate with the presentation components. using the message server. use clear table before select single or where ever applicable. ans:ii)Pool tables is a logical representation of transparent tables .fnam. Follow the naming standards (of the company or client you are working) 2. Use select field one field two etc do not use select * 3. Use case statement in place of if else 5.dynpro. What are the fields in a BDC_Tab Table. What is cardinality? For cardinality one out of two (domain or data element) should be the same for Ztest1 and Ztest2 tables. ans:BDCDATA (standard structure). 105.Hence no existence at database level.dynbegin. What do you define in the domain and data element. Avoid unnecessary loops. check for sy-subrc where ever applicable 7. What is the difference between a pool table and a transparent table and how they are stored at the database level. do proper documentation of the program inside abap editor and also in se38 (screen-documentation radio button ) 9. M:N Cardinality specifies the number of dependent(Target) and independent (source) entities which can be in a relationship.fval. If requirec use loop with where clause or Read with binary search 4. use ABAP TRACE try to work on those SQL statements to improve performance . Estimate Guidelines for ABAP programs 1. avoid collect statement if possinble 8. Where as transparent tables are physical tables and exist at database level. What is the structure of a BDC sessions. 106. 108. try to use views rather than nested select statement 10. Technical details like 107. 6.104. ans:program. use index only if it is required 12. which is efficient one? 19) What are the output type and Tcodes? 20) Where we use Chain and Endchain? 21) Do you use select statement in loop endloop. pattens(***** ----.11. 14. declare variables / parameters with meaningful words like v_matnr for material number or v_bukrs for plant or at least v_matnum for material number etc. 15. how will be the performance? To improve the performance? 22) In select-options. how to get the default values as current month first date and last date by default? Eg: 1/12/2004 and 31/12/2004 . 13. Otherwise use occurs 0. while using select statements use single select. select * upto 5 rows . which is faster? 10) What are the difference between Interactive and Drill Down Reports? 11) How to pass the variables to forms? 12) How to create a link between modified form and modified print program? 13) What is the table.etc) Answers to some ABAP Interview Questions Questions which I have faced in an interview: 1) What is runtime analysis? Have you used this? 2) What is meant by performance analysis? Have done anything to improve the performance? 3) How to transfer the objects? Have to transferred any objects? 4) How did you test the developed objects? 5) What is the difference between SAP Memory and ABAP Memory? 6) In order to upload Purchase order details. how you handle multiple values for a single field? Eg: Item field may contain no.use select options wisely taking performance into account. which contain the details of all the name of the programs and forms? 14) How did you test the form u developed? How did you taken print? 15) What are Standard Texts? 16) What is the difference between Clustered Tables and Pooled Tables? 17) What is pf-status? 18) Among "Move" and "Move Corresponding". in internal table declaration try to use correct occurs number say occurs 1000. of values for a record 7) What is the procedure you followed to upload the data? 8) How did you handle errors in Call Transaction? 9) Among the Call Transaction and Session Method. Beautify the code using pretty printer.etc based on the requirement. There are two types of testing .Positive testing In negative testing we will give negative data in input and we check any errors occurs. In positive testing we will give positive data in input for checking errors.Variable3 9) Among the Call Transaction and Session Method..Message id . which is faster? Call transaction is faster then session method. When you go to se30. Process will not complete until session get correct.Go thru these answers: 1) What is runtime analysis? Have you used this? It's checks program execution time in microseconds. 8) How did you handle errors in Call Transaction? We can create a internal table like 'bsgmcgcoll'. You can get how much past is your program.if you give desired program name in performance file. It will take you to below screen. when you run the call transaction.. .Message Number .because we can transfer large amount of data from internal table to database and if any errors in a session. But usually we use session method in real time.Message type . We can get errors in this internal table. Below messages are go to internal table. 10) What are the difference between Interactive and Drill Down Reports? . 2) What is meant by performance analysis? Have done 3) How to transfer the objects? Have you transferred any objects? 4) How did you test the developed objects? I was testing a developed object. All the messages will go to internal table.Negative testing .Variable1 .Variable2 . which we are using for secondary list in interactive report.drilldown means above paragraph only. You can use these events to move through layers of information about individual items in a list. And these all are stored in database (data dictionary). 11) How to pass the variables to forms? 12) What is the table.ABAP/4 provides some interactive events on lists such as AT LINE-SELECTION (double click) or AT USER-COMMAND (pressing a button). 18) Among "Move" and "Move Corresponding". Cluster table are logical tables that must be assigned to a table cluster when they are defined. items and different function keys.so if we give move corresponding. 17) What is pf-status? Pf status is used in interactive report for enhancing the functionality. which contain the details of all the name of the programs and forms? Table contains vertical and horizontal lines. Cluster table can be used to store control data they can also used to store temporary data or text such as documentation. Pooled tables are logical tables that must be assigned to a table pool when they are defined. we can get menus. We can scroll depends upon your wish. We can store the data in table as blocks.. Those fields only moving to other place (what ever you want). Drill down report is nothing but interactive report.. 13) How did you test the form u developed? How did you taken print? 14) What are Standard Texts? 16) What is the difference between Clustered Tables and Pooled Tables? A pooled table is used to combine several logical tables in the ABAP/4 dictionary. 19) What are the output type and Tcodes? . Which contain the details of all the name of the programs and forms? (I don't know). 'move corresponding' is very efficient then 'move' statement. which is efficient one? I guess.. Because usually we use this stamtent for internal table fields only.. If we go to se41. ..and at user command is used to modify the screen in a selection screen and in genarating secondary lists. how to get the default values as current month first date and last date by default? Eg: 1/12/2004 and 31/12/2004 Common Questions and Answers about ABAP/4 and Developments 1.. The name itself implies the internal subroutines defined by form /perform. Both the events AT SELECTION-SCREEN and AT USER-COMMAND are processed after user input.subroutines which are defined and used in a same program.. 2) ALV gives many advantages than a list like sorting summing getting graphics like that stuff 3) While generating a interactive report we will use get cursor. Why do we use GET CURSOR and what is it? 4.20) Where we use Chain and End chain? 21) Do you use select statement in loop end loop.external in the sense if you create a sub routine in one program and you're calling this subroutine in another program .... how will be the performance? To improve the performance? 22) In select-options.external subroutines can be called outside the program.. can be called within the same prog in which they were declared. Why do we use ALV? 3...... Then what is the difference between these and when we should use what? Sudeshna Answer 1: 1) Internal subroutines in the sense . Sarath Reddy Answer 2: 1.then this is external subroutine.. What is the difference between external & internal subroutine? 2. 4) At selection screen is used to validate the fields in a selection screen....use is to get the value of the fiel under the cursor. .... . Once you select into EKPO. suppose we want to double click on any filled in the list and want to trace data using that field we use getcursor . its main advantage is by using ALV technique we can find totals ...2..AT SELECTION-SCREEN is used where you have a seperate selection screen using select-options or parameters where as AT USER-COMMAND is used where no selection screen exists.2. if the unix-command were the date? . select single * from *ekpo where ebeln = '67890' and ebelp = '1'.. 3.sort in any order etc there itself in the list output of course we need to write all those functionalities while using ALV. FORMAT INTENSIFIED ON COLOR = COLORID. I think it may be left over from earlier releases. The '*' format can be confusing. 4. you can use it the same way as *EKPO. SAP LIST VIEWER is ALV . How do I use variables in the FORMAT command? DATA COLORID TYPE I VALUE 4.. You now have two separate records.. like *ekpo. how does one capture the results of the command? For example.. GETCURSOR is used to trace the position of the cursor in the list . one in ekpo and one in *ekpo....at.. EKPO is database table and *EKPO is internal table..subtotals . like 2. Shiva I had seen some of the standard abap that the table name had *.. For example: select single * from ekpo where ebeln = '12345' and ebelp = '1'. What is the meaning? What is the difference between with * and without * ? It just lets you use the table a second time. Another way to do this is to simply use the 'into' argument in the 'select' statement to read the second ekpo record into some other field.also many functional modules are defined under ALV concept.user-command is mainly used while setting pf-status which means creating our own menu with function codes etc. When using CALL 'SYSTEM' id 'COMMAND' field unix-command. 2 choose Functions: .DATE_2. like this DATA: BEGIN OF TABL OCCURS 0.DAYS. END OF TABL. LINE(560).g TABL.'DATE_1='. REFRESH TABL. DAYS = DATE_2 . WRITE:/ 'DATE_2='. MOVE STRING1 TO STRING3. I think this is what you need.You capture the results in the table e. When I scanned the function library.DATE_1. DATE_2 = SY-DATUM + 65. Run this code and then you will understand. For SAP Version 3. I am working on a program that needs to show number of days between 2 dates. I can probably code this in ABAP but does anyone know if a function exists to do this. DATE_2 LIKE SY-DATUM. DATA DAYS TYPE I. CALL 'SYSTEM' ID 'COMMAND' FIELD PARCOM_LOC ID 'TAB' FIELD TABL-*SYS*.'DAYS='. WRITE STRING2 TO STRING3+STR_LENGTH. DATA: DATE_1 LIKE SY-DATUM. I wrote this example for you. If you want a space between both fields: CONCATENATE STRING1 STRING2 INTO STRING3 SEPARATED BY ' '. DATE_1 = SY-DATUM.0 choose: CONCATENATE STRING1 STRING2 INTO STRING3. I only found a function to give you the number of years between dates. How do I concatenate two strings in Abap/4? For all SAP Versions STR_LENGTH = STRLEN( STRING1 ).DATE_1. For SAP Version 2. MOVE 'unix command' to U_COMMAND .2x you can get some idea's from the program SAPMSOS0. REFRESH RT. * Table for system messages DATA: BEGIN OF RT OCCURS 100 . CALL 'SYSTEM' ID 'COMMAND' FIELD U_COMMAND ID 'TAB' FIELD RT-*SYS* . START-OF-SELECTION . I want to pass the parameters in the program. WRITE : / RT-LINE .STRING_CONCATENATE for 2 Strings and STRING_CONCATENATE_3 for 3 Strings. If you are on R/3 2.. (2) or try the following program but unfortunately the command CALL SYSTEM is not supported by SAP. command in the report to pass the variant thru the program I would like to know how to execute from ABAP code an external Unix program and check for a return code? There are different ways to this: (1) OPEN DATASET <file> FOR OUTPUT 'unix command' CLOSE DATASET <file> This command executes the unix command and writes the output into <file> Look into OSS Note 9391. General .2.. I want to run a job in the background using a logical database and I do not want the user prompted for the parameters. Has anyone been successful in suppressing the selection screen that is automatically displayed when using logical data bases. REPORT ZUNIXCOM .TABStrips in ABAP . LINE(100) .1 .. Try using the SUBMIT rep USING SELECTION-SET 'variant' WITH . DATA: U_COMMAND(200). ENDLOOP. END OF RT . LOOP AT RT. marc. SELECTION-SCREEN COMMENT (10) text-m01. SELECTION-SCREEN SKIP. SELECT-OPTIONS vplant FOR ekko-reswk. SELECTION-SCREEN BEGIN OF BLOCK rype WITH FRAME TITLE text-t04. ekpo. eket. SELECTION-SCREEN BEGIN OF LINE.com * REPORT ZTABSTRIPS LINE-SIZE 120 NO STANDARD PAGE HEADING. SELECTION-SCREEN END OF BLOCK data1. SELECTION-SCREEN COMMENT 4(35) text-c06 FOR FIELD fix. SELECT-OPTIONS sched FOR ekko-ebeln. SELECTION-SCREEN BEGIN OF LINE. *---------------------------------------------------------------------* * Tab Strips 3 *---------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF SCREEN 103 AS SUBSCREEN. SELECTION-SCREEN BEGIN OF BLOCK data2 WITH FRAME TITLE text-t03. PARAMETERS fix RADIOBUTTON GROUP one. SELECTION-SCREEN END OF BLOCK rype. *---------------------------------------------------------------------* * Tab Strips 1 *---------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN. . SELECTION-SCREEN END OF LINE. TABLES: ekko. SELECTION-SCREEN END OF SCREEN 101.* * Different Selection Options separated by Tabstrips 1. SELECTION-SCREEN BEGIN OF BLOCK data1 WITH FRAME TITLE text-t02. SELECTION-SCREEN END OF BLOCK vendor. ABAP Programming and Other IMG Stuff * http://www. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN SKIP. SELECTION-SCREEN END OF BLOCK data2. SELECTION-SCREEN BEGIN OF BLOCK vendor WITH FRAME TITLE text-t00. SELECTION-SCREEN END OF SCREEN 102. t134h. SELECT-OPTIONS matl FOR ekpo-matnr. SELECTION-SCREEN BEGIN OF BLOCK interval WITH FRAME TITLE text-t05. SELECTION-SCREEN SKIP. plant FOR ekpo-werks. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN BEGIN OF LINE. *---------------------------------------------------------------------* * Tab Strips 2 *---------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN. SELECTION-SCREEN COMMENT 4(35) text-c05 FOR FIELD del. SELECT-OPTIONS: busarea FOR t134h-gsber. SELECTION-SCREEN BEGIN OF LINE.2 and 3 * * Written by : SAP Basis. SELECTION-SCREEN SKIP. SELECT-OPTIONS vendor FOR ekko-lifnr. PARAMETERS del RADIOBUTTON GROUP one.sap-img. puorg FOR ekko-ekorg. SELECTION-SCREEN TAB (17) name2 USER-COMMAND ucomm2 DEFAULT SCREEN 102. SELECTION-SCREEN END OF BLOCK type.PARAMETERS mon RADIOBUTTON GROUP two. SELECTION-SCREEN END OF BLOCK uno. SELECTION-SCREEN END OF SCREEN 103. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN COMMENT 4(15) text-c08 FOR FIELD int. PARAMETERS wek RADIOBUTTON GROUP two. SELECTION-SCREEN END OF LINE. PARAMETERS int RADIOBUTTON GROUP thr. SELECTION-SCREEN COMMENT 4(15) text-c02 FOR FIELD wek. SELECTION-SCREEN END OF BLOCK interval. SELECTION-SCREEN END OF BLOCK pre. PARAMETERS evalweek TYPE sptag. SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN END OF LINE. PARAMETERS bp RADIOBUTTON GROUP slv. SELECTION-SCREEN END OF LINE. name3 = text-n03. . SELECTION-SCREEN BEGIN OF BLOCK type WITH FRAME TITLE text-t01. SELECTION-SCREEN COMMENT 35(30) text-i01. PARAMETERS evalmon TYPE spbup. SELECTION-SCREEN COMMENT 4(15) text-c09 FOR FIELD vn. SELECTION-SCREEN BEGIN OF TABBED BLOCK uno FOR 20 LINES. SELECTION-SCREEN BEGIN OF LINE. A demo program to create subscreen in your ABAP Program * * A demo program to create subscreen in your ABAP Program * * This report will display the user last login date and time. SELECTION-SCREEN COMMENT 4(15) text-c07 FOR FIELD ext. PARAMETERS ext RADIOBUTTON GROUP thr. SELECTION-SCREEN COMMENT 4(15) text-c01 FOR FIELD mon. INITIALIZATION. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN SKIP. SELECTION-SCREEN BEGIN OF LINE. PARAMETERS vn RADIOBUTTON GROUP slv. SELECTION-SCREEN TAB (23) name3 USER-COMMAND ucomm3 DEFAULT SCREEN 103. SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN COMMENT 4(17) text-c10 FOR FIELD bp. SELECTION-SCREEN TAB (15) name1 USER-COMMAND ucomm1 DEFAULT SCREEN 101. SELECTION-SCREEN BEGIN OF LINE. name1 = text-n01. name2 = text-n02. SELECTION-SCREEN BEGIN OF BLOCK pre WITH FRAME TITLE text-t06. SELECT-OPTIONS: CLASSTYP FOR USR02-CLASS. WRITE: / 'User '. SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-020. ABAP Programming and Other IMG Stuff http://www. USR02-LTIME. SELECT * FROM USR02 WHERE BNAME IN USERNAME AND ERDAT IN LASTLOGI AND CLASS IN CLASSTYP. TABLES: USR02. END OF BLOCK SUB. FUNCTION KEY 2.sap-img.* * Subscreen selection 1 : User Name * 2 : Last Login Date * 3 : Class Belong To * * Written by : SAP Basis. . USR02-TRDAT. SELECTION-SCREEN END OF SCREEN 100. SELECTION-SCREEN END OF BLOCK B2. SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-030. * STANDARD SELECTION SCREEN FOR SCROLLING LEFT AND RIGHT SELECTION-SCREEN: FUNCTION KEY 1. SELECT-OPTIONS: USERNAME FOR USR02-BNAME. SELECTION-SCREEN END OF BLOCK B3. SELECTION-SCREEN END OF SCREEN 200. *--------------------------------------------------------------* SUBSCREEN 3 *--------------------------------------------------------------SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN. 'Last Login Date '. USR02-CLASS. 'Last Login Time '. 'CLASS '. SELECTION-SCREEN: BEGIN OF TABBED BLOCK SUB FOR 15 LINES. SELECTION-SCREEN END OF BLOCK B1. START-OF-SELECTION. "FIELDS ON SELECTION SCREENS *--------------------------------------------------------------* SUBSCREEN 1 *--------------------------------------------------------------SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN. *--------------------------------------------------------------* SUBSCREEN 2 *--------------------------------------------------------------SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.com * * REPORT ZSUBSCREEN. SELECTION-SCREEN END OF SCREEN 300. "Logon data SSCRFIELDS. SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-010. SELECT-OPTIONS: LASTLOGI FOR USR02-TRDAT. USR02-BNAME. ABAP Programming and Other IMG Stuff * http://www. SSCRFIELDS-FUNCTXT_02 = '@0E@'. ELSEIF SSCRFIELDS-UCOMM = 'FC02'. INITIALIZATION.sap-img. VALUE LIKE LINE OF LIST. WHEN 300. SUB-DYNNR = 300. IF SSCRFIELDS-UCOMM = 'FC01'. ENDIF. AT SELECTION-SCREEN.ENDSELECT. VALUE-KEY = '1'. ELSEIF SSCRFIELDS-UCOMM = 'FC02'. ENDCASE. SUB-DYNNR = 100. SUB-DYNNR = 100. . LIST TYPE VRM_VALUES.com * REPORT ZLIST. * SCREEN ICON LEFT AND RIGHT SSCRFIELDS-FUNCTXT_01 = '@0D@'. IF SSCRFIELDS-UCOMM = 'FC01'. WHEN 100. END-OF-SELECTION. SUB-PROG = SY-REPID. List Box in ABAP Report * * List Box in ABAP Report * * Written by : SAP Basis. CASE SY-DYNNR. ENDIF. PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10. SUB-DYNNR = 200. ELSEIF SSCRFIELDS-UCOMM = 'FC02'. NAME = 'PS_PARM'. ENDIF. SUB-DYNNR = 100. TYPE-POOLS: VRM. IF SSCRFIELDS-UCOMM = 'FC01'. AT SELECTION-SCREEN OUTPUT. SUB-DYNNR = 300. WHEN 200. SUB-DYNNR = 200. DATA: NAME TYPE VRM_ID. WRITE: / 'TABLE EMPTY'. Auto Disallowed Back Posting to Previous Period *********************************************************************** * AUTO DISALLOWED BACK POSTING TO PREVIOUS PERIOD *********************************************************************** REPORT ZBDCMMRV. BUKRS LIKE MARV-BUKRS. DATA: END OF IPUTTAB. VALUE-TEXT = 'LINE 2'. START-OF-SELECTION. DATA: BEGIN OF MESSTAB OCCURS 50. * Auto / Manual run the Batch Input Program PARAMETERS P-RUN AS CHECKBOX DEFAULT 'X'. "Company Code * INTERNAL TABLE FOR BATCH INPUT DATA DATA: BEGIN OF IPUTTAB OCCURS 50. SELECT * FROM MARV WHERE BUKRS = P-BUKRS. * Batch Input Name PARAMETERS P-BTCHSN(12) DEFAULT 'MMRVCHANGE'. END OF ULTAB. DATA: C_TAXKM LIKE MG03STEUER-TAXKM VALUE '1'. PS_PARM. CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST. TABLES: MARV. * CHECK WHETHER TABLE IS EMPTY IF ULTAB[] is initial. W-LINE-NO TYPE I. * INTERNAL TABLE FOR BATCH INPUT ERROR MESSAGE. APPEND ULTAB. APPEND VALUE TO LIST. WRITE: / 'PARAMETER:'. ENDIF. INCLUDE STRUCTURE BDCMSGCOLL. ENDSELECT. * Create Batch session . ULTAB-BUKRS = MARV-BUKRS. VALUE-KEY = '2'. * Company Code PARAMETERS P-BUKRS LIKE MARV-BUKRS. APPEND VALUE TO LIST. INCLUDE STRUCTURE BDCDATA. DATA: END OF MESSTAB. REFRESH ULTAB.VALUE-TEXT = 'LINE 1'. * INTERNAL TABLE FOR DATA DATA: BEGIN OF ULTAB OCCURS 50. APPEND IPUTTAB. IPUTTAB-DYNPRO = '100'. CALL FUNCTION 'BDC_CLOSE_GROUP'. IPUTTAB-DYNBEGIN = 'X'. IPUTTAB-FVAL = ' '. IPUTTAB-FVAL = 'X'. IPUTTAB-FNAM = 'MARV-XRUEV'. PERFORM SCREEN1. * END OF MAIN PROGRAM FORM SCREEN1. APPEND IPUTTAB. . * MMRV ENQUIRY BY COMPANY CODE CLEAR IPUTTAB. LOOP AT ULTAB. * Specify that we are now done with this screen (Save it with F11) CLEAR IPUTTAB. PERFORM CLOSE-SESS. IPUTTAB-FNAM = 'BDC_OKCODE'. * MODIFY SCREEN IN MMRV CLEAR IPUTTAB. APPEND IPUTTAB. PERFORM SCREEN2. IPUTTAB-FNAM = 'MARV-XRUEM'. *********************************************************************** * FORM : SCREEN1 * *********************************************************************** FORM SCREEN2. ** LOOP TABLE TO CREATE SCREEN INPUT SORT. APPEND IPUTTAB. PERFORM PRN_ULTAB. IPUTTAB-PROGRAM = 'SAPMM03Y'. IPUTTAB-DYNBEGIN = 'X'. APPEND IPUTTAB. * DISALLOWED BACKPOSTING GENERALLY CLEAR IPUTTAB. IPUTTAB-FNAM = 'MARV-BUKRS'. * UNTICK ALLOWED POSTING TO PREVIOUS PERIOD CLEAR IPUTTAB. IPUTTAB-DYNPRO = '110'. IPUTTAB-PROGRAM = 'SAPMM03Y'.PERFORM CRE-BATCH-SESS. REFRESH IPUTTAB. IPUTTAB-FVAL = ULTAB-BUKRS. ENDFORM. ENDLOOP. * SCREEN #1: INITAL SCREEN FOR MAINTAINING SOURCE LIST CLEAR IPUTTAB. IF P-RUN = 'X'. WRITE: ' RECORD# '. ENDFORM.) delimeter for bdc but I could not upload data from note pad to sap. * closing the session. Delimiter for BDC Program I use (tab and .IPUTTAB-FVAL = '/11'. ENDIF. W-LINE-NO. ELSE. W-LINE-NO = W-LINE-NO + 1. ENDFORM. APPEND IPUTTAB. *********************************************************************** * FORM : PRN-ULTAB * * DESCRIPTION : PRINT OK TABLE * *********************************************************************** FORM PRN_ULTAB. ENDFORM. ** Create BTCI session ** CALL FUNCTION 'BDC_OPEN_GROUP' EXPORTING CLIENT = SY-MANDT GROUP = P-BTCHSN USER = SY-UNAME KEEP = 'X'. . *********************************************************************** * FORM : CRE-BATCH-SESS * * DESCRIPTION : CREATE BATCH SESSION * *********************************************************************** FORM CRE-BATCH-SESS. * Maual run the Batch Input Program CALL FUNCTION 'BDC_INSERT' EXPORTING TCODE = 'MMRV' TABLES DYNPROTAB = IPUTTAB. * Auto run the Batch Input Program CALL TRANSACTION 'MMRV' USING IPUTTAB MODE 'E' UPDATE 'S' MESSAGES INTO MESSTAB. ENDFORM. *********************************************************************** * FORM : CLOSE-SESS * * DESCRIPTION : CLOSE THE SESSION * *********************************************************************** FORM CLOSE-SESS. WRITE: / ULTAB-BUKRS. Use . You either save the excel sheet as Tab delimited file or . Then when its tab delimited or . END OF IT_DUMMY.csv. *uploading the input file*********************************************** CALL FUNCTION 'UPLOAD' EXPORTING FILENAME = INPUT TABLES DATA_TAB = IT_DUMMY EXCEPTIONS CONVERSION_ERROR = 1 INVALID_TABLE_WIDTH = 2 INVALID_TYPE =3 NO_BATCH =4 UNKNOWN_ERROR =5 OTHERS = 6. "lot size key END OF IT_MAIN. if we are using excel sheet as a data provider for BDC Program. "material selection to change DISLS LIKE MARC-DISLS. ) this is wrong you have to use TAB OR . APPEND IT_MAIN. While executing bdc you have to mention delimiter factor at bdc screen. TEXT(500).csv file. Nitin Can anybody tell me. *appending it_main by splitting the uploaded file LOOP AT IT_DUMMY. DATA : BEGIN OF IT_MAIN OCCURS 0. DATA : BEGIN OF IT_DUMMY OCCURS 0. MATNR LIKE RMMG1-MATNR.' INTO IT_MAIN-MATNR IT_MAIN-DISLS. then how to define a delimiter so that my BDC programe should automatically split the field. (comma) . SPLIT IT_DUMMY AT '. SPLIT the contents into respective fields. and declare your internal table to get the corresponding the contents from the file. ENDLOOP. .As you mentioned that you have used ( tab & . Here is a sample for CSV file : *declaration of internal tables. (comma). "Mrp Group "Purchasing group . " Purchasing Group * * Mrp 1 disgr like MARC-DISGR. "Material Group ekwsl like MARA-EKWSL."like mara-brgew."Material Valuation rlgrap. Basic 1 Maktx Like makt-maktx. Tables: Mara. "Division brgew(7). "Gross Weight gewei like MARA-GEWEI."Material Descriptions marc. mbrsh like mara-mbrsh. "Material Group BISMT LIKE MARA-BISMT."Plant Data for Material mbew."Storage Location Data for Material mvke. "Material Code "Industry Data "Material Type Org Data Werks lgort vkorg vtweg "Plant "Storage Location "Sales Orgnization "Distribution Chanel like like like like marc-werks. mtart like mara-mtart."Program Fields/Screen Fields for SAPLGRAP Data: begin of ITAB occurs 0."General Material Data mard. mard-lgort. "Uom matkl like mara-matkl. " Old Material Number spart like mara-spart.Example how Views are dealt in BDC Can any body tell me some views of MM that we can use in BDC? Rashi Well here is an example for you to see how the views are dealt with in BDC's. " Purchasing Value Key ekgrp like MARC-EKGRP."Sales Data for Material Makt. "Weight Unit ntgew(7). include bdcrecx1. mvke-vtweg. "Description meins like mara-meins. ekgrp like MARC-EKGRP. mvke-vkorg."Internal table for Semi-Finished Material * * * Initial data matnr like mara-matnr.. ***************************************************** ****This is a BDC for Semi finished Materials******** report ZBDC_SEMIFIN no standard page heading line-size 255." like mara-ntgew. "Net Weight * Purchasing MAKTL LIKE MARA-MATKL.. "Planned delivery time fhori(3). "Create a session . "Procurement type lgpro like MARC-LGPRO. "Unit of issue FEVOR LIKE MARC-FEVOR. "Safety stock * Mrp 3 PERKZ LIKE MARC-PERKZ. "Backward Consumption period vint2(3). MARC-BSTMA. "Production Storage Location dzeit(3). *COSTING EKALR LIKE MBEW-EKALR. perform upload." like MARC-VINT1. "Record Allready exists."like MARC-PLIFZ. MARC-BSTFE. "Value for uo issue * Accounting 1 bklas like vprsv like verpr(7). MARC-DISPO. "Availability Check * Mrp 4 sbdkz like MARC-SBDKZ. "Price Control Indicator like MBEW-VERPR. " Costing Lot size end of ITAB. MARC-BSTMI." like RMMZU-UMREN."like MARC-FHORI." STPRS like MBEW-BKLAS. "Total record processed start-of-selection. "Consumption mode vint1(3). MARC-BSTRF. ********************************************************** Data: W_record type I. "In house Production time plifz(3)." With qty str LOSGR like MARC-LOSGR. * "Individual/ Collective "Repetitive Manufacturing "REM Profile Work Scheduling View ausme like MARC-AUSME. "Value/Price MBEW-STPRS. "Production Scheduler SFCPF like MARC-SFCPF. vrmod like MARC-VRMOD. SFEPR like MARC-SFEPR.dismm dispo disls BSTMI BSTMA BSTRF BSTFE like like like like like like like MARC-DISMM. "Production Scheduler Profile umren(5)."like MARC-VINT2. MARC-DISLS. SAUFT like MARC-SAUFT. "Sched margin key eisbe like MARC-EISBE. "Val for base uom umrez(5) . "Forward Consumption period mtvfp like MARC-MTVFP. w_trecord type I. "Valuation Class MBEW-VPRSV."like RMMZU-UMREz. "Upload Data from Text File Perform Open_group."like MARC-DZEIT. "Mrp Type "Mrp Controller "Lot Size * Mrp 2 beskz like MARC-BESKZ. perform bdc_field using 'MSICHTAUSW-KZSEL(13)' 'X'. perform semi.clear : w_record. perform bdc_field using 'BDC_OKCODE' '/00'. *Initial Screen perform bdc_dynpro perform bdc_field using 'SAPLMGMM' '0060'. * Check for material in master ************************* select single * from mara where matnr eq ITAB-matnr. w_trecord = w_trecord + 1. loop at ITAB. perform bdc_field using 'MSICHTAUSW-KZSEL(09)' 'X'. if sy-subrc ne 0. perform bdc_field using 'MSICHTAUSW-KZSEL(12)' 'X'. perform bdc_field using 'MSICHTAUSW-KZSEL(14)' 'X'.w_trecord. perform bdc_field using 'MSICHTAUSW-KZSEL(17)' 'X'.. perform bdc_field using 'MSICHTAUSW-KZSEL(15)' 'X'. perform bdc_field using 'RMMG1-MTART' 'HALB'. perform bdc_field using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(17'. ***********************Views********************************** *Select Views perform bdc_dynpro using 'SAPLMGMM' '0070'. using 'BDC_OKCODE' '/00'. endif. using 'BDC_CURSOR' 'RMMG1-MTART'. perform close_group. "Create Semi Finish Materials if w_trecord gt 0 or w_record gt 0. . perform bdc_field using 'RMMG1-MATNR' ITAB-MATNR. "Close session FORM SEMI. ***********************Views********************************** *perform bdc_dynpro *perform bdc_field * *perform bdc_field * using 'SAPLMGMM' '0070'. perform bdc_field using 'BDC_OKCODE' '=AUSW'. perform bdc_field using 'RMMG1-MBRSH' 'M'. perform bdc_field using 'MSICHTAUSW-KZSEL(01)' 'X'. perform batch_job. using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)'. using 'MARA-MTPOS_MARA' 'NORM'. using 'BDC_OKCODE' '=ENTR'. using 'RMMG1-LGORT' ITAB-LGORT. using 'MARA-BRGEW' ITAB-BRGEW. using 'BDC_OKCODE' '/00'. using 'BDC_OKCODE' '/00'. using 'MARA-MEINS' ITAB-MEINS. using 'BDC_OKCODE' '=SP09'.*perform *perform * *perform * *perform * *perform *perform * *perform * *perform *perform * *perform * *perform * bdc_dynpro bdc_field bdc_field bdc_field bdc_dynpro bdc_field bdc_field bdc_dynpro bdc_field bdc_field bdc_field *Org Data perform bdc_dynpro perform bdc_field perform bdc_field perform bdc_field perform bdc_field *Basic 1 perform bdc_dynpro perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field *Purchasing using 'SAPLMGMM' '0070'. using 'MARA-NTGEW' ITAB-NTGEW. using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(13)'. using 'MARA-MATKL' ITAB-MATKL. using 'MSICHTAUSW-KZSEL(13)' ITAB-KZSEL_13_012. using 'BDC_CURSOR' 'MARA-NTGEW'. using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)'. using 'BDC_OKCODE' '=ENTR'. using 'BDC_CURSOR' 'RMMG1-LGORT'. using 'SAPLMGMM' '0070'. using 'MSICHTAUSW-KZSEL(17)' ITAB-KZSEL_17_011. using 'MARA-BISMT' ITAB-BISMT. using 'MARA-GEWEI' ITAB-GEWEI. using 'MAKT-MAKTX' ITAB-MAKTX. using 'SAPLMGMM' '0070'. using 'SAPLMGMM' '4004'. using 'MARA-SPART' ITAB-SPART. . using 'RMMG1-WERKS' ITAB-WERKS. using 'SAPLMGMM' '0080'. using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(17)'. using 'MARA-EKWSL' ITAB-EKWSL. ENDIF. using 'BDC_OKCODE' '=SP14'."MAX LOT SIZE perform bdc_field using 'MARC-BSTRF' ITAB-BSTRF. using 'MARC-EKGRP' ITAB-EKGRP. using 'MARC-BESKZ' ITAB-BESKZ. using 'MARC-LGPRO' ITAB-LGPRO. using 'MARA-MEINS' ITAB-MEINS. perform bdc_field using 'MAKT-MAKTX' ITAB-MAKTX. perform bdc_field using 'BDC_CURSOR' 'MARC-DISLS'. using 'BDC_OKCODE' '=SP12'. IF ITAB-DISLS EQ 'EX' . *MRP 1 perform bdc_dynpro perform bdc_field using 'SAPLMGMM' '4000'. perform bdc_field using 'MARC-DISMM' ITAB-DISMM. perform bdc_field using 'MARC-EKGRP' ITAB-EKGRP."RNDING ELSEIF ITAB-DISLS EQ 'FX'. . perform bdc_field using 'MARC-DISPO' ITAB-DISPO. perform bdc_field using 'MARC-BSTFE' ITAB-BSTFE.perform bdc_dynpro perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field using 'SAPLMGMM' '4000'."MIN LOT SIZE perform bdc_field using 'MARC-BSTMA' ITAB-BSTMA. using 'BDC_OKCODE' '=SP13'. using 'MAKT-MAKTX' ITAB-MAKTX. using 'MARA-MATKL' ITAB-MATKL. perform bdc_field using 'MARC-BSTMI' ITAB-BSTMI. *MRP 2 perform bdc_dynpro perform bdc_field perform bdc_field perform bdc_field perform bdc_field using 'SAPLMGMM' '4000'. using 'BDC_CURSOR' 'MARA-EKWSL'. using 'MAKT-MAKTX' ITAB-MAKTX. perform bdc_field using 'MARA-MEINS' ITAB-MEINS. perform bdc_field using 'MARC-DISLS' ITAB-DISLS. using 'SAPLMGMM' '4000'. using 'BDC_CURSOR' 'MARC-SFCPF'.perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field *MRP 3 perform bdc_dynpro perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field *MRP 4 perform bdc_dynpro perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field *Work Scheduling perform bdc_dynpro perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field using 'MARC-DZEIT' ITAB-DZEIT. using 'BDC_CURSOR' 'MARC-MTVFP'. using 'MARC-VINT1' ITAB-VINT1. using 'MAKT-MAKTX' ITAB-MAKTX. using 'MARC-FEVOR' . using 'SAPLMGMM' '4000'. using 'MARC-VINT2' ITAB-VINT2. using 'MARC-SFEPR' ITAB-SFEPR. using 'MAKT-MAKTX' ITAB-MAKTX. using 'MARC-SBDKZ' ITAB-SBDKZ. using 'BDC_OKCODE' '=SP24'. using 'BDC_OKCODE' '=SP15'. using 'SAPLMGMM' '4000'. using 'MARC-FHORI' ITAB-FHORI. using 'MAKT-MAKTX' ITAB-MAKTX. using 'BDC_CURSOR' 'MARC-SFEPR'. using 'MARC-MTVFP' ITAB-MTVFP. using 'MARC-EISBE' ITAB-EISBE. using 'MARC-PERKZ' ITAB-PERKZ. using 'MARC-PLIFZ' ITAB-PLIFZ. using 'MARC-VRMOD' ITAB-VRMOD. using 'BDC_CURSOR' 'MARC-EISBE'. using 'MARA-MEINS' ITAB-MEINS. using 'MARC-SAUFT' ITAB-SAUFT. using 'BDC_OKCODE' '=SP17'. using 'MARA-MEINS' ITAB-MEINS. using 'MARC-DZEIT' ITAB-DZEIT. using 'BDC_OKCODE' '=SP26'. using 'SAPLMGMM' '4000'. using 'MBEW-STPRS' ITAB-STPRS. ELSEIF ITAB-VPRSV ='V'. perform bdc_field using 'MBEW-VERPR' "FILLS VALUE ITAB-VERPR. ENDIF. using 'MBEW-VPRSV' ITAB-VPRSV. using 'MBEW-STPRS' "FILLS STD PRICE ITAB-VERPR. using: 'BDC_OKCODE' '=ENTR'. 'RMMZU-UMREN' ITAB-UMREN. using 'MARC-DZEIT' itab-DZEIT. using 'BDC_CURSOR' 'MBEW-STPRS'.perform bdc_field perform bdc_field perform bdc_field ITAB-FEVOR. using 'MARC-LGPRO' itab-LGPRO. using 'MAKT-MAKTX' ITAB-MAKTX. using 'SAPLMGMM' '4000'. using 'BDC_CURSOR' . perform bdc_field using 'SAPLMGMM' '0510'. perform bdc_field perform bdc_field *Accounting perform bdc_dynpro perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field perform bdc_field IF ITAB-VPRSV = 'S'. using 'MARC-SFCPF' ITAB-SFCPF. using 'MARC-LGPRO' ITAB-LGPRO. using 'BDC_OKCODE' '=BU'. 'RMMZU-UMREZ' ITAB-UMREZ. using 'MAKT-MAKTX' ITAB-MAKTX. *Check for Conversation Factor if ITAB-MEINS ne iTAB-ausme and iTAB-umren gt and iTAB-umrez gt perform bdc_dynpro perform bdc_field endif. using 'MBEW-BKLAS' ITAB-BKLAS. *Cost Estimate perform bdc_dynpro perform bdc_field perform bdc_field perform bdc_field 0 0. using 'MARA-SPART' ITAB-SPART. using 'MARA-MEINS' ITAB-MEINS. uline. 80 ''. endif. perform bdc_transaction using 'MM01'. perform bdc_field using 'MARC-LOSGR' ITAB-LOSGR. write:/05 '2. w_record = w_record + 1. perform bdc_field REFRESH BDCDATA. w_trecord right-justified. format color col_heading. * ************************************************************* else. if w_trecord gt 0. endif. ENDFORM. form Upload. ENDLOOP. 80 ''. write:/ 'Please follow the following steps to run this job'. 'Semi-Fin'. skip. perform bdc_field using 'MBEW-EKALR' ITAB-EKALR. form batch_job. 80 ''.Goto Transaction SM35'. = ' ' = ' ' = ' ' = ITAB = = = = = = = 1 2 3 4 5 6 7. if w_record gt 0. 80 ''.'.'MARC-PRCTR'. 80 ''. format color col_normal. write:/05 '1. . write:/05 '3.Select your Session Name'. Write:/ 'Background Job has been Created for '. CALL FUNCTION 'UPLOAD' EXPORTING CODEPAGE FILENAME FILETYPE TABLES DATA_TAB EXCEPTIONS CONVERSION_ERROR INVALID_TABLE_WIDTH INVALID_TYPE NO_BATCH UNKNOWN_ERROR GUI_REFUSE_FILETRANSFER OTHERS ENDFORM. format color col_negative.Click On Execute Button'. write:/ 'as listed below. 80 ''. Many ABAPERS have this problem. DATA: END OF W_LOG. "y = page forward. Here is the solution code for this :************************************************************************ * data for controlling paging on screen 0102 DATA: W_MAXLINES(2) TYPE N. so how to determine the number of available lines depending on the font size. W_NEXT_LINE(3) TYPE N. The number of lines vary. endif. then the font size changes from machine to machine as a result the no of entries keeps changing. DATA: END OF W_HDR. INCLUDE STRUCTURE D022S. * set w_maxlines to the number of var-loop occurrences on the screen so * that we know when to page forward on screen 0102 . DATA: END OF W_MC. DATA: BEGIN OF W_MC OCCURS 20. W_PAGE(1). INCLUDE STRUCTURE D021S. if a batch input has a table control. INCLUDE STRUCTURE D020S. ************************************************************************ FORM GET_MAX_LINES. Determine the number of lines on a screen for programming BDC Is there a way to determine the number of lines on a screen for programming BDC? Many users have different size fonts and resolutions on each screen. n otherwise W_SCRLEN(2) TYPE I. endform. format color off.write:/ w_record . END OF W_DYNPRONAME. DATA: END OF W_FLD. W_SCRLINE(2) TYPE I. DYNPRO(4) VALUE '0102'. DATA: BEGIN OF W_LOG OCCURS 20.'records already existed'. DATA: BEGIN OF W_FLD OCCURS 100. DATA: BEGIN OF W_DYNPRONAME. PROGRAM(8) VALUE 'SAPMM60X'. 80 ''. INCLUDE STRUCTURE D023S. DATA: BEGIN OF W_HDR. uline. 1 ) . ENDFORM.1. IF SY-SUBRC EQ 0 AND W_SCRLEN NE 0.* also initialise w_next_line to zero for GET_NEXT_LINE * this subroutine caters for all cases . W_NEXT_LINE = 1.3 * and then 1 less but not sure why! W_MAXLINES = SY-SROWS . "this required if no screen loop ENDIF. MOVE 99 TO W_MAXLINES. * set w_page if page forward is required W_NEXT_LINE = W_NEXT_LINE + 1. ELSE. 2 ulines * 3 = no of lines after loop .( wscrline . ************************************************************************ . W_PAGE = 'Y'. LOOP AT W_FLD WHERE LTYP EQ 'L'. W_NEXT_LINE. W_PAGE = 'N'.4 . ENDIF.4 . IF W_NEXT_LINE GT W_MAXLINES.W_SCRLINE . ENDFORM.including screens without loops CLEAR: W_MAXLINES. pushbuttons. IMPORT DYNPRO W_HDR W_FLD W_LOG W_MC ID W_DYNPRONAME.3. W_MAXLINES = W_MAXLINES . "first var-loop line MOVE W_FLD-LBLK TO W_SCRLEN. MOVE W_FLD-LINE TO W_SCRLINE.command line. ************************************************************************ FORM GET_NEXT_LINE. "depth of loop block EXIT. ENDLOOP. * sy-srows = total no of lines on screen * w_scrline = actual first line of loop so that * w_scrline .1 . ELSE.1 = number of heading lines (before loop) * 4 = no of lines at top of screen .uline & Page count * w_scrlen = no of lines in loop block * w_maxlines = sy-srows . W_MAXLINES = W_MAXLINES DIV W_SCRLEN. Or this.How to used 3 tables for inner joins? Inner joins using 3 tables Try this :SELECT stpo~stlnr stpo~idnrk mast~matnr mara~mtart stpo~menge INTO CORRESPONDING FIELDS OF TABLE zmat1 FROM mast JOIN stpo ON stpo~stlnr = mast~stlnr JOIN mara ON mara~matnr = mast~matnr WHERE stpo~stlty = 'M' "AND stpo~idnrk IN s_matnr AND mast~werks = 1000. This code locates sales. delivery and payment terms info from a billing document number. this one also works fine : select zfpcd~cadivi zfpcd~proforma zfpcd~factura zfpcd~aniofactura zfpcd~montousd zfpcd~montoap zfpcd~ebeln zfpcd~inco1 . Here s_matnr is a select-options on the selection-screen. Code: Select single Vbrk~Bukrs Vbrk~Kunrg Vbrk~Vbeln Vbrk~Fkdat Vbrk~Bstnk_Vf Vbrk~Zterm Tvzbt~Vtext Vbak~Vbeln Vbak~Bstdk Likp~Vbeln Likp~lfdat Likp~Lfuhr into w_vbrk from vbrk inner join Tvzbt on Tvzbt~Zterm = Vbrk~Zterm and Tvzbt~Spras = sy-langu Inner join Vbfa as SalesLnk on SalesLnk~vbeln = pu_vbeln and SalesLnk~vbtyp_v = c_order inner join Vbak on Vbak~Vbeln = SalesLnk~Vbelv Inner join Vbfa as DeliveryLnk on DeliveryLnk~vbeln = pu_vbeln and DeliveryLnk~vbtyp_v = c_Delivery inner join Likp on Likp~Vbeln = DeliveryLnk~Vbelv where vbrk~vbeln = pu_Vbeln. or Here. . BKLAS TYPE MBEW-BKLAS. SKAT. BKBEZ TYPE T025T-BKBEZ. ITAB LIKE SORTED TABLE OF WA WITH NON-UNIQUE KEY BKLAS MATNR. * It will reduce your network load. "General Material Data "Material Descriptions "Material Valuation "G/L Account Master Record "Valuation Class Descriptions "Standard Accounts Table DATA: BEGIN OF WA. KTO. TYP. MATNR TYPE MARA-MATNR. MAKTX TYPE MAKT-MAKTX. * * Written by : SAP Basis. ABAP Programming and Other IMG Stuff * http://www. TABLES: MARA. MAKT. MTART TYPE MARA-MTART.BSX * * If you use inner join to read data from several logically * connected tables instead of nested Select statements. MAT. SELECT-OPTIONS: PLANT MATLTYPE MATERIAL CHARTACC FOR FOR FOR FOR MBEW-BWKEY MARA-MTART MBEW-MATNR T030-KTOPL MEMORY MEMORY MEMORY MEMORY SELECT P~BKLAS F~MATNR F~MTART G~MAKTX T~BKBEZ INTO CORRESPONDING FIELDS OF TABLE ITAB ID ID ID ID PLT.zfpcd~lifnr lfa1~name1 zcdvs~status zfpcd~conint into it_lista from zfpcd inner join zcdvs on zfpcd~ebeln = zcdvs~ebeln and zfpcd~proforma = zcdvs~proforma and zfpcd~lifnr = zcdvs~lifnr inner join lfa1 on zfpcd~lifnr = lfa1~lifnr where zcdvs~status = '04'. END OF WA. MBEW. * * Based on transaction OBYC .sap-img. Inner Join to retrieve the Material Valuation Class * * Inner Join to retrieve the Material Valuation Class pointing to * which General Ledger. T030.Inventory Posting . T025T.com * REPORT ZVALGL. FROM ( ( ( ( MBEW AS P INNER JOIN MARA AS F ON P~MATNR INNER JOIN MAKT AS G ON P~MATNR INNER JOIN T025T AS T ON P~BKLAS WHERE P~BWKEY IN PLANT AND F~MTART IN MATLTYPE AND P~MATNR IN MATERIAL AND G~SPRAS = 'E'. Try this changes ** in global data add these two hashed tables data: begin of wa_mkpfmseg. CLEAR: T030. SELECT SINGLE * FROM T030 WHERE BKLAS = WA-BKLAS AND KTOSL = 'BSX'. My program spended more than an hour to select 5000 records from mkpf inner mseg(From a range of 100000 records) . *************************************************** Select statement with inner join is taking forever Following is the select stmt which is taking forever. SKAT. T030-KONTS. Can somebody let me know how to fine tune this statement. WRITE: / WA. = F~MATNR ) = G~MATNR ) = T~BKLAS ) ) LOOP AT ITAB INTO WA. SELECT MKPF~BUDAT MKPF~CPUTM MSEG~MATNR MSEG~WERKS MSEG~EBELN MSEG~EBELP MSEG~ERFMG INTO CORRESPONDING FIELDS OF TABLE W_DTL_INVOICE FROM MKPF INNER JOIN MSEG ON MKPF~MBLNR = MSEG~MBLNR AND MKPF~MJAHR = MSEG~MJAHR WHERE MKPF~BUDAT > '20040721' AND MSEG~BWART = '101' AND MSEG~BUKRS = '1733'. SELECT SINGLE * FROM SKAT WHERE SAKNR = T030-KONTS AND SPRAS = 'E'. This is the solution I made. ENDLOOP. . Now it needs less than 15 seconds to perform the same task. It does not have much records. mblnr like mkpf-mblnr. Kasi I have gone through the same problem last year. SKAT-TXT20. budat like mkpf-budat. end of wa_mkpfmseg. ebelp like mseg-ebelp. ebelp like mseg-ebelp. end of wa_mkpfmseg. matnr like mseg-matnr. bukrs like mseg-bukrs bwart like mseg-bwart. werks like mseg-werks. data ht_mkpfmseg like hashed table of wa_mkpfmseg with unique key mblnr mjahr zeile with header line. ** change your select sentence to look like this: select mkpf~mblnr mkpf~mjahr mseg~zeile mseg~bukrs mseg~bwart MKPF~BUDAT MKPF~CPUTM MSEG~MATNR MSEG~WERKS MSEG~EBELN MSEG~EBELP MSEG~ERFMG INTO TABLE ht_mkpfmseg FROM MKPF INNER JOIN MSEG ON mkpf~mandt = mseg~mandt AND MKPF~MBLNR = MSEG~MBLNR AND MKPF~MJAHR = MSEG~MJAHR where mkpf~budat > '20040721'. erfmg like mseg-erfmg. data ht_mkpfmsegSel like hashed table of wa_mkpfmsegSel with unique key budat cputm matnr werks ebeln ebelp with header line.mjahr like mkpf-mjahr. budat like mkpf-budat. matnr like mseg-matnr. ebeln like mseg-ebeln. ebeln like mseg-ebeln. cputm like mkpf-cputm. zeile like mseg-zeile. erfmg like mseg-erfmg. check ht_mkpfmseg-bukrs = '1733' and ht_mkpfmseg-bwart = '101' read table ht_mkpfmsegsel with table key budat = ht_mkpfmseg-budat cputm = ht_mkpfmsegcputm matnr = ht_mkpfmseg-matnr . loop at ht_mkpfmseg. werks like mseg-werks. cputm like mkpf-cputm. data: begin of wa_mkpfmsegSel. just let us know. ht_mkpfmsegSel-budat = ht_mkpfmseg-budat. loop at ht_mkpfmsegSel. endloop.0 up to 4. move-corresponding ht_mkpfmseg to ht_mkpfmsegsel. modify table ht_mkpfmsegSel transporting erfmg. insert table ht_mkpfmsegsel. else. ht_mkpfmsegSel-cputm = ht_mkpfmseg-cputm. endif. Kind regards *********************************** . Here put the code between your select . " at this point ht_mkpfmsegSel has the data collected that you want.. ht_mkpfmsegSel-ebelp = ht_mkpfmseg-ebelp. the data is selected into a hashed table which are the faster access tables provided by SAP from 4. As the select isn't restricting bukrs and bwart (but there is a good reason on this: it's faster to read 100000 records into a hashed table and then filter the 80000 unwanted than to select the 20000 records via non index fields in the where clause. . endselect. ht_mkpfmsegSel-ebeln = ht_mkpfmseg-ebeln.werks = ht_mkpfmseg- werks ebeln = ht_mkpfmseg-ebeln ebelp = ht_mkpfmseg-ebelp transporting erfmg.6c (I don't know about 4. you're not distracting the sql optimizer when it analizes the sql where clause.7) 3. I hope this help you. ht_mkpfmsegSel-matnr = ht_mkpfmseg-matnr.. add ht_mkpfmseg-erfmg to ht_mkpfmsegSel-erfmg. If not. This should run faster because of the next reasons: 1... if sy-subrc <> 0. I tested it in my own programs). endloop. It makes use of the first index declared on mkpf (budat-mblnr)2. ht_mkpfmsegSel-werks = ht_mkpfmseg-werks..
Copyright © 2024 DOKUMEN.SITE Inc.