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

Configuration in BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Likes
545

Hi,

Could you please explain what is the necessity of configuration tables in fm

BAPI_SALESORDER_CREATEFROMDAT2 and if it is possible send coding for the configuration.

Thanks,

shyla kumar

Hi,

Could you please explain what is the necessity of configuration tables in fm

BAPI_SALESORDER_CREATEFROMDAT2 and if it is possible send coding for the configuration.

Thanks,

shyla kumar

3 REPLIES 3
Read only

Former Member
0 Likes
479

Hi

If you know how to create a sales order online (trx VA01), you should know which data are necessary for that BAPI.

When it needs to use a BAPI it would be thing to do the same action by transaction.

Max

Read only

Former Member
0 Likes
479

Hi,

If at all you are using a Configurable Material in your sales Order, having the Classification data configured for that material in MM01, then the values for that Classification (based on the class like Variant or material class) has to be passed to this BAPI.

Regards,

Anji

Read only

Former Member
0 Likes
479

Hi Shyla,

Check out the code below.The parameters passed are onle mandatory fields.You can pass additional fields to it.

Reward points if found useful....

REPORT Z6SKS_HERSHEYS2.

data : order_header_in1 type BAPISDHD1.

data: order_partners1 type BAPIPARNR occurs 0 with header line.

data: ORDER_ITEMS_IN1 type BAPISDITM occurs 0 with header line.

DATA : SALESDOCUMENT1 TYPE BAPIVBELN-VBELN.

DATA : RETURN1 TYPE BAPIRET2 OCCURS 0.

DATA : RETURN2 TYPE BAPIRET2.

order_header_in1-doc_type = 'TA'.

order_header_in1-sales_org = '0001'.

order_header_in1-distr_chan = '01'.

order_header_in1-division = '01'.

ORDER_ITEMS_IN1-material = '000000000000000013'.

append ORDER_ITEMS_IN1.

order_partners1-PARTN_ROLE = 'WE'.

order_partners1-PARTN_NUMB = '0000000017'.

APPEND order_partners1.

Perform call_function.

&----


*& Form call_function

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form call_function .

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

EXPORTING

  • SALESDOCUMENTIN =

order_header_in = order_header_in1

  • ORDER_HEADER_INX =

  • SENDER =

  • BINARY_RELATIONSHIPTYPE =

  • INT_NUMBER_ASSIGNMENT =

  • BEHAVE_WHEN_ERROR =

  • LOGIC_SWITCH =

  • TESTRUN =

  • CONVERT = ' '

IMPORTING

SALESDOCUMENT = SALESDOCUMENT1

tables

RETURN = RETURN1

ORDER_ITEMS_IN = ORDER_ITEMS_IN1

  • ORDER_ITEMS_INX =

order_partners = order_partners1

  • ORDER_SCHEDULES_IN =

  • ORDER_SCHEDULES_INX =

  • ORDER_CONDITIONS_IN =

  • ORDER_CONDITIONS_INX =

  • ORDER_CFGS_REF =

  • ORDER_CFGS_INST =

  • ORDER_CFGS_PART_OF =

  • ORDER_CFGS_VALUE =

  • ORDER_CFGS_BLOB =

  • ORDER_CFGS_VK =

  • ORDER_CFGS_REFINST =

  • ORDER_CCARD =

  • ORDER_TEXT =

  • ORDER_KEYS =

  • EXTENSIONIN =

  • PARTNERADDRESSES =

.

IF NOT SALESDOCUMENT1 IS INITIAL.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

IMPORTING

RETURN = RETURN2

.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'

  • IMPORTING

  • RETURN =

.

ENDIF.