FUNCTION zpm_create_subsequent_notif.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(REF_NOTIFICATION) TYPE QMNUM OPTIONAL
*" VALUE(FUNC_LOCATION) TYPE TPLNR OPTIONAL
*" VALUE(NOTIF_DESCRIPTION) TYPE QMTXT OPTIONAL
*" VALUE(LONG_TEXT) TYPE STRING OPTIONAL
*" VALUE(PRIORITY) TYPE PRIOK OPTIONAL
*" VALUE(REPORTED_BY) TYPE QMNAM OPTIONAL
*" EXPORTING
*" VALUE(SUB_NOTIF) TYPE QMNUM
*" TABLES
*" RETURN STRUCTURE BAPIRET2
*"----------------------------------------------------------------------
IF ref_notification IS INITIAL.
RETURN.
ENDIF.
DATA: ls_riqs5 TYPE riqs5.
DATA: lt_inlines TYPE TABLE OF rfc_tline.
DATA: ls_viqmel_out TYPE viqmel.
DATA: ls_viqmel_out1 TYPE viqmel.
DATA: lt_return TYPE TABLE OF bapiret2.
DATA: lt_return1 TYPE TABLE OF bapiret2.
SELECT SINGLE * FROM viqmel INTO @DATA(ls_viqmel) WHERE qmnum = @ref_notification.
IF sy-subrc = 0.
MOVE-CORRESPONDING ls_viqmel TO ls_riqs5.
ls_riqs5-qwrnum = ref_notification.
ls_riqs5-tplnr = func_location.
ls_riqs5-qmtxt = notif_description.
ls_riqs5-priok = priority.
IF reported_by IS NOT INITIAL.
ls_riqs5-qmnam = reported_by.
ELSE.
ls_riqs5-qmnam = sy-uname.
ENDIF.
ls_riqs5-qmdat = sy-datum.
ls_riqs5-mzeit = sy-uzeit.
ENDIF.
SPLIT long_text AT '<BR/>' INTO TABLE DATA(lt_ltext).
IF lt_ltext IS NOT INITIAL.
LOOP AT lt_ltext INTO DATA(ls_ltext).
APPEND INITIAL LINE TO lt_inlines ASSIGNING FIELD-SYMBOL(<fs_inlines>).
<fs_inlines>-refobjtyp = 'QMEL'.
<fs_inlines>-tdformat = '>X'.
CONCATENATE '* ' ls_ltext INTO <fs_inlines>-tdline RESPECTING BLANKS.
CONDENSE <fs_inlines>-tdline.
ENDLOOP.
ENDIF.
CALL FUNCTION 'IQS4_CREATE_NOTIFICATION'
EXPORTING
i_riqs5 = ls_riqs5
i_commit = 'X'
IMPORTING
e_viqmel = ls_viqmel_out
TABLES
i_inlines_t = lt_inlines
return = lt_return.
READ TABLE lt_return WITH KEY type = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND LINES OF lt_return TO return.
RETURN.
ELSE.
CALL FUNCTION 'IQS4_SAVE_NOTIFICATION'
EXPORTING
i_qmnum = ls_viqmel_out-qmnum
i_commit = 'X'
IMPORTING
e_viqmel = ls_viqmel_out1
TABLES
return = lt_return1.
READ TABLE lt_return1 WITH KEY type = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
APPEND LINES OF lt_return TO return.
RETURN.
ELSE.
sub_notif = ls_viqmel_out-qmnum.
ENDIF.
ENDIF.
ENDFUNCTION.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 |