SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

Call Non Standard Form Class

Former Member
0 Kudos

Dear Experts,

I'll try to explain my problem;

I have created new Form Class for print Service Notifications, I create three application forms for this Form Class. This is working fine.

Problem is:

I want to call this Form Class from Service Notification print button (TC IQS1, IQS2), and don't know how to do this. I want a pop-up asking me for which one of three application forms I want to print. (I can achieve this with standards like MOVE-IN).

Can anyone help me?

Thanks in advance.

1 ACCEPTED SOLUTION

former_member587072
Participant
0 Kudos

Hello .... You'll need to call FM EFG_PRINT_EXPANED after the application form is selected. Have a look at one of the correspondence (print) events with transaction FQEVENTS. This sample code below is from event R380.

Regards, Joe

  • --- prepare print workbench

CLEAR l_eprintparams.

  • --- fill print parameters usint i_efgpp

MOVE-CORRESPONDING x_efgpp TO l_eprintparams.

IF NOT ( x_dfkkcoh-formkey IS INITIAL ).

l_eprintparams-formkey = x_dfkkcoh-formkey.

ELSE.

l_eprintparams-formkey = 'IS_U_IDE_REMADV_CMPLNT'.

ENDIF.

  • --- determine Language

IF x_dfkkcoh-spras IS INITIAL.

l_eprintparams-langu = l_corr_receiver-langu.

ELSE.

l_eprintparams-langu = x_dfkkcoh-spras .

ENDIF.

  • --- fill print parameters usint i_itcpo

MOVE-CORRESPONDING x_itcpo TO l_eprintparams.

  • --- call print workbench

CALL FUNCTION 'EFG_PRINT_EXPANDED'

EXPORTING

x_sendcontrol = x_dfkkcoh-sendcontrol

x_rec_addr = l_corr_receiver-addrnumber

x_rec_persnumber = l_corr_receiver-persnumber

x_printparams = l_eprintparams

x_archive_params = x_archive_params

x_archive_index = x_archive_index

EXCEPTIONS

not_qualified = 1

input_error = 2

print_failed = 3

cancelled = 4

rec_addr_not_found = 5

send_addr_not_found = 6

OTHERS = 7.

View solution in original post

3 REPLIES 3

former_member587072
Participant
0 Kudos

Hello .... You'll need to call FM EFG_PRINT_EXPANED after the application form is selected. Have a look at one of the correspondence (print) events with transaction FQEVENTS. This sample code below is from event R380.

Regards, Joe

  • --- prepare print workbench

CLEAR l_eprintparams.

  • --- fill print parameters usint i_efgpp

MOVE-CORRESPONDING x_efgpp TO l_eprintparams.

IF NOT ( x_dfkkcoh-formkey IS INITIAL ).

l_eprintparams-formkey = x_dfkkcoh-formkey.

ELSE.

l_eprintparams-formkey = 'IS_U_IDE_REMADV_CMPLNT'.

ENDIF.

  • --- determine Language

IF x_dfkkcoh-spras IS INITIAL.

l_eprintparams-langu = l_corr_receiver-langu.

ELSE.

l_eprintparams-langu = x_dfkkcoh-spras .

ENDIF.

  • --- fill print parameters usint i_itcpo

MOVE-CORRESPONDING x_itcpo TO l_eprintparams.

  • --- call print workbench

CALL FUNCTION 'EFG_PRINT_EXPANDED'

EXPORTING

x_sendcontrol = x_dfkkcoh-sendcontrol

x_rec_addr = l_corr_receiver-addrnumber

x_rec_persnumber = l_corr_receiver-persnumber

x_printparams = l_eprintparams

x_archive_params = x_archive_params

x_archive_index = x_archive_index

EXCEPTIONS

not_qualified = 1

input_error = 2

print_failed = 3

cancelled = 4

rec_addr_not_found = 5

send_addr_not_found = 6

OTHERS = 7.

Former Member
0 Kudos

Thanks Joseph,

Useful your answer, but I need to choose the App Form for a Form Class, I tried to use function EFG_PRINT but always give me PRINT_FAILED (Message number: 014), I supose that I'm sending bad information to the function (Pop-ups works correctly). My Form Class is similar to move in form class... Any idea?

DATA: GL_TAB_RANGES LIKE EFG_RANGES OCCURS 1 WITH HEADER LINE,

W_EPRINTPARAMS LIKE EPRINTPARAMS.

CLEAR GL_TAB_RANGES. REFRESH GL_TAB_RANGES.

GL_TAB_RANGES-SIGN = 'I'.

GL_TAB_RANGES-OPTION = 'EQ'.

GL_TAB_RANGES-LOW = 'number_of_bp'.

APPEND GL_TAB_RANGES.

  • fill general parameters for print options

CLEAR W_EPRINTPARAMS.

W_EPRINTPARAMS-FORMCLASS = 'ZMY_ZCLASSFORM'.

CALL FUNCTION 'EFG_PRINT'

EXPORTING

X_PRINTPARAMS = W_EPRINTPARAMS

TABLES

XT_RANGES = GL_TAB_RANGES

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks!

Former Member
0 Kudos

My fault... I need pass to the function de Movein Document Number instead of Business Partner.

Working perfectly.

Thank you very much!