Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding a standard program

Former Member
0 Likes
335

Hi ,

I have got a requirement in which i need to add 5 new fields to the standard program RMCB0300. The present program is written in ALV classes . Our requiement is to make that program in to totally to ALV grid. I need the code if any one send me the code for this.We need to add 5 new fields apart from the old strategy. Please send me the code . I am new to this ABAP-Object oriented approach. Definetely this is a very cruicial issue for me in the project. Nothing more than that is to be changed.

Want more details i will send you.

Thanks & Regards...

Satish

1 REPLY 1
Read only

former_member480923
Active Contributor
0 Likes
304

Hi,

there is a perform routine AUSTAB_AUSGEBEN in the program RMCS0LIS, if you go thru the following piece of code in that Perform routine (at line number 378)

LOOP AT AUS_S000.
  CHECK <AUSTAB_GLOBAL>-FLG_AUSBLENDEN = FALSE.

  AUSTAB_TABIX = SY-TABIX.
  PERFORM COLOR_TAB_LESEN USING <AUSTAB_GLOBAL>-COLOR_ID.
  PERFORM SPALTENANFANG_AUSGEBEN USING TRUE.
  PERFORM KENNZAHLENZEILE_AUSGEBEN.
ENDLOOP.

This table is used for ur output.

After that its simple u have to do replace the loop with the following piece of code:


  data: wa_layout type lvc_s_layo.

** Create the Container
  create object wl_ref_container
        exporting
          container_name    = w_container.
** Create the Grid object
  create object w_grid
    exporting
      i_parent          = wl_ref_container
    exceptions
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      others            = 5.
  check sy-subrc = 0.
** Layout
  wa_layout-zebra = c_check.
  wa_layout-stylefname = 'STYLO'.
** display ALV
  if w_sale = c_check.

    call method w_grid->set_table_for_first_display
      exporting
        is_layout                     = wa_layout
      changing
        it_outtab                     = <b>AUS_S000</b>
        it_fieldcatalog               = t_fcat
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.
    if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
  else.
    call method w_grid->set_table_for_first_display
      exporting
        is_layout                     = wa_layout
      changing
        it_outtab                     = t_likp
        it_fieldcatalog               = t_fcat
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.
    if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
  endif.

remember to create the fieldcatalog equivalent to the Table.

Hope That Helps

Anirban M.