SAP Jobsuche bei DV-Treff
Tekko
  • Tekko
  • SAP Forum - User Thema Starter
vor 4 Jahre
Hallo Leute,

Wieso funktioniert dieser Code nicht?

Es wird kein Auftrag erstellt.



REPORT ZSUBCONORDER.


Data: it_methods TYPE STANDARD TABLE OF BAPI_ALM_ORDER_METHOD.
it_methods = VALUE #( ( REFNUMBER = '000001'
                        OBJECTTYPE = 'HEADER'
                        METHOD = 'CREATE'
                        OBJECTKEY = '%00000000001' ) ).

it_methods = VALUE #( ( REFNUMBER = '000001'
                        OBJECTTYPE = 'OPERATION'
                        METHOD = 'CREATE'
                        OBJECTKEY = '%00000000001' ) ).

it_methods = VALUE #( ( REFNUMBER = '000001'
                        METHOD = 'SAVE'
                        OBJECTKEY = '%00000000001' ) ).



Data IT_HEADER TYPE STANDARD TABLE OF BAPI_ALM_ORDER_HEADERS_I.
IT_HEADER = VALUE #( (  ORDER_TYPE = 'PM01'
                        MN_WK_CTR = 'MECHANIK'
                        PMACTTYPE = '103'
                        FUNCT_LOC = 'K1-ZPW-2'
                        START_DATE = '18032020'
                        FINISH_DATE = '20032020'
                        PRIORITY = '1'
                        SHORT_TEXT = 'LB über SE38') ).



DATA IT_HEADER_UP Type STANDARD TABLE OF BAPI_ALM_ORDER_HEADERS_UP.
IT_HEADER_UP = VALUE #( (
                        MN_WK_CTR = 'X'
                        PMACTTYPE = 'X'
                        FUNCT_LOC = 'X'
                        START_DATE = 'X'
                        FINISH_DATE = 'X'
                        PRIORITY = 'X'
                        SHORT_TEXT = 'X') ).


DATA IT_OPERATION TYPE STANDARD TABLE OF BAPI_ALM_ORDER_OPERATION.
IT_OPERATION = VALUE #( (
                        ACTIVITY = '0010'
                        CONTROL_KEY = 'PM02'
                        DESCRIPTION = 'ABC'
                        SUBCONTRACTING = 'X'
                          ) ).

DATA IT_OPERATION_UP TYPE STANDARD TABLE OF BAPI_ALM_ORDER_OPERATION_UP.
IT_OPERATION_UP = VALUE #( (
                            ACTIVITY = 'X'
                            CONTROL_KEY = 'X'
                            DESCRIPTION = 'X'
                            SUBCONTRACTING = 'X'
                            ) ).


DATA ET_NUMBERS TYPE STANDARD TABLE OF BAPI_ALM_NUMBERS WITH HEADER LINE.
DATA wa_et_Numbers type BAPI_ALM_NUMBERS.


DATA Return TYPE STANDARD TABLE OF BAPIRET2.
DATA wa_return type BAPIRET2.





CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
* EXPORTING
*   IV_MMSRV_EXTERNAL_MAINTENACE       =
  TABLES
    it_methods                         = it_methods
    IT_HEADER                          = IT_HEADER
    IT_HEADER_UP                       = IT_HEADER_UP
*   IT_HEADER_SRV                      =
*   IT_HEADER_SRV_UP                   =
*   IT_USERSTATUS                      =
*   IT_PARTNER                         =
*   IT_PARTNER_UP                      =
    IT_OPERATION                       = IT_OPERATION
    IT_OPERATION_UP                    = IT_OPERATION_UP
*   IT_RELATION                        =
*   IT_RELATION_UP                     =
*   IT_COMPONENT                       =
*   IT_COMPONENT_UP                    =
*   IT_OBJECTLIST                      =
*   IT_OBJECTLIST_UP                   =
*   IT_OLIST_RELATION                  =
*   IT_TEXT                            =
*   IT_TEXT_LINES                      =
*   IT_SRULE                           =
*   IT_SRULE_UP                        =
*   IT_TASKLISTS                       =
*   EXTENSION_IN                       =
    RETURN                             = RETURN
    ET_NUMBERS                         = ET_NUMBERS
*   IT_REFORDER_ITEM                   =
*   IT_REFORDER_ITEM_UP                =
*   IT_REFORDER_SERNO_OLIST_INS        =
*   IT_REFORDER_SERNO_OLIST_DEL        =
*   IT_PRT                             =
*   IT_PRT_UP                          =
*   IT_REFORDER_OPERATION              =
*   IT_SERVICEOUTLINE                  =
*   IT_SERVICEOUTLINE_UP               =
*   IT_SERVICELINES                    =
*   IT_SERVICELINES_UP                 =
*   IT_SERVICELIMIT                    =
*   IT_SERVICELIMIT_UP                 =
*   IT_SERVICECONTRACTLIMITS           =
*   IT_SERVICECONTRACTLIMITS_UP        =
*   ET_NOTIFICATION_NUMBERS            =
*   IT_PERMIT                          =
*   IT_PERMIT_UP                       =
*   IT_PERMIT_ISSUE                    =
*   IT_ESTIMATED_COSTS                 =
          .




CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
 EXPORTING
   WAIT          = ' '
* IMPORTING
*   RETURN        =
          .



Alpmann
vor 4 Jahre
Hallo Tekko,

den BAPI_ALM_ORDER_MAINTAIN habe ich noch nicht benutzt, aber an dieser Stelle ist meiner Meinung nach was falsch:

Data IT_HEADER TYPE STANDARD TABLE OF BAPI_ALM_ORDER_HEADERS_I.

IT_HEADER = VALUE #( ( ORDER_TYPE = 'PM01'

MN_WK_CTR = 'MECHANIK'

PMACTTYPE = '103'

FUNCT_LOC = 'K1-ZPW-2'

START_DATE = '18032020'

FINISH_DATE = '20032020'

PRIORITY = '1'

SHORT_TEXT = 'LB über SE38') ).

Probier mal das Datum so zu übergeben (JJJJMMTT):

START_DATE = '20200318'

FINISH_DATE = '20200320'

Mit freundlichen Grüßen

Matthias Alpmann

Tekko
  • Tekko
  • SAP Forum - User Thema Starter
vor 4 Jahre

Zitat von: Alpmann 

Probier mal das Datum so zu übergeben (JJJJMMTT):

START_DATE = '20200318'

FINISH_DATE = '20200320'

Hallo Alpmann,

Danke für deine Antwort :D

Hat aber leider nicht funktioniert.

maxzottl
vor 4 Jahre
Hallo Tekko,

was steht denn nach Aufruf des FUB in RETURN? (hat mir gute Hinweise geliefert)

Bei meinem letzten Versuch hatte ich SAVE ohne weitere Parameter aufgerufen.

it_methods = VALUE #( ( REFNUMBER = space

METHOD = 'SAVE'

OBJECTKEY = space ) ).

hth

maxzottl

Benutzer, die gerade dieses Thema lesen