Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_CONTRACT_CREATEFROMDATA

Former Member
0 Likes
1,859

Hi,

I am using the BAPI :BAPI_CONTRACT_CREATEFROMDATA

I need to create a Sales CONTRACT using this Bapi.It doesnt do so, when i debugged i came to know error which states 'Sales Document Type does not exist' for any of the contract type. How do i go about this?

Also,

Could any one please tell me what all data do i need to pass to this BAPI: BAPI_CONTRACT_CREATEFROMDATA.

Thanks,

Riya.

11 REPLIES 11
Read only

Former Member
0 Likes
1,536

Hi,

The sales doc type which you are passing in ORDER_HEADER_IN : DOC_TYPE is not configured for that contract type.

Try with some other sales doc type or check the configuration settings.

Regards,

Pankaj

Read only

0 Likes
1,536

Hi,

As i mentioned it gives me this message for all types.

I have tried all the possible sales document types. Kindly help me with this.

Thanks,

Riya.

Read only

0 Likes
1,536

Hi Riya,

I am not sure on this, but it looks like something wrong with configuration settings.

In SPRO go to define sales doc type and check the contract part of it, there is a field Contract data allwd. check if its X or not. You may get some help from there. Check F1 help for this field.

Regards,

Pankaj

Read only

Former Member
0 Likes
1,536

I´m using this BAPI in a migration report.

This is the minimum information I supply:

  • fill header data

clear gs_ct_header.

gs_ct_header-doc_type = ls_record-auart.

gs_ct_header-sales_org = ls_record-vkorg.

gs_ct_header-distr_chan = p_vtweg.

gs_ct_header-division = p_spart.

gs_ct_headerx-updateflag = 'I'.

gs_ct_headerx-doc_type = gc_true.

gs_ct_headerx-sales_org = gc_true.

gs_ct_headerx-distr_chan = gc_true.

gs_ct_headerx-division = gc_true.

  • fill partner

clear: gs_partner, gt_partner[].

gs_partner-partn_role = 'AG'.

l_kunnr = ls_record-kunnr.

gs_partner-partn_numb = l_kunnr.

append gs_partner to gt_partner.

The Sales Document Type (AUART) has to be maintained in table TVAK.

Just as a test, try creating a contract manually (VA41) and check the contract types you can choose.

Also check the sales area data you supply...

If it still doesn´t work, please post the contents of the return table.

Regards,

Michael

Read only

0 Likes
1,536

Hi Michael , thanx a lot ive solved that query but i still get an error message which is listed below.

Please help and if could provide me with any mail or chat id since you are working on a similar thing on which i am working.

As of now i am just running for demo with only 1 line item.

233 SALES_HEADER_IN has been processed successfully

384 Sales unit ****** is not defined for item 000010

248 Error in SALES_ITEM_IN 000000

555 The sales document is not yet complete: Edit data

219 Sales document was not changed

Thanks.

Read only

0 Likes
1,536

OK, it looks like you have a problem with your unit of measure...

Start transaction MM03 and enter the material number you are experiencing problems with.

In additional data, check the units of measure that are maintained for this material.

Is the unit you are using maintained?

Read only

0 Likes
1,536

Yes it is maintained but i guess it is alternate unit of measure.

Do i need change it? If yes.. how do i do it.

Thanks.

Edited by: riya riya on Jan 9, 2008 4:02 PM

Read only

0 Likes
1,536

Did you concern that the unit of measure is language dependent?

I know I had that problem before... some other BAPI though.

There is a conversion routine 'CUNIT' for converting the unit to target quantity unit of measure in ISO code.

Read only

0 Likes
1,536

Yes.. the language is EN.

Also i dint quiet get what exactly you were trying to explain in the above reply.

Read only

0 Likes
1,536

Sorry, I don´t have that much time....

The error seems to be in the data of table CONTRACT_ITEMS_IN.

Can you post the values you enter in this table (and CONTRACT_ITEMS_INX as well).

Read only

0 Likes
1,536

Hi,

Just one last thing after the document gets created, the Contract Start date and End date do not get populated.

I am passing these values in the fields:

CT_VALID_F & CT_VALID_T. Is this correct?

Or should i pass them to some other fields like QT_VALID_F & QT_VALID_T please advise.

Thanks,

Riya.