cancel
Showing results for 
Search instead for 
Did you mean: 

Determine Block Number at Save

Former Member
0 Kudos

Hi Gurus,

we'are tryning to determine the block numbers for a specified resource into Tcode /sapapo/res01

( Block planning / Create Blocks / Insert Blocks)

We only found one BADI that could help us : /SAPAPO/MC01_BLK , method BLOCK_CHANGES_PUBLISH.

But this method doesn't allow any Block number change.

Checking the standard code, we noticed an interesting form :

in Include /SAPAPO/LMC01_RULF99 , perform propose_blocknr_from_user ,

its parameters correspond to want we want to modify but its code is empty, it only contains following comments :

* from here, a block number can be set by from a customer
* enhancement (modification, by now)
* In order to activate, above Form propose_blocknr_for_line,
* set global variable gb_blocknr_active = 'X',
* and enter customer specific coding in order to determine the
* block number below.

* implement customer-specific functionality to determine
* new block numbers here (as a modification).
* Write new block number into CC_BLOCKNR.
* Use LC_RESID as internal ID for ressource,
* and LC_SIMVERSID as internal ID for planning version,
* if required.
* Also, some methods of class /SAPAPO/CL_TMC01TB may
* be helpful in order to determine new block numbers
* (like method BLOCKNR_IS_UNIQUE)

Do we have to modify the standard code in this perform, or is there another method to determine block numbering among project specific rules ?

Thanks' in advance for responding !

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear Romain,

can you explained more what exactly your business requirements?

Former Member
0 Kudos

Hi,

to be more specific,

in Tcode : /sapapo/res01 , when we go on Block planning / Create Blocks / Insert Blocks,

and when we insert new blocks, they haven't got any number.

We would like to be able to assign automatically numbers to those blocks , with specific business rules.

This numbering could be set, maybe when we save the resource, or when when we add the blocks, we don't really mind.

We just want to be able to set a calculated number to blocks.

Former Member
0 Kudos

hi Romain

Block numbers to be generated automatically. This is not a standard functionality. Based on the customer requirement we activating the user exit /SAPAPO/LMC01_RULF99.

for every Location and resource we specified a number range

for Block ID

User Exit - /SAPAPO/LMC01_RULF99 is implemented to achieve the Generation of block number automatically. It is implemented in the Function Pool /SAPAPO/MC01_RUL Formulate Rules Using Characterisics, inside the sub program /SAPAPO/LMC01_RULF05.

Read the table gt_tmc01tr with key component id and Block id.

In the subroutine propose_blocknr allows automatic determination of a block number for a newly created block by user enhancement. Using the method /sapapo/cl_mc01_vrs=>componentid_unfold get the resource id and version id, because the action to be performed only on a Active version. Now, call the /sapapo/cl_tmc01tb=>blockid_2_blocknr to get the old block numbers, so that it does not get disturbed. Call the method /sapapo/cl_tmc01tb=>blocknr_is_unique

To have a block number which is unique.

Now, block number is generated using the following procedure. Initially check if any block number is already exists or not. If not, proceed further by calling the function module MMRP_RESID_2_RESNAME for getting the resource name and id. Split the resource at u2018_u2019 and get the location number. Get the Number range from the block number range table zao_blk_num_ran( custom table which stores location , resource & number range). Check for the location number and Resource exists in the table, if it matches then call the function module: NUMBER_GET_NEXT to generate an unique number for each block.

Now, to specify the range, ZAO_BLOCK ( custom object)is created in SNUM transaction.

After generating the number the exit /SAPAPO/LMC01_RULO15 is used to display them.

In the standard code, a line has been deleted and a new line is added to make the block number in display mode.

Hope this information helpas you

please feel free to ask furthur doubt

regards

Vaibhav sareen

Edited by: vaibhav sareen on Jul 3, 2009 2:23 PM

Former Member
0 Kudos

Thanks' , that looks very great !,

I just wanted to know how to access to this UE,

I didn't find any way of implementing through CMOD or SMOD ...

And going tryning to modify includes /SAPAPO/LMC01_RULF99 or /SAPAPO/LMC01_RULF05 requires a standrad code change,

Cheers ,

Former Member
0 Kudos

hi! Romain

there is no such enhancement .. let me give u a detailed answer

its a program program /SAPAPO/LMC01_RULF99

and read it carefully it will tell u in comments how to modify and where to modify.

regards

vaibhav sareen

Edited by: vaibhav sareen on Jul 3, 2009 5:00 PM

Edited by: vaibhav sareen on Jul 3, 2009 6:01 PM

Former Member
0 Kudos

OK, yep as said in the first post, we already found this one,

but we were quite disappointed to have to ask an access key to SAP in order to change the standard code for this requitement ....

If there's no other option, we'll take this one,

best regards !

Former Member
0 Kudos

Hi!!! Romain

is your question still unanswered???

regards

Vaibhav Sareen