‎2014 Jun 06 6:38 AM
Hello everyone,
I am using BAPI 'BAPI_SALESORDER_CREATEFROMDAT2' for sales order creation.
I want create a sales order for which Contract start date and Contract end date are required.
My concern is I am not able to find the structure and the field names for these two fields in the BAPI.
I have read the documentation for the BAPI but could not locate these two fileds.
Please advice me as soon as possible.
Awaiting for your response.
- Nikhil.
‎2014 Jun 06 6:44 AM
Hi Nikhil
please try this if you can get it through
BAPISDHD1-CT_VALID_F and BAPISDHD1-CT_VALID_T.
but i will prefer you to use
BAPI_CUSTOMERCONTRACT_CHANGE.
‎2014 Jun 06 6:51 AM
Thanks Sanjeev Kumar for quick reply.
I will validate your suggestion.
You have suggested BAPI for contract. But I am interested in BAPI for sales order creation.
My understanding is both are different. Please correct me if I am wrong.
Regards
NG
‎2014 Jun 06 6:56 AM
Hi Nikhil,
for BAPI_SALESORDER_CREATEFROMDAT2 you have to search on SCN , you will get how to implement it , the field i have suggested shall work in it for Contract Start date and Contract End Date.
Please work on it , i hope you will get what you need.
‎2014 Jun 06 7:26 AM
Hi Nikhil,
Fields are present in BAPI there is structure name as ORDER_HEADER_IN in which you can find the fields name as
CT_VALID_F
CT_VALID_T
Hope this will Help.
Regards
Shahezad
‎2014 Jun 06 7:47 AM
‎2014 Jun 06 8:00 AM
Vijay, Mohammad and Sanjeev,
You all suggested the same solution. But it didn't worked.
I tried following,
wa_head-ct_valid_f = exl_wa-ct_valid_f .
wa_head-ct_valid_t = exl_wa-ct_valid_t .
wa_headx-ct_valid_f = 'X'.
wa_headx-ct_valid_t = 'X'.
No luck
‎2014 Jun 06 8:04 AM
Hi Nikhil,
please debug your code and see that you are getting values in that fields or not.
‎2014 Jun 06 8:13 AM
Hi Nikhil,
It should work.. can you hard code the date and see?? or just put the date in debugger and see whether it is getting reflected...
‎2014 Jun 06 10:45 AM
Sanjeev Kumar, I have debugged the code and have confirmed that values are correct.
Viswanathan Srinivasan, I also tried hard coding values, it didn't worked.
Vijay Vikram, date format is yyyymmdd. what do you mean by validation?
-
NG
‎2014 Jun 06 10:50 AM
Hi Nikhil,
so what is the concern, if you are getting your data in above fields.
‎2014 Jun 06 11:00 AM
Those two fields, Contract Start date and End date, are not updated in the sales order.
Rest of the fields like Purchase order date is being populated in SO.
Check screen shot for reference.
‎2014 Jun 06 11:07 AM
Hi,
did you used the BAPI_TRANSACTION_COMMIT after using this bapi.
‎2014 Jun 06 11:55 AM
‎2014 Jun 06 12:00 PM
Hi Nikhil,
its common problem with using that bapi, what i will suggest you to first check your data for consistency like data formats you have used in your flat file , and if everything is ok, then search in this forum for any ulternate solution.
‎2014 Jun 06 8:25 AM
Hi Nikhi,
Check date format and validations for date format.
Thanks
Vijay
‎2014 Jun 06 12:06 PM
Hi,
Try tis,
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = object
IMPORTING
output = object.
Regards,
Venkat
‎2014 Jun 06 12:34 PM
Perhaps using function module SD_SALESDOCUMENT_CREATE can be a solution.
Or perhaps try to use a BADI to enforce populating these fields (meaning you have to temporarliy store the input file in a table which you can read in the BADI).