Code: Alles auswählen.
REPORT ZTEST_CK_F_SD_ORDER_CALC.
Data: lv_matnr Type matnr,
lv_werk type werks,
lv_cuobj TYPE cuobj,
lv_klvar type CK_KLVAR,
lv_psdat type ERDAT,
lv_menge LIKE RK70S-MENGE,
lv_vbeln type vbeln,
lv_posnr type POSNR,
lv_kalnr type CK_KALNR,
lv_dunkel type C LENGTH 1,
lv_S_AUCOST Type c LENGTH 1.
Data: T_KEPH_EXP Type TABLE OF KEPH,
KLVAR_EXP LIKE KEKO-KLVAR,
KALVAR_EXP LIKE KEKO-KLVAR,
KALNR_EXP LIKE KEKO-KALNR,
HWGES_EXP LIKE CKHS-HWGES,
HWVAR_EXP LIKE CKHS-HWGES,
HWFIX_EXP LIKE CKHS-HWGES,
HWAER_EXP LIKE CKHS-HWAER,
SAVE_FLG LIKE SY-BATCH,
RETURN Like BAPIRET2.
lv_matnr = '000000094799010000'.
lv_werk = '7311'.
lv_cuobj = '000000000000080216'.
lv_klvar = 'Z540'.
lv_psdat = '20221004'.
lv_menge = '1'.
lv_vbeln = '003010794'.
lv_posnr = '000010'.
lv_kalnr = '000116381893'.
lv_dunkel = 'X'.
lv_S_AUCOST = 'A'.
CALL FUNCTION 'CK_F_SD_ORDER_CALC'
EXPORTING
MATNR_IMP = lv_matnr
WERKS_IMP = lv_werk
* OBJNR_IMP =
CUOBJ_IMP = lv_cuobj
KLVAR_IMP = lv_klvar
* ZSCHL_IMP =
* KALSM_IMP =
PSDAT_IMP = lv_psdat
MENGE_IMP = lv_menge
VBELN_IMP = lv_vbeln
POSNR_IMP = lv_posnr
KALNR_IMP = lv_kalnr
* BWTAR_IMP =
* KZBWS_IMP = ' '
S_DUNKEL = lv_dunkel
S_AUCOST = lv_S_AUCOST
* I_TECHS =
IMPORTING
KLVAR_EXP = KLVAR_EXP
KALVAR_EXP = KALVAR_EXP
KALNR_EXP = KALNR_EXP
HWGES_EXP = HWGES_EXP
HWVAR_EXP = HWVAR_EXP
HWFIX_EXP = HWFIX_EXP
HWAER_EXP = HWAER_EXP
SAVE_FLG = SAVE_FLG
TABLES
T_KEPH_EXP = T_KEPH_EXP
EXCEPTIONS
FAILED = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = RETURN
.
COMMIT WORK.
write: 'ausgabe'.