cancel
Showing results for 
Search instead for 
Did you mean: 

Upload Contracts

Former Member
0 Kudos

Has anyone tried uploading Contracts from file in SRM 4.0?If so let pls me know what procedure you have used.

Raghu

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Raghu,

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

Former Member
0 Kudos

Does anybody have the success of using this Function Module "BBP_PD_CTR_CREATE" to create purchase contracts in SRM.

I am trying to test this FM using test data but ended in error.

I have populated i_header, i_item, i_partner, i_orgdata, but when I process the FM I am getting errors saying

BBP_PD - 428 - Enter exactly one partner of type Vendor

BBP_PD - 552 - No organizational data exists on header level

Any idea...

Former Member
0 Kudos

How you resolved the other errors??

Former Member
0 Kudos

Hi Raghu,

You can use the function module 'BBP_PD_CTR_CREATE' to create a contracts from a file. The important data required to the function module is the header data, Item data, partner data and the Purchasing Org and Purchasing group data.

Rgrds,

Sohail

Former Member
0 Kudos

Hello,

BBP_PD_CTR_CREATE is an internal function, that you would need to complete with BBP_PD_CTR_SAVE and COMMIT.

You can then develop your own upload tool, or use the standard upload feature, based on an XLS file (with a not so easy format).

See online help:

http://help.sap.com/saphelp_srm40/helpdata/en/e5/2c85403e1b6e1de10000000a1550b0/frameset.htm

Rgds

Christophe

Former Member
0 Kudos

Thanks Sohail.I have already used this FM unsucessfully.Maybe i am missing something.I will give it another shot.

Thanks

Raghu

Former Member
0 Kudos

Thanks Christophe,

I have already tried this FM.Let me give it another shot and will get back.

Thanks

Raghu