Google Search - Blog...........

SAP ABAP - Sample Program On Payment Reminder.

make sure to include the pnp ldb.
REPORT zpar_paymentreminder
NO STANDARD PAGE HEADING
LINE-SIZE 132
LINE-COUNT 65.


*----------------------------------------------------------------------*
* T A B L E S *
*----------------------------------------------------------------------*
TABLES: pernr, "Standard Selections
pa0001, "Org. Assignment
pa0002, "Personal Data
pa0015, "Additional Payments
somlreci1, "API Recipient List
t512t. "Wage Type Texts

*----------------------------------------------------------------------*
* T Y P E - P O O L S *
*----------------------------------------------------------------------*
TYPE-POOLS : slis.

*----------------------------------------------------------------------*
* I N F O T Y P E S *
*----------------------------------------------------------------------*
INFOTYPES: 0001, "Org assignment
0002, "Personal Data
0015. "Additional Payments

*----------------------------------------------------------------------*
* T Y P E S *
*----------------------------------------------------------------------*
*- Type diclaration to hold payment reminder details
TYPES : BEGIN OF ty_payments,
pernr(10) TYPE c, "EE Number
lastn(40) TYPE c, "EE L name
vorna(40) TYPE c, "EE F name
lgart(10) TYPE c, "Wage type
lgtxt(25) TYPE c, "Wage type text
estdt(20) TYPE c, "Date of origion
betrg(20) TYPE c, "Wage type amount
waers(10) TYPE c, "Currency
zuord(20) TYPE c, "Assignment number
spernr(10) TYPE c, "Supervisor
slastn(40) TYPE c, "Supervisor L name
svorna(40) TYPE c, "Supervisor F name
END OF ty_payments,
tt_payments TYPE STANDARD TABLE OF ty_payments.

*- Types diclaration to hold wage type texts
TYPES : BEGIN OF ty_wtext,
lgart TYPE t512t-lgart, "Wage type
lgtxt TYPE t512t-lgtxt, "Wage type text
END OF ty_wtext,
tt_wtext TYPE STANDARD TABLE OF ty_wtext.

*- Types diclaration to hold supervisor fname lname
TYPES :BEGIN OF ty_supervisor,
pernr(8) TYPE c,
lastn(40) TYPE c,
vorna(40) TYPE c,
END OF ty_supervisor,
tt_supervisor TYPE STANDARD TABLE OF ty_supervisor.

*----------------------------------------------------------------------*
* S T R U C T U R E S *
*----------------------------------------------------------------------*
*- Structure to hold payments
DATA : gf_payments TYPE ty_payments,
*- Structure to hold Output Details in delimited format
gf_output_soli TYPE soli,
*- Structure to hold Imported Object Components
gf_objpack TYPE sopcklsti1,
*- Structure to hold data in single line format
gf_objhead TYPE solisti1,
*- Structure to hold data in single line format
gf_objtxt TYPE solisti1,
*- Structure to hold data for API Recipient List
gf_reclist TYPE somlreci1,
*- Structure to hold email data
gf_doc_chng TYPE sodocchgi1,
*- Structure to hold wage type texts
gf_wtext TYPE ty_wtext,
*- Structure to hold supervisor fname lname
gf_supervisor TYPE ty_supervisor,
*- Structure to hold layout settings
gf_layo TYPE slis_layout_alv.

*----------------------------------------------------------------------*
* I N T E R N A L T A B L E S *
*----------------------------------------------------------------------*
*- Inernal table to hold payments
DATA : it_payments TYPE tt_payments,
*- Internal Table to hold Output Details in delimited format
it_output_soli TYPE TABLE OF soli,
*- Internal Table to hold Imported Object Components
it_objpack TYPE TABLE OF sopcklsti1,
*- Internal Table to hold data in single line format
it_objhead TYPE TABLE OF solisti1,
*- Internal Table to hold data in single line format
it_objtxt TYPE TABLE OF solisti1,
*- Internal Table to hold data for API Recipient List
it_reclist TYPE TABLE OF somlreci1,
*- Internal Table to hold wage type texts
it_wtext TYPE tt_wtext,
*- Internal Table to hold supervisor fname lname
it_supervisor TYPE tt_supervisor,
*- Inernal Tabel to hold list headings
it_list TYPE slis_t_listheader,
*- Internal Table to hold events
it_events TYPE slis_t_event,
*- Internal Table to hold fieldcatalog
it_fcat TYPE slis_t_fieldcat_alv.

*----------------------------------------------------------------------*
* C O N S T A N T S *
*----------------------------------------------------------------------*
CONSTANTS : c_molga(2) TYPE c VALUE '10', "Country Grouping
c_int(3) TYPE c VALUE 'INT', "Internet mail address
c_doc_type(3) TYPE c VALUE 'RAW', "Code for document class
c_excel(3) TYPE c VALUE 'XLS', "Code for document class
c_rec_type TYPE c VALUE 'U', "Recipient type
c_express TYPE c VALUE 'X'. "Send express

*----------------------------------------------------------------------*
* S E L E C T I O N S C R E E N S *
*----------------------------------------------------------------------*

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

SELECT-OPTIONS : s_lgart FOR pa0015-lgart. "Wage type
PARAMETERS : p_days TYPE i. "Number of days prior

SELECTION-SCREEN END OF BLOCK bl_pay.

SELECTION-SCREEN BEGIN OF BLOCK bl_emopt WITH FRAME TITLE text-002.

PARAMETERS : p_email AS CHECKBOX. "Send mail
PARAMETERS : p_send TYPE adr6-smtp_addr DEFAULT 'HR DIRECT'."Sender
SELECT-OPTIONS : s_rec FOR somlreci1-receiver NO INTERVALS."Emailaddress

SELECTION-SCREEN END OF BLOCK bl_emopt.

*----------------------------------------------------------------------*
* S T A R T O F S E L E C T I O N *
*----------------------------------------------------------------------*
START-OF-SELECTION.

perform refresh_all.


*- Number of days to check prior
p_days = p_days - 1.
pnpendda = pnpendda + p_days.

*- Wage type texts
PERFORM wagetype_texts.

*- Get event
GET pernr.

*- Read latest record from Org. Assignment
rp-provide-from-last p0001 space pnpbegda pnpendda.
*- Read latest record from Personal Data
rp-provide-from-last p0002 space pnpbegda pnpendda.

*- Importing Supervisor details
PERFORM supervisor_flname.
*- Payment reminder details
PERFORM payment_reminder_details.

*----------------------------------------------------------------------*
* E N D O F S E L E C T I O N *
*----------------------------------------------------------------------*
END-OF-SELECTION.

*- Payment reminder mail attachments
PERFORM mail_details.

*- Send mail
IF NOT it_payments[] IS initial.
IF p_email = 'X'.
PERFORM send_mail.
ENDIF.
ENDIF.

*&---------------------------------------------------------------------*
*& Form wagetype_texts
*&---------------------------------------------------------------------*
* This routine for getting wagetype texts
*----------------------------------------------------------------------*
FORM wagetype_texts .

*- Get wage type text
SELECT lgart "Wage type
lgtxt "Wage type text
FROM t512t
INTO TABLE it_wtext
WHERE sprsl = sy-langu
AND molga = c_molga
AND lgart IN s_lgart.

IF sy-subrc = 0.
SORT it_wtext BY lgart.
ENDIF.

ENDFORM. " wagetype_texts

*&---------------------------------------------------------------------*
*& Form supervisor_flname
*&---------------------------------------------------------------------*
* This routine for getting supervisor fname lname
*----------------------------------------------------------------------*
FORM supervisor_flname .

*- Get supervisor Fname Lname
IF NOT p0001-mstbr IS initial.
SELECT pernr "Supervisor
nachn "Supervisor L name
vorna "Supervisor F name
FROM pa0002
INTO TABLE it_supervisor
WHERE pernr = p0001-mstbr
AND begda <= pnpendda AND endda >= pnpbegda.
ENDIF.

ENDFORM. " supervisor_flname

*&---------------------------------------------------------------------*
*& Form payment_reminder_details
*&---------------------------------------------------------------------*
* This routine for populating Payment reminder details
*----------------------------------------------------------------------*
FORM payment_reminder_details .

*- Local declarations
DATA : l_estdt(10) TYPE c. "Date
*- Clear
CLEAR l_estdt.

LOOP AT p0015 INTO p0015 WHERE begda <= pnpendda AND endda >= pnpbegda
AND lgart IN s_lgart.

gf_payments-pernr = p0015-pernr. "EE Number
gf_payments-lastn = p0002-nachn. "EE L name
gf_payments-vorna = p0002-vorna. "EE F name
gf_payments-lgart = p0015-lgart. "Wage type

*- Wage type text
READ TABLE it_wtext INTO gf_wtext
WITH KEY lgart = p0015-lgart
binary search
transporting lgtxt.
IF sy-subrc = 0.
gf_payments-lgtxt = gf_wtext-lgtxt. "Wage type text
ENDIF.
*- Date of origion
IF NOT p0015-begda IS initial.
WRITE p0015-begda TO l_estdt.
ENDIF.
gf_payments-estdt = l_estdt. "Date of origion
gf_payments-betrg = p0015-betrg. "Wagetype amount
gf_payments-waers = p0015-waers. "Currency
gf_payments-zuord = p0015-zuord. "Assignment number
*- Supervisor details
READ TABLE it_supervisor INTO gf_supervisor WITH KEY
pernr = p0001-mstbr.
gf_payments-spernr = gf_supervisor-pernr. "Supervisor
gf_payments-slastn = gf_supervisor-lastn. "Supervisor L name
gf_payments-svorna = gf_supervisor-vorna. "Supervisor F name

*- Append
APPEND gf_payments TO it_payments.
*-Clear
CLEAR gf_payments.

ENDLOOP.

ENDFORM. " payment_reminder_details

*&---------------------------------------------------------------------*
*& Form mail_details
*&---------------------------------------------------------------------*
* This routine for header and payment reminder details to send mail
*----------------------------------------------------------------------*
FORM mail_details .

*- Local declarations
DATA : lf_string TYPE string. "To hold output data

*- Clear
CLEAR lf_string.

*- Header data of payment reminder
PERFORM move_header_details_data.

*- Payments reminder data
LOOP AT it_payments INTO gf_payments.

CONCATENATE gf_payments-pernr gf_payments-lastn gf_payments-vorna
gf_payments-lgart gf_payments-lgtxt gf_payments-estdt
gf_payments-betrg gf_payments-waers gf_payments-zuord
gf_payments-spernr gf_payments-slastn gf_payments-svorna
INTO lf_string SEPARATED BY
cl_abap_char_utilities=>horizontal_tab.

CONCATENATE cl_abap_char_utilities=>newline lf_string
INTO lf_string.
*- Move
MOVE lf_string TO gf_output_soli-line.
*- Append
APPEND gf_output_soli TO it_output_soli.
*- Clear
CLEAR : gf_output_soli, lf_string.
ENDLOOP.

ENDFORM. " mail_details

*&---------------------------------------------------------------------*
*& Form move_header_details_data
*&---------------------------------------------------------------------*
* This routine for header details for mail attachment
*----------------------------------------------------------------------*
FORM move_header_details_data .

*- Local declarations
DATA : lf_string TYPE string. "To hold output data

CONCATENATE text-003 text-004 text-005 text-006
text-007 text-008 text-009 text-010
text-011 text-012 text-013 text-014
INTO lf_string SEPARATED BY
cl_abap_char_utilities=>horizontal_tab.

*- Move
MOVE lf_string TO gf_output_soli-line.
*- Append
APPEND gf_output_soli TO it_output_soli.
*- Clear
CLEAR : gf_output_soli, lf_string.

ENDFORM. " move_header_details_data

*&---------------------------------------------------------------------*
*& Form send_mail
*&---------------------------------------------------------------------*
* Sending payment reminder details to employee with attachment
*----------------------------------------------------------------------*
FORM send_mail.

*- Local declarations
DATA: l_lines TYPE sy-tabix, "To hold number of records
l_msg_lines TYPE sy-tabix. "To hold number of records

*- Clear
CLEAR : l_lines, l_msg_lines.

*- Creation of the document to be sent
gf_doc_chng-obj_name = text-022.
gf_doc_chng-obj_descr = text-022.

*- Body of mail data
PERFORM move_body_mail_data.

DESCRIBE TABLE it_objtxt LINES l_msg_lines.
READ TABLE it_objtxt INTO gf_objtxt INDEX l_msg_lines.
gf_doc_chng-doc_size = ( l_msg_lines - 1 ) * 255 + STRLEN( gf_objtxt )
.
*- Creation of the entry for the compressed document
gf_objpack-transf_bin = ' '.
gf_objpack-head_start = 1.
gf_objpack-head_num = 0.
gf_objpack-body_start = 1.
gf_objpack-body_num = l_msg_lines.
gf_objpack-doc_type = c_doc_type.
*- Append
APPEND gf_objpack TO it_objpack.
*- Clear
CLEAR gf_objpack.

*- Creation of the document attachment
*- Describe
DESCRIBE TABLE it_output_soli LINES l_lines.

*- Don't create attachment if no data is present
IF l_lines <> 0.
LOOP AT it_output_soli INTO gf_output_soli.
gf_objtxt = gf_output_soli.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.
ENDLOOP.

*- Object header
gf_objhead-line = text-022.
*- Append
APPEND gf_objhead TO it_objhead.
*- Clear
CLEAR gf_objhead.

*- Creation of the entry for the compressed attachment
gf_objpack-transf_bin = ' '.
gf_objpack-head_start = 1.
gf_objpack-head_num = 1.
gf_objpack-body_start = l_msg_lines + 1.
gf_objpack-body_num = l_lines.
gf_objpack-doc_type = c_excel.
gf_objpack-obj_name = text-023.
gf_objpack-obj_descr = text-023.
gf_objpack-doc_size = l_lines * 255.
*- Append
APPEND gf_objpack TO it_objpack.
*- Clear
CLEAR gf_objpack.
ENDIF.

*- Completing the recipient list
LOOP AT s_rec.
gf_reclist-receiver = s_rec-low.
gf_reclist-rec_type = c_rec_type.
gf_reclist-express = c_express.
*- Append
APPEND gf_reclist TO it_reclist.
*- Clear
CLEAR gf_reclist.
ENDLOOP.

* gf_reclist-receiver = text-026.
* gf_reclist-rec_type = c_rec_type.
* gf_reclist-express = c_express.
**- Append
* APPEND gf_reclist TO it_reclist.
**- Clear
* CLEAR gf_reclist.


CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = gf_doc_chng
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = it_objpack
OBJECT_HEADER = it_objhead
CONTENTS_TXT = it_objtxt
RECEIVERS = it_reclist
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 8.

IF sy-subrc <> 0.
WRITE:/ text-024.
ELSE.
*- Display the Email Id and details for which email was send.
PERFORM display_payments_reminder.
ENDIF.

IF sy-subrc = 0.
*- Calling the program to send the email
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = c_int
AND RETURN.
ENDIF.

ENDFORM. " send_mail

*&---------------------------------------------------------------------*
*& Form move_body_mail_data
*&---------------------------------------------------------------------*
* This routine for body of the mail
*----------------------------------------------------------------------*
FORM move_body_mail_data .

*- Local declarations
DATA : l_begda(10) TYPE c, "Begin date
l_endda(10) TYPE c. "End date

*- Clear
CLEAR : l_begda, l_endda.

*- Report run dates
WRITE pnpbegda TO l_begda.
WRITE pnpendda TO l_endda.

CONCATENATE text-015 l_begda 'for' l_endda
INTO gf_objtxt-line SEPARATED BY space.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.

gf_objtxt-line = space.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.

gf_objtxt-line = text-016.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.

gf_objtxt-line = text-017.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.

gf_objtxt-line = text-018.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.

gf_objtxt-line = text-019.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.

gf_objtxt-line = text-020.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.

gf_objtxt-line = text-021.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.

gf_objtxt-line = space.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.

gf_objtxt-line = space.
*- Append
APPEND gf_objtxt TO it_objtxt.
*- Clear
CLEAR gf_objtxt.

ENDFORM. " move_body_mail_data

*&---------------------------------------------------------------------*
*& Form display_payments_reminder
*&---------------------------------------------------------------------*
* This routine for display email details for which email was send
*----------------------------------------------------------------------*
FORM display_payments_reminder .

*- Fieldcatalog
PERFORM fill_fieldcatalog.
*- Events
PERFORM fill_events.
*- Display output
PERFORM display_output.

ENDFORM. " display_payments_reminder

*&---------------------------------------------------------------------*
*& Form fill_fieldcatalog
*&---------------------------------------------------------------------*
* This routine for field attributes
*----------------------------------------------------------------------*
FORM fill_fieldcatalog .

*- Local data
DATA : l_cnt TYPE i.
DATA : lf_fcat LIKE LINE OF it_fcat. "Fieldcatalog


*- EE Number.
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'PERNR'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-003.
APPEND lf_fcat TO it_fcat.

*- EE L name
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'LASTN'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-004.
APPEND lf_fcat TO it_fcat.

*- EE F name
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'VORNA'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-005.
APPEND lf_fcat TO it_fcat.

*- Wage type
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'LGART'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-006.
APPEND lf_fcat TO it_fcat.

*- Wage type text
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'LGTXT'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-007.
APPEND lf_fcat TO it_fcat.

*- Date of origion
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'ESTDT'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-008.
APPEND lf_fcat TO it_fcat.

*- Wage type amount
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'BETRG'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-009.
APPEND lf_fcat TO it_fcat.

*- Currency
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'WAERS'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-010.
APPEND lf_fcat TO it_fcat.

*- Assignment number
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'ZUORD'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-011.
APPEND lf_fcat TO it_fcat.

*- Supervisor
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'SPERNR'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-012.
APPEND lf_fcat TO it_fcat.

*- Supervisor l name
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'SLASTN'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-013.
APPEND lf_fcat TO it_fcat.

*- Supervisor f name
ADD 1 TO l_cnt.
CLEAR lf_fcat.
lf_fcat-fieldname = 'SVORNA'.
lf_fcat-tabname = 'IT_PAYMENTS'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-seltext_l = text-014.
APPEND lf_fcat TO it_fcat.


ENDFORM. " fill_fieldcatalog

*&---------------------------------------------------------------------*
*& Form fill_events
*&---------------------------------------------------------------------*
* This routine for events
*----------------------------------------------------------------------*
FORM fill_events .

*- Local declarations
DATA : lf_event LIKE LINE OF it_events. "Events
*- Clear
CLEAR : lf_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = it_events
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.

IF sy-subrc EQ 0.
*- Read events table
READ TABLE it_events INTO lf_event WITH KEY name = slis_ev_top_of_page.
*- Move
MOVE 'TOP_OF_PAGE' TO lf_event-form.
*- Append
APPEND lf_event TO it_events.
*- Clear
CLEAR lf_event.
ENDIF.

ENDFORM. " fill_events

*&---------------------------------------------------------------------*
*& Form display_output
*&---------------------------------------------------------------------*
* This routine for display output
*----------------------------------------------------------------------*
FORM display_output .

*- Local declarations
DATA : l_repid TYPE sy-repid. "Report name
*- Move
l_repid = sy-repid.

*- Layout settings
gf_layo-colwidth_optimize = 'X'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = l_repid
IS_LAYOUT = gf_layo
IT_FIELDCAT = it_fcat
I_SAVE = 'X'
IT_EVENTS = it_events
TABLES
T_OUTTAB = it_payments
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.

ENDFORM. " display_output

*&---------------------------------------------------------------------*
*& Form top_of_page
*&---------------------------------------------------------------------*
* This routine for heading
*----------------------------------------------------------------------*
FORM top_of_page.

*- Local declarations
DATA : lf_list LIKE LINE OF it_list. "List heading
*- Clear
CLEAR lf_list.

lf_list-typ = 'H'.
lf_list-info = text-025.
*- Append
APPEND lf_list TO it_list.
*- Clear
CLEAR lf_list.

LOOP AT s_rec.
lf_list-typ = 'S'.
lf_list-info = s_rec-low.
*- Append
APPEND lf_list TO it_list.
*- Clear
CLEAR lf_list.
ENDLOOP.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = it_list.

ENDFORM. "top_of_page
*&---------------------------------------------------------------------*
*& Form refresh_all
*&---------------------------------------------------------------------*
FORM refresh_all .
CLEAR : gf_payments, gf_wtext, it_payments[], it_wtext[],
gf_supervisor, it_supervisor[].
ENDFORM. " refresh_all

No comments:

Post a Comment