Application Development 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: 

Reg: Customizing CN41N transaction by adding addtional columns

Former Member
0 Kudos

Dear Experts,

The output of CN41N transaction contains all the data required, I need to add few columns in the ALV Report. Those columns are formulas of the standard output.

Can anyone tell me how to achieve this, it would be great.

Please tell me how to update this, i'm not able to find out the internal table and the field catalogue before getting displayed.

I would be waiting for your replies.

Thanks in advance.

Regards,

Abdur Rafique

Edited by: abdur rafique on Apr 20, 2011 12:27 PM

3 REPLIES 3

former_member184578
Active Contributor
0 Kudos

Hi,

Program for CN41N is RPSINFO . Goto Se38 enter program name as RPSINFO and click on copy.., copy all to ur zreport.,

now go to include rpsinfo_load_alv_grid001. this contains the populating data., now create a z include and copy every thing in rpsinfo_load_alv_grid001 to ur z include., and customize it as per ur requirement., u can append the fields u want to the standard sturucture.

hope this helps u.,

Thanks & Regards

Kiran

0 Kudos

Hi Kiran,

Thanks for the reply, This is the code mentioned below in the include which you have suggested. Please tell me where the data is getting populated and the field catalogue. I'm new to ABAP OOPs.


*----------------------------------------------------------------------*
***INCLUDE RPSINFO_LOAD_ALV_GRID001 .
*----------------------------------------------------------------------*
* File contains Forms for generating teh Period Breakdown screen
*----------------------------------------------------------------------*


*&---------------------------------------------------------------------*
*&      Module  PREPARE_STATUS_0300  OUTPUT
*&---------------------------------------------------------------------*
*       PBO Module that prepares the PS-STATUS for the screen 300 that
*       handles the Period Breakdown
*----------------------------------------------------------------------*
MODULE prepare_status_0300 OUTPUT.
  DATA: lt_stat TYPE STANDARD TABLE OF tp_pf_tab.
  DATA: ls_stat TYPE tp_pf_tab.
  data : DESC_TEXT type C LENGTH 200.

DESC_TEXT = OBJ_TXT.


  ls_stat-pfkey =  'FC01'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'FC02'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'FC03'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'FC04'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'FC05'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'ONLI'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'SVSS'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'SPOS'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'TSPU'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'OPTI'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'GET'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'DYNS'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'DELS'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'VSHO'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'VDEL'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'SPOS'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'DELA'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'VRSS'.
  APPEND ls_stat TO lt_stat.

  ls_stat-pfkey =  'VRSL'.
  APPEND ls_stat TO lt_stat.

  SET PF-STATUS 'PFSTATUS_1000' EXCLUDING lt_stat.
  SET TITLEBAR 'OPT_TITLE' with text-021 OBJ_TXT.
endmodule.                 " PREPARE_STATUS_0300  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  LOAD_ALV_GRID  OUTPUT
*&---------------------------------------------------------------------*
*       PBO Module that handles the creation and display of the alv grid
*       for the screen 300 that handles the Period Breakdown
*----------------------------------------------------------------------*
MODULE load_alv_grid OUTPUT.
  IF g_grid_disp IS INITIAL.
    CREATE OBJECT g_grid_disp.
  ENDIF.
  IF g_grid_disp->g_alv_grid IS INITIAL.
    PERFORM create_and_disp_grid.
  ENDIF.
ENDMODULE.                 " LOAD_ALV_GRID  OUTPUT

*&---------------------------------------------------------------------*
*&      Form  CREATE_AND_DISP_GRID
*&---------------------------------------------------------------------*
*       Create the ALV Grid to display the Period Breakdown
*----------------------------------------------------------------------*
FORM create_and_disp_grid.
  DATA: prd_bd_fcat TYPE lvc_t_fcat.
  FIELD-SYMBOLS: <fs_imported_tree_tab> TYPE cnpsj_struc.

  IMPORT prd_bd_fcat FROM MEMORY ID 'PERIODBREAKDOWN'.
  CALL METHOD g_grid_disp->prepare_grid
    EXPORTING
      container_name = 'CUSTCONTAINER_ALV_GRID'.

  CALL METHOD g_grid_disp->display_grid
    EXPORTING
      im_def_catalog = prd_bd_fcat " gt_save_catalog
      im_struc_type  = 'CNZVR'
    CHANGING
      ch_grid_tab    = m_disp_cnzv.
ENDFORM.                    " CREATE_AND_DISP_TREE

*&---------------------------------------------------------------------*
*&      Module  INPUT_USER_SELECTION_0300  INPUT
*&---------------------------------------------------------------------*
*       PAI Module for the screen 300 that handles the Period Breakdown
*----------------------------------------------------------------------*
MODULE input_user_selection_0300 INPUT.
  DATA: prd_bd_fcat TYPE lvc_t_fcat.
  CASE ok_code.
    WHEN 'E' OR 'ENDE' OR 'ECAN'.
      CALL METHOD g_grid_disp->g_alv_grid->get_frontend_fieldcatalog
        IMPORTING
          ET_FIELDCATALOG = prd_bd_fcat.
      EXPORT prd_bd_fcat TO MEMORY ID 'PERIODBREAKDOWN'.
      SET SCREEN 0.
      FREE g_grid_disp.
      LEAVE SCREEN.
  ENDCASE.
ENDMODULE.                 " INPUT_USER_SELECTION_0300  INPUT

It would be great, if you can provide me the point.

Thanks and Regards,

Abdur Rafique

0 Kudos

Hi,

in this form., CNZVR is the structure and from this field catalog is populating., if u append ur fields to this structure then it ll cum in the grid i think.,

FORM create_and_disp_grid.
  DATA: prd_bd_fcat TYPE lvc_t_fcat.
  FIELD-SYMBOLS: <fs_imported_tree_tab> TYPE cnpsj_struc.
 
  IMPORT prd_bd_fcat FROM MEMORY ID 'PERIODBREAKDOWN'.
  CALL METHOD g_grid_disp->prepare_grid
    EXPORTING
      container_name = 'CUSTCONTAINER_ALV_GRID'.
 
  CALL METHOD g_grid_disp->display_grid
    EXPORTING
      im_def_catalog = prd_bd_fcat " gt_save_catalog
      im_struc_type  = 'CNZVR'        " append ur fields to this standard structure
    CHANGING
      ch_grid_tab    = m_disp_cnzv.
ENDFORM.                    " CREATE_AND_DISP_TREE

Double click on PERFORM at_selection_screen.

in this perform data is populating., check tat.,

hope this helps.,

Thanks & Regards

Kiran