cancel
Showing results for 
Search instead for 
Did you mean: 

FM to read USMD1211 and attach it to Master Object

puneet_gupta1
Explorer
0 Kudos

Hello Everyone,

Requirement: Transfer attachments from MDG to ECC.

For ex- CR created for Vendor Master. Above table stores the attachments but not linked to vendor.

Our strategy: Create an FM which will read the above tables and attach it to Master data object. The attachments will be accessed from ECC as well.

Can someone pass the FM or the pseudo logic to Read Table usmd1211 and usmd1212 and attach the documents uploaded and the notes written in CR UIBB to the master object.

Tried to search for GOS API but its more pointed towards creating an attachment rather than attaching the table to master data object.

Referred the below link but in vain.

"https://archive.sap.com/discussions/thread/3557172"

Any help will be appreciated. Thanks Much !

Regards

Puneet

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello Puneet,

USMD1211 contains the CR details.

USMD1212 contains the CR attachment content.

In order to read the contents of CR from table USMD1212, you can use the combination of below function modules:

* Convert Xstring To Binary

SCMS_XSTRING_TO_BINARY

* Convert From Raw Type To Text

SO_SOLIXTAB_TO_SOLITAB

Use file extension from USMD1211 to create file and attach it to master object like vendor, customer during runtime using below FMs :

1.SO_FOLDER_ROOT_ID_GET : Folder Id gets created where attachments will be placed.

2.SO_OBJECT_INSERT : Create file and Move to a folder.

3.BINARY_RELATION_CREATE_COMMIT : This is responsible for attachment of file to master object.

Answers (1)

Answers (1)

puneet_gupta1
Explorer
0 Kudos

Hi Everyone,

Any help on the above, please. Not able to figure out the logic from the SAP provided APIs.

Best Regards

Puneet Gupta