Application Development 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: 

Issues with BAPI: BAPI_ALM_ORDER_MAINTAIN (table: SRULE)

0 Kudos
1,698
Hi,

I have some issues to configure this BAPI correctly.

Create am pm order isn`t a issue and this is working fine, but while I am trying to set up the setllement-rule i am running in trouble.

The return of the bapi is:

E IWO_BAPI2 104 Entry 1 in table SRULE (method CREATE) was not found
E IWO_BAPI2 113 Error during processing of BAPI methods
E IWO_BAPI 121 Error reading the order %00000000001 in the document tables

I configured the BAPI (methods) in this way:

*Start HEADER CREATE
  wa_methods-refnumber = '000001'.
  wa_methods-objecttype = 'HEADER'.
  wa_methods-method = 'CREATE'.


*Prüfung wenn externe Nummernvergabe, dann externe Nummer - sonst interne
  IF im_exnumber EQ 'E'.
    wa_methods-objectkey = im_aufnr.
  ELSE.
    wa_methods-objectkey = '%00000000001'.
  ENDIF.

  APPEND wa_methods TO it_methods.
  CLEAR wa_methods.
*Ende HEADER CREATE


*Start HEADER RELEASE
  IF im_release EQ 'X'.
    wa_methods-refnumber = '000001'.
    wa_methods-objecttype = 'HEADER'.
    wa_methods-method = 'RELEASE'.


*Prüfung wenn externe Nummernvergabe, dann externe Nummer - sonst interne
    IF im_exnumber EQ 'E'.
      wa_methods-objectkey = im_aufnr.
    ELSE.
      wa_methods-objectkey = '%00000000001'.
    ENDIF.


    APPEND wa_methods TO it_methods.
    CLEAR wa_methods.
  ENDIF.


*ENDE HEADER RELEASE


*Start Operation CREATE
  wa_methods-refnumber = '000001'.
  wa_methods-objecttype = 'OPERATION'.
  wa_methods-method = 'CREATE'.


*Prüfung wenn externe Nummernvergabe, dann externe Nummer - sonst interne
  IF im_exnumber EQ 'E'.
    wa_methods-objectkey = im_aufnr && '0010'.
  ELSE.
    wa_methods-objectkey = '%00000000001'.
  ENDIF.


  APPEND wa_methods TO it_methods.
  CLEAR wa_methods.


*Ende Operation CREATE


*Start Components
  IF im_component EQ 'X'.
    wa_methods-refnumber = '000001'.
    wa_methods-objecttype = 'COMPONENT'.
    wa_methods-method = 'CREATE'.
    wa_methods-objectkey = '%00000000001'.


    APPEND wa_methods TO it_methods.
    CLEAR wa_methods.
  ENDIF.
*Ende Components


*Start Abrechnungsvorschrift / SRULE
  IF im_srule EQ 'X'.
    wa_methods-refnumber = '000001'.
    wa_methods-objecttype = 'SRULE'.
    wa_methods-method = 'CREATE'.


*Prüfung wenn externe Nummernvergabe, dann externe Nummer - sonst interne
    IF im_exnumber EQ 'E'.
           wa_methods-objectkey = im_aufnr.
    ELSE.
            wa_methods-objectkey = '%00000000001'.
    ENDIF.


    APPEND wa_methods TO it_methods.
    CLEAR wa_methods.
  ENDIF.


*ENDE Abrechnungsvorschrift / SRULE




*START SAVE
  "  wa_methods-refnumber = '000001'.
  wa_methods-objecttype = ''.
  wa_methods-method = 'SAVE'.
  wa_methods-objectkey = '%00000000001'.


  APPEND wa_methods TO it_methods.
  CLEAR wa_methods.
*ENDE SAVE


It doesn`t matter how the structure IT_SRULE is configured...

It would be great if someone have a idea how I could fix this issue.

Regards, Julian
0 REPLIES 0