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

How to create contract using fm BAPI_CONTRACT_CREATEFROMDATA or fm SD_SA...

Former Member
0 Likes
481

Hi All,

I have a reqiurement where i need to create a contract using either of the function modules SD_SALESDOCUMENT_CREATE or BAPI_CONTRACT_CREATEFROMDATA but i want the data related to partner like sold-to-party in the contract to come from reference document no. but it is not taking values form that referenced document.

Message was edited by:

agarwal ashsih

3 REPLIES 3
Read only

Former Member
0 Likes
417

Hi,

Look at the below code



CALL FUNCTION 'SD_SALESDOCUMENT_CREATE' 
EXPORTING 
* SALESDOCUMENT = 
SALES_HEADER_IN = IT2_HEADER 
* SALES_HEADER_INX = 
* SENDER = 
* BINARY_RELATIONSHIPTYPE = ' ' 
* INT_NUMBER_ASSIGNMENT = ' ' 
* BEHAVE_WHEN_ERROR = ' ' 
* LOGIC_SWITCH = ' ' 
* BUSINESS_OBJECT = ' ' 
* TESTRUN = 
* CONVERT_PARVW_AUART = ' ' 
* STATUS_BUFFER_REFRESH = 'X' 
IMPORTING 
SALESDOCUMENT_EX = IT2_SALESDOC 
* SALES_HEADER_OUT = IT2_HEADERSALES 
TABLES 
RETURN = IT2_RETURN 
SALES_ITEMS_IN = IT2_ORDERITEMSIN 
* SALES_ITEMS_INX = 
SALES_PARTNERS = IT2_ORDERPARTNERS 
SALES_SCHEDULES_IN = IT2_ORDERSCHEDIN 
* SALES_SCHEDULES_INX = 
SALES_CONDITIONS_IN = IT2_CONDITIONS 
* SALES_CFGS_REF = 
* SALES_CFGS_INST = 
* SALES_CFGS_PART_OF = 
* SALES_CFGS_VALUE = 
* SALES_CFGS_BLOB = 
* SALES_CFGS_VK = 
* SALES_CFGS_REFINST = 
* SALES_CCARD = 
SALES_TEXT = IT2_ORDERTEXT 
* SALES_KEYS = 
* SALES_CONTRACT_IN = 
* SALES_CONTRACT_INX = 
* EXTENSIONIN = 
* PARTNERADDRESSES = 
* SALES_SCHED_CONF_IN = 
* ITEMS_EX = 
* SCHEDULE_EX = 
* BUSINESS_EX = 
* INCOMPLETE_LOG = 
* EXTENSIONEX = 
* CONDITIONS_EX =

Regards

Sudheer

Read only

Former Member
0 Likes
417

since u r referencing the document number ....enable

CONTRACT_HEADER_INX structure as 'x' along with the document no: field in the processing logic ....ok

REF_DOC VGBEL [ Document number of the reference document]

.......

reward points if helpful.....

Read only

0 Likes
417

Thanx for ur reply..

I have populated the referenced field but noe its showing me error : Contract Signed date not entered. Document not saved.

Kindly help me.