Instruction manuals

Attachment Transfer From ECC PR to SRM

Description
Attachment Issues from PR to SRM
Published
of 15
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
  Attachment Transfer from ECC PR to SRM Situation: ã   Material, Service & Limit item procurement in Extended Classic Scenario are intended to transferred thru RFC route Requirement: ã   Quotes from the Supplier has to be attached as a reference document while Buyer sends a PO ã   Craftsmen have to use the exploded view diagram from the manufacturer to find the item they need ã   Technical Documents/Drawings that have to be attached to the ECC PR Challenges: ã   Only ECC PR can be transferred thru BBP_EXTREQ_TRANSFER ã   There is no SC header therefore PR Header attachments cannot be seen in the SC header ã   Hence PR Header attachments have to be attached to the SC first Line Item Methods: ã   DMS (Document Management Server)  ã   GOS (General Object Service)  ã   DMS & GOS for attachment transfer http://www.sapfans.com/forums/viewtopic.php?f=12&t=349621     Recommendation: Scenario: One wants to transfer a PR header attachment from ECC to SRM Shopping Cart. This blog shows how to transfer header attachments from PR to SRM SC when-- 1. PR header attachments are Service (GOS) and NOT DMS. 2. Report BBP_EXTREQ_TRANSFER is used to send PR to SRM. Since there is no concept of attachment at SC header we will attach the PR header attachments to first item of SC. Step1--> Fetch the attachment data in ERP systems as explained below.   Create an RFC enabled function module in back end system with following interface: Importing Parameters: Exporting Parameters:   Attachment Transfer from ECC PR to SRM Source Code of Function Module: **conversion declaration DATA: lv_codep TYPE cpnormcp, lo_conu TYPE REF TO cl_abap_conv_uc_number. DATA: lt_asci_list TYPE TABLE OF solisti1 WITH HEADER LINE, lt_conhex TYPE solix OCCURS 1 WITH HEADER LINE, lv_inp TYPE string, lv_ous TYPE xstring, lv_len TYPE i. **End DATA: lo_is_object_a TYPE sibflporb. DATA: lt_rel TYPE obl_t_relt, wa_rel LIKE LINE OF lt_rel. DATA: lt_links TYPE obl_t_link, lw_links TYPE obl_s_link, lv_document_id TYPE so_entryid, ls_data TYPE sofolenti1. DATA lt_content TYPE swuoconttab. lo_is_object_a-typeid = 'BUS2105'. lo_is_object_a-catid = 'BO' . lo_is_object_a-instid = p_bo_id . wa_rel-sign = 'I'. wa_rel-option = 'EQ'. wa_rel-low = 'ATTA' . APPEND wa_rel TO lt_rel. TRY.  Attachment Transfer from ECC PR to SRM CALL METHOD cl_binary_relation=>read_links EXPORTING is_object = lo_is_object_a it_relation_options = lt_rel IMPORTING et_links = lt_links. CATCH cx_obl_parameter_error . CATCH cx_obl_internal_error . CATCH cx_obl_model_error . ENDTRY. * DESCRIBE TABLE lt_links LINES ev_records. * LT_LINKS contains one record for each attachment at header * Read all attachments one by one * In case of text files table it_solix(binary) is initial after below FM call but lt_asci_list is populated with CHAR format string passing this directly as *export/table parameter to the calling system(SRM)causes dump PARAMETER_CONVERSION_ERROR in calling system so alwasy convert the *CHAR strinh into Binary data before sending to calling system READ TABLE lt_links INTO lw_links INDEX iv_read_index. IF sy-subrc = 0. lv_document_id = lw_links-instid_b . CALL FUNCTION 'SO_DOCUMENT_READ_API1' EXPORTING document_id = lv_document_id IMPORTING document_data = ls_data TABLES object_content = lt_asci_list contents_hex = it_solix EXCEPTIONS document_id_not_exist = 1 operation_no_authorization = 2 x_error = 3 OTHERS = 4. es_data = ls_data.  Attachment Transfer from ECC PR to SRM * In case converting CHAR string to Binary data for sending to calling system IF NOT lt_asci_list[] IS INITIAL. CALL FUNCTION 'SYSTEM_CODEPAGE' get the current code page IMPORTING codepage = lv_codep . CREATE OBJECT lo_conu instantiate cl_abap_conv_uc_number EXPORTING im_source_codepage = lv_codep EXCEPTIONS converter_creation_failed = 1 OTHERS = 2. LOOP AT lt_asci_list. WRITE cl_abap_char_utilities=>cr_lf TO lt_asci_list-line+253. to put linefeed at end MOVE lt_asci_list-line TO lv_inp. move char to input string CALL METHOD lo_conu->convert_char_stream call method to convert EXPORTING im_stream = lv_inp IMPORTING ex_stream = lv_ous ex_stream_len = lv_len EXCEPTIONS conversion_error = 1 OTHERS = 2. IF sy-subrc <> 0. CONTINUE. if error in conversion than do no append to table * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ELSE. MOVE lv_ous TO lt_conhex-line. move the binary string to binary table APPEND lt_conhex. ENDIF. ENDLOOP. it_content[] = lt_conhex[]. ENDIF. ELSE. ev_exit = 'X'. ENDIF. * ENDLOOP. ENDFUNCTION.
Search
Tags
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x