"Read the Status using PREMISE
CALL FUNCTION 'STATUS_READ' "Read Object Status (JSTO and JEST)
EXPORTING
client = SY-MANDT " sy-mandt Client
objnr = " jsto-objnr Object Number = PREMISE OBJNR
only_active = 'X' " jest-inact 'Transfer Active Statuses Only' Flag
TABLES
status = lt_objnr_stat " jstat Table of Individual Statuses for the Object
EXCEPTIONS
OBJECT_NOT_FOUND = 1 " Status Object Not Found
IF line_exists( lt_objnr_stat[ stat = 'E0002' ] ). "STATUS to check
"APPEND Message to EXTENSION DATA
APPEND VALUE #( ref_field_name = 'The Premise needs to be' ref_field_value = 'Inspected') TO ct_extension_data.
**CREATE CPEM CASE
*fill out ls_casecreate and lt_objects
*values depends on the configuration on your system
CALL FUNCTION 'BAPI_EMMA_CASE_CREATE' "Create Clarification Case Manually
EXPORTING
case_create = ls_casecreate " bapi_emma_case_create Fields for Creation of Manual Case
TABLES
objects = lt_objects " bapi_emma_case_object Case Objects
case_text = lt_case_text " bapi_emma_tline Long Text
return = lt_return " bapiret2 Return Parameters
. " BAPI_EMMA_CASE_CREATE
READ TABLE lt_return TRANSPORTING NO FIELDS WITH KEY type = 'E'. "Check for errors
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 |