Skip to Content
0
Former Member
Nov 01, 2009 at 08:42 AM

Calling a Class IHC_CL_PROC_PN and a method 'CREATE' in a ABAP program

129 Views

Hello ,

I need to update payment notes in transaction 'IHC1IP' and am using the Class 'IHC_CL_PROC_PN' to make a call to the method CREATE of class IHC_CL_PROC_PN. I have prepared the structure for the payment order by reading the file and then call this method to create payment orders. This method would provide you the option of passing the payment notes

via the parameter IT_PAYMENT_NOTES.

Do we need to have the Class definition and the class implementation explicitly written in the custom abap program? I did the below.

*----


  • CLASS IHC_CL_PROC_PN DEFINITION

*----


**

*----


CLASS IHC_CL_PROC_PN DEFINITION.

PUBLIC SECTION.

methods: create importing

I_PN type IHC_DB_PN

IT_PAYMENT_NOTES type IHC_TTY_GUI_PAYMENT_NOTES optional

IT_PN_RINFO type IHC_TTY_PN_RINFO optional

IT_PN_CONT type IHC_TTY_PN_CONT optional

IT_PN_BP type IHC_TTY_PN_BP optional

IT_DOC type IHC_TTY_DOC optional

I_TESTRUN type IHC_DTE_TESTRUN default ' '

I_HANDLE_LUW type IHC_DTE_HANDLE_LUW default 'X'

I_ERROR_ROLLBACK type IHC_DTE_HANDLE_LUW default 'X'

exporting

E_PN_SEMKEY type IHC_STR_PN_SEMKEY

ET_ERRORS type IHC_TTY_GUI_CHECK_RESULT

ET_MESSAGES type IHC_TTY_LOG_MESSAGE

raising

CX_IHC_PROC .

class-methods S_INSTANCE

exporting

E_RETURN_REF type ref to IHC_CL_PROC_PN

raising

CX_IHC_PROC .

endclass. "IHC_CL_PROC_PN DEFINITION

CLASS IHC_CL_PROC_PN IMPLEMENTATION.

METHOD create.

ENDMETHOD. "class_constructor

method s_instance.

endmethod. "s_instance

endclass. "IHC_CL_PROC_PN IMPLEMENTATION

  • start of selection

data: zcr_porder type ref to IHC_CL_PROC_PN.

create object zcr_porder.

TRY.

CALL METHOD ihc_cl_proc_pn=>s_instance

IMPORTING

e_return_ref = zcr_porder.

CATCH cx_ihc_proc.

ENDTRY.

TRY.

CALL METHOD zcr_porder->CREATE

EXPORTING

I_PN = it_ipn

IT_PAYMENT_NOTES = it_pay_notes-i_pay

  • IT_PN_RINFO =

  • IT_PN_CONT =

  • IT_PN_BP =

  • IT_DOC =

  • I_TESTRUN = ' '

I_HANDLE_LUW = 'X'

I_ERROR_ROLLBACK = 'X'

IMPORTING

  • E_PN_SEMKEY =

ET_ERRORS = it_errors-i_error

ET_MESSAGES = it_msgs-i_msg .

CATCH CX_IHC_PROC.

CALL METHOD ZCATCH_ERROR->IF_MESSAGE~GET_TEXT

RECEIVING

RESULT = l_result.

cleanup.

clear l_result.

ENDTRY.

This is not giving me an error/ dump but its neither creating the payment orders. I dont understand why cant i create a instance without the definition and the implementation? What should be written in the implementation part of the method CREATE and S_INSTANCE? Can you please give me a solution in this?

Thanks,

Anita