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: 

Copy Routines.....

former_member925838
Participant
0 Kudos

Hello Experts,

I have created an extra tab in VL01N which contains 6 fields. the same tab i have also created in VF01.

now when user enters data in VL01N data should get copied while creating invoice..

I have searched SDN, Googled about it.

i found that i have to implement a routine.. I have never worked on routine before.

So please can anybody help me with how to create a custom routine. i dont want the steps, i want what pre-requisite i need for writing custom routines, how can i write the code? i have gone through some standard routines for eg LV60A003.

But i did not get anything from that. so please can anyone help.

Is there any other way than writing routine for implementing above scenario.

Thanks,

Amar

14 REPLIES 14

Former Member
0 Kudos

Hi,

Use Tcode VOFM, there you can see routines for delivery

Create your routine for header, Item etc & you can populate those fields..

This may be helpful...

Regards,

Rahul

koolspy_ultimate
Active Contributor
0 Kudos

Hi ,

for creating a routine you need to use tcode: vofm

[Click here |http://wiki.sdn.sap.com/wiki/display/ABAP/RequirementRoutines-OutputControl] for detailed explanation

Regards,

koolspy.

0 Kudos

Hi ,

Steps for Creating Routine

1) Transaction Code vofm

2) in MEnu -> Formulas ->Condition Value

3) Go to the end of LIst

4) Enter Number Range between 600 and 999 " FOr Customized

5) Details description

6) Press Enter

7) it will ask for Access KEy -> For change in Object

😎 Register your Object in SAP.Service .com site using BASIS LOGIN or Tell besis to give assecc Key for given object details i.e Installation no , program , r3full ,name of object

9) after Registering it will give access Key

10 ) Insert that Access Key in screen on which it is asked

11) It will create one FORM -ENDFORM routine by that routine number given by you

12) Activate that Routine by selecting the row and pressing -> Menu->EDIT->Activate

13) Remember it will create routine as per your Selected Area / Formula .

14) You can then add Code in that routine

I have done this Routine Today Only For SALES & Dist -PRicing (Formulae ).

regards

Deepak.

0 Kudos

Thanks all of you .your replies helped.

i will check and will get back to you.

Thanks,

Amar

0 Kudos

Hello Deepak,

Can you post the code you have written for the routine.

Thanks,

Amar

0 Kudos

Hi ,

FORM FRM_KONDI_WERT_826.
*{   INSERT         DVSK901825                                        1
* New Routine Created 826 for  Duty Drawback scheme  Comparing Two values  of
*   wf_kwert and wf_wf_kwert1 and passing  value which is less than the other
*  Routine Created   By : Deepak Dhamat on  28.09.2011 ,Specs : D .P.KaDAM .
tables : zvtdds , mvke ,lips.

data :  wf_ntgew like mara-ntgew,
        wf_MVGR5 like vbap-MVGR5,
        wf_kwert like komv-kwert,
        wf_kwert1 like komv-kwert,
        wa_komv like xkomv,
        ykomv like xkomv,
        ymvke like mvke ,
        wf_weight like mara-ntgew.

 ykomv = xkomv.

 select  single ntgew
   into  wf_ntgew
   from  mara client specified
  where  mandt  = sy-mandt
    and  matnr  = komp-matnr.

if sy-subrc eq 0.

    if sy-tcode = 'VF01' .   " If VF01  mvgr5 value taken from  lips


 select single *
    from lips CLIENT SPECIFIED
   where  mandt = sy-mandt
   AND   VBELN  = KOMP-VGBEL
   and   matnr = komp-matnr
    and   kokrs = komk-vkorg
    and   vtweg = komk-vtweg .

   IF SY-SUBRC = 0 .
    select single * from  zvtdds client specified
         where  mandt  = sy-mandt
         and    vkorg  = komk-vkorg
         and    vtweg  = komk-vtweg
         and    mvgr5 = lips-mvgr5.
    endif.


 ELSEIF  ( SY-TCODE  =  'VA01' or sy-tcode  = 'VA02' ) . " if  VA01 or VA02  value mvgr5 taken from mvke


  select SINGLE *
    from mvke client specified
    where mandt = sy-mandt
    and   matnr = komp-matnr
    and   vkorg = komk-vkorg
    and   vtweg = komk-vtweg .

    if sy-subrc = 0 .

  select single * from  zvtdds client specified
         where  mandt  = sy-mandt
         and    vkorg  = komk-vkorg
         and    vtweg  = komk-vtweg
         and    mvgr5 = mvke-mvgr5.

    endif.

ENDIF.


   if sy-subrc eq 0.
       wf_weight =  komp-ntgew * zvtdds-kbetr2 / 100 .
       wf_kwert1 = wf_weight * 10000 /  komp-kursk  .
   endif.
*  depb rate based on percentage in document curency
   wf_kwert = komp-kzwi2 .

endif.




 xkwert = wf_kwert * zvtdds-kbetr1 / 10000 .



  if wf_kwert1 le xkwert and wf_kwert1 ne 0.          " for maintaing value 0 for KBETR2 field
     xkwert = wf_kwert1.
  else.
     xkwert = xkwert.
  endif.


*   xkwert = xkwert * zvtdds-kbetr1 / 10000 .



if xkwert lt 0 .

message w021(zfi) .

endif .

*** For -ve fob value message .





*}   INSERT
ENDFORM.

re

0 Kudos

Thanks Deepak.

0 Kudos

Hi Amar ,

After Creating Routine and transporting to Target System . YOu need to Run program

NOTE: we need to generate that routine call in Target System , Executing report RV80HGEN .

Unless That Report is executed it will not Add the include in program RV64ANNN .

There should be entry in Program RV64ANNN .

Otherwise it will not get call and nor you can activate Debugging for that routine .

Regards

Deepak.

0 Kudos

Hi Amar,

For executing the program RV80HGEN automatically create the XPRA entry (see below for the entry)in the transport request which has the newly created routine.


Program ID     Object Type    Object name
R3TR	       XPRA	      RVH80GEN

Srikanth.

0 Kudos

Yes, thanks.

actually i was going to ask you the same thing.. but before i thought i should write the routine.

but really thanks. your posts helped a lot.

Thanks,

Amar

0 Kudos

Hi Deepak,

I have done all steps suggested by you,

I have created a routine in formula-rounding rules..

and activated it as suggested by you,

but my functional consultant is telling me he cant see the routine in f4 help for rounding off option while assigning it to condition types.

can you please through a light on it, whats wrong???

Thanks

0 Kudos

Hi ,

Have you executed report RV80HGEN .

read about this First before using .

Unless That Report is executed it will not Add the include in program RV64ANNN .

There should be entry in Program RV64ANNN .

Otherwise it will not get call and nor you can activate Debugging for that routine .

i will suggest you to check routine number which you created is there in program RV64ANNN

regards

Deepak.

Edited by: Deepak Dhamat on Oct 20, 2011 1:17 PM

0 Kudos

yes i Have executed report RV80HGEN .

it give me message that all routines are activated

but there is no entry in program RV64ANNN........

0 Kudos

Hi ,

Read about MEKP transaction code , you will get help regarding Rounding Values ,

regards

Deepak.