2009 Aug 29 1:12 PM
Hi experts,
My selection screen contains one parameter for fiscal year and select option for period from and period to.
1) if the user enters only fiscal year data will be populated for all the periods from Jan to dec
2) if th euser enters any specific period ( january to march or january to june) in that case data will be populated only for those specific periods insted of all the period.
how can I restrict the field catalog to the specific periods.
regards,
Ashok revoori
Hi experts,
My selection screen contains one parameter for fiscal year and select option for period from and period to.
1) if the user enters only fiscal year data will be populated for all the periods from Jan to dec
2) if th euser enters any specific period ( january to march or january to june) in that case data will be populated only for those specific periods insted of all the period.
how can I restrict the field catalog to the specific periods.
regards,
Ashok revoori
2009 Aug 29 1:19 PM
hi,
dont say this is field catalog.....this is for the selection screen elements.......you can use at selection-screen events......like output and on field....for the code search in SCN...there are many samples..
Regards,
Venkat
2009 Aug 29 3:37 PM
Hi Ashok,
for you, the question is clear, because you are working on it. For me, it is not clear at all. You are talking about a field catalog. This term ins widely used for ALV display. If you have an ALV display table with columns for each month, you may set the columns not to be displayed as technical.
But I do not know if his is your question.
Regards,
Clemens
2009 Aug 31 5:58 AM
<font color=blue>Hi Ashok,
Here is one sample program to generate fieldcatalog dynamically. Execute and change according to your requirement.
<b><pre>REPORT ztest_notepad.
&----
*& Declarations
&----
*Type-pools
TYPE-POOLS:
slis.
*Types
TYPES:
ty_fcat TYPE lvc_s_fcat,
ty_fcatalog TYPE slis_fieldcat_alv.
*Work areas
DATA:
wa_fcat TYPE ty_fcat,
wa_fcatalog TYPE ty_fcatalog.
*Internal tables
DATA:
it_fcat TYPE STANDARD TABLE OF ty_fcat,
it_fcatalog TYPE STANDARD TABLE OF ty_fcatalog.
*Type reference
DATA:
it_dyn_tab TYPE REF TO data,
wa_newline TYPE REF TO data.
*Filed symbols
FIELD-SYMBOLS:
<gt_table> TYPE STANDARD TABLE,
<fs_dyntable>,
<fs_fldval> TYPE ANY,
<l_field> TYPE ANY.
*Variables
DATA:
l_fieldname TYPE lvc_s_fcat-fieldname,
l_tabname TYPE lvc_s_fcat-tabname,
l_fieldtext TYPE lvc_s_fcat-seltext,
l_index TYPE char2.
"Selection-screen
PARAMETERS:
p_colms TYPE i.
&----
*& start-of-selection.
&----
START-OF-SELECTION.
PERFORM build_fieldcat.
PERFORM create_dynamic_table.
DO 20 TIMES.
DO p_colms TIMES.
l_index = sy-index.
CONCATENATE 'FIELD' l_index INTO l_fieldname.
ASSIGN COMPONENT l_fieldname OF STRUCTURE <fs_dyntable> TO <l_field>.
<l_field> = sy-index.
ENDDO.
INSERT <fs_dyntable> INTO TABLE <gt_table>.
ENDDO.
LOOP AT it_fcat INTO wa_fcat.
PERFORM fieldcatalog1 USING: wa_fcat-fieldname
wa_fcat-tabname
wa_fcat-seltext.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZTEST_NOTEPAD'
it_fieldcat = it_fcatalog
TABLES
t_outtab = <gt_table>.
&----
*& Form BUILD_FIELDCAT
&----
FORM build_fieldcat .
CLEAR: l_fieldname,
l_tabname,
l_fieldtext,
l_index.
DO p_colms TIMES.
CLEAR l_index.
l_index = sy-index.
CONCATENATE 'FIELD' l_index INTO l_fieldname.
CONCATENATE 'Field' l_index INTO l_fieldtext.
l_tabname = '<GT_TABLE>'.
PERFORM fieldcatalog USING: l_fieldname
l_tabname
l_fieldtext.
ENDDO.
ENDFORM. " BUILD_FIELDCAT
&----
*& Form CREATE_DYNAMIC_TABLE
&----
FORM create_dynamic_table .
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fcat
IMPORTING
ep_table = it_dyn_tab.
ASSIGN it_dyn_tab->* TO <gt_table>.
Create dynamic work area and assign to FS
CREATE DATA wa_newline LIKE LINE OF <gt_table>.
ASSIGN wa_newline->* TO <fs_dyntable>.
ENDFORM. " CREATE_DYNAMIC_TABLE
&----
*& Form FIELDCATALOG
&----
FORM fieldcatalog USING field table f_txt.
wa_fcat-fieldname = field.
wa_fcat-tabname = table.
wa_fcat-seltext = f_txt.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ENDFORM. " FIELDCATALOG
&----
*& Form FIELDCATALOG1
&----
FORM fieldcatalog1 USING field table f_txt.
wa_fcatalog-fieldname = field.
wa_fcatalog-tabname = table.
wa_fcatalog-seltext_m = f_txt.
APPEND wa_fcatalog TO it_fcatalog.
CLEAR wa_fcatalog.
ENDFORM. " FIELDCATALOG1</pre></b>
Thanks,Venkat.O</font>
2009 Aug 31 6:18 AM
Hi,
in your case you need to create two field catalogs and two internal tables as per ur requirement and then put case or if condition to diaplay results accordingly..
thanks
Ashu Singh