Dear Jelena,
The output type is configured now and i attached my custom program to send email to this output type. Email is being send when invoice is created using vf01.
However in case of vf04, the output type is failing, i checked the code and found out that nast-objky is not getting populated.
*---------------------------------------------------------------------*
* FORM ENTRY
*---------------------------------------------------------------------*
FORM entry USING return_code us_screen.
DATA: lf_retcode TYPE sy-subrc.
IF nast-objky IS INITIAL.
MESSAGE 'Invoice number not found'(001) TYPE 'S'.
ELSEIF v_vbeln IS INITIAL.
v_vbeln = nast-objky.
ENDIF.
Am i missing anything here.
Thanks