cancel
Showing results for 
Search instead for 
Did you mean: 

Upload new Contracts in SRM4.0

Former Member
0 Kudos

Hi ,

Can you let me know the syntax in the excel file to upload data to create new contract in SRM 4.0?

Regards,

G

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gourang,

See note 734060, which provides you Excell macros to view the downloaded document.

The best way to get the format for contract upload in SRM is to first download one.

In fact the function has been designed by SAP to allow document modification outside of SRM, not for document creation: but I'm sure you'll figure out how to create contracts using the same functions.

Regards.

Vadim

Former Member
0 Kudos

Hi Vadim,

Thanks ,but I have already downloaded the Add-on for the excel.I have been able to change the Contracts as well to highest hierarchy...no issues at all in Change functionality.

I have tried many things for the uploading the excel sheet from an already existing contract to a new contract ( Process Contract>Create Contract>Upload),but despite using various combinations of Change indicators, I still get the message ' no content found for updating the current document'.

In the change upload, the GUI ID helps the SRM contract to identify the excel sheet as its own , but in case of creating a new contract , there is no GUI ID in the excel sheet, so the challenge lies here, as to whether there is some syntax in the Excel file that will make the SRM system understand that this is for creation of new contract and hence GUI ID has to be assigned internally.

I hope I am not confusing you.

Let me know if you need any more details.

Thanks,

Gourang

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Gourang,

you can upload (Tab Delimited) [Excel file] having contract data using GUI_UPLOAD function with following parameters.

*-- Convert filename to a string

w_filename = p_file.

*-- Upload data from file to an internal table

*-- File must be saved as TXT [Comma Delimited]

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = w_filename

has_field_separator = 'X'

dat_mode = 'X'

TABLES

data_tab = t_input_data

EXCEPTIONS

file_open_error = 1

file_read_error = 2

invalid_type = 5

OTHERS = 17.

file browsing option can be provide on selection-screen using following FM call.

DATA: wl_filediag_fil1(200) VALUE 'C:\test.csv', "Infile name

wl_filediag_path_1(200) VALUE 'C:\',

wl_filediag_mask_1(200) VALUE ',.,..',

wl_filediag_title_1(40) VALUE 'File to upload'.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_filename = wl_filediag_fil1

def_path = wl_filediag_path_1

mask = wl_filediag_mask_1

title = wl_filediag_title_1

IMPORTING

filename = p_file

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

Once data will be there in ITAB- t_input_data you can go for following FM calls,

*--Reset Buffer Tables

CALL FUNCTION 'BBP_PROCDOC_RESET_BUFFER'.

*-- Creat Contracts using FM

CALL FUNCTION 'BBP_PD_CTR_CREATE'

EXPORTING

i_header = wa_header

IMPORTING

e_header = wa_ret_hdr

TABLES

i_item = t_item

i_partner = t_partner

i_longtext = t_longtext

i_orgdata = t_orgdata

e_messages = t_messages.

*--Set 'Contract Status' --. 'Released' [I1141]

CALL FUNCTION 'BBP_PROCDOC_STATUS_CHANGE'

EXPORTING

i_guid = wa_ret_hdr-guid "--> Cntr-Header-GUID

i_activity = c_release_contract "--> 'CTRE'

i_object_type = c_contract "--> 'BUS2000113'

TABLES

e_messages = t_m_status "Message Log

CHANGING

e_changed = w_changing. "Flag

*--Reset Buffer Tables

CALL FUNCTION 'BBP_PROCDOC_RESET_BUFFER'.

*--Commit work

COMMIT WORK AND WAIT.

IMPORTANT -

Reseting of BUFFER tables before and after making call to FM - BBP_PD_CTR_CREATE is mandatory to avoid any discrepancy during CONTRACT Creation.

Reward points if needful.

Regards,

Rakesh B Bhagat.

[Infosys Technologis Ltd., India]

Email : rakesh_bhagat@infosys.com