Application Development and Automation 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: 
Read only

Issue with identifying the t.code

Former Member
0 Likes
898

Dear friends,

I have t.code ZVL10G which is used to create deliveries.

I have put some custom logic in user exit - FORM USEREXIT_MOVE_FIELD_TO_LIPS as mentioned below.

the thing is that the code needs to be triggered only when executed with transaction 'ZVL10G'. I have put the condition as shown below but, it is not working.

FORM USEREXIT_MOVE_FIELD_TO_LIPS.

if sy-tcode eq 'ZVL10G'.

**custom logic

endif.

ENDFORM.

Kindly suggest on this issue.

8 REPLIES 8
Read only

Former Member
0 Likes
846

Use

If   T180-tcode  eq  'ZVL10G'.
 your code.
endif.

instead.

G@urav.

Read only

0 Likes
846

In debug mode, T180-TCODE = 'VL01N' so, i can't use this info.

Thanks for ur quick reply....

Read only

0 Likes
846

then I guess ZVL10G must be calling VL01n internally.

You can try one more option..

sy-cprog stores the name of the program which starts the transaction.

Try putting condition on SY-PROG . It must solve the problem.

G@urav.

Read only

0 Likes
846

Yes, ZVL10G it's created a delivery..so it is calling VL01N transaction. for my include MV50AFZ1 the main program is SAPMV50A.

So, SYST-CPROG = SAPMV50A..

Read only

0 Likes
846

How are you creating delivery in ZVL10G?

Are you calling some BAPI/ BDC?

sy-cprog should store the calling program (can be the main program if started by main program).

If transaction is started from your z-program the sy-cprog has to be your Z-program.

Anyways, if this doesn't work then we can try some flag usage in ABAP /SAP memory.

G@urav.

Read only

0 Likes
846

Hi,

How are you creating delivery in ZVL10G?

When I execute the transaction ZVL10G, am getting all the filtered sales orders list. at the top I have push button 'Dialog' .

I need to select particular order and press 'Dialog' button, at this point of time our code in MV50AFZ1 is getting triggered.

Thanking you...

Read only

0 Likes
846

What I suggest is use some global flag in system(Export/import or Shared Memory Object).

set its value to ZVL10G when u click dialog, and use its value in user exit.After using it don't forget to clear that memory.

Also don't forget to reward if found helpful

G@urav.

Read only

Former Member
0 Likes
846

Hi

you are correct it should work, try to check it agian in debugg mode.

regards