cancel
Showing results for 
Search instead for 
Did you mean: 

how to retrieve information for approval note change?

former_member186144
Participant
0 Kudos

Dear SAP gurus,

We would need to make a report to retrieve the approval note made by approvers in all documents (SC, PO, Contract, Bid invitation). So we should show in report who make what note and in what time. Does anyone of you know the logic and table that we can use for this?

I will reward for any helpful answers.

Best regards,

Yosea

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use the FM "BBP_PROCDOC_GETDETAIL" to read the data of all the attachements for any type of doc(PO,SC etc).the contents of the attachemnts cna be seen in the table "ET_ATTACH".You can look for contents specific to "APPROVAL NOTE " using the TEXT ID for it ie. "NOTM".

BR,

Disha.

Pls reward points for useful answers.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

<b>Please read this -></b>

<b>Please call FM BBP_PD_SC_GETDETAIL to get SC Approval Note text contents. Inside Internal Table E_LONGTEXT contains the value for note for approval.

TDLINE -> Note for Approval.

TDID -> 'NOTM' </b>

<u>Similary we can also use the following function module in your custom report - BBP_PROCDOC_GETDETAIL (For Shopping cart, Bid, Contract, Bid Invitation)</u>

<i><u>Object types</u>

BUS2121 -> Shopping cart

BUS2201 -> Local PO

BUS2202 Object Type EBP Local Bid

BUS2200 Object Type EBP Local Bid Invitation

BUS2000113 Object Type EBP Contract

</i>

<b>Sample code</b>

  DATA:
               lt_attach TYPE bbpt_pds_att_t,
               ls_header TYPE bbp_pds_header,
               lv_object_type TYPE oj_name.



  IF iv_object_type IS INITIAL.
    CALL FUNCTION 'BBP_PROCDOC_GETDETAIL'
      EXPORTING
        i_guid          = iv_guid
        i_with_itemdata = ''
      IMPORTING
        e_header        = ls_header.
    lv_object_type = ls_header-object_type.
  ELSE.
    lv_object_type = iv_object_type.
  ENDIF.


  IF  lv_object_type = 'BUS2121'.
    CALL FUNCTION 'BBP_PD_SC_GETDETAIL'
      EXPORTING
        i_guid            = iv_guid
        i_attach_with_doc = 'X'
        i_with_itemdata   = ''
      IMPORTING
        et_attach         = lt_attach.


  ELSEIF lv_object_type = 'BUS2201'.
    CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
      EXPORTING
        i_guid            = iv_guid
        i_attach_with_doc = 'X'
        i_with_itemdata   = ''
      IMPORTING
        et_attach         = lt_attach.


  ELSEIF lv_object_type = 'BUS2000113'.
    CALL FUNCTION 'BBP_PD_CTR_GETDETAIL'
      EXPORTING
        i_guid            = iv_guid
        i_attach_with_doc = 'X'
        i_with_itemdata   = ''
      IMPORTING
        et_attach         = lt_attach.


  ELSEIF lv_object_type = 'BUS2200'.
    CALL FUNCTION 'BBP_PD_BID_GETDETAIL'
      EXPORTING
        i_guid            = iv_guid
        i_attach_with_doc = 'X'
        i_with_itemdata   = ''
      IMPORTING
        et_attach         = lt_attach.
  ENDIF.

  et_attachment = lt_attach.
*Delete lines which have deletion indicator
  DELETE et_attachment WHERE del_ind = 'X'.


  DATA: ls_attachment TYPE bbp_pds_att_t,
        lt_attach_help TYPE bbpt_pds_att_t.

  CONSTANTS: lc_bbp_p_doc TYPE sdok_class VALUE 'BBP_P_DOC'.

*Umlagern und Ergaenzen der Daten in lt_attach_help
  LOOP AT et_attachment INTO ls_attachment.
    IF ls_attachment-phio_objid IS INITIAL.
      ls_attachment-phio_objid = ls_attachment-guid.
      ls_attachment-phio_class = lc_bbp_p_doc.
      APPEND ls_attachment TO lt_attach_help.
    ELSE.
      APPEND ls_attachment TO lt_attach_help.
    ENDIF.
  ENDLOOP.

  REFRESH et_attachment.
  et_attachment = lt_attach_help.

<u>Related link -></u>

Hope this will help.

Regards

- Atul

former_member186144
Participant
0 Kudos

Hi Atul/Disha,

Thanks for the replies. I got to see the content of the note now. But the E_LONGTEXT only have the content of the note, but not showing who write the note and when. Can I use the text id and the GUID to go to other table to retrieve that information? (user who put the note and when).

Best regards,

Yosea