cancel
Showing results for 
Search instead for 
Did you mean: 

Order Number is not getting created for an PM Notification Number from FM BAPI_ALM_ORDER_MAINTAIN

deepa_patil1
Explorer
0 Kudos

Hi Experts,

Please help me out in finding solution

Im passing all the credentials to FM BAPI_ALM_ORDER_MAINTAIN.In my requirement i need to pass only header info to FM.Kindly find the below details to FM Im passing as per the requirement. After execution of Bapi FM the output Im receiving Return table is sending only Success message telling Bapi Control was Ended and there is no order number created by FM. Is there anything Im missing or any details Please let me known.

LS_METHD-REFNUMBER = '000001'.
LS_METHD-OBJECTTYPE = 'HEADER'.
LS_METHD-METHOD = 'SAVE'.
LS_METHD-OBJECTTYPE = ' '.
APPEND LS_METHD TO LT_METHD.

LS_HEADER-ORDERID = '%00000000001'.
LS_HEADER-ORDER_TYPE = 'PM02'.
LS_HEADER-PLANPLANT = '1000'.
LS_HEADER-MN_WK_CTR = 'MECHANIK'.
LS_HEADER-PLANT = '1000'.
LS_HEADER-PMACTTYPE = '102'.
LS_HEADER-PLANGROUP = '100'.
LS_HEADER-SYSTCOND = 'U'.
LS_HEADER-FUNCT_LOC = 'K1-B01-1'.
LS_HEADER-EQUIPMENT = 'P-1000-N001'.
LS_HEADER-LOC_WK_CTR = 'MECHANIK'.
LS_HEADER-START_DATE = '12072018' ." '15102002'.
LS_HEADER-FINISH_DATE = '31072018'.
LS_HEADER-PRIORITY = '1'.
LS_HEADER-NOTIF_NO = '10000887'.
APPEND LS_HEADER TO LT_HEADER.


CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
EXPORTING
IV_MMSRV_EXTERNAL_MAINTENACE = ' '
TABLES
IT_METHODS = LT_METHD
IT_HEADER = LT_HEADER
RETURN = LT_RET
ET_NUMBERS = LT_NUMB
ET_NOTIFICATION_NUMBERS = LT_NOT_NO.


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Thanks

Deepa

Accepted Solutions (0)

Answers (4)

Answers (4)

deepa_patil1
Explorer
0 Kudos

Hello Rekha,

Thanks for Reply

If i will pass Create Operation of my data to FM

ls_method-refnumber = 1.

ls_method-objecttype = 'OPERATION'.

ls_method-method = 'CREATE'.

ls_method-objectkey = '%00000000001'.

APPEND ls_method TO lt_methods.

CLEAR ls_method.

ls_operation-activity = '0010'.

ls_operation-control_key = i_ctlkey.

ls_operation-work_cntr = wrk_ctr.

ls_operation-plant = plant.

ls_operation-description = 'Operation Text'

ls_operation-cost_element = cst_elmt.

APPEND ls_operation TO lt_operation.

Im able to get a Error Message as 'Order is changed, but not created'.

But not creating any Order Number. Is there anything Im missing or any details Please let me known.

Regards,

Deepa

Rekha_DR
Developer Advocate
Developer Advocate
0 Kudos

Hello Deepa,

For order creation, atleast one operation should be created. So create an entry for operation and pass the operation internal table to

'BAPI_ALM_ORDER_MAINTAIN' . See if the below example works.

*Create Operation

ls_method-refnumber = 1.

ls_method-objecttype = 'OPERATION'.

ls_method-method = 'CREATE'.

ls_method-objectkey = '%00000000001'.

APPEND ls_method TO lt_methods.

CLEAR ls_method.

ls_operation-activity = '0010'.

ls_operation-control_key = i_ctlkey.

ls_operation-work_cntr = wrk_ctr.

ls_operation-plant = plant.

ls_operation-description = 'Operation Text'

ls_operation-cost_element = cst_elmt.

APPEND ls_operation TO lt_operation.


CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = lt_methods
it_header = lt_header
it_operation = lt_operation
it_component = lt_component
et_numbers = et_numbers
return = lt_return.

Best Regards,

Rekha



deepa_patil1
Explorer
0 Kudos

Hello Muhammad,

Thanks for Reply

If i will pass LS_METHD-OBJECTKEY = '%00000000001' to Method Table. Im able to get a Success Message as 'BAPI control was ended',

But not creating any Order Number. Is there anything Im missing or any details Please let me known.

Regards,

Deepa




former_member213491
Participant
0 Kudos

Hallo Deepa A,

You have missed a Objeckt Key in Header.

LS_METHD-OBJECTKEY = '%00000000001'.