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: 

Hi,

Former Member
0 Kudos

HI,

CAN ANY ONE POST ME THE REAL TIME SCENARIOS FOR USING FUNCTION MODULES. PLEASE POST BE THE SCENARIO AND THE FOLLOWING STEPS, IT WOULD BE OF GREAT HELP

BYE

CINDY

5 REPLIES 5

Former Member
0 Kudos

hi Cindy,

In the below link you can find the usage of GUI_DOWNLOAD FM this is how FM Usage is done ... is this for what you are looking for ????

*.......................................................................
*: Report:  ZDOWNEMPDATA                                               :
*:                                                                     :
*: Author:  www.SAPDev.co.uk                                           :
*:                                                                     :
*: Date  :  2004                                                       :
*:                                                                     :
*: Description: Downloads employee data to TAB delimited flat files    :
*:                                                                     :
*:.....................................................................:
*.......................................................................
*: Report:  ZDOWNEMPDATA                                               :
*:                                                                     :
*: Author:  www.SAPDev.co.uk                                           :
*:                                                                     :
*: Date  :  2004                                                       :
*:                                                                     :
*: Description: Downloads employee data to TAB delimited flat files    :
*:                                                                     :
*:.....................................................................:
REPORT  zdownempdata                                         .

INFOTYPES: 0000, 0001, 0007, 0008, 0121, 0615.
NODES: pernr.
TABLES: t001p.

TYPES: BEGIN OF t_employee,
*        INCLUDE STRUCTURE hrms_biw_io_occupancy.
  begda	TYPE begda,
  endda	TYPE endda,
  pernr	TYPE pernr_d,
  rfpnr	TYPE rfpnr,
  bukrs	TYPE bukrs,
  werks	TYPE persa,
  btrtl	TYPE btrtl,
  persg	TYPE persg,
  persk	TYPE persk,
  orgeh	TYPE orgeh,
  stell	TYPE stell,
  plans	TYPE plans,
  kokrs	TYPE mast_coar,
  kostl	TYPE mast_cctr,
  abkrs	TYPE abkrs,
  molga	TYPE molga,
  trfar	TYPE trfar,
  trfgb	TYPE trfgb,
  trfkz	TYPE trfkz,
  trfgr	TYPE trfgr,
  trfst	TYPE trfst,
  bsgrd	TYPE bsgrd,
  ansal	TYPE ansal_15,
  ancur	TYPE ancur,
  empct	TYPE empct,
  stat2	TYPE stat2,
  ncsdate     TYPE hiredate,
  sltyp	TYPE p_sltyp,
  slreg	TYPE p_slreg,
  slgrp	TYPE p_slgrp,
  sllev	TYPE p_sllvl,
  ansvh	TYPE ansvh,
  vdsk1	TYPE vdsk1,
  sname	TYPE smnam,
 END OF t_employee.
DATA: it_employee TYPE STANDARD TABLE OF t_employee INITIAL SIZE 0,
      wa_employee TYPE t_employee.

TYPES: BEGIN OF t_emptexts,
*        INCLUDE STRUCTURE hrms_bw_txt_employee.
  DATEFROM	TYPE RSDATEFROM,
  DATETO	TYPE RSDATETO,
  PERNR	TYPE PERSNO,
  TXTMD	TYPE EMNAM,
 END OF t_emptexts.
DATA: it_emptexts TYPE STANDARD TABLE OF t_emptexts INITIAL SIZE 0,
      wa_emptexts TYPE t_emptexts.

TYPES: BEGIN OF t_contract,
*        INCLUDE STRUCTURE pa0615.
  pernr TYPE p0615-pernr,
  begda TYPE p0615-begda,
  endda TYPE p0615-endda,
  aedtm TYPE p0615-aedtm,
  ctype TYPE p0615-ctype,
  cbeg  TYPE p0615-cbeg,
  cend  TYPE p0615-cend,
 END OF t_contract.
DATA: it_contract TYPE STANDARD TABLE OF t_contract INITIAL SIZE 0,
      wa_contract TYPE t_contract.

DATA: it_tabemp TYPE filetable,
      gd_subrcemp TYPE i,
      it_tabempt TYPE filetable,
      gd_subrcempt TYPE i,
      it_tabcont TYPE filetable,
      gd_subrccont TYPE i.

DATA: gd_downfile TYPE string.


SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
PARAMETERS: p_emp   LIKE rlgrap-filename,
            p_empt  LIKE rlgrap-filename,
            p_cont LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK block1.


***********************************************************************
*at selection-screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_emp.

  REFRESH: it_tabemp.
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title      = 'Select File'
      default_filename  = '*.xls'
      initial_directory = 'C:'
      multiselection    = ' '  "No multiple selection
    CHANGING
      file_table        = it_tabemp
      rc                = gd_subrcemp.

  LOOP AT it_tabemp INTO p_emp.
  ENDLOOP.


***********************************************************************
*at selection-screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_empt.

  REFRESH: it_tabemp.
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title      = 'Select File'
      default_filename  = '*.xls'
      initial_directory = 'C:'
      multiselection    = ' '  "No multiple selection
    CHANGING
      file_table        = it_tabempt
      rc                = gd_subrcempt.

  LOOP AT it_tabempt INTO p_empt.
  ENDLOOP.


***********************************************************************
*at selection-screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cont.

  REFRESH: it_tabcont.
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      window_title      = 'Select File'
      default_filename  = '*.xls'
      initial_directory = 'C:'
      multiselection    = ' '  "No multiple selection
    CHANGING
      file_table        = it_tabcont
      rc                = gd_subrccont.

  LOOP AT it_tabcont INTO p_cont.
  ENDLOOP.


************************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.

GET pernr.
* Selecting the latest infotype record
  rp_provide_from_last p0000 space pn-begda pn-endda.
  rp_provide_from_last p0001 space pn-begda pn-endda.
  rp_provide_from_last p0007 space pn-begda pn-endda.
  rp_provide_from_last p0008 space pn-begda pn-endda.
  rp_provide_from_last p0121 space pn-begda pn-endda.
  rp_provide_from_last p0615 space pn-begda pn-endda.

  MOVE-CORRESPONDING p0001 TO wa_employee.
  wa_employee-rfpnr = p0121-rfp01. "?????

  MOVE-CORRESPONDING p0007 TO wa_employee.
  MOVE-CORRESPONDING p0008 TO wa_employee.
  MOVE-CORRESPONDING p0000 TO wa_employee.


  SELECT SINGLE molga
    FROM t001p
    INTO wa_employee-molga
   WHERE werks EQ p0001-werks AND
         btrtl EQ p0001-btrtl.

  SELECT SINGLE trfkz
    FROM t503
    INTO wa_employee-trfkz
   WHERE persg EQ p0001-persg AND
         persk EQ p0001-persk.

  CALL FUNCTION 'HR_ENTRY_DATE'
    EXPORTING
      persnr                     = pernr-pernr
*   RCLAS                      =
*   BEGDA                      = '18000101'
*   ENDDA                      = '99991231'
*   VARKY                      =
   IMPORTING
      entrydate                  = wa_employee-ncsdate
* TABLES
*   ENTRY_DATES                =
 EXCEPTIONS
   ENTRY_DATE_NOT_FOUND       = 1
   PERNR_NOT_ASSIGNED         = 2
   OTHERS                     = 3
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

* append employee data
  APPEND wa_employee TO it_employee.
  CLEAR: wa_employee.

  wa_emptexts-datefrom = p0001-begda.
  wa_emptexts-dateto   = p0001-endda.
  wa_emptexts-pernr    = p0001-pernr.
  wa_emptexts-txtmd    = p0001-ename.

* append employee texts data
  APPEND wa_emptexts TO it_emptexts.
  CLEAR: wa_emptexts.

  MOVE-CORRESPONDING p0615 TO wa_contract.
* append employee contract data
  APPEND wa_contract TO it_contract.
  CLEAR: wa_contract.


************************************************************************
*END-OF-SELECTION.
END-OF-SELECTION.

* download employee data
  IF NOT p_emp IS INITIAL.
    gd_downfile = p_emp.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = gd_downfile
        filetype              = 'ASC'
        write_field_separator = 'X'
      TABLES
        data_tab              = it_employee.
    IF sy-subrc EQ 0.
      WRITE:/ 'Employee file downloaded to',
              gd_downfile.
    ELSE.
      WRITE:/ 'There was an error downloading Employee file to',
              gd_downfile.
    ENDIF.
  ENDIF.

* download employee texts data
  IF NOT p_empt IS INITIAL.
    gd_downfile = p_empt.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = gd_downfile
        filetype              = 'ASC'
        write_field_separator = 'X'
      TABLES
        data_tab              = it_emptexts.
    IF sy-subrc EQ 0.
      WRITE:/ 'Employee text file downloaded to',
              gd_downfile.
    ELSE.
      WRITE:/ 'There was an error downloading Employee text file to',
              gd_downfile.
    ENDIF.
  ENDIF.

* download contract data
  IF NOT p_cont IS INITIAL.
    gd_downfile = p_cont.
    <b>CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = gd_downfile
        filetype              = 'ASC'
        write_field_separator = 'X'
      TABLES
        data_tab              = it_contract.
    IF sy-subrc EQ 0.
      WRITE:/ 'Employee contract file downloaded to',
              gd_downfile.
    ELSE.</b>      WRITE:/ 'There was an error downloading Employee contract file to',
              gd_downfile.
    ENDIF.
  ENDIF.

Check this out

http://www.sapdevelopment.co.uk/programs/custom/zdownempdata.htm

Regards,

Santosh

Manohar2u
Active Contributor
0 Kudos

Here you refer for sample programs on function modules

http://www.sap-img.com/abap-function.htm

Regds

Manohar

Manohar2u
Active Contributor
0 Kudos

Also refer to this BAPI link

http://www.sappoint.com/abap/bapiintro.pdf

And function exit example

http://www.ficoexpertonline.com/downloads/User%20ExitsWPedit.doc

Regds

Manohar

Message was edited by: Manohar Reddy

Former Member
0 Kudos

Hi Cindy,

Here is another example of function module in real time scenario(Enqueue and dequeue).

When a user(A, for instance) wants to change the sales order (VA02), he will enter into sales order in change mode. At this point of time, a lock is placed on the object with user A. When user B or user A in another session wants to edit the same sales order, then he will get a message saying that the object is currently locked on user A.

All this scenario is based on lock object and uses the FM "ENQUEUE_E<objectname>" and "DEQUEUE_E<objectname".

This way, we use FM in the program point of use.

Hope this will give you some idea.

Regards,

Vicky

PS: Award points if helpful

0 Kudos

Hi,

Please see the example below:

REPORT zfr_aging_of_deposits

NO STANDARD PAGE HEADING

LINE-SIZE 0

LINE-COUNT 0

MESSAGE-ID zz.

TYPE-POOLS: slis.

----


  • Data dictionary tables *

----


TABLES: bsis,

bkpf,

bseg,

lfa1,

t001.

----


  • Structures *

----


TYPES: BEGIN OF t_bsis,

bukrs LIKE bsis-bukrs,

hkont LIKE bsis-hkont,

zuonr LIKE bsis-zuonr,

belnr LIKE bsis-belnr,

gjahr LIKE bsis-gjahr,

budat LIKE bsis-budat,

shkzg LIKE bsis-shkzg,

dmbtr LIKE bsis-dmbtr,

sgtxt LIKE bsis-sgtxt,

END OF t_bsis.

TYPES: BEGIN OF t_bseg,

lifnr LIKE bseg-lifnr,

bldat LIKE bkpf-bldat,

budat LIKE bkpf-budat,

xblnr LIKE bkpf-xblnr,

bktxt LIKE bkpf-bktxt,

sgtxt LIKE bseg-sgtxt,

s_dat TYPE string,

e_dat TYPE string,

bukrs LIKE bseg-bukrs,

belnr LIKE bseg-belnr,

buzei LIKE bseg-buzei,

gjahr LIKE bseg-gjahr,

shkzg LIKE bseg-shkzg,

dmbtr LIKE bseg-dmbtr,

name1 LIKE lfa1-name1,

amount1 LIKE bseg-dmbtr, "if 30 days and below

amount2 LIKE bseg-dmbtr, "if > 30 and < 60 days

amount3 LIKE bseg-dmbtr, "if > 60 and < 90 days

amount4 LIKE bseg-dmbtr, "if > 90 and < 120 days

amount5 LIKE bseg-dmbtr, "if > 180 days

END OF t_bseg.

----


  • Internal tables *

----


DATA: it_bsis TYPE STANDARD TABLE OF t_bsis,

it_bseg TYPE STANDARD TABLE OF t_bseg WITH HEADER LINE,

it_lines TYPE STANDARD TABLE OF tline WITH HEADER LINE,

it_thead TYPE STANDARD TABLE OF thead WITH HEADER LINE.

----


  • Data declarations *

----


*ALV Declarations

DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,

g_repid LIKE sy-repid,

gs_layout TYPE slis_layout_alv,

gt_list_top_of_page TYPE slis_t_listheader,

gt_events TYPE slis_t_event WITH HEADER LINE,

gt_print TYPE slis_print_alv.

CONSTANTS: gc_top TYPE slis_formname VALUE 'TOP_OF_PAGE',

gc_topsum TYPE slis_formname VALUE 'TOP_OF_LIST'.

*field-symbols

FIELD-SYMBOLS: <fs_bsis> LIKE LINE OF it_bsis.

----


  • Initialization *

----


INITIALIZATION.

g_repid = sy-repid.

----


  • Selection screen *

----


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_bukrs LIKE t001-bukrs OBLIGATORY,

p_budat LIKE bkpf-budat OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b1.

*at selection-screen on p_bukrs

AT SELECTION-SCREEN ON p_bukrs.

IF p_bukrs <> 'GLOB' AND

p_bukrs <> 'INOV' AND

p_bukrs <> 'GXCH'.

MESSAGE e008 WITH 'Invalid Company Code!'.

ENDIF.

----


  • Start of selection *

----


START-OF-SELECTION.

PERFORM get_data.

CHECK NOT it_bsis[] IS INITIAL.

PERFORM combine_data.

END-OF-SELECTION.

IF it_bsis[] IS INITIAL.

MESSAGE i010.

ELSE.

PERFORM display_results.

ENDIF.

----


  • FORM get_data *

----


  • ........ *

----


FORM get_data.

DATA: lv_hkont TYPE hkont VALUE '190100'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = '190100'

IMPORTING

output = lv_hkont.

SELECT bukrs hkont zuonr belnr gjahr budat shkzg dmbtr sgtxt FROM bsis

INTO TABLE it_bsis

WHERE bukrs = p_bukrs

AND budat < p_budat

AND xragl = space

AND xstov = space

AND hkont = lv_hkont.

ENDFORM.

----


  • FORM combine_data *

----


  • ........ *

----


FORM combine_data.

DATA: lv_age_of_rec TYPE p.

LOOP AT it_bsis ASSIGNING <fs_bsis>.

SELECT SINGLE budat bldat xblnr bktxt FROM bkpf

INTO (it_bseg-budat,it_bseg-bldat, it_bseg-xblnr, it_bseg-bktxt)

WHERE bukrs = <fs_bsis>-bukrs

AND belnr = <fs_bsis>-belnr

AND gjahr = <fs_bsis>-gjahr

AND stblg = space

AND xstov = space.

SELECT SINGLE bukrs belnr buzei gjahr shkzg dmbtr lifnr sgtxt

FROM bseg INTO (it_bseg-bukrs, it_bseg-belnr, it_bseg-buzei,

it_bseg-gjahr, it_bseg-shkzg, it_bseg-dmbtr,

it_bseg-lifnr, it_bseg-sgtxt)

WHERE bukrs = <fs_bsis>-bukrs

AND belnr = <fs_bsis>-belnr

AND gjahr = <fs_bsis>-gjahr

AND koart = 'K'

AND hkont = <fs_bsis>-hkont

AND umskz = 'K'.

  • AND fdlev = 'DP'.

CONCATENATE: it_bseg-bukrs it_bseg-belnr it_bseg-gjahr it_bseg-buzei

INTO it_thead-tdname.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = '0001'

language = sy-langu

name = it_thead-tdname

object = 'DOC_ITEM'

TABLES

lines = it_lines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

  • IF sy-subrc <> 0.

  • MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

  • WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

  • ENDIF.

IF sy-subrc = 0.

READ TABLE it_lines TRANSPORTING tdline.

IF sy-subrc = 0.

SPLIT it_lines-tdline AT '-' INTO it_bseg-s_dat it_bseg-e_dat.

ENDIF.

ENDIF.

SELECT SINGLE name1 FROM lfa1

INTO it_bseg-name1

WHERE lifnr = it_bseg-lifnr.

lv_age_of_rec = p_budat - it_bseg-budat.

IF lv_age_of_rec < 30.

MOVE it_bseg-dmbtr TO it_bseg-amount1.

ELSEIF lv_age_of_rec > 30 AND lv_age_of_rec < 60.

MOVE it_bseg-dmbtr TO it_bseg-amount2.

ELSEIF lv_age_of_rec > 60 AND lv_age_of_rec < 90.

MOVE it_bseg-dmbtr TO it_bseg-amount3.

ELSEIF lv_age_of_rec > 90 AND lv_age_of_rec < 120.

MOVE it_bseg-dmbtr TO it_bseg-amount4.

ELSEIF lv_age_of_rec > 180.

MOVE it_bseg-dmbtr TO it_bseg-amount5.

ENDIF.

APPEND it_bseg.

CLEAR: it_bseg, bkpf, it_lines-tdline.

ENDLOOP.

ENDFORM.

----


  • FORM display_results *

----


  • ........ *

----


FORM display_results.

SORT it_bseg BY lifnr bldat budat xblnr bktxt sgtxt s_dat e_dat.

PERFORM f_build_layout USING gs_layout.

PERFORM f_init_fieldcat USING gt_fieldcat[].

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = g_repid

i_callback_top_of_page = 'TOP_OF_PAGE'

is_layout = gs_layout

it_fieldcat = gt_fieldcat[]

i_save = 'X'

TABLES

t_outtab = it_bseg[]

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDFORM. " DISPLAY_ALV

----


  • FORM top_of_page *

----


  • ........ *

----


FORM top_of_page.

*ALV header declarations

DATA: t_header TYPE slis_t_listheader,

wa_header TYPE slis_listheader,

t_line LIKE wa_header-info,

lv_header TYPE string,

lv_date TYPE sy-datum,

lv_time TYPE sy-uzeit,

lv_user TYPE sy-uname,

lv_time_n_date(30).

SELECT SINGLE butxt FROM t001

INTO t001-butxt

WHERE bukrs = p_bukrs.

*Company code

CLEAR lv_header.

CONCATENATE: 'Company:' t001-butxt INTO lv_header

SEPARATED BY space.

wa_header-typ = 'H'.

wa_header-info = lv_header.

APPEND wa_header TO t_header.

CLEAR wa_header.

*Title of the report

CLEAR lv_header.

CONCATENATE: 'Report Title:' sy-title INTO lv_header

SEPARATED BY space.

wa_header-typ = 'A'.

wa_header-info = lv_header.

APPEND wa_header TO t_header.

CLEAR wa_header.

*Date and time

WRITE: sy-datum TO lv_date MM/DD/YYYY,

sy-uzeit TO lv_time USING EDIT MASK '__:__:__'.

CONCATENATE: 'Generated on:' lv_date lv_time

INTO lv_time_n_date SEPARATED BY space.

wa_header-typ = 'A'.

wa_header-info = lv_time_n_date.

APPEND wa_header TO t_header.

CLEAR wa_header.

*Generated by

CLEAR lv_header.

MOVE sy-uname TO lv_user.

CONCATENATE: 'Generated by:' lv_user INTO lv_header

SEPARATED BY space.

wa_header-typ = 'A'.

wa_header-info = lv_header.

APPEND wa_header TO t_header.

CLEAR wa_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = t_header.

ENDFORM. " TOP_OF_PAGE

----


  • FORM f_build_layout *

----


  • ........ *

----


  • --> %LAYOUT *

----


FORM f_build_layout USING %layout TYPE slis_layout_alv.

%layout-zebra = 'X'.

%layout-colwidth_optimize = 'X'.

%layout-totals_text = 'Total'.

ENDFORM. " F_BUILD_LAYOUT

----


  • FORM f_init_fieldcat *

----


  • ........ *

----


  • --> %FIELDCAT *

----


FORM f_init_fieldcat USING %fieldcat TYPE slis_t_fieldcat_alv.

DATA: lc_fieldcat TYPE slis_fieldcat_alv.

CLEAR lc_fieldcat.

DEFINE m_field.

add 1 to lc_fieldcat-col_pos.

lc_fieldcat-fieldname = &1.

lc_fieldcat-outputlen = &2.

lc_fieldcat-seltext_l = &3.

lc_fieldcat-do_sum = &4.

lc_fieldcat-inttype = &5.

lc_fieldcat-hotspot = &6.

lc_fieldcat-fix_column = &7.

lc_fieldcat-ddictxt = 'L'.

lc_fieldcat-no_zero = 'X'.

append lc_fieldcat to %fieldcat.

END-OF-DEFINITION.

m_field 'BLDAT' '8' 'Doc date' '' '' '' 'X'.

m_field 'BUDAT' '8' 'Posting Date' '' '' '' 'X'.

m_field 'LIFNR' '10' 'Vendor Code' '' '' '' 'X'.

m_field 'NAME1' '35' 'Vendor Name' '' '' '' 'X'.

m_field 'XBLNR' '16' 'Reference' '' '' '' ''.

m_field 'BKTXT' '25' 'Header Text' '' '' '' ''.

m_field 'SGTXT' '50' 'Line Item Text' '' '' '' ''.

m_field 'S_DAT' '8' 'Start Date' '' '' '' ''.

m_field 'E_DAT' '8' 'End Date' '' '' '' ''.

m_field 'DMBTR' '13' 'Amount in PHP' 'X' '' '' ''.

m_field 'AMOUNT1' '13' '30 days and below' 'X' '' '' ''.

m_field 'AMOUNT2' '13' '> 30 but < 60 days' 'X' '' '' ''.

m_field 'AMOUNT3' '13' '> 60 but < 90 days' 'X' '' '' ''.

m_field 'AMOUNT4' '13' '> 90 but < 120 days' 'X' '' '' ''.

m_field 'AMOUNT5' '13' '> 180 days' 'X' '' '' ''.

ENDFORM. " f_init_fieldcat

Regards!

P.S. Please do award points if helpful.