cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI for CO Production Order KKF1

Former Member
0 Kudos

Hi PP Friends.

I want to know if you know a bapi or function module for the transaction KKF1 (CO Production Order)

I Try the bapi

BAPI_INTERNALORDER_CREATE (Create Internal Order From Transferred Data), but the documentation said the bapi only create

Orders from categories "01" and "02".

thanks!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

try this

KPLC1_ECP_INTERNAL_ORDER

Answers (2)

Answers (2)

Private_Member_49934
Contributor
0 Kudos

You could try the below function modules

CALL FUNCTION 'KAUF_ORDER_CREATE'

EXPORTING

   I_AUART                        = 'type'

*   I_AUFNR                        = ' '

*   I_AUTYP_ERL                    = ' '

*   I_DIALOG                       = ' '

   I_MATNR                        = 'mat'

*   I_OREXT                        =

*   I_REFNR                        = ' '

   I_SAVE_FLAG                    = 'X'

   I_WERKS                        = 'plant'

*   I_NEGLECT_FIELDSELECTION       = ' '

*   I_APROF                        = ' '

IMPORTING

   E_AFKO                         = E_AFKO

   E_AFPO                         = E_AFPO

   E_COAS                         = E_COAS

   E_KAUF                         = E_KAUF

   E_INDEX                        E_INDEX

EXCEPTIONS

   FOREIGN_LOCK                   = 1

   ORDER_TYPE_NOT_VALID           = 2

   REFERENCE_NOT_VALID            = 3

   WRONG_INPUT                    = 4

   NO_NUMBER_RANGE                = 5

   OTHERS                         = 6

          .

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.



CALL FUNCTION 'KAUF_ORDER_STORE'

  EXPORTING

   I_AFKO                    = E_AFKO

   I_AFPO                    = E_AFPO

   I_CHECK                   = 'X'

    i_coas                    = E_COAS

*   I_DIALOG                  = ' '

    i_kauf                    = E_KAUF

   I_SAVE_FLAG               = 'X'

EXCEPTIONS

   ILLEGAL_CHANGE            = 1

   ORDER_NOT_IN_BUFFER       = 2

   OTHERS                    = 3

          .

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.



COMMIT WORK AND  WAIT.

Former Member
0 Kudos

HI. Good try, but FM KPLC1_ECP_INTERNAL_ORDER dont have parameters to create a CO Production order, like Material Number, Settlement profile.

this FM is only a include in other program !

other idea?