cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying include RV60AFZZ routine USEREXIT_NUMBER_RANGE

Former Member
0 Kudos

<i>Include program</i> : RV60AFZZ

<i>Routine</i>: USEREXIT_NUMBER_RANGE

<b>Objective:</b>

-


to assign number range according to

FKART - Billing type

AND

REGIO_1 - Region (State, Province, County) delivery plant

REGIO_2 - Region (State, Province, County) Ship-to-party

<b>Problem:</b>

-


<b>A)</b> I will require the billing type and region for delivery plant or VBRP-WERKS and ship-to party number, to decide the correct number range.

In which variable (coming through standard prg) I can expect them???

<b>B)</b> When i am trying to write any thing inside the subroutine <b>USEREXIT_NUMBER_RANGE</b> it is asking for access key, so I wonder what is the use for user exit if it is behaving like as if i am modifying the standard code.

I observed that the :

- Clicking the button "Modification overview" on the tool bar returning the msg that "No modification found"

- the <b>insert</b> butoon beside the "Modification overview" button is disabled

Now, in case i need to do

- some cmod and smod thing, whoose mechanism i am completely unknown of. plz provide me a link to the step-by-step docu on the web

- if you are suggesting that since i am doing the modification for the first time and I <b>had to</b> get and supply the access key then plz let me know where to ask for the key and what info they will need to give me a key

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Dear Flora,

First Of all you need to have a Access Key - Its a must for User exits. you can take help of Basis Administrator for the same.

Once you have the access key just click on insert button to insert the modification in the standard program.

Thanks

Anurag

Former Member
0 Kudos
*---------------------------------------------------------------------*
*       FORM USEREXIT_NUMBER_RANGE                                    *
*---------------------------------------------------------------------*
*       This userexit can be used to determine the numberranges for   *
*       the internal document number.                                 *
*       US_RANGE_INTERN - internal number range                       *
*       This form is called from form LV60AU02                        *
*---------------------------------------------------------------------*
FORM USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN.

* Example: Number range from TVFK like in standard
*{   INSERT         TIDK900180                                        1
* determine number ranges for VAT and RETAIL Invoice as
* per delivery plant
break-point.
Data: l_ship_REGION like adrc-region,
      l_plant_REGION like adrc-region,
      wa_ZBILLING like ZBILLING.
*Region, Ship-to-party
select single REGION
from vbpa  inner join adrc on adrc~addrnumber = vbpa~adrnr
           into l_ship_REGION
where
      parvw = 'WE' and vbeln = VBAP-vbeln and posnr = VBAP-posnr.
if sy-subrc NE 0.
select single REGION
from vbpa  inner join adrc on adrc~addrnumber = vbpa~adrnr
           into l_ship_REGION
where
      parvw = 'WE' and vbeln = VBAP-vbeln and posnr = '000000'.
endif.
Select single REGIO
from T001W
        into l_plant_REGION
Where
     werks = VBAP-werks.
*Clear the number range
  Clear US_RANGE_INTERN.
*Find Entry for Region in Zbilling table
Select Single * from Zbilling into wa_zbilling
Where
     FKART = vbrk-FKART AND
     REGIO = l_plant_REGION AND
     SHREGIO = l_ship_REGION.
if sy-subrc = 0.
   US_RANGE_INTERN = wa_zbilling-SNO.
   exit.
else.
* When the Region (Plant) will not be equal to Region (Ship-to-party)
* then select row for the delivery plant region for which there is no
* corresponding value in field
* Region (ship-to-party)
Select Single * from Zbilling into wa_zbilling
Where
     FKART = vbrk-FKART AND
     REGIO = l_plant_REGION AND
     SHREGIO = ''.
     if sy-subrc = 0.
       US_RANGE_INTERN = wa_zbilling-SNO.
       exit.
     endif.


endif.






*}   INSERT
* US_RANGE_INTERN = TVFK-NUMKI.

ENDFORM.
*eject

Answers (5)

Answers (5)

former_member188685
Active Contributor
0 Kudos

Hi Flora,

For getting the access key,go to table DEVACCESS and provide your user id and get the Access key

and change the user exit.

thanks

vijay

Former Member
0 Kudos

Hi,

1.You can create a Z table which stores number key as per plant and biling type. ex table structure could be :

Plant receiving palnt(VBRP-VSTEL) Billing type number key

These values are available in vbap-werks andtvfk-fkart during runtime(U can check in debugging).

2.U dont need to use SMOD/CMOD for this.get the access key by providing following info:

Program ID - R3TR

Object - PROG

pROGRAM NAME RV60AFZZ

and UR installation number.

U can take help of basis to get the access id if u dont have OSS autherizations.

Hope this helps.

Ramesh

former_member188685
Active Contributor
0 Kudos
* Example: Number range from TVFK like in standard
* US_RANGE_INTERN = TVFK-NUMKI.
*{                                                 

data: t_tknum           like vttp-tknum,
      t_exnum           like eikp-exnum,
      t_aland           like kna1-land1,
      t_land1           like kna1-land1,
      t_adrnr(10)       type c.
DATA: BEGIN OF ZNVBPA,
        ADRNR     LIKE VBPA-ADRNR,
        KUNNR     LIKE VBPA-KUNNR,
      END OF ZNVBPA.

 IF VBRK-FKART = 'ZBIC'.   "stc00011
    VBRK-TAXK1 = '0'.
 endif.
*  Stop if foreign trade data is missing.
if vbrk-fkart = 'ZC' OR VBRK-FKART = 'ZI'.
  t_aland = space.
  t_land1 = space.
  t_adrnr = space.
  if lips-vbeln > space.                    " AND vbak-vkorg = '5000'.
      Select single aland from tvst into t_aland
          where vstel = likp-vstel.
      select single adrnr from vbpa  into t_adrnr
        where parvw = 'WE' and vbeln = lips-vbeln.
      if sy-subrc = 0.
        select single country from adrc into t_land1
          where addrnumber = t_adrnr.
      endif.
      IF T_LAND1 = T_ALAND.
        STOP.
      ENDIF.
      if t_land1 ne t_aland.
          t_exnum = space.

          select exnum from eipo into t_exnum
              where exnum = likp-exnum and
              ( stawn = space or herkl = space ).
          endselect.
          if t_exnum <> space.
            stop.
          endif.
      endif.
  endif.
endif.

IF VBRK-FKART = 'ZI'.
  clear znvbpa.
  IMPORT ZNVBPA FROM MEMORY ID 'ZNVBPA2'.
  if not znvbpa-kunnr is initial.        
    loop at xvbpa where parvw = 'WE'
        and vbeln = vbrk-vbeln
        and kunnr <> znvbpa-kunnr.

    XVBPA-ADRNR = ZNVBPA-ADRNR.
    XVBPA-KUNNR = ZNVBPA-KUNNR.
    MODIFY XVBPA INDEX  SY-TABIX.
    endloop.

  ENDIF.
ENDIF.

try this code inside ..the userexit_number_range

Former Member
0 Kudos

Hi Flora,

1. Get the access key for it.

Its a MUST.

2. This include

has form defintions

with the name USEREXIT**

But it is not directly a user exit.

Regards,

Amit M.

Former Member
0 Kudos