Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Transaction KKF2

Former Member
0 Likes
2,190

hi,

i have a problem with a process, want to change the system status of the order QM and this process dont modify the table "aufk" fields "PHAS2" , "IDAT2", just in the table "JEST"

Transaction KKF2 until shows to end's tecnical the order

if i do manual on the transaction KKF2 is modify the fields on the table "AUFK"

someone knows what i can do?!

my code

CALL FUNCTION 'KAUF_ORDER_READ'
 EXPORTING
*   I_ACTVT                      = '03'
   i_aufnr                      = p_aufnr
*   I_AUTYP_ERL                  = ' '
*   I_COAS                       = ' '
*   I_ENQUEUED                   = ' '
*   I_INDEX                      = 0
   i_afko                       = i_afko
   i_afpo                       = i_afpo
*   I_COSTS_EXIST                =
 IMPORTING
   e_afko                       = e_afko
   e_afpo                       = e_afpo
   e_coas                       = e_coas
   e_kauf                       = e_kauf
*   E_COAS_OLD                   =
 EXCEPTIONS
   auart_not_found              = 1
   foreign_lock                 = 2
   no_authority                 = 3
   order_not_found              = 4
   order_type_not_valid         = 5
   wrong_input                  = 6
   logsystem_inconsistent       = 7
   OTHERS                       = 8
          .
IF sy-subrc  0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
 
e_coas-aenam = sy-uname.
e_coas-aedat = sy-datlo.                                    "Note 93897
e_coas-aezeit = sy-uzeit.
 
IF e_coas-astnr NE e_kauf-old_astnr.
  e_coas-stdat = sy-datlo.
ENDIF.
IF ( e_coas-estnr IS INITIAL OR e_coas-astnr > e_coas-estnr ).
  e_coas-estnr = e_coas-astnr.
ENDIF.
 
e_coas-idat2 = sy-datlo.
e_coas-phas0 = ''.
e_coas-phas1 = ''.
e_coas-phas2 = 'X'.
e_coas-phas3 = ''.
e_coas-idat2 = sy-datlo.
 
CALL FUNCTION 'KAUF_ORDER_ACTIVITY'
  EXPORTING
    i_coas         = e_coas
    i_kauf         = e_kauf
    i_vrgng        = 'BTAB'
*    I_CHECK        = 'X'
*    I_DIALOG       = ' '
  IMPORTING
    e_coas         = e_coas
    e_kauf         = e_kauf.
 
CALL FUNCTION 'KAUF_ORDER_STORE'
  EXPORTING
    i_afko = e_afko
    i_afpo = e_afpo
    i_coas = e_coas
    i_kauf = e_kauf.
 
 
*CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,533

I just went through the same issue with standard transaction vs calling a BAPI. After wasting one week of time, i came to know that it is the way SAP has designed and needs OSS notes on that. So i created an enhancement point at a right point which solved the issue.

Hope this helps,

-Veer

hi,

i have a problem with a process, want to change the system status of the order QM and this process dont modify the table "aufk" fields "PHAS2" , "IDAT2", just in the table "JEST"

Transaction KKF2 until shows to end's tecnical the order

if i do manual on the transaction KKF2 is modify the fields on the table "AUFK"

someone knows what i can do?!

my code

CALL FUNCTION 'KAUF_ORDER_READ'
 EXPORTING
*   I_ACTVT                      = '03'
   i_aufnr                      = p_aufnr
*   I_AUTYP_ERL                  = ' '
*   I_COAS                       = ' '
*   I_ENQUEUED                   = ' '
*   I_INDEX                      = 0
   i_afko                       = i_afko
   i_afpo                       = i_afpo
*   I_COSTS_EXIST                =
 IMPORTING
   e_afko                       = e_afko
   e_afpo                       = e_afpo
   e_coas                       = e_coas
   e_kauf                       = e_kauf
*   E_COAS_OLD                   =
 EXCEPTIONS
   auart_not_found              = 1
   foreign_lock                 = 2
   no_authority                 = 3
   order_not_found              = 4
   order_type_not_valid         = 5
   wrong_input                  = 6
   logsystem_inconsistent       = 7
   OTHERS                       = 8
          .
IF sy-subrc  0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
 
e_coas-aenam = sy-uname.
e_coas-aedat = sy-datlo.                                    "Note 93897
e_coas-aezeit = sy-uzeit.
 
IF e_coas-astnr NE e_kauf-old_astnr.
  e_coas-stdat = sy-datlo.
ENDIF.
IF ( e_coas-estnr IS INITIAL OR e_coas-astnr > e_coas-estnr ).
  e_coas-estnr = e_coas-astnr.
ENDIF.
 
e_coas-idat2 = sy-datlo.
e_coas-phas0 = ''.
e_coas-phas1 = ''.
e_coas-phas2 = 'X'.
e_coas-phas3 = ''.
e_coas-idat2 = sy-datlo.
 
CALL FUNCTION 'KAUF_ORDER_ACTIVITY'
  EXPORTING
    i_coas         = e_coas
    i_kauf         = e_kauf
    i_vrgng        = 'BTAB'
*    I_CHECK        = 'X'
*    I_DIALOG       = ' '
  IMPORTING
    e_coas         = e_coas
    e_kauf         = e_kauf.
 
CALL FUNCTION 'KAUF_ORDER_STORE'
  EXPORTING
    i_afko = e_afko
    i_afpo = e_afpo
    i_coas = e_coas
    i_kauf = e_kauf.
 
 
*CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .

2 REPLIES 2
Read only

Former Member
0 Likes
1,534

I just went through the same issue with standard transaction vs calling a BAPI. After wasting one week of time, i came to know that it is the way SAP has designed and needs OSS notes on that. So i created an enhancement point at a right point which solved the issue.

Hope this helps,

-Veer

Read only

Former Member
0 Likes
1,533

i solved the problem with function ALE_INTERNALORDER_DB_CHANGE