method IF_EX_FDM_USER_SCREEN~GET_CREATE_SCREEN.
E_DYNNR = '9001'.
E_PROGNAME = 'Zz_program_name'.
endmethod.
METHOD if_ex_fdm_user_screen~create_screen_pai.
DATA: wa_attr TYPE LINE OF fdm_t_attribute.
DATA: l_dynpro_program LIKE sy-repid,
l_dynpro_number LIKE sy-dynnr,
lt_dynpfield TYPE TABLE OF dynpread,
wa_dynpfield LIKE LINE OF lt_dynpfield.
*-------------------------
* 1,Get screen values
*-------------------------
l_dynpro_program = 'ZXXX_PROGRAM_NAME'.
l_dynpro_number = '9001'.
CLEAR wa_dynpfield.
REFRESH lt_dynpfield.
MOVE 'UDMCASEATTR00-ZZ_FIELDS' TO wa_dynpfield-fieldname.
APPEND wa_dynpfield TO lt_dynpfield.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = l_dynpro_program
dynumb = l_dynpro_number
TABLES
dynpfields = lt_dynpfield.
*----------------------------------------
*2, Pass Z field to Dispute attribute (UDMCASEATTR00)
*----------------------------------------
wa_attr-attr_id = 'ZZ_FIELDS'.
CLEAR wa_dynpfield.
READ TABLE lt_dynpfield INTO wa_dynpfield WITH KEY fieldname = 'UDMCASEATTR00-ZZ_FIELDS'.
wa_attr-attr_value = wa_dynpfield-fieldvalue.
APPEND wa_attr TO e_user_attributes.
CLEAR wa_attr.
...
*--------------------------------------------------------------------
* 3, Get Answers and export to memory for dispute case saving using
*--------------------------------------------------------------------
CLEAR: wa_dynpfield, l_memory.
READ TABLE lt_dynpfield INTO wa_dynpfield WITH KEY fieldname = 'ZZR1_Y'.
IF wa_dynpfield-fieldvalue IS INITIAL.
MOVE 'N' TO l_memory+0(1).
ELSE.
MOVE 'Y' TO l_memory+0(1).
ENDIF.
...
EXPORT l_memory = l_memory TO MEMORY ID 'ZANSWER'.
ENDMETHOD.
METHOD if_ex_scmg_store_s~was_saved.
*----------------------------------------
* 1. Get Question Answer and Store to Ztable
*----------------------------------------
IMPORT l_memory = l_memory FROM MEMORY ID 'ZANSWER'.
FREE MEMORY ID 'ZANSWER'.
IF l_memory IS INITIAL.
RETURN.
ENDIF.
...process data...
modify ztable from lt_tab.
IF sy-subrc EQ 0.
COMMIT WORK.
ENDIF.
*----------------------------------
* 2, Store Qustions to Dispute Notes
*----------------------------------
"Get Dispute Guid
l_guid = im_case->get_guid( ).
CALL METHOD cl_scmg_case_api=>if_scmg_case_api~open_case
EXPORTING
im_case_guid = l_guid
im_enqueue = abap_false
* im_scope = IF_SRM_SP_ENQUEUE=>SCOPE_DIALOG_AND_UPDATE_TASK
im_check_authority = abap_false
RECEIVING
re_case = lref_case
EXCEPTIONS
failed = 1
enqueue_failed = 2
invalid_guid = 3
cx_srm_gsp_back = 4
no_authority = 5
OTHERS = 6.
" concatenate answers for case notes
CLEAR wa_im_text. REFRESH lt_im_text.
i = 1.
MOVE i TO wa_im_text-tdformat.
MOVE 'If any of these questions is answered `Yes`, then this is a Quality Complaint. Please create an F1.'
TO wa_im_text-tdline.
APPEND wa_im_text TO lt_im_text.
...
CALL METHOD lref_case->note_insert
EXPORTING
im_id = 'Z001'
im_text = lt_im_text
im_lang = sy-langu
EXCEPTIONS
failed = 1.
IF sy-subrc <> 0.
ENDIF.
CALL METHOD lref_case->save
EXPORTING
im_dequeue = ''
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
ELSE.
COMMIT WORK.
ENDIF.
FUNCTION z_qnq_screen.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(CASE_GUID) TYPE SCMG_CASE_GUID
*" REFERENCE(IM_MODE) TYPE SCMG_PROCESSING_MODE
*"----------------------------------------------------------------------
CALL SCREEN 9001 STARTING AT 10 10.
ENDFUNCTION.
method IF_EX_SCMG_CASE_FCODE_S~EXECUTE.
DATA: l_guid TYPE bdm_case_guid.
l_guid = im_case->g_backend->get_guid( ).
if im_mode eq 'C'.
message 'Only Modify/Disply allowed at UDM_DISPUTE.' type 'E'.
endif.
CALL FUNCTION 'Z_QNQ_SCREEN'
EXPORTING
case_guid = l_guid
IM_MODE = im_mode.
endmethod.
LOOP AT SCREEN.
IF screen-name = 'R1_Y'.
CLEAR r1_y.
MOVE 'X' TO r1_n.
MODIFY SCREEN.
ENDIF.
...
ENDLOOP.
LOOP AT SCREEN .
IF screen-name NE 'BCANCEL' AND im_mode EQ 'D'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |