07-23-2014 4:58 PM
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.
07-23-2014 5:22 PM
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
07-23-2014 6:55 PM
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.
07-24-2014 10:05 AM
Sorry
but what do you need?
ALV variants called as your Z-report or the std one?
Max
07-24-2014 4:11 PM
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.
07-24-2014 12:14 PM
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
07-24-2014 4:14 PM
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.
07-24-2014 4:36 PM
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
07-25-2014 7:30 AM
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.
07-25-2014 7:39 AM
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
07-25-2014 7:54 AM
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.
07-25-2014 8:54 AM
I would suggest to not copy the standard
Then either
Which fields did you add in selection, from which table ?
Regards,
Raymond
07-25-2014 10:03 AM
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