Skip to Content
0
Former Member
Apr 22, 2015 at 07:10 AM

Work Manager 6.2 (CS) - Longtext not set for multiplie Notification Activities

19 Views

Hi all,

I am trying to post multiple activities, each with its own long text from the work manager. The thing is that only the first activity will have the long text. While debugging /SYCLO/IF_CORE_DO_HANDLER~CREATE (/SMERP/CL_CS_NOTIFICATION_DO), I found a curious piece of code, that basically does the following:

  • Loop over activities (outer loop)
    • Get a fresh sort number
    • Loop over long texts (inner loop)
      • if the long text sort number matches the activity sort number (the activity from the outer loop)
        • then replace the long text sort number by the fresh sort number and remove the long text from the list of long texts and copy its values to another list
        • else remove the long text from the list of long texts and copy its values to another list
    • replace the activity sort number (the activity from the outer loop) with the fresh sort number

What happens with multiple activities is that in the inner loop, all the long texts are removed from the list of long texts (even those that are matching the second, third, ... activity in the activity list). Therefore, only for the first activity, long texts are added. Did anyone else encounter this problem (if this is working for anyone, could you provide me with your BAPI parameters)? Any idea on what SAPWM-911 is about (would it be safe to get rid of that part)?

LOOP AT me->tab_notif_activity ASSIGNING <notif_activity>.
ADD 1 TO lv_sort_no.
LOOP AT lt_notif_longtext INTO ls_notif_longtext WHERE objtype = lc_ltext_notif_activity.
lv_index = sy-tabix.
IF ls_notif_longtext-objkey+4(4) = <notif_activity>-act_sort_no.
ls_notif_longtext-objkey+4(4) = lv_sort_no.
APPEND INITIAL LINE TO me->tab_notif_longtext ASSIGNING <notif_longtext>.
MOVE-CORRESPONDING ls_notif_longtext TO <notif_longtext>.
DELETE lt_notif_longtext INDEX lv_index.
"<--Ins 332_700 SP1 - SAPWM-911 - Start
ELSE.
"Check for remaining longtext rows not matching with parent table
"is considered as update to the existing activity notes
APPEND INITIAL LINE TO me->tab_notif_longtext ASSIGNING <notif_longtext>.
MOVE-CORRESPONDING ls_notif_longtext TO <notif_longtext>.
DELETE lt_notif_longtext INDEX lv_index.
"<--Ins 332_700 SP1 - SAPWM-911 - End
ENDIF.
ENDLOOP.
<notif_activity>-act_sort_no = lv_sort_no.
ENDLOOP.

Thanks in advance for any contribution to this problem.

Regards, Daniel