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: 

sales order header tabs

Former Member
0 Kudos

Hi all,

My requirement is that I have to write a BDC on sales order.

but when i go to condition tab in sales order header then OK CODE comes different for different order types

can we determine somehow that what will be the correct position of condition tab.

regards,

kushagra

2 REPLIES 2

Former Member
0 Kudos

Hi,

Try to Avoid BDC for Sales Order Creation.

Use BAPI ==> BAPI_SALESORDER_CREATEFROMDAT2

DATA BEGIN OF it_hdr.

INCLUDE STRUCTURE bapisdhd1.

DATA END OF it_hdr.

DATA BEGIN OF it_hdrx .

INCLUDE STRUCTURE bapisdhd1x.

DATA END OF it_hdrx.

DATA BEGIN OF it_itm OCCURS 0.

INCLUDE STRUCTURE bapisditm.

DATA END OF it_itm.

DATA BEGIN OF it_itmx OCCURS 0.

INCLUDE STRUCTURE bapisditmx.

DATA END OF it_itmx.

DATA BEGIN OF it_shitm OCCURS 0.

INCLUDE STRUCTURE bapischdl.

DATA END OF it_shitm.

DATA BEGIN OF it_shitmx OCCURS 0.

INCLUDE STRUCTURE bapischdlx.

DATA END OF it_shitmx.

DATA BEGIN OF it_par OCCURS 0.

INCLUDE STRUCTURE bapiparnr.

DATA END OF it_par.

DATA BEGIN OF it_ret OCCURS 0.

INCLUDE STRUCTURE bapiret2.

DATA END OF it_ret.

DATA wrk_num LIKE bapivbeln-vbeln.

it_hdr-doc_type = 'ZDCI'.

it_hdr-sales_org = '1000'.

it_hdr-distr_chan = '10'.

it_hdr-division = '10'.

it_hdr-sales_off = '1902'.

it_hdrx-updateflag = 'I'. "I:Create a new sales document

it_hdrx-doc_type = 'X'.

it_hdrx-sales_org = 'X'.

it_hdrx-distr_chan = 'X'.

it_hdrx-division = 'X'.

it_itm-itm_number = '10'.

it_itm-material = 'INOVA'.

it_itm-target_qty = '1'.

it_itmx-updateflag = 'I'.

it_itmx-itm_number = '10'.

it_itmx-material = 'X'.

it_itmx-target_qty = 'X'.

APPEND it_itm.

APPEND it_itmx.

it_shitm-itm_number = '10'.

it_shitm-req_qty = '1'.

it_shitmx-updateflag = 'I'.

it_shitmx-itm_number = '10'.

it_shitmx-req_qty = 'X'.

APPEND it_shitm.

APPEND it_shitmx.

it_par-partn_role = 'AG'.

it_par-partn_numb = '0002001913'.

APPEND it_par.

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

EXPORTING

order_header_in = it_hdr

order_header_inx = it_hdrx

IMPORTING

salesdocument = wrk_num

TABLES

return = it_ret

order_items_in = it_itm

order_items_inx = it_itmx

order_partners = it_par

order_schedules_in = it_shitm

order_schedules_inx = it_shitmx

  • 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 =

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

LOOP AT it_ret.

WRITE 😕 it_ret-message.

WRITE wrk_num.

ENDLOOP.

Regards,

Durai.V

0 Kudos

a BDC is already there in the code I just have to modify the code to add conditions to the header conditions tab.