Posts

Showing posts with the label ABAP Fundamentals

Routing Creation(CA01) - SAP Upload Tool - Using BDC.

Image
Routing defines the sequence of activities performed at the work center. Routing plays an important role in calculating production cost, machine time, and labor time. A routing is a description of which operations or list of activities has to be carried out during the production and planning process. It also tells what order or sequence the activities/operations needs to be carried out at work centers or machines. This program can be used for routing creation. Its a simple program which takes care of multiple options. This program also helps to generate the file format, which will remove the dependency on the file format all the time.  SAMPLE PROGRAM: REPORT zpp_routing_creation. *&---------------------------------------------------------------------* *& Report ZTEST *&---------------------------------------------------------------------* *& Report Name        : ZPP_ROUTING_CREATION *& Report Title    ...

SAP Function Module - READ_TEXT - Sample Program.

Image
READ_TEXT function module can be used to process text modules in application programs, all information about a text module must be transferred to internal work areas. A text is read from the text file or text memory with this function module. It must be described fully by specifying OBJECT, NAME, ID, and LANGUAGE. Generic entries in these parameters are not valid. When header information and text lines have been read successfully, they are transferred to the work areas HEADER and LINES. Sample Program On READ_TEXT Using Subroutines: DATA :  gt_head    TYPE TABLE OF thead,              gwa_head   TYPE  thead,              gt_tlines  TYPE TABLE OF tline,              gwa_tlines TYPE tline. PERFORM  read_text  USING  'VBBK' lv_vbeln '0001' lv_text. ************Sub Routine***************** ...

SAP Function Module - SAVE_TEXT - Sample Program.

Image
SAVE_TEXT function module writes a text module to the text file or text memory, depending on the specific text object. This function module can be used to change existing texts and to create new texts. If it is clear that it is a new text, this can be specified via the parameter INSERT. The result is better performance as a test read is not performed. Sample Program On SAVE_TEXT Using Subroutines: DATA :  gt_head    TYPE TABLE OF thead,              gwa_head   TYPE  thead,              gt_tlines  TYPE TABLE OF tline,              gwa_tlines TYPE tline. PERFORM  prepare_save_text  USING  'VBBK' lv_vbeln '0001' lv_text. ************Sub Routine***************** FORM  prepare_save_text  USING  p_tdobject p_tdname p_tdid p_tdline.   CHECK  p_tdline  IS NOT INITI...

Parallel Cursor Looping - SAP ABAP - Performance Tuning

Nested Loops is one of the fear factors for all the ABAP developers as this consumes lot of program execution time. If the number of entries in the internal tables is huge, then the situation would be too worse. The solution for this is to use parallel cursor method whenever there is a need for Nested Loop. Advantages Over Conventional Nested Loop Method: When nested loop becomes necessary than parallel cursor is really helpful in improving the performance. It will help us to avoid complete looping of the internal table. If there are two-three internal tables inside the loop it will be more efficient way of coding.  PROGRAM LINES: Conventional Method Using Nested Loops: loop at lt_vbpa into wa_vbpa.   loop at lt_kna1 into wa_kna1 where kunnr = wa_vbpa-kunnr. ****** Your Actual logic within inner loop ******   endloop. endloop. The below code is the replacement for above code with Parallel Cursor logic which is most preferred method. Paralle...

Create/ Access Dynamic Internal Table - SAP ABAP

Image
A  Dynamic Internal Table  is the extension of the internal table concept which is used in the program to store itemized data with the fact that the number of columns are not known at the type of declaring the structure of the table. The final structure of the table is known at the runtime or compile time. How To Create Dynamic Internal Table There are few ways to declare the dynamic internal table. Now based on the requirement we need to decide which way we need to proceed for table creation. 1st Way: Here from selection screen (p_table) we are getting the table name whose data needs to be displayed. Now in the table <t_itab> we are having 20 records from MARA table stored to be displayed. 2nd Way:  Now the second way we can create the dynamic internal table is to using dynamic field catalog based on which the dynamic table will be created. Here we are dynamically populating the lt_fcat. Here few fields are fixed like aufnr, matnr, charg...

Internal Table Operations - SAP ABAP.

Internal tables are an important feature of the ABAP language. Internal tables are preferably used to store and format the content of database tables from within a program. Furthermore, internal tables in connection with structures are an important means of defining complex data structures in an ABAP program. The representation and processing on Internal Table plays a key role in the development Therefore, it is necessary to have well knowledge about its operation. For the developer who are new to SAP, it is somehow difficult to understand how these operation takes place and works. Here we elaborate on different operation of Internal Table with new advanced Syntax. INTRODUCTION: When you define internal tables, you can select one of three table types:  Standard, Sorted, or Hashed.  The table type determines how an application can store and access data in the table. Storage and access are simplest for standard tables. In terms of functionality, there is little diff...