Application Development and Automation 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: 
Read only

Electronic Bank Statement Upload

Former Member
0 Likes
1,143

Hello,

The client requires that electronic bank statements be uploaded automatically. There was a zprogram (ZRFEBKA00 which is a copy of the include RFEBKA00) that was developed in the ECC 4.6 system and was working properly. After an upgrade the program now terminates without uploading the files.

What happens is that the files are encrypted and placed on a server. Before they are uploaded into SAP they have to be decrypted. But now the program is failing to decrypt these files.

Here is where the program is failing in the code.

concatenate sy-datum '-' sy-uzeit into id.

*message i000(fb) with

  • 'Processing might take a while... Please be patient. '

  • 'Press CONTINUE to begin'.

*===========================================================

concatenate 'C:\SAP\decrypt.bat' bankfile

id into command separated by ' '.

CALL FUNCTION 'GUI_EXEC'

EXPORTING

COMMAND = command.

  • PARAMETER =

  • IMPORTING

  • RETURNCODE =

IF SY-SUBRC <> 0.

message i000(fb) with 'Error executing external commands.'

'Contact System Admin.'.

Leave program.

ENDIF.

*===========================================================

time1 = sy-uzeit.

do.

refresh it_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'c:\sap\waitd.txt'

  • FILETYPE = 'ASC'

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB = it_file

EXCEPTIONS

FILE_OPEN_ERROR = 1

FILE_READ_ERROR = 2

NO_BATCH = 3

GUI_REFUSE_FILETRANSFER = 4

INVALID_TYPE = 5

OTHERS = 6.

IF SY-SUBRC <> 0.

ELSE.

refresh it_file.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'c:\sap\xxx.txt'

  • FILETYPE = 'ASC'

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB = it_file

EXCEPTIONS

FILE_OPEN_ERROR = 1

FILE_READ_ERROR = 2

NO_BATCH = 3

GUI_REFUSE_FILETRANSFER = 4

INVALID_TYPE = 5

OTHERS = 6.

IF SY-SUBRC = 0.

exit.

else.

message i000(fb) with

'Error creating working environment.'

'Possible causes: Incorrect PGP Key or Password'

'Please contact Systems Admin'.

Perform DeleteWorkfiles.

Leave program.

ENDIF.

ENDIF.

time2 = sy-uzeit.

timediff = time2 - time1.

if timediff >= 60.

message s000(fb) with 'External Processes (PGP) taking too long: '

timediff

'seconds'.

Perform Deleteworkfiles.

Leave Program.

endif.

enddo.

endform.

Help will be greatly appreciated.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
936

Hi ANhakaniso,

There could be either one of the two problems existed.

1.The presentaion server path should be accuarte.

2. The Apllication server path should be valid and chekc whether the bank electronic statement is in the valid path.

SO please valida the paths which ever you are using previously and now.

Hope this helps you.

Regards,

Rama.

Hi ANhakaniso,

There could be either one of the two problems existed.

1.The presentaion server path should be accuarte.

2. The Apllication server path should be valid and chekc whether the bank electronic statement is in the valid path.

SO please valida the paths which ever you are using previously and now.

Hope this helps you.

Regards,

Rama.

4 REPLIES 4
Read only

Former Member
0 Likes
937

Hi ANhakaniso,

There could be either one of the two problems existed.

1.The presentaion server path should be accuarte.

2. The Apllication server path should be valid and chekc whether the bank electronic statement is in the valid path.

SO please valida the paths which ever you are using previously and now.

Hope this helps you.

Regards,

Rama.

Read only

Former Member
0 Likes
936

Hi,

The code you've provided could raise a number of errors, but presumably the problem is coming from this part of the code?


concatenate 'C:\SAP\decrypt.bat' bankfile id into command separated by ' '. 

CALL FUNCTION 'GUI_EXEC' 
  EXPORTING COMMAND = command. 
* PARAMETER = 
* IMPORTING 
* RETURNCODE = 

You would probably benefit from mapping a variable to the RETURNCODE parameter to get a better idea of what the problem is. If the call of GUI_EXEC fails the assocated error message would not be generated as the function does not raise any EXCEPTIONS, so this code


IF SY-SUBRC 0. 
  message i000(fb) with 'Error executing external commands.' 'Contact System Admin.'. 
  Leave program. 
ENDIF. 

is essentially redundent and processing would continue to the next function. It would also be useful to include the return codes from the GUI_UPLOAD functions in the error text to aid diagnosys.

Regards,

Nick

Read only

0 Likes
936

Have noticed that the call function 'GUI_EXEC' is said to be obsolete, does that matter?

Read only

0 Likes
936

Hi,

It might, but it's no guarantee that it doesn't work, just that there's a newer way of performing the function. If you wanted to replace it you could use class CL_GUI_FRONTEND_SERVICES method EXECUTE.

Regards,

Nick