Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Implicit enhancement point does not execute in Call Transaction VF01

glauco
Active Contributor

enhancement-error-1.png

enhancement-error-2.png

enhancement-error-3.png

Hi.

We have created an implicit enhancement point to change some Ztable values when saving VF01 transaction (SD Billing).

We created an implicit enhancement point in very last line of RV_INVOICE_REFRESH function module.

This function module RV_INVOICE_REFRESH is always executed when creating SD billing, after saving standard routines, directly by VF01 transaction and when we call transaction VF01 command iinside a Zprogram.

We execute VF01 transaction by entering in the comamnd bar, I put a session break point which is catch and we can debug it.

But this same break does not stops the execution when we use Call Transaction VF01 command.

There isn't any condition to call/execute this enhancement though.

I've also teste an infinite loop but it did not stoped.
I can do it calling a new function module inside Zprogram, but I really wantto know about it.

Is there a difference when implementing an implicit enhancement point when executing the transaction in the command bar from sap main screen or via Call Transaction and why ?

5 REPLIES 5

michael_piesche
Active Contributor
0 Kudos

Did you choose a static (declaration) or a dynamic (code) enhancement point (based on your second screen shot that field is empty, which it shouldnt be in my opinion if you are doing an implicit enhancement).

Generally you would choose a static enhancement, if you always want your coding to be executed. If you want it to be called "dynamically", you need to apply switch settings in the properties of your enhancement implementation object. And that switch needs to be on of course for your coding to be 'active'.

I find the naming static and dynamic more appropriate than declaration and code. Also check out the Information icon when creating the enhancement, it gives you the same and a little more info as i described above.

I have not encountered a case yet where I would choose a dynamic implicit enhancement based on a switch from the switch framework. This might be more for coding that is used in several systems and different systems having different switch settings, my opinion though.

0 Kudos
glauco.kubrusly, if you use the answer box, there is only a notification sent out to the auther of the question, which would be you. If you want to notify a specific community member, you either have to directly comment their answers, or you have to mention them in the comment box, like this glauco.kubrusly. And also, use the answer box only for answers to your problem, not for comments or more detail about your problem, use the comment box instead for those.Regarding your problem: So you used a dynamic/code implicit enhancement, which requires you to also set a switch setting in the properties of your enhancement object and that switch needs to be on, like I mentioned above already.Rather than using dynamic/code implicit enhancements, I would rather suggest to use static/declaration implicit enhancements, as those will always be executed once the enhancement is activated. The naming code vs declaration is rather confusting, but just look at the ABAP help for these two and you will understand.

Let me know whether you found a solution to your problem or whether you still have issues.

Sandra_Rossi
Active Contributor
0 Kudos

What exact "Call Transaction 'VF01'" did you use? (with USING, OPTIONS FROM, others?)

Does it run exactly in the same context, same user, same server, same client, same data, etc.?

glauco
Active Contributor
0 Kudos

>What exact "Call Transaction 'VF01'" did you use? (with USING, OPTIONS FROM, others?)



FORM f_bapi_criar_fat_devo .

DATA:
  gv_modo_bi TYPE c LENGTH 1 VALUE 'N'.

  CLEAR gv_nova_fat_devo.


  FREE: gt_bdc,
        gt_messages.

  PERFORM f_preenche_bdc USING:
          'X' 'SAPMV60A'               '0102'.
  PERFORM f_preenche_bdc USING:
         ' ' 'KOMFK-VBELN(01)'        gv_new_sales_order_devo.
  PERFORM f_preenche_bdc USING:
         ' ' 'BDC_OKCODE'             '=SICH'.

  CALL TRANSACTION 'VF01'
        USING gt_bdc
        MODE gv_modo_bi
        MESSAGES INTO gt_messages.

  CLEAR gt_messages.
  READ TABLE gt_messages WITH KEY msgtyp = 'E'.
  IF sy-subrc = 0.
    " ERROR
    MESSAGE i048(zsd) WITH gv_nova_ov_devo.
*                        DISPLAY LIKE 'E'.
    MESSAGE
    ID      gt_messages-msgid
    TYPE    'S'
    NUMBER  gt_messages-msgnr
    WITH    gt_messages-msgv1
            gt_messages-msgv2
            gt_messages-msgv3
            gt_messages-msgv4
            DISPLAY LIKE 'E'.
    STOP.

  ELSE.

    " SUCESS
    READ TABLE gt_messages WITH KEY msgtyp = 'S'
                                    msgid = 'VF'
                                    msgnr = '311'.
    IF sy-subrc = 0.
      gv_new_bill_devo = gt_messages-msgv1.

      " Sales Order &1 and Billind document &2 created
      MESSAGE s047(zsd) WITH gv_new sales_order_devo gv_new_bill_devo.

    ENDIF.

  ENDIF.


ENDFORM.

>Does it run exactly in the same context, same user, same server, same client, same data, etc.?

Yes for all bellow.
same context,
same user,
same server,
same client,
same data, etc

We can make it manually by executing the standard transactions VA01 and VF01

And we can do it callig VA01 and VF01 from Zprogram.

glauco
Active Contributor
0 Kudos

Hi! Thank you for your answer.

The type of implicit enhancement is that which we create directly in the source code (in very begining or very ending of atandard programs).

So, I did this way.

inside the function module in ABAP editor (ECC 6.0)

Click on Enhance button (Shift + F4)

Right button on that enhancement point line in the very last line of the function module:

on the enhancement operation option context menu, choose create implementration.

Choose the Code (enhancement option), on the popup options.

Click on Create enhancement implementation button (F8)

Enhancement implementation new name: zenh_test

Short text: test

Composite enhanc. Imple.: empty.

Click Button create.

So we're able now to put our ABAP code inside the new enhancement and EndEnhancement.

ENHANCEMENT 1 zenh_test. "active version.

I put the code here.

ENDENHANCEMENT.

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Function Module RV_INVOICE_REFRESH, End