Skip to Content
author's profile photo Former Member
Former Member

CRM_DATAEXCH_R3D_MBDOC_FIL not working for standard CATEGORY field

Hello Experts,

I have a requirement in which I need to fill standard category field in activity_h using data coming from ECC system. SAP has recomended to apply a manual note 710149 [ Version 4]

As mentioned in the note i have coded in the method CRM_DATAEXCH_R3D_MBDOC_FILL as mentioend below:

READ TABLE ti_bapimtcs ASSIGNING <fs_bapimtcs>
       WITH KEY tabname = 'BAPISDHD'.
    IF sy-subrc = 0.
      ASSIGN ct_bus_trans_msg TO <fs_bad_bus_transn_message>.
      IF sy-subrc = 0.
        LOOP AT <fs_bad_bus_transn_message>-orderadm_h ASSIGNING <fs_orderadm_h>.
          IF <fs_bad_bus_transn_message>-activity_h IS INITIAL.
*            ASSIGN  <fs_orderadm_h>-sendbits TO <fs_activity_h>.
*            assign component
*            CLEAR wa_activity_h.
          ENDIF.

*        LOOP AT <fs_bad_bus_transn_message>-activity_h ASSIGNING <fs_activity_h>.
          IF <fs_bapimtcs>-data+254(4) IS NOT INITIAL.
            CASE <fs_bapimtcs>-data+254(4).
              WHEN 'ARIB'.
                wa_activity_h-category = 'TEL'.
              WHEN 'B2B'.
                wa_activity_h-category = 'TEL'.
              WHEN 'DFUE'.
                wa_activity_h-category = 'TEL'.
              WHEN 'EFRM'.
                wa_activity_h-category = 'TEL'.
              WHEN 'EMAI'.
                wa_activity_h-category = 'TEL'.
              WHEN 'FAX'.
                wa_activity_h-category = 'TEL'.
              WHEN 'FSE'.
                wa_activity_h-category = 'TEL'.
              WHEN 'GFAX'.
                wa_activity_h-category = 'TEL'.
              WHEN 'GHX'.
                wa_activity_h-category = 'TEL'.
              WHEN 'JDNT'.
                wa_activity_h-category = 'TEL'.
              WHEN 'MAIL'.
                wa_activity_h-category = 'TEL'.
              WHEN 'MDNT'.
                wa_activity_h-category = 'TEL'.
              WHEN 'NHNT'.
                wa_activity_h-category = 'TEL'.
              WHEN 'OSD'.
                wa_activity_h-category = 'TEL'.
              WHEN 'OSDM'.
                wa_activity_h-category = 'TEL'.
              WHEN 'SCIQ'.
                wa_activity_h-category = 'TEL'.
              WHEN 'TELE'.
                wa_activity_h-category = '202'.
              WHEN 'WCNT'.
                wa_activity_h-category = 'TEL'.
              WHEN 'WEB'.
                wa_activity_h-category = 'INT'.
              WHEN 'XWEB'.
                wa_activity_h-category = 'ZO1'.
            ENDCASE.
            wa_activity_h-orderadm_h_guid =  <fs_orderadm_h>-orderadm_h_guid.
*            wa_activity_h-sendbits = <fs_orderadm_h>-sendbits.
            APPEND wa_activity_h TO <fs_bad_bus_transn_message>-activity_h.
          ENDIF.
*        ENDLOOP.
        ENDLOOP.
        LOOP AT <fs_bad_bus_transn_message>-activity_h ASSIGNING <fs_activity_h>.
* Resolve the sendbits into a table of field names
          REFRESH lt_fields.
*          CALL FUNCTION 'SMOG_SENDBITS_CHECK'
*            EXPORTING
*              structurename       = 'BAD_ACTIVITY_H_MESS'
*              sndbits             = <fs_activity_h>-sendbits
*            TABLES
*              sfields             = lt_fields
*            EXCEPTIONS
*              structure_not_found = 1
*              OTHERS              = 2.
*          CHECK sy-subrc EQ 0.

** Add the names of the new fields
          CLEAR ls_field.
          ls_field-fieldname = 'CATEGORY'.
          INSERT ls_field INTO TABLE lt_new_fields.
          INSERT LINES OF lt_new_fields INTO TABLE lt_fields.
** Code the sendbits again
          CALL FUNCTION 'SMO_SNDBITS_SETX'
            EXPORTING
              structurename       = 'BAD_ACTIVITY_H_MESS'
*              fieldname           = 'CATEGORY'
            TABLES
              sfields             = lt_fields
            CHANGING
              sndbits             = <fs_activity_h>-sendbits
            EXCEPTIONS
              structure_not_found = 1
              wrong_fieldname     = 2
              OTHERS              = 3.
        ENDLOOP.

      ENDIF.
    ENDIF.

But my category field is not getting updated. Please let me know how to resolve this issue.

Regards,

Pranay

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2011 at 09:06 AM

    We are not using this BADI any more.

    We have enhanced the ORDERADM_H structure with BSARK field from ECC and filling the data in the middleware Exit.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.