You are on page 1of 5

SAP Gateway: How to save text(PR Approver

comments) in header level.


Posted by Kiran VK Feb 3, 2015
Hi,
the Blog describes how to save text(PR Approver comments) in header level for Standard fiori PR App.
Enhancements : Implicit Enhancement for Collective Approve Action (SET_DECISION_REL_COLLECTIVE).
Implicit Enhancement for Collective Reject Action (SET_DECISION_REJECT_COLLECTIVE).
Implicit Enhancement - SET_DECISION_REL_COLLECTIVE:Execute SE80-> choose Package-> specify package name GBAPP_APV_PR.

Expand Class Library->Classes, double click on class CL_GBAPP_APV_PR_API.

Generated by Jive on 2015-08-11+02:00


1

SAP Gateway: How to save text(PR Approver comments) in header level.

Find the method SET_DECISION_REL_COLLECTIVE, double click on the

method.
Once get into the method click on the Enhance (Shift + F4) button from tool bar.

Right click on the method at starting line, choose Enhancement Operations -> Show Implicit
Enhancement Options. It will show like below arrow at both start & end of the the method.

Right click at the end of the method, choose 'Enhancement Operations -> Create Implicit
Enhancement. click on 'Code' button.

Generated by Jive on 2015-08-11+02:00


2

SAP Gateway: How to save text(PR Approver comments) in header level.

'Select or Create Enhancement Implementation' popup will come.It will ask you the Enhancement name &
Short description. click on Enter.

Implement custom logic(Logic provide below) between ENHANCEMENT and ENDENHANCEMENT. Save and
activate it.
Implicit Enhancement - SET_DECISION_REJECT_COLLECTIVE: Same as Implicit Enhancement - SET_DECISION_REL_COLLECTIVE.
Custom Logic:1. 1. Check whether the Document Type is not equal to RV (Contract Requisition) or not.
2. If Document Type is not RV, then initiate the text (FM: INIT_TEXT) with Id = B01, Name
= PR No. and Object = EBANH.
3. Loop the Item text table and append to the other table (Which is the input table of SAVE_TEXT
function module).
4. Pass the Header details (Id + Name + Object) and Text table to the SAVE_TEXT fm.
Code:
DATA : l_thead
TYPE thead,
lt_tline TYPE STANDARD TABLE OF tline INITIAL SIZE 30,
l_tline
TYPE tline,
l_txfunction TYPE cdupdkz.
DATA : lv_bsart TYPE bbsrt.
IF NOT iv_approval_text IS INITIAL.

Generated by Jive on 2015-08-11+02:00


3

SAP Gateway: How to save text(PR Approver comments) in header level.

SELECT SINGLE bsart


FROM eban
INTO lv_bsart
WHERE banfn = iv_pr_number.
IF lv_bsart <> 'RV'.
l_thead-tdid = 'B01'.
l_thead-tdname = iv_pr_number.
l_thead-tdobject = 'EBANH'.
* initialize text
CALL FUNCTION 'INIT_TEXT'
EXPORTING
id
= l_thead-tdid
language = sy-langu
name = l_thead-tdname
object = l_thead-tdobject
IMPORTING
header = l_thead
TABLES
lines = lt_tline
EXCEPTIONS
OTHERS = 1.
LOOP AT lt_text INTO ls_text.
l_tline-tdformat = ls_text-tdformat.
l_tline-tdline = ls_text-tdline.
APPEND l_tline TO lt_tline.
ENDLOOP.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = l_thead
IMPORTING
function = l_txfunction
TABLES
lines = lt_tline
EXCEPTIONS
OTHERS = 1.
ENDIF.
ENDIF.
Regards,

Generated by Jive on 2015-08-11+02:00


4

SAP Gateway: How to save text(PR Approver comments) in header level.

Kiran.
838 Views Tags: pr_approver_comments_at_header_level
There are no comments on this post

Generated by Jive on 2015-08-11+02:00


5

You might also like