1 DATA:ls_return TYPE bapireturn1,
2 ls_plaf TYPE plaf,
3 ls_headerdata TYPE bapiplaf_i1.
4
5 ls_headerdata-pldord_profile = ls_plaf-paart .
6 ls_headerdata-plan_plant = ls_plaf-plwrk .
7 ls_headerdata-prod_plant = ls_plaf-pwwrk .
8 ls_headerdata-material = ls_plaf-matnr .
9 ls_headerdata-order_start_date = ls_plaf-psttr .
10 ls_headerdata-order_fin_date = ls_plaf-pedtr .
11 ls_headerdata-base_uom = ls_plaf-meins .
12 ls_headerdata-version = ls_plaf-verid .
13 ls_headerdata-total_plord_qty = ls_plaf-bdmng.
14 ls_headerdata-firming_ind = 'X' .
15
16 CALL FUNCTION 'BAPI_PLANNEDORDER_CREATE'
17 EXPORTING
18 headerdata = ls_headerdata
19 * IS_SEASON_INFO =
20 * IV_ASSIGN_SEASON =
21 IMPORTING
22 return = ls_return
23 plannedorder = ls_plaf-plnum
24 * CREATEDHEADERDATA =
25 * CAPACITYHEADERDATA1 =
26 * CAPACITYHEADERDATA2 =
27 * CAPACITYHEADERDATA3 =
28 * TABLES
29 * COMPONENTSDATA =
30 * CREATEDCOMPONENTSDATA =
31 * CAPACITYDATA1 =
32 * CAPACITYDATA2 =
33 * CAPACITYDATA3 =
34 .
35
36 IF ls_return-type = 'S' .
37
38 CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
39 EXPORTING
40 wait = 'X'.
41
42 ELSE .
43
44 CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
45
46 ENDIF .