05-29-2013 1:23 PM
Hi all,
Before posting my question, I searched a lot for my requirement, but i am not getting exact solution,
few links referred in sdn, but not helping me ,
http://scn.sap.com/thread/1084156http://scn.sap.com/thread/905304
In my report,
I have a parameter in selection screen.
pa_var like disvariant-variant.
And i used this function module 'REUSE_ALV_VARIANT_F4' to fill my gs_variant only inside f4_variant_help,
But if user write something inside pa_var without using the help?
I understand that need to define match code for my variant parameter
How i need to use match code for this parameter? Any standard match code available or i need to create custom match code?
have idea on defining match code for standard table fields, but not for variant!.
Could you please guide me!.
Thanks,
Regards
Kannan
05-29-2013 1:56 PM
I am not sure what your requirement is, but I can answer the question;
"But if user write something inside pa_var without using the help?"
The program will use this value.
It is called a search HELP, and is used to HELP the user find an input. The user does not HAVE TO use the search help.
If you want to check the user input, you can do this in event AT SELECTION-SCREEN ON <fieldname> or in event AT SELECTION-SCREEN.
You can check the following sample program for more info :
BCALV_TEST_LIST_LAYOUT
05-29-2013 1:58 PM
Hi,
Why dont you create your custom matchcode. Check the below link to get started:
http://help.sap.com/saphelp_40b/helpdata/EN/cf/21ef1f446011d189700000e8322d00/content.htm
Cheers,
Arindam
05-29-2013 2:29 PM
I don't understand you requirement, you already managed the search help with REUSE_ALV_VARIANT_F4. If you want to check existence of user input, call REUSE_ALV_VARIANT_EXISTENCE
* Search help
at selection-screen on value-request for variant.
is_variant-variant = variant.
is_variant-report = sy-repid.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = is_variant
i_save = 'A'
i_display_via_grid = 'X'
importing
es_variant = is_variant
exceptions
not_found = 1
program_error = 2
others = 3.
if sy-subrc = 0.
variant = is_variant-variant.
endif.
* Input check
at selection-screen on variant.
is_variant-variant = variant.
is_variant-report = sy-repid.
check is_variant-variant is not initial.
call function 'REUSE_ALV_VARIANT_EXISTENCE'
exporting
i_save = 'A'
changing
cs_variant = is_variant
exceptions
wrong_input = 1
not_found = 2
program_error = 3
others = 4.
if sy-subrc ne 0.
message e204(0k) with is_variant-variant.
endif.
Regards,
Raymond
05-29-2013 3:06 PM
Hi Guiseppi,
Thanks for your support.
my client advised to use match code object in parameter input field.
pa_var like disvariant-variant.
i looked one more solution , given by you earlier in some other discussion
"
http://scn.sap.com/thread/3317515
for using match code in my report, should i create search help based on ltdx table? or any standard search help available
could you please guide me
Thanks
Regards
05-29-2013 3:51 PM
Hi,
Try using the FM LVC_VARIANT_F4 AT SELECTION-SCREEN ON VALUE REQUEST FOR pa_var.
Here some code:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pv_varnt.
PERFORM variant_f4 CHANGING pv_varnt.
*&---------------------------------------------------------------------*
*& Form VARIANT_F4
*&---------------------------------------------------------------------*
FORM variant_f4 CHANGING pv_varnt TYPE slis_vari.
DATA :ls_varnt TYPE disvariant.
ls_varnt-report = sy-repid.
CALL FUNCTION 'LVC_VARIANT_F4'
EXPORTING
is_variant = ls_varnt
i_save = 'A'
IMPORTING
es_variant = ls_varnt
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
IF sy-subrc EQ 0.
pv_varnt = ls_varnt-variant.
ENDIF.
ENDFORM. " VARIANT_F4
Regards
Sam,