
I would like to share my experience from one of Ariba network integration with ECC project. The requirement was to send PO pdf as part of the attachment list when sending PO cXML to Ariba network. There was already a custom output type (I will call this PRN1) defined for generating the PO PDF. After processing PRN1, PO pdf gets stored in an archive drive. So only thing we have to do is while processing our ARIBA output (I will call this ZZAR), somehow process the PRN1 output and read the PO PDF that gets stored in archive and include that as part of the attachment list.
SELECT SINGLE * FROM nast INTO nast WHERE objky = ent_nast-objky
AND kschl = 'PRN1'
AND kappl = 'EF'
AND vstat = '0'.
IF sy-subrc = 0.
SELECT SINGLE * FROM tnapr INTO tnapr WHERE kschl = 'PRN1' AND kappl = 'EF'.
x_formty = '1'.
zzusbest-vertrag = ' '.
PERFORM old_entry_neu USING ent_retco ent_screen.
PERFORM nast_update(rsnast00) USING ent_retco.
ENDIF.
IF is_nast-vstat = 0.
PERFORM PROCESS_PRN1_FR_ZZAR(ZPRN1PROCESS) USING iv_returncode
iv_us_screen is_nast.
ENDIF.
COMMIT WORK.
DATA: lv_name(120) TYPE c,
lo_nast TYPE REF TO cl_arberp_nast,
ls_nast TYPE nast.
* tell the calling program that the call was OK
CLEAR: iv_returncode.
* define field symbols
FIELD-SYMBOLS: <fs_nast> TYPE any.
* get NAST information via global assign from calling program
CONCATENATE '(RSNAST00)' 'NAST' INTO lv_name.
ASSIGN (lv_name) TO <fs_nast>.
MOVE-CORRESPONDING <fs_nast> TO ls_nast.
DATA:
ls_nast_prn1 TYPE nast.
SELECT SINGLE * FROM nast INTO ls_nast_prn1 WHERE objky = ls_nast-objky AND kschl = 'PRN1' AND kappl = 'EF' AND vstat = '0'.
IF sy-subrc = 0.
*call FM in new task
CALL FUNCTION 'ZMM_NEU1_PROCESS' STARTING NEW TASK 'ZARITASK'
EXPORTING
is_nast = ls_nast_neu1
iv_returncode = iv_returncode
iv_us_screen = iv_us_screen.
*
WAIT UP TO 5 SECONDS.
* * create an object of the nast class and call the send method
CREATE OBJECT lo_nast
EXPORTING
iv_appl_comp_id = if_arbfnd_appl_comp_id_c=>gc_erp
is_nast = ls_nast.
lo_nast->send_message( EXPORTING iv_us_screen = iv_us_screen
CHANGING cv_returncode = iv_returncode ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.