2007 Jan 30 5:26 PM
Hello Friends,
I am working on the Positive payments - Outgoing payments to Banks. The standard SAP program is doing the Check extract for the same. If I run the transaction code FCHX, then this transaction is using the program RFCCHKE00 to produce the output file from SAP. The format of the output file does not match the Bank format and so I've to reformat the output file to the bank format before transferring the data to the respective banks.
Could anybody tell me how to reformat the output file programattically? Shd I write an ABAP for this or what should I do? If I've to write an ABAP then could somebody help me with the program?. Please advise.
This is very urgent please.
Thanks in Advance.
Hello Friends,
I am working on the Positive payments - Outgoing payments to Banks. The standard SAP program is doing the Check extract for the same. If I run the transaction code FCHX, then this transaction is using the program RFCCHKE00 to produce the output file from SAP. The format of the output file does not match the Bank format and so I've to reformat the output file to the bank format before transferring the data to the respective banks.
Could anybody tell me how to reformat the output file programattically? Shd I write an ABAP for this or what should I do? If I've to write an ABAP then could somebody help me with the program?. Please advise.
This is very urgent please.
Thanks in Advance.
2007 Jan 30 5:38 PM
check below program which was written for the same purpose in one of our client.
<b>AWARD Points</b>
REPORT zfo_positive_pay LINE-SIZE 120
LINE-COUNT 60
MESSAGE-ID zf_cd.
***********************************************************************
====================== T A B L E S =======================
***********************************************************************
TABLES: t001, "Company Codes
t012, "House Banks
tcurc, "Currency Codes
payr, "Payment data
dfkkcr. "Repository For Checks
***********************************************************************
====================== T Y P E S =======================
***********************************************************************
TYPES: BEGIN OF ty_boa_format,
acc_num(10) TYPE c,
void_ind(1) TYPE c,
filler(2) TYPE c,
s_no(10) TYPE c,
amount(12) TYPE c,
add_data(45) TYPE c,
END OF ty_boa_format.
TYPES: BEGIN OF ty_boa_detail_format,
acc_num(10) TYPE c,
void_ind(1) TYPE c,
filler(2) TYPE c,
s_no(10) TYPE c,
amount(12) TYPE c,
iss_date(8) TYPE c,
add_data(37) TYPE c,
END OF ty_boa_detail_format.
***********************************************************************
========= I N T E R N A L T A B L E S ==============
***********************************************************************
DATA BEGIN OF it_sap_format OCCURS 0.
INCLUDE STRUCTURE dtachkp.
DATA END OF it_sap_format.
DATA: it_boa_format TYPE STANDARD TABLE OF ty_boa_format
WITH HEADER LINE,
it_boa_detail_format TYPE STANDARD TABLE OF ty_boa_detail_format
WITH HEADER LINE.
internal tables to send E-mail
DATA: st_doc_chng LIKE sodocchgi1,
"Data of an object which can be changed
it_objtxt LIKE STANDARD TABLE OF solisti1 ,
"SAPoffice: Single List with Column Length 255
wa_objtxt LIKE LINE OF it_objtxt,
it_objpack LIKE STANDARD TABLE OF sopcklsti1 ,
"SAPoffice: Description of Imported Object Components
wa_objpack LIKE LINE OF it_objpack,
it_objhead LIKE STANDARD TABLE OF solisti1 ,
"SAPoffice: Single List with Column Length 255
wa_objhead LIKE LINE OF it_objhead,
it_reclist LIKE STANDARD TABLE OF somlreci1 ,
"SAPoffice: Structure of the API Recipient List
wa_reclist LIKE LINE OF it_reclist,
it_objbin LIKE STANDARD TABLE OF solisti1,
"SAPoffice: Single List with Column Length 255
wa_objbin LIKE LINE OF it_objbin.
***********************************************************************
========= C O N S T A N T S ==============
***********************************************************************
CONSTANTS c_flag TYPE c VALUE 'X'.
***********************************************************************
========= V A R I A B L E S ==============
***********************************************************************
DATA: w_flag TYPE c,
w_str(70) TYPE c, " To store E-Amil contents
w_tab_lines TYPE sy-tabix.
*********************************************************************
========== S E L E C T I O N S C R E E N =============
***********************************************************************
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECTION-SCREEN: SKIP.
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: p_bukrs LIKE payr-zbukr OBLIGATORY DEFAULT '2580',
p_hbkid LIKE payr-hbkid OBLIGATORY DEFAULT 'BOAUS',
p_waers LIKE payr-waers OBLIGATORY DEFAULT 'USD'.
SELECT-OPTIONS: s_erdat FOR dfkkcr-erdat OBLIGATORY.
"DEFAULT SY-DATUM.
SELECT-OPTIONS: s_voidr FOR payr-voidr.
SELECTION-SCREEN: END OF BLOCK b2.
SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME.
PARAMETERS: p_sfile LIKE rlgrap-filename OBLIGATORY,
p_opath LIKE rlgrap-filename OBLIGATORY,
p_ofile LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK b3.
SELECTION-SCREEN: END OF BLOCK b1.
***********************************************************************
============ I N I T I L I Z A T I O N =============
***********************************************************************
data : w_bukrs like payr-zbukr.
INITIALIZATION.
DATA: l_path1 LIKE rlgrap-filename VALUE '/global/data/transfer/',
l_path2 LIKE rlgrap-filename VALUE '/3302/pub/out/'.
CONCATENATE l_path1 sy-sysid l_path2 INTO p_opath.
***********************************************************************
============ A T S E L E C T I O N S C R E E N =============
***********************************************************************
AT SELECTION-SCREEN.
*---to Validate the entered Company code
PERFORM to_validate_bukrs.
*---to Validate the entered house bank
PERFORM to_validate_hbkid.
*---to Validate the entered currency
PERFORM to_validate_waers.
AT SELECTION-SCREEN OUTPUT.
*--- to populate the default file names if the entered company code and
*--- house bank id are valid
PERFORM to_populate_default_file_names.
***********************************************************************
============ S T A R T O F S E L E C T I O N =============
***********************************************************************
START-OF-SELECTION.
*---checking of file CD_POS_COMPLETE for existence
PERFORM CHECK_FILES.
*--- to submit the report RFCHKE00
PERFORM submit_rfchke00.
*--- to open the unix file and download the data
PERFORM open_unix_file_and_process.
*--- to convert the sapfile format to the required BOA format
PERFORM sap_format_to_boa_format.
***********************************************************************
============= E N D O F S E L E C T I O N ===============
***********************************************************************
END-OF-SELECTION.
*If entered file exists in the Unix directory
IF w_flag = ' '.
*--- process the boa internal table to generate the trailer records for
*--- every new account number
PERFORM process_boa_for_trailer_record.
*--- upload data to the unix file which contains the required BOA format
PERFORM upload_unix_file.
*---addition of files into server
PERFORM ADD_FILES.
*-----Send a E-Mail to the user
PERFORM send_email.
ENDIF.
***********************************************************************
=================== S U B R O U T I N E S ==================
***********************************************************************
&----
*& Form to_validate_bukrs
&----
to validate the entered company code at the selection screen
----
FORM to_validate_bukrs .
IF NOT p_bukrs IS INITIAL.
SELECT SINGLE bukrs
FROM t001
INTO t001-bukrs
WHERE bukrs EQ p_bukrs.
IF sy-subrc NE 0.
MESSAGE e004 WITH text-e01.
STOP.
ENDIF.
ELSE.
MESSAGE e004 WITH text-e00.
ENDIF.
ENDFORM. " to_validate_bukrs
&----
*& Form to_validate_hbkid
&----
to validate the entered house bank id at the selection screen
----
FORM to_validate_hbkid .
IF NOT p_hbkid IS INITIAL.
SELECT SINGLE hbkid
FROM t012
INTO t012-hbkid
WHERE hbkid EQ p_hbkid.
IF sy-subrc NE 0.
MESSAGE e004 WITH text-e02.
STOP.
ENDIF.
ELSE.
MESSAGE e004 WITH text-e00.
ENDIF.
ENDFORM. " to_validate_hbkid
&----
*& Form to_validate_waers
&----
to validate the entered cCurrency at the selection screen
----
FORM to_validate_waers .
IF NOT p_waers IS INITIAL.
SELECT SINGLE waers
FROM tcurc
INTO tcurc-waers
WHERE waers EQ p_waers.
IF sy-subrc NE 0.
MESSAGE e004 WITH text-e03.
STOP.
ENDIF.
ELSE.
MESSAGE e004 WITH text-e00.
ENDIF.
ENDFORM. " to_validate_waers
&----
*& Form to_populate_default_file_names
&----
to disable the file name fields and to populate the default values
into it
----
FORM to_populate_default_file_names .
DATA: l_date LIKE sy-datum.
l_date = sy-datum.
IF p_sfile IS INITIAL or w_bukrs <> p_bukrs.
*--- move the entered company code, house bank id and todays
*--- date to the sap file name
CONCATENATE '/tmp/FI_' p_bukrs p_hbkid p_waers sy-datum
INTO p_sfile.
ENDIF.
IF p_ofile IS INITIAL or w_bukrs <> p_bukrs.
CONCATENATE '3302-BA-03-'
l_date '-' sy-uzeit '-' p_bukrs '-out'
INTO p_ofile.
ENDIF.
w_bukrs = p_bukrs.
ENDFORM. " to_populate_default_file_names
&----
*& Form open_unix_file_and_process
&----
opne the unix file and download data to internal table
----
FORM open_unix_file_and_process .
DATA : l_msg(80) TYPE c.
CLEAR w_flag.
open the file in text mode
OPEN DATASET p_sfile FOR INPUT
IN TEXT MODE
MESSAGE l_msg
ENCODING DEFAULT.
IF sy-subrc NE 0.
MESSAGE s004 WITH l_msg '-' p_sfile.
w_flag = 'X'.
STOP.
ENDIF.
move the downloaded file data record wise to the internal table
till it reaches to the last record
DO.
READ DATASET p_sfile INTO it_sap_format.
IF sy-subrc = 0.
APPEND it_sap_format.
ELSE.
cursor reached to the last record of the file
EXIT.
ENDIF.
ENDDO.
remove the header record form the downloaded file data
DELETE it_sap_format INDEX 1.
remove the dataset file created by sap standard program
DELETE DATASET p_sfile.
close the opened file
CLOSE DATASET p_sfile.
ENDFORM. " open_unix_file_and_process
&----
*& Form sap_format_to_boa_format
&----
to convert the sap generated file format to the required Bank Of
America format
----
FORM sap_format_to_boa_format .
DATA: l_amount(10),
l_decimal(2),
l_payee2 LIKE payr-znme2.
LOOP AT it_sap_format.
WRITE it_sap_format-bankn TO it_boa_detail_format-acc_num
RIGHT-JUSTIFIED.
UNPACK it_boa_detail_format-acc_num TO it_boa_detail_format-acc_num.
IF NOT it_sap_format-voidr IS INITIAL.
it_boa_detail_format-void_ind = '2'.
ELSE.
CLEAR it_boa_detail_format-void_ind.
ENDIF.
it_boa_detail_format-filler = space.
WRITE it_sap_format-chect TO it_boa_detail_format-s_no
RIGHT-JUSTIFIED.
UNPACK it_boa_detail_format-s_no TO it_boa_detail_format-s_no.
WRITE it_sap_format-amnt+6(9) TO l_amount.
WRITE it_sap_format-decm+0(2) TO l_decimal.
CONCATENATE '0' l_amount l_decimal INTO it_boa_detail_format-amount.
it_boa_detail_format-iss_date = it_sap_format-zaldt.
*addition of payee2 field in version2.
CLEAR l_payee2.
SELECT SINGLE znme2
INTO l_payee2
FROM payr
WHERE zbukr = p_bukrs AND
hbkid = p_hbkid AND
chect = it_sap_format-chect.
*payee1 and payee2 separated by # symbol.
it_boa_detail_format-add_data+0(20) = it_sap_format-znme1.
it_boa_detail_format-add_data+20(1) = '#'.
it_boa_detail_format-add_data+21(16) = l_payee2.
*if payee1 is initial , then condenses the name
CONDENSE it_boa_detail_format-add_data.
APPEND it_boa_detail_format.
ENDLOOP.
CLEAR it_boa_detail_format.
ENDFORM. " sap_format_to_boa_format
&----
*& Form process_boa_for_trailer_record
&----
to generate the trailer record for every new account number
----
FORM process_boa_for_trailer_record .
DATA: l_cnt TYPE i,
l_amt(12) TYPE p DECIMALS 2,
l_temp(12).
*--- sort the table on account number
SORT it_boa_detail_format BY acc_num.
LOOP AT it_boa_detail_format.
to get the item line count and the total
if it_boa_detail_format-void_ind <> '2'.
l_cnt = l_cnt + 1.
l_amt = l_amt + it_boa_detail_format-amount.
endif.
it_boa_format-acc_num = it_boa_detail_format-acc_num.
it_boa_format-void_ind = it_boa_detail_format-void_ind.
it_boa_format-filler = it_boa_detail_format-filler.
it_boa_format-s_no = it_boa_detail_format-s_no.
it_boa_format-amount = it_boa_detail_format-amount.
it_boa_format-add_data+0(8) = it_boa_detail_format-iss_date.
it_boa_format-add_data+8(37) = it_boa_detail_format-add_data.
APPEND it_boa_format.
CLEAR it_boa_format.
for the new bank account number
AT END OF acc_num.
it_boa_format-acc_num = it_boa_detail_format-acc_num.
it_boa_format-void_ind = 'T'.
it_boa_format-filler = ''.
it_boa_format-s_no = l_cnt.
*-- unpack is used to add leading zeros
UNPACK it_boa_format-s_no TO it_boa_format-s_no.
l_amt = l_amt / 100.
UNPACK l_amt TO it_boa_format-amount.
l_temp = it_boa_format-amount.
*-- Changes as per BOA - no decimals requried ,instead put a 0
*-- in the start
CLEAR it_boa_format-amount.
it_boa_format-amount+0(01) = '0'. "Zero at the start
it_boa_format-amount1(9) = l_temp1(9). "9 digits whole amt
it_boa_format-amount10(2) = l_temp10(2). "2 decimals amt
UNPACK it_boa_format-add_data TO it_boa_format-add_data.
APPEND it_boa_format.
CLEAR: l_cnt,
l_amt,
l_temp,
it_boa_format.
ENDAT.
ENDLOOP.
ENDFORM. " process_boa_for_trailer_record
&----
*& Form upload_unix_file
&----
create unix file with the required BOA format
----
FORM upload_unix_file .
DATA l_msg(80) TYPE c.
opne the unix file
CONCATENATE p_opath p_ofile INTO p_ofile.
OPEN DATASET p_ofile FOR OUTPUT
IN TEXT MODE
MESSAGE l_msg
ENCODING DEFAULT.
IF sy-subrc NE 0.
MESSAGE i004 WITH l_msg.
EXIT.
ENDIF.
move the data from internal table to unix file
LOOP AT it_boa_format.
TRANSFER it_boa_format TO p_ofile.
ENDLOOP.
message about number of records downloaded
IF sy-subrc EQ 0.
MESSAGE s004 WITH
sy-tfill 'records downloaded to the file'
p_ofile.
ENDIF.
close file
CLOSE DATASET p_ofile.
ENDFORM. " upload_unix_file
&----
*& Form submit_rfchke00
&----
to submit the standard program RFCHKE00 to extract the checks
for the given company code, House bank and currecncy
----
FORM submit_rfchke00 .
SUBMIT rfchke00 WITH par_zbuk EQ p_bukrs
WITH par_hbki EQ p_hbkid
WITH par_waer EQ p_waers
WITH par_xneu EQ c_flag
WITH sel_zald IN s_erdat
WITH par_file EQ p_sfile
WITH par_dbup EQ c_flag
WITH sel_void IN s_voidr
AND RETURN.
IF sy-subrc NE 0.
MESSAGE i004 WITH text-e04.
EXIT.
ENDIF.
ENDFORM. " submit_rfchke00
&----
*& Form send_email
&----
sends an email in the required format
----
FORM send_email .
Populate the Mail contents
PERFORM populate_email_ref_data.
Populate the attachment data
PERFORM pop_data_objbin.
CLEAR w_tab_lines.
DESCRIBE TABLE it_objbin LINES w_tab_lines.
wa_objhead = text-021.
APPEND wa_objhead TO it_objhead.
Creation of the entry
wa_objpack-transf_bin = 'X'.
wa_objpack-head_start = 0.
wa_objpack-head_num = 0.
wa_objpack-body_start = 0.
wa_objpack-body_num = w_tab_lines.
wa_objpack-doc_type = 'txt'.
wa_objpack-obj_name = 'POS pay-FI'.
wa_objpack-obj_descr = text-022.
wa_objpack-doc_size = w_tab_lines * 255.
APPEND wa_objpack TO it_objpack.
Populate the User mail ids from the distribution list
PERFORM receiver_details.
ENDFORM. " send_email
&----
*& Form POPULATE_EMAIL_REF_DATA
&----
Subroutine to set the Attachment file name ,Mail subject,
Body of the mail and size of the mail
----
FORM populate_email_ref_data .
Setting up attachment file name
st_doc_chng-obj_name = text-t02.
Setting up mail subject
st_doc_chng-obj_descr = text-t03.
st_doc_chng-sensitivty = 'P'.
*Seting up the body of the E-mail
wa_objtxt = text-t04.
APPEND wa_objtxt TO it_objtxt.
DESCRIBE TABLE it_objtxt LINES w_tab_lines.
READ TABLE it_objtxt INTO wa_objtxt INDEX w_tab_lines.
*Finding size of the E-mail
st_doc_chng-doc_size = ( w_tab_lines - 1 ) * 255 + STRLEN( wa_objtxt ).
Creation of the entry for the compressed document
CLEAR wa_objpack-transf_bin.
wa_objpack-head_start = 1.
wa_objpack-head_num = 0.
wa_objpack-body_start = 1.
wa_objpack-body_num = w_tab_lines.
wa_objpack-doc_type = 'RAW'.
APPEND wa_objpack TO it_objpack.
ENDFORM. " POPULATE_EMAIL_REF_DATA
&----
*& Form POP_DATA_OBJBIN
&----
Subroutine to populate the contennts of the attached document
----
FORM pop_data_objbin .
DATA : l_date LIKE sy-datum.
l_date = sy-datum - 1.
Populating the message
CLEAR w_str.
CONCATENATE text-t06 l_date INTO w_str SEPARATED BY space.
MOVE w_str TO wa_objbin-line.
CONCATENATE cl_abap_char_utilities=>cr_lf w_str INTO w_str.
wa_objbin-line = w_str.
APPEND wa_objbin TO it_objbin.
CLEAR w_str.
CLEAR wa_objbin.
WRITE TEXT-T07 TO W_STR+01(64). "Message
MOVE W_STR TO WA_OBJBIN-LINE.
CONCATENATE CL_ABAP_CHAR_UTILITIES=>CR_LF W_STR INTO W_STR.
WA_OBJBIN-LINE = W_STR.
APPEND WA_OBJBIN TO IT_OBJBIN.
CLEAR W_STR.
CLEAR WA_OBJBIN.
WRITE TEXT-T06 TO W_STR.
MOVE W_STR TO WA_OBJBIN-LINE.
CONCATENATE CL_ABAP_CHAR_UTILITIES=>CR_LF W_STR INTO W_STR.
WA_OBJBIN-LINE = W_STR.
APPEND WA_OBJBIN TO IT_OBJBIN.
CLEAR: W_STR,
WA_OBJBIN.
*for Company Code and House Bank
CONCATENATE text-t08 p_bukrs INTO w_str SEPARATED BY space.
CONCATENATE w_str text-t09 INTO w_str.
CONCATENATE w_str p_hbkid INTO w_str SEPARATED BY space.
MOVE w_str TO wa_objbin-line.
CONCATENATE cl_abap_char_utilities=>cr_lf w_str INTO w_str.
wa_objbin-line = w_str.
APPEND wa_objbin TO it_objbin.
CLEAR w_str.
CLEAR wa_objbin.
WRITE text-t07 TO w_str+0(62).
MOVE w_str TO wa_objbin-line.
CONCATENATE cl_abap_char_utilities=>cr_lf w_str INTO w_str.
wa_objbin-line = w_str.
APPEND wa_objbin TO it_objbin.
CLEAR w_str.
CLEAR wa_objbin.
Processing output records to send email in attachment
LOOP AT it_boa_format.
PERFORM cheque_records_to_objbin.
ENDLOOP.
IF it_objbin[] IS INITIAL.
MOVE 'No data in Positive Payfile for FI' TO wa_objbin-line.
CONCATENATE cl_abap_char_utilities=>cr_lf w_str INTO w_str.
wa_objbin-line = w_str.
APPEND wa_objbin TO it_objbin.
CLEAR w_str.
CLEAR wa_objbin.
ENDIF.
ENDFORM. " POP_DATA_OBJBIN
&----
*& Form CHEQUE_RECORDS_TO_OBJBIN
&----
Subroutine to populate the output data in attachment
----
FORM cheque_records_to_objbin .
DATA: l_bank_acc_no(10),
l_check_no(10),
l_amount(12),
l_paid_date(8),
l_status(1).
l_bank_acc_no = it_boa_format-acc_num.
l_check_no = it_boa_format-s_no.
l_amount = it_boa_format-amount.
l_paid_date = it_boa_format-add_data+0(8).
l_status = it_boa_format-void_ind.
Display only summarised records in Email
IF it_boa_format+10(1) = 'T'.
WRITE text-t05 TO w_str+01(80).
MOVE w_str TO wa_objbin-line.
CONCATENATE cl_abap_char_utilities=>cr_lf w_str INTO w_str.
wa_objbin-line = w_str.
APPEND wa_objbin TO it_objbin.
CLEAR w_str.
CLEAR wa_objbin.
WRITE l_bank_acc_no TO w_str+0(18).
WRITE l_check_no TO w_str+18(12).
WRITE l_amount TO w_str+30(14).
MOVE w_str TO wa_objbin-line.
CONCATENATE cl_abap_char_utilities=>cr_lf w_str INTO w_str.
wa_objbin-line = w_str.
APPEND wa_objbin TO it_objbin.
CLEAR w_str.
CLEAR wa_objbin.
WRITE text-t05 TO w_str+01(80).
MOVE w_str TO wa_objbin-line.
CONCATENATE cl_abap_char_utilities=>cr_lf w_str INTO w_str.
wa_objbin-line = w_str.
APPEND wa_objbin TO it_objbin.
CLEAR w_str.
CLEAR wa_objbin.
ELSE.
for detail records
WRITE L_BANK_ACC_NO TO W_STR+0(18).
WRITE L_CHECK_NO TO W_STR+18(12).
WRITE L_AMOUNT TO W_STR+30(14).
WRITE L_PAID_DATE TO W_STR+44(12).
WRITE L_STATUS TO W_STR+56(1).
*
MOVE W_STR TO WA_OBJBIN-LINE.
CONCATENATE CL_ABAP_CHAR_UTILITIES=>CR_LF W_STR INTO W_STR.
WA_OBJBIN-LINE = W_STR.
APPEND WA_OBJBIN TO IT_OBJBIN.
ENDIF.
CLEAR: w_str,
wa_objbin.
ENDFORM. " CHEQUE_RECORDS_TO_OBJBIN
&----
*& Form RECEIVER_DETAILS
&----
Subroutine to populate the receiver details
----
FORM receiver_details .
wa_reclist-receiver = text-t10. "'[email protected]'.
wa_reclist-rec_type = 'U'.
APPEND wa_reclist TO it_reclist.
CLEAR wa_reclist.
*-- Sending the email with attached document
PERFORM call_email_function.
ENDFORM. " RECEIVER_DETAILS
&----
*& Form CALL_EMAIL_FUNCTION
&----
text
----
FORM call_email_function .
Call function to send email
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = st_doc_chng
commit_work = 'X'
put_in_outbox = 'X'
importing
sent_to_all = sent_to_all
TABLES
packing_list = it_objpack
object_header = it_objhead
contents_bin = it_objbin
contents_txt = it_objtxt
receivers = it_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
CASE sy-subrc.
WHEN 1.
*message e004.
WHEN 2.
*message e005.
WHEN 3.
*message e006.
WHEN 0.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
*leave program.
SET SCREEN 0.
MESSAGE s004(zf_cd) WITH text-012 ' ' text-t10.
ENDCASE.
ENDFORM. " CALL_EMAIL_FUNCTION
&----
*& Form CHECK_FILES
&----
Perform used to check whether FI_POS_COMPLETE file exists on the
server
----
form CHECK_FILES .
DATA : L_MSG(80) TYPE C,
L_FILE LIKE RLGRAP-FILENAME.
CLEAR : L_FILE.
CONCATENATE P_OPATH 'FI_POS_COMPLETE_' P_BUKRS INTO L_FILE.
OPEN DATASET L_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC = 0.
CLOSE DATASET L_FILE.
MESSAGE E054.
ELSE.
CLOSE DATASET L_FILE.
ENDIF.
endform. " CHECK_FILES
&----
*& Form ADD_FILES
&----
Perform used to create the FI_POS_COMPLETE file on the server with a 0
byte record
----
form ADD_FILES .
DATA : L_MSG(80) TYPE C,
L_FILE LIKE RLGRAP-FILENAME.
CLEAR : L_FILE.
CONCATENATE P_OPATH 'FI_POS_COMPLETE_' P_BUKRS INTO L_FILE.
OPEN DATASET L_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC = 0.
TRANSFER SPACE TO L_FILE.
ELSE.
MESSAGE I055.
ENDIF.
CLOSE DATASET L_FILE.
endform. " ADD_FILES
2007 Jan 30 7:02 PM
Thanks Ramesh.
I'll check your program and let you know if I need any further help.
Thanks a lot for your immediate help.