Showing posts with label ABAP Tips. Show all posts
Showing posts with label ABAP Tips. Show all posts

How to download the data structure of tables in SE11?

Good morning people around the world. Its me again doing some blogs. Sharing to you some tips and tricks in the SAP world. Well, before I start my topic today, just want you to know that our country was hit by one of the strongest typhoons on earth this year named "Yolanda". Thank God and it did not hit directly Manila, the capital of the country where millions of people are living. Just recently, Bohol in the Visayan island was hit another 7.2 magnitude earthquake which causes more than 200 people died. Anyway, let us pray together to all our brethren who were in the midst of this natural calamity.

So to begin my discussion today, I will share to you a great tutorial which I know it will be beneficial to all. Many SAP systems have customized developments. In relation to it, there are custom tables also that were created by the ABAP developers. Now, the question of many developers is, how can they back up their tables into their laptops or computers? Just like in my previous blog which I tackled on how to download your ABAP code into PDF file, now what we want to download into our own computer is the structure of our custom table that we created?

Why do we need to download the structure of our custom tables? Basically, we need to have a copy of it as for our future reference. Actually, in other databases like MySQL, there is that functionality of IMPORT/EXPORT which you can download the whole database into your computer. But in SAP, this feature is not supported. What SAP offers is the transport system from one system to another but not into your own computer.

So in this tutorial, I will discuss to you a simple way to back-up your custom tables into your local drive. Just follow the steps below:


Steps:

1. First, open your custom table using SE11. What I used as an example here is EKKO which is a standard table.


2. In the file menu, click Utilities->Database Object->Display.


3. A new screen like this one below appears showing the structure of the table. Please take note that the data elements were replaced with elementary data types.


4. Normally, when we download, we go to System ->List->Save. But as you can see, all options are disabled.


5. In order to download it, put your mouse cursor anywhere in the table then right-click it. From the context menu, select View Source.


5. A notepad then appears displaying the source code of the table. This is an HTML format.


6. Click the Save in the file menu. This dialog appears. Then save your file anywhere now into your local drive. Remember, since this is an HTML file, save this way, your filename must end with .html, so example, table_ekko.html. And the last reminder is, change the "Save as type" into "All files" (Please refer to screenshot below).


7. Congratulations. you have now a copy into your local drive the custom table you created. Go to the directory where you save your file. Open it and it will look the same as the one in SAP.


Sample Result:

How to download your ABAP Codes into PDF file?

It's my first day of work again after suffering a long week of vacation due to influenza. Ouch. Well, no one wants to get sick. Im just so lucky enough it was not a dengue or whatsoever complicated illness but its a plain flu which needs a bed rest. In effect, my ABAP developments were curtailed and postponed for its delivery.  Thanks a lot to my Project Manager for her kind considerations.

So today, I finished doing my task assigned to me the previous week. Actually, it just a finishing touch producing the desired result. After a couple of hours doing it, its done and ready for testing. After I test and it passes with all the requirements and conditions set in the functional design, I decided to download the ABAP codes I did for future reference since it uses a dynamic internal table that has a static fields.

Normally, when I backup my ABAP codes, I just COPY-PASTE it in a notepad or in a word document. This technique is ok. But now I want to have a PDF file so I can save it into my mobile phone in order to view it anywhere at any given time.

Well, this is now the solution I discovered which I want to share to everyone.

Steps:
1. At the lower right part of the ABAP editor, you will see this button in yellow. That button is below the vertical scroll bars. Click this button to view the different options.




2. From the options, click keyboard. Then select File.ExportPDF from the command list. Please refer from the screenshot below.



3. On the input box, New Shortcuts, type CTRL + ATL + L. Then click the button Assign. By the way, the combination of the keys can be different from yours as long as it is available. It so happened that this key combinations are available so I used in this tutorial. After clicking the Assign button, you will see the keys reflected in the Shortcuts for selected commands textbox. Then click the Save button afterwards.



4. Once you save the settings you did above, you will be back into your ABAP editor. Now, in your editor, pressed the key combination you set. In my case, I will press 
 CTRL + ATL + L. Immediately, the Save dialog box will be prompted like this one. Type the filename of your file and locate the directory where you want to save. Finally, click the Save button to create the PDF file.



So that's how simple to create a PDF file for your ABAP codes. I hope you like this tutorial.


Sample PDF Output:

How to create a number range in SAP using SNRO?

During ABAP development, sometimes we need to generate a unique ID which is needed as primary key for a custom table we created. Unlike in other databases such as mySQL that a field can be set as auto-increment once defined as primary key. In SAP environment, this feature is missing in table creation so we need to setup a number range that generates distinct number which increments and used as primary key. 

A Number Range is a sequence of numbers with a start and an end. It shows the current number that is being used in your program. Letters cannot be added as a prefix or suffix in generating number ranges like, A-001, A-002, etc.

So in this tutorial, I divided into four parts which I will discuss one by one. It includes the following topics:
  1. Setting the number range definition
  2. Setting the number range object
  3. Transporting the number range to other system
  4. Implementing the number range in a program
Steps:

Setting the Number Range Definition
First, type the tcode SNRO into the command prompt.

Then, enter a name in the input field for your number range object. Note that it must begin with Y or Z just like in other objects that indicates it is a customer development. After which, click the Create button .
















In this next screen, set the following parameters:
a. Short Text – short description for the number range (20 characters).
b. Long Text – long description for the number range (60 characters).
c. Number length domain – Name of the domain, which determines the length of the number range number
d. Warning % - Percentage of no remaining in a number range, upon reaching which in number assignment is given. Example, you have defined an interval of 1 to 1000. If you want to issue a warning at the number 900, enter 10% here.


Click on the Save button  in the toolbar menu to save the number range definition. A popup screen will be displayed which you need to add a package. But for this tutorial, just click the Local Object below.















Setting the Number Ranges Interval
After creating the number range definition, the next step is to set the intervals for this object. Go back to the main window, click the button Number Ranges button on the toolbar.


Then in this screen, click the button Change Intervals. 

Then click the Add Interval button on this screen.












Enter an integer for the column “No”, “From Number” and “To Number”. This is the number range interval set for this object. Then press enter and click the check button .
















Click on "Save" button. And the number range interval you have just declared will be listed in the Number Range object 's number intervals list. You can declare multiple intervals but be sure there will be no overlapping between intervals.



Transporting the number range to other system
The following warning screen is displayed once you save the number ranges. It states that the interval is not automatically added on the transport request no. So we need to add the intervals manually on the transport request number in order to be transported to other system.

Go back again into the main screen. On the file menu, click menu Interval->transport as seen below.


This transport message appears afterwards. Just click the Yes button below to include the intervals in a transport request no.





















After which, it will create a transport request number which adds the number range interval. Thereby, it can be transported now to other system.









Implementing the number range in a program
After defining the number range object, it’s time to discuss how to use number range object in ABAP code. The following function modules are used in implementing the number range object:
  1. NUMBER_RANGE_ENQUEUE -function sets a lock on the number range object. 
  2. NUMBER_GET_NEXT - function call the next number in the number range interval is read and passed into an ABAP variable.
  3. NUMBER_RANGE_DEQUEUE - function and removing the lock on the relate SAP number range object.
Complete Sample Code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
DATA: gv_id TYPE i.
CONSTANTS:
   c_obj TYPE inri-object     VALUE 'ZNEWTEST',
   c_no  TYPE inri-nrrangenr  VALUE '01'.

START-OF-SELECTION.
  PERFORM f_getnextnum USING gv_id c_obj c_no.
  WRITE gv_id.

*&---------------------------------------------------------------------
*& Form f_getnextnum
*&---------------------------------------------------------------------
* text
*----------------------------------------------------------------------
FORM f_getnextnum USING
      p_nextnum TYPE i
      p_rangeobj TYPE inri-object
      p_rangeno TYPE inri-nrrangenr.

  CALL FUNCTION 'NUMBER_RANGE_ENQUEUE'
    EXPORTING
      object           = p_rangeobj
    EXCEPTIONS
      foreign_lock     = 1
      object_not_found = 2
      system_failure   = 3
      OTHERS           = 4.
  IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
      nr_range_nr             = p_rangeno
      object                  = p_rangeobj
    IMPORTING
      number                  = p_nextnum
    EXCEPTIONS
      interval_not_found      = 1
      number_range_not_intern = 2
      object_not_found        = 3
      quantity_is_0           = 4
      quantity_is_not_1       = 5
      interval_overflow       = 6
      buffer_overflow         = 7
      OTHERS                  = 8.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  CALL FUNCTION 'NUMBER_RANGE_DEQUEUE'
    EXPORTING
      object = p_rangeobj.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDFORM.  

How to activate &SAP_EDIT in SE16N?

SE16N is a powerful transaction code in SAP. What makes it powerful is the use of this command &SAP_EDIT which can modify table records, add entries to tables  and the worst, it can delete table records without further notice. 

In some ways, this feature is beneficial also as there's no need to create Views to maintain a particular table. However, sometimes it is also crucial to use this feature as data can be modified or deleted without caution. Once this happens, it may bring down the whole system. That's why SAP security team then created an OSS notes (1446530 and 1525586) that disabled this features. 

So when you try to type the command &SAP_EDIT into your command bar, it will no longer activate the editing feature. But if you still want to activate it (cause you have a hard head... just kidding), here's the procedure to enable this feature. As I said, please do this with PRE-CAUTIONS.

Steps:
1) Go to tcode SE16N and type the table name you want to modify. In this example, I used the table BSID. It can be seen that the checkbox "Maintain entries" is still uncheck.



















2) Now, instead of typing &SAP_EDIT in the command window, type /H to activate the debugger. Then press the enter key.










3) While in debug mode, type the name of the following  global variables GD-EDIT. Click the pencil button to change the value of it. 









As seen below, enter "X" as the value of the global variable. Then click the eyeglass button.









4) Finally, press F8 key to exit from debugging mode. Now you will see that the option "maintain entries" is now check. This means, you can now edit that table. :)



NOTE: this tutorial needs precautions. This is only for tutorial purposes. Do not do this into your QA or PROD System as it may incur damaged.

How to implement "Parallel Cursor"?

Sometimes we need to loop within a loop as other calls it as a nested loop. We cannot deny the fact that there are tables in the data dictionary wherein we loop a header internal table and carry out some processing for each of the lines in the corresponding Item level internal table. To perform the same, we end up using nested loops which have a great impact on the performance and result in long execution times. 

In order to overcome this situation, we need to implement PARALLEL CURSOR technique/approach wherein we maintain a cursor which holds the value of the index from where the subsequent search should start. This will result in vastly optimized ABAP components which would further facilitate faster data loading.


Illustration:

Suppose we have two internal tables IT_EKKO (header) and IT_EKPO (item) containing purchase order header and item level data and we need to extract some item level details on the basis of PO number which is common key in both the tables. We will have to put a nested loop here. Suppose there are 1000 records in table IT_EKPO and for PO 123 there are three records available in IT_EKPO table.

Example of a Nested Loop

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
DATA : 
   it_ekko  TYPE STANDARD TABLE OF ekko,
   wa_ekko  TYPE ekko,
   it_ekpo  TYPE STANDARD TABLE OF ekpo,
   wa_ekpo  TYPE ekpo.

DATA : 
   lv_tabix TYPE sy-tabix.

SELECT * FROM ekko INTO TABLE it_ekko.
SELECT * FROM ekpo INTO TABLE it_ekpo.

LOOP AT it_ekko INTO wa_ekko.
   LOOP AT it_ekpo INTO wa_ekpo WHERE ebeln = wa_ekko-ebeln.
       "Logial ABAP statements 
   ENDLOOP.
ENDLOOP.

Here when WA_EKKO-EBELN =123 the inner loop will execute 1000 times and statement inside the loop will execute 3 times. This will result in higher data load runs and poor performance. We can optimize the above using parallel cursor technique as elaborated below:

Parallel cursor is the technique to increase the performance of the program, when there are nested loops. The approach uses a variable using which we can maintain a cursor which will avoid the search to start all over again, from the first record. Instead it will control the loop to start the search from a specified index. This as a result makes the search faster and thus the high end performance improvement is scene in data loading processes. A mandatory prerequisite before using the approach is that the internal tables are both sorted by the respective key fields.


Nested Loop Using Parallel Cursor:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
DATA : 
it_ekko TYPE STANDARD TABLE OF ekko,
wa_ekko TYPE ekko,
it_ekpo TYPE STANDARD TABLE OF ekpo,
wa_ekpo TYPE ekpo.
DATA : lv_tabix TYPE sy-tabix.

SELECT * FROM ekko INTO TABLE it_ekko.
SELECT * FROM ekpo INTO TABLE it_ekpo.
SORT it_ekko BY ebeln.
SORT it_ekpo BY ebeln.

LOOP AT it_ekko INTO wa_ekko.
   READ TABLE it_ekpo TRANSPORTING NO FIELDS 
   WITH KEY ebeln = wa_ekko-ebeln binary search.
   IF sy-subrc EQ 0.
      lv_tabix = sy-tabix.
      LOOP AT it_ekpo INTO wa_ekpo FROM lv_tabix.
         IF wa_ekpo-ebeln NE wa_ekko-ebeln.
            EXIT.
         ENDIF.
         Logial ABAP statements ………..
      ENDLOOP.
   ENDIF.
ENDLOOP.

Here when WA_EKKO-EBELN =123 the inner loop will execute 4 times and statement inside the loop will execute 3 times. This will result in a major performance improvement over the nested loop code elaborated earlier in the document.

How to access a TCODE without authorization?

Its weekend again and time to share all knowledge I learned over the week. I know this topic that I will discuss today would be beneficial to my fellow ABAP developers specially when they dont have the SAP_ALL authorizations. For the sake of everyone, SAP_ALL authorizations is an authorization provided to a user in which he can access all standard tcodes of SAP system. So whether this is a functional or technical tcode, it is possible to access. 

However, in an environment of a multinational company, this authorization is NOT permitted. As a developer, you are only given the access of all tcodes related to development like, SE38 (ABAP Editor), SE24 (Class Editor), SE37 (Function Module Editor) and other tcode related to development.

Now the issue is, how about if I want to access a particular tcode which is not related to ABAP Development? Let say, SU01, User Maintenance? But when I access it, I got this message "You are not authorized to access"? So in case you encounter it, what will you do?
Do you have any idea to by-pass the authorization set to your user account? Or will you ask your Basis people to grant you an access to this transaction code? How about if they denied your request? 

Dont worry now as the pain is over. Well, in this tutorial, I will discuss with you on how to access any SAP Tcodes even you don't have any authorizations.Yes, you are right. We will by-pass the that authorization limiting you to access a particular tcode. The only requirement here is you must have an access to SE38 and you have the role S_DEVELOP. Since you will be creating a new program which we will call, ZTCODE. :)

First thing, create an ABAP program. Then copy this program below. It is just a 12 liner program. A simple one.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
DATA: l_tcode TYPE sytcode.
PARAMETERS: p_tcode TYPE sy-tcode.
START-OF-SELECTION.

  SELECT SINGLE tcode FROM tstc
    INTO l_tcode
    WHERE tcode = p_tcode.
  IF sy-subrc = 0.
    CALL TRANSACTION p_tcode.
  ELSE.
    MESSAGE 'TCODE not found.' TYPE 'I'.
  ENDIF. 
Once you are done, save and activate your program. The secret here is be sure to create a customized transaction code for this program. Let say, ZTCODE. Otherwise, you can't access that particular tcode you want to view. Clear? 


Result:
Initially, I can't access SU01.



But after I created this program, I activated and ran it.



And voila, I can now access SU01 without the BASIS people. :)

How to create a dynamic internal table?

Dynamic internal table is an extension to the internal table concept. It is used when the number of fields is NOT known at the design time or until the compile time. So in this tutorial, I will discuss the basic methods in implementing a dynamic internal table.

First add the static structure. When I say static structure, this is the structure that is declared explicitly in your ABAP program. In my sample codes below, I have two fields for my static structure. (see TYPES: t_output in the sample code below).

Next, count how many no. of columns to be added dynamically. You can compute this from the selection screen from where it will be referenced. So in my sample code below, I have one parameter. Based from this parameter, user will enter how many columns they want to add. So be sure, you must define this point since this is critical where the number of columns will be determined. Remember that the number of column is the number of loop.

Then, combine the dynamic columns together with the static fields. However, before you can combine you must do the loop adding the dynamic column with their fieldname and datatype. (see subroutine f_add_dyn_field in the sample code below)

Finally, create the dynamic table by instantiating it with reference to cl_abap_structdescr . The dynamic table then will be passed to the FM REUSE_ALV_GRID_DISPLAY for display. Remember also in creating the fieldcatalog, you must do a loop to add the dynamic column. Otherwise, it will not be displayed. For reference, see the routine f_build_fieldcatalog.

Complete Sample Code:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
REPORT  y_dynamic_table.

TYPE-POOLS : abap,slis.

TYPES: BEGIN OF t_output,
  bukrs TYPE bukrs,
  dmbtr TYPE dmbtr,
END OF t_output.

DATA:
   wa_data_ref         TYPE REF TO data,
   wa_struct_type      TYPE REF TO cl_abap_structdescr,
   wa_elem_type        TYPE REF TO cl_abap_elemdescr,
   wa_comp_fld         TYPE cl_abap_structdescr=>component,
   i_comp_tab          TYPE cl_abap_structdescr=>component_table,
   i_comp_tot_tab      TYPE cl_abap_structdescr=>component_table,
   g_total_field       TYPE i,
   g_tabix(2)          TYPE c.

DATA:
   i_fieldcatalog      TYPE slis_t_fieldcat_alv WITH HEADER LINE,
   g_layout            TYPE slis_layout_alv.

FIELD-SYMBOLS:
   <fs_it_output>      TYPE STANDARD TABLE,
   <fs_wa_output>      TYPE ANY.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p_nocol(2) TYPE c DEFAULT 5.
SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.
  PERFORM f_add_static_structure.
  PERFORM f_add_dyn_field.
  PERFORM f_create_dyn_itab.
  PERFORM f_display_alv_report.

*&--------------------------------------------------------------*
*&      Form  F_CREATE_DYN_ITAB
*&--------------------------------------------------------------*
FORM f_add_static_structure.
  wa_struct_type ?= cl_abap_typedescr=>describe_by_name( 'T_OUTPUT' ).
  i_comp_tab = wa_struct_type->get_components( ).
  APPEND LINES OF i_comp_tab TO i_comp_tot_tab.
ENDFORM.                    " F_CREATE_DYN_ITAB

*&--------------------------------------------------------------*
*&      Form  F_ADD_DYN_FIELD
*&--------------------------------------------------------------*
FORM f_add_dyn_field .
  g_tabix = 0.
  DO p_nocol TIMES.
    g_tabix = g_tabix + 1.
    wa_elem_type ?= cl_abap_elemdescr=>describe_by_name( 'DMBTR').
    CONCATENATE 'COL_' g_tabix  INTO wa_comp_fld-name.
    wa_comp_fld-type = cl_abap_elemdescr=>get_p(
    p_length = wa_elem_type->length
    p_decimals = wa_elem_type->decimals ).
    APPEND wa_comp_fld TO i_comp_tot_tab.
  ENDDO.
ENDFORM.                    " F_ADD_DYN_FIELD

*&--------------------------------------------------------------*
*&      Form  F_CREATE_TAB
*&--------------------------------------------------------------*
FORM f_create_dyn_itab.
  wa_struct_type = cl_abap_structdescr=>create( i_comp_tot_tab ).
  CREATE DATA wa_data_ref TYPE HANDLE wa_struct_type.
  ASSIGN wa_data_ref->* TO  <fs_wa_output>.
  CREATE DATA wa_data_ref LIKE STANDARD TABLE OF <fs_wa_output>.
  ASSIGN wa_data_ref->* TO <fs_it_output>.
ENDFORM.                    " F_CREATE_TAB

*&--------------------------------------------------------------*
*&      Form  f_display_alv_report
*&--------------------------------------------------------------*
FORM f_display_alv_report .
  PERFORM f_create_layout USING g_layout.
  PERFORM f_build_fieldcatalog.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = sy-repid
      i_callback_pf_status_set = 'PF_STATUS'
      is_layout                = g_layout
      it_fieldcat              = i_fieldcatalog[]
    TABLES
      t_outtab                 = <fs_it_output>
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.
ENDFORM.                    " F_DISPLAY_ALV_REPORT

*&--------------------------------------------------------------*
*&      Form  f_create_layout
*&--------------------------------------------------------------*
FORM f_create_layout USING p_gd_layout TYPE slis_layout_alv.
  p_gd_layout-zebra = 'X'.
  p_gd_layout-colwidth_optimize = space.
ENDFORM. " f_create_layout

*&--------------------------------------------------------------*
*&      Form  pf_status
*&--------------------------------------------------------------*
FORM pf_status USING ut_extab TYPE slis_t_extab.
  SET PF-STATUS  'STANDARD_FULLSCREEN'  OF PROGRAM 'SAPLKKBL'.
ENDFORM.                    "pfstatus

*&--------------------------------------------------------------*
*&      Form  f_build_fieldcatalog
*&--------------------------------------------------------------*
FORM f_build_fieldcatalog.
  REFRESH i_fieldcatalog.
  i_fieldcatalog-fieldname  = 'BUKRS'.
  i_fieldcatalog-seltext_l  = 'Company Code'.
  i_fieldcatalog-outputlen  = 20.
  APPEND i_fieldcatalog TO i_fieldcatalog.
  CLEAR i_fieldcatalog.
  i_fieldcatalog-fieldname  = 'DMBTR'.
  i_fieldcatalog-seltext_l  = 'Amount'.
  i_fieldcatalog-outputlen  = 10.
  APPEND i_fieldcatalog TO i_fieldcatalog.
  CLEAR i_fieldcatalog.
  g_tabix = 0.
  DO p_nocol TIMES.
    g_tabix = g_tabix + 1.
    wa_elem_type ?= cl_abap_elemdescr=>describe_by_name( 'DMBTR').
    CONCATENATE 'COL_' g_tabix  INTO wa_comp_fld-name.
    i_fieldcatalog-fieldname  = wa_comp_fld-name.
    i_fieldcatalog-seltext_m  = wa_comp_fld-name.
    i_fieldcatalog-outputlen  = 13.
    APPEND i_fieldcatalog TO i_fieldcatalog.
  ENDDO.
ENDFORM.                    "f_build_fieldcatalog


Output:
 


Five columns are added.


thanks a lot again for reading... keep on visiting this blog... enjoy... :)

How to change a $TMP package into a Z* or Y* package?

Sometime when we develop an ABAP program, we save it as LOCAL ($TMP) object specially if we dont want to transport to other system such program or maybe, the Transport No. is not yet created by the Basis people.



So in this tutorial, I will show to you how to change from local object ($TMP) to a Z* or Y* package and add its transport no.

STEPS:

1. Open your program in SE38. Click Goto-->Object Directory Entry.


2. This screen below appears. Click on the pencil button to change.



 Once clicked, the package parameter is now modifiable. Type here your Z* or Y* package and hit the save button.


After you hit the Save button, the screen for adding TR number appears. There you can now add the transport no as specified by you.

Thanks for reading again. Enjoy

How to download the data structure of tables in SE11?

Good morning people around the world. Its me again doing some blogs. Sharing to you some tips and tricks in the SAP world. Well, before I s...