This website is not affiliated with, sponsored by, or approved by SAP AG.

IS-U using EFG_PRINT_INIT & EFG_PRINT_CLOSE

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

IS-U using EFG_PRINT_INIT & EFG_PRINT_CLOSE

Postby ABAPears » Tue Jul 01, 2014 8:28 am

Is anyone familiar with Function Modules EFG_PRINT_INIT and EFG_PRINT_CLOSE ?

Within IS-U, We are processing Mass Bill Printing using parallel processing to
create a flat file extract then provide that to a 3rd party for printing.

Transaction EFRM was used to maintain the Billing form. The User Exits available to us are:

USER_EXIT_BLPRINT_START_EXIT
This exit is processed BEFORE anything is done or read in the
application form. Use this Exit to initialize settings in the form, if required

USER_EXIT_BLPRINT_END_EXIT
This exit is processed AFTER the hierarchy has been processed.
Use this Exit to check or set
final settings in the form, if required.

Currently we have custom code within USER_EXIT_BLPRINT_END_EXIT
We simply check the Last Doc indicator then create the output file.

IF x_last_doc = 'X'.
OPEN DATASET fname FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.

LOOP AT gt_final INTO gs_final.
TRANSFER gs_final TO fname.
CLEAR gs_final.
ENDLOOP.

ENDIF.
REFRESH gt_final.
CLOSE DATASET fname.
Endif.

The issue is, when the Last Doc record is being processed within SAP program
REAPRIN0, if that Last Doc record has an error ( ie... no Bank data for Business Partner)
The SAP program code will exclude the record from passing through the User Exits.
This prevents the OUtput file from being created.

I have found that X_LAST_DOC is defined using print parameter structure EPRINTPARAMS-LAST_DOC.
LAST_DOC is now considered OBSOLETE. According to SAP documentation I should use
the EFG_PRINT_INIT and EFG_PRINT_CLOSE function modules. I have been looking for
help on properly using these Functions, but have only found some generalized instructions.

I assume that I am to call EFG_PRINT_INIT within the user exit USER_EXIT_BLPRINT_START_EXIT
and to call EFG_PRINT_CLOSE within USER_EXIT_BLPRINT_END_EXIT. I do not understand
how to check the results of EFG_PRINT_CLOSE? To put it simply, I do not understand
how to properly use these Functions... is there an example or DEMO available to look at?

Thank you !
ABAPears
 
Posts: 2
Joined: Wed Jun 25, 2014 9:43 am

Return to ABAP

Who is online

Users browsing this forum: No registered users and 10 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.