Application Development 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: 

Need to change CONTRACT End date using Bapi BAPI_CUSTOMERCONTRACT_CHANGE

Former Member
0 Kudos

Hi,

I need to change date of a contract and for the same I am using Bapi "BAPI_CUSTOMERCONTRACT_CHANGE".

I am passing the following Parameters to the BAPI.

SALESDOCUMENT -- Have passed the Contract Number in this.

CONTRACT_HEADER_IN -- Have passed the values of the following fields ::

COLLECT_NO -- Sales Document number

Sales_Org -- Sales Organization

Distribution Channes -- Dist. Channel

Division -- Division

CT_VALID_T -- New date which I want as the contract end date.

CONTRACT_HEADER_INX -- Following values have been paased in this Structure.

UPDATEFLAG -- 'U'.

CT_VALID_T -- 'X'.

Now when I run the BAPI with these inputs I get the output as ' Field 'GUEEN' cannot be copied, because it is not ready for input'.This is a information message. But the changes are not reflected in the contract. I have done the commit work after BAPI.

When I changes the value for CT_VALID_T flag from 'X' to 'U' the message mentioned above does not come but the end result is same and changes are not reflected in the contract.

I would be really helpful to you if get any kind of helf to know ehy the output is not coming.

Thanks a Lot for your kind help!!!!

Regards,

Lalit Kabra

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Lalit,

The value for CT_VALID_T flag has to be 'X' in the CONTRACT_HEADER_INX structure.

In this case, you receive an informative message "Field 'GUEEN' cannot be copied, because it is not ready for input'"

That is the problem. You cannot change this field because your functional team has this field as "not ready for input" in change mode.

Can you change this field in transaction VA42? If you can't modify it in dialog, you can't modify it with BAPI.

Regards,

6 REPLIES 6

Former Member
0 Kudos

Hi Lalit,

The value for CT_VALID_T flag has to be 'X' in the CONTRACT_HEADER_INX structure.

In this case, you receive an informative message "Field 'GUEEN' cannot be copied, because it is not ready for input'"

That is the problem. You cannot change this field because your functional team has this field as "not ready for input" in change mode.

Can you change this field in transaction VA42? If you can't modify it in dialog, you can't modify it with BAPI.

Regards,

0 Kudos

Hi,

Thanks a Lot for your prompt answer.

But I could not find this field GUEEN in sales order.

One more thing when I try doing this same functionalty using BDC, it works fine. I dont know why it is not working using BAPI.

Could any one please guide me if I am using the correct BAPI "BAPI_CUSTOMERCONTRACT_CHANGE".

Is there any other BAPI/Functionmodule given SAP to change the contract end date of a contract.

Your help and inputs would be highly appreciated.

Regards,

Lalit Kabra

0 Kudos

Hi,

try to use the structure CONTRACT_DATA_IN and CONTRACT_DATA_INX. The field you have to fill is CON_EN_DAT, for the item "000000" (header data).

The field VBAK-GUEEN is filled with the data of VEDA-VENDDAT for the header.

Regards,

Pepe

0 Kudos

Hi,

Thanks a Lot for your kind help!!!

It worked!!!!

Regards,

Lalit

MKM
Active Participant
0 Kudos

Hi,

I am also facing the same problem. I have tried what is given in this solution.

But in my case, Contract end date is changing. But to different dates.

I don't know on which logic this dates are varying.

Thanks for the help in advance.

Regards,

Manoj

Muthukumaran
Explorer
0 Kudos

Hi,

Is it possible to add contract start date and end date using quotation BAPI(  BAPI_QUOTATION_CREATEFROMDATA2)?

Same field which you tried earlier.

Thanks,

Muthu