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

custom copy for FBL5N, Layout additional fields

Former Member
0 Likes
1,834

Hello,

I have copied fbl5n report into a z program and function module FI_ITEMS_DISPLAY into a Z function module.

The structure for ALF is RFPOSXEXT which I copied into a Z Structure. I have added some fields into this structure and populated them into internal table.

Now my problem is I am not able to change the layout or can able to see these new 3 fields in the ALV output.

How can I get these 3 fields visible in the alv layout. Pls advie.

Thanks,

Rupalee.

Hello,

I have copied fbl5n report into a z program and function module FI_ITEMS_DISPLAY into a Z function module.

The structure for ALF is RFPOSXEXT which I copied into a Z Structure. I have added some fields into this structure and populated them into internal table.

Now my problem is I am not able to change the layout or can able to see these new 3 fields in the ALV output.

How can I get these 3 fields visible in the alv layout. Pls advie.

Thanks,

Rupalee.

6 REPLIES 6
Read only

Former Member
0 Likes
1,410

At your Z Function

call function 'REUSE_ALV_LIST_DISPLAY'
         exporting
              i_buffer_active          = space
*             i_bypassing_buffer       = c_x
              i_callback_program       = g_repid
              i_callback_pf_status_set = c_formname_pf_status_set
              i_callback_user_command  = c_formname_callback_user
              i_structure_name         = 'RFPOSXEXT'   "REPLACE THAT WITH YOUR Z STRUCTURE
              is_layout                = is_u_layout
              it_fieldcat              = it_u_fieldcat
              it_sort                  = it_u_sort
              i_default                = gd_alvdefault
              i_save                   = ld_save
              is_variant               = is_u_variant
              is_print                 = is_print
              it_events                = gt_events
              it_event_exit            = gt_event_exit

call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
        i_buffer_active          = space
*       i_bypassing_buffer       = c_x
        i_callback_program       = g_repid
        i_callback_pf_status_set = c_formname_pf_status_set
        i_callback_user_command  = c_formname_callback_user
        i_callback_top_of_page   = c_formname_top_of_page
        i_structure_name         = 'RFPOSXEXT'  "REPLACE THAT WITH YOUR Z STRUCTURE
        i_grid_title             = titletext
        i_grid_settings          = s_grid_settings
        is_layout                = is_u_layout
        it_fieldcat              = it_u_fieldcat
        it_sort                  = it_u_sort
        i_default                = gd_alvdefault
        i_save                   = ld_save
        is_variant               = is_u_variant
        is_print                 = is_print
        it_events                = gt_events
        it_event_exit            = gt_event_exit
      tables
        t_outtab                 = it_items
      exceptions
        program_error            = 1
        others                   = 2.

Read only

Former Member
0 Likes
1,410

Hi Rupalee

I'm very sorry, but I think all you did it is useless.

U don't need to create a copy of FBL5N in order to display additional fields, some user-exit are available to do it.

I think there are several posts on the forum about this issue.

Anyway u need to:

- Enhance the structure RFPOS and RFPOSX

- Run the program RFPOSXEXTEND in order to update the structure RFPOSXEXT

- Active the BTE 1650 to populate the new fields

Max

Read only

0 Likes
1,410

Hi.

I have already changed the structure name to Z, also changed c_program_ar to my z program.

Still it doesnt work

Also I dont want to go for BTE now, bcos it will impact the standard FBL5N...I first want ti create a Z transaction.

My second step is I am going to propse the solution of BTE to client.

Pls advice how can I create ALV Variant and use it for my z report which will be same as standard + new 3 fields.

Thanks.

Read only

0 Likes
1,410

Hi

U need to check which report name is assigned to variant structure: the variant is assigned to the report.

In the event end-of-selection, the standard program RFITEMAR assign the data for the variant:

gs_variant-report   = g_repid.
  gs_variant-username = sy-uname.
  gs_variant-variant  = pa_vari.

So u make sure G_REPID has the name of your Z-REPORT.

Max

Read only

Former Member
0 Likes
1,410

Hi,

The copy into Z as well as layout things worked. Better approach is to use BTE and use std. transaction.

Read only

0 Likes
1,410

Hi,

Try This Program

report copy_layout.
data : lt_ltdx like ltdx occurs 0 with header line.
data : lt_ltdxt like ltdxt occurs 0 with header line.
parameters report like ltdx-report obligatory.
parameters report2 like ltdx-report obligatory.
"copy layout of report to report2.

start-of-selection.
  select * into table lt_ltdx from ltdx
                where report = report.
  select * into table lt_ltdxt from ltdxt
                where report = report.
  loop at lt_ltdx.
    lt_ltdx-report = report2.
    modify ltdx from lt_ltdx..
  endloop.
  loop at lt_ltdxt.
    lt_ltdxt-report = report2.
    modify ltdxt from lt_ltdxt..
  endloop.
  message 'Copy Complete.' type 'I'.