Beruflich Dokumente
Kultur Dokumente
Purpose
This Document demonstrates the use of FM OIJ02_CREATE_TICKT with the latest release [ I am using
mySAP ECC 6.0 EHP 6 ].
And also demonstrates the use of OIJB_TKT_QCI_INTERFACE for quantity conversion parameters of SAP IS
Oil.
The FM is used to post ticket against nomination and encapsulates the entire functionality into one [Earlier
Transactions
How to achieve :
lt_return TYPE TABLE OF bapiret2.
lw_tkt_h-tplst = lw_oijnomh-tplst.
lw_tkt_h-tsyst = lw_oijnomh-tsyst.
lw_tkt_h-erdat = sy-datum.
lw_tkt_h-erzeit = sy-uzeit.
lw_tkt_h-ernam = sy-uname.
ADD 1 TO lw_tcount.
EXPORTING
input = lw_g_odet-nomtk
IMPORTING
output = lw_tkt_h-ticketnr.
CONCATENATE lw_tkt_h-ticketnr
lw_g_odet-nomit+7(3)
lw_tcount
INTO lw_tkt_h-ticketnr
SEPARATED BY ‘_’.
lw_tkt_h-ticket_type = ‘YRT’.
lw_tkt_h-ticket_version = 00.
lw_tkt_h-ticket_purpose = 01.
lw_tkt_h-updkz = ‘I’.
lw_tkt_i-nomit = lw_g_odet-nomit.
This indicator is to be passed if you want to close the nomination line item
* lw_tkt_i-close_nomit = ‘X’.
lw_tkt_i-vehicle = lw_g_odet-vehid.
lw_tkt_i-nomnr = lw_oijnomh-nomnr.
lw_tkt_i-matnr = lw_oijnomi-matnr_i.
lw_tkt_i-locid = lw_oijnomi-locid.
lw_tkt_i-substatus = lw_oijnomi-isubstat.
lw_tkt_i-sityp = lw_oijnomi-sityp.
lw_tkt_i-charg_l = lw_oijnomi-charg_l.
lw_tkt_i-charg_d = lw_oijnomi-charg_d.
lw_tkt_i-charg_o = lw_oijnomi-charg_o.
The scenario is the identifier which states whether the process is outbound or inbound
Depending on this the Source Plant / SLoc or Destination Plant / Sloc is filled.
INTO lw_tkt_i-mvscenario
WHERE sityp = lw_oijnomi-sityp
IF p_omode = 7.
lw_tkt_i-werks_o = lw_oijnomi-locpt.
lw_tkt_i-lgort_o = lw_oijnomi-locsl.
ELSEIF p_omode = 3.
lw_tkt_i-werks_d = lw_oijnomi-locpt.
lw_tkt_i-lgort_d = lw_oijnomi-locsl.
ENDIF.
lw_tkt_i-time_st_led_ot = lw_tkt_i-time_st_load_sta.
lw_tkt_i-ticket_item = 10.
lw_tkt_i-ticket_version = 00.
lw_tkt_i-ticket_purpose = 01.
lw_tkt_i-updkz = ‘I’.
IF sy-uzeit LT ‘060000’.
lw_tkt_i-budat = sy-datum – 1.
lw_tkt_i-oib_bltime = ‘115500’.
ELSE.
lw_tkt_i-budat = sy-datum.
lw_tkt_i-oib_bltime = sy-uzeit.
ENDIF.
If you are using sub-items as in my case is a rail scenario so I am passing the sub-items as well
It is not a mandatory parameter, as in Vessel case there won’t be any so it can be skipped.
<lfs_item>-ticket_item = lw_tkt_i-ticket_item.
<lfs_item>-ticket_version = lw_tkt_i-ticket_version.
<lfs_item>-ticket_purpose = lw_tkt_h-ticket_purpose.
<lfs_item>-act_date = sy-datum.
<lfs_item>-act_time = sy-uzeit.
lw_tkt_si-updkz = ‘U’.
lw_tkt_i-meins = <lfs_item>-subitm_actuom.
lw_tkt_i-tstmp = <lfs_item>-zz_dip_temp .
ELSE.
ENDIF.
IF lw_tkt_i-tdich IS INITIAL.
lw_tkt_i-tdich = <lfs_item>-zz_dip_den.
ELSE.
lw_tkt_i-tdich = ( lw_tkt_i-tdich + <lfs_item>-zz_dip_den ) / 2.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
IF lt_tkt_si IS INITIAL.
ENDIF.
The QCI parameters are an important part of the entire IS-Oil scenario so for that conversion the below
FM is used.
EXPORTING
is_working = ‘H’
is_ticket_header = lw_tkt_h
is_ticket_item = lw_tkt_i
is_nomination_header = lw_oijnomh
is_nomination_item = lw_oijnomi
CHANGING
cs_oij_el_tkt_i_o1 = lw_i_o1
ct_oij_el_tkt_i_o2 = lt_i_o2
return = lt_return
EXCEPTIONS
ticket_item_unit_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
IF sy-msgid IS INITIAL.
MESSAGE i016(rp) WITH text-e03 .
ELSE.
MESSAGE ID sy-msgid TYPE ‘I’ NUMBER sy-msgno
CLEAR lw_act_flag.
ENDIF.
The ACT flag for the actualization of the ticket if you want to actualize it later keep it blank.
This is an important part… In my case I am not passing the QCI Defaults so If we are changing the
defaults
lw_i_o1-mttmp = lw_tkt_i-tstmp.
lw_i_o1-tdich = lw_tkt_i-tdich.
lw_i_o2-manen = ‘X’.
MODIFY lt_i_o2 FROM lw_i_o2 TRANSPORTING manen WHERE manen = space .
EXPORTING
flag_actualization = lw_act_flag
CHANGING
gs_h = lw_tkt_h
gt_i = lt_tkt_i
gt_si = lt_tkt_si
gt_i_o2 = lt_i_o2
gt_i_o1 = lt_i_o1
lt_bapi_return = lt_return.
MESSAGE ID lw_return-id
TYPE lw_return-type
NUMBER lw_return-number
WITH lw_return-message_v1 lw_return-message_v2.
ENDIF.
If you are already a member in this website, Please Click here to login If you are not yet a member, Please
Contact US