Skip to Content

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’.

               /wp-content/uploads/2015/02/img1_636420.png

Expand ‘Class Library->Classes’, double click on class ‘CL_GBAPP_APV_PR_API’./wp-content/uploads/2015/02/img2_636300.png   

Find the method ‘SET_DECISION_REL_COLLECTIVE’, double click on the method./wp-content/uploads/2015/02/img3_636301.png

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

               /wp-content/uploads/2015/02/img4_636419.png

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.

img5.PNG

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

img6.PNG

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

img7.PNG

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. 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.

   SELECT SINGLE bsart

     FROM eban

     INTO lv_bsart

     WHERE banfn = iv_pr_number.

   IF lv_bsart <> ‘RV’.

   

     l_theadtdid = ‘B01’.

     l_theadtdname = iv_pr_number.

     l_theadtdobject = ‘EBANH’.

   

* initialize text

     CALL FUNCTION ‘INIT_TEXT’

       EXPORTING

         id       = l_theadtdid

         language = sylangu

         name     = l_theadtdname

         object   = l_theadtdobject

       IMPORTING

         header   = l_thead

       TABLES

         lines    = lt_tline

       EXCEPTIONS

         OTHERS   = 1.

     LOOP AT lt_text INTO ls_text.

       l_tlinetdformat = ls_texttdformat.

       l_tlinetdline   = ls_texttdline.

       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,

Kiran.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply