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: 

How to update LTDX table for ZReport of T-Code FBL5N

Former Member
0 Kudos

Hi,

We have copied report RFITEMAR(T-code FBL5N) to ZRFITEMAR(T-Code ZFBL5N), to meet some of our requirement.

Now, It is not showing Layouts in F4 help of screen field "Layout" in ZFBL5N and also we are not able to set default variant for the same.

I found the issue is, First it goes to table LTDX to search for any default/1SAP variant but it didn't find any entries in the table.

If we can make this entry(Report: ZFITEMRA, Variant: 1SAP) in table LTDX, then issue can be solved. Please let me know if any other way is available for this type of issue.

Thank you.

12 REPLIES 12

Former Member
0 Kudos

Hi

You need to check what parameter you're moving to FI_ITEMS_DISPLAY

The standard program RFITEMAR calls the fm FI_ITEMS_DISPLAY in order to display the items list:


  call function 'FI_ITEMS_DISPLAY'

    exporting

      caller_repid  = c_repid_ar

      acctype       = c_koart_ar

      x_change      = x_change

      i_u_save      = gd_alvsave

      is_u_variant  = gs_variant

      it_u_fieldcat = gt_fieldcat[]

      it_kontab     = it_accts[]

      it_slbtab     = it_comps[]

      it_t001       = it_h_t001[]

      it_kna1       = it_h_kna1[]

      it_knb1       = it_h_knb1[]

      x_grid        = x_grid

      x_inet        = pa_inet

    tables

      it_items      = it_pos.

You should check which program name you're moving in GS_VARIANT, probably your Z-program move the standard program name

Max

0 Kudos

Hi Max,

Thank you for your reply.

Yes, this will work if we pass RFITEMAR in GS_VARIANT but if we pass this report name then all the variant which will be created in FBL5N(RFITEMAR) will also be displayed here and our requirement is to create the variant for ZFBL5N(ZRFITEMAR) only.

FBL5N and ZFBL5N's variants should be displayed in their respective T-code only.

One solution is to make REPORT ID = ZFITEMAR, VARIANT = 1SAP entry in LTDX table. I am looking for any other solution, if exists.

Thanks.

0 Kudos

Sorry

but what do you need?

ALV variants called as your Z-report or the std one?

Max

0 Kudos

Max,

I want functionality like In my ZFBL5N I should be able to create variant with reference to ZFBL5n only(with ZReport ID e.g ZRFITEMAR).

I don't want FBL5N variant in ZFBL5N.

Thanks.

raymond_giuseppi
Active Contributor
0 Kudos

Either you pass you report name in the IS_U_VARIANT-REPORT and you will see and mantain your variant, either you pass the standard name and you will see and mantain the standard variant. So I would suggest to pass your report name, but first copy standard variant from standard report. (Look at attached report)

But, why did you copy the report, as there is a standard solution to add fields to the item line ALV display reports ?

(Ref Note 984305 - Line item: Definition of special fields (T021S), also 1323512 - Line items: BADI FI_ITEMS_CH_DATA)

Regards,

Raymond

0 Kudos

Raymond,

If we pass report name in the IS_U_VARIANT-REPORT then in FM FI_ITEMS_DISPALY it is overwriting the original reference with report name SAPLFI_ITEMS and when you create variant it creates variant in table LTDX with reference to that report only.


Thanks.

0 Kudos

Hi

FI_ITEMS_DISPALY is used by FBL1N, FBL3N and FBL5N and now (in your system) ZFBL5N, but the problem is FI_ITEMS_DISPLAY expects to be called only by standard transaction so:



  if not is_u_variant-variant is initial.

*   check existence of named variant:

    perform alv_variant_check changing x_varexist.

    if x_varexist is initial.

      message i000(msitem) with is_u_variant-variant.

    endif.

  else.

*   check existence of default variant:

    perform alv_default_check changing x_varexist.

  endif.

  if x_varexist is initial.

*   take 1SAP, if it exists:

    clear is_u_variant.

    case acctype.

      when 'D'.

        is_u_variant-report = c_program_ar.

      when 'K'.

        is_u_variant-report = c_program_ap.

      when 'S'.

        is_u_variant-report = c_program_gl.

    endcase.

    is_u_variant-variant = '1SAP'.

    is_u_variant-username = sy-uname.

    perform alv_variant_check changing x_varexist.

    if x_varexist is initial.

      clear is_u_variant.

    endif.

  endif.

As you can see, the fm check if the variant exists and if you don't move any variant the fm check if a default variant exists, if both controls fail then fm overwrites the report name.

So I believe you should create a default variant in order to avoid the fm overwrites the report name

Max

0 Kudos

Max,

Yes, that is the one solution and there is 1 standard report RKKBALVC using which we can maintain that entry.

I was looking for any other alternative to avoid updating standard table LTDX through this report.

Thanks.

0 Kudos

Try

call function 'FI_ITEMS_DISPLAY'
     exporting
       caller_repid = lv_repid " you report
       acctype      = space " space to bypass some part of logic (but test other sequels)
       i_u_save     = 'A'
       is_u_variant = is_variant " with your report too
       x_grid       = 'X'
     tables
       it_items     = lt_items.

But I ask again, whid did you copy standard report when there are options to add fields in it ?

Regards,

Raymond

0 Kudos

Raymond,

We copied FBL5N because we wanted to add some more fields on selection screen of FBL5N.

Let me know if there is any other way to do the same.

Thanks.

0 Kudos

I would suggest to not copy the standard

  • Extend RFPOS[X], execute RFPOSXEXTEND, use BAdI FI_ITEMS_CH_DATA to add the new displayed fields in standard transaction too (read the links I provided)

Then either

  • You can add selection with Customizing or tables of logical database DDF (kna1, knb1, bs[i,a]d, etc.) do it
  • Else create a small wrapper using same logical database than FBL5n/RFITEMAR with your own selection field with extra criteria, and call FM FI_COMPANY_CODE_DATA, ITEM_DERIVE_FIELDS  to enrich data and last FI_ITEMS_DISPLAY to display with caller_repid = 'RFITEMAR' and  acctype = 'R', you will share ALV variant with FBL5n but there should not problem, as you have the same data to display.

Which fields did you add in selection, from which table ?

Regards,

Raymond

0 Kudos

Hi

I agree with Raymond, you can enhance the logical database DDF in order to add new selections in free selections and if you have to copy the standard one it would be better to keep the "standard" layout, so they will be available for the both program.

If the fields are not available in the logical database you can add them with a custom selection view

Max