cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture 0unit value with out using it in Input ready query

Former Member
0 Kudos

Hi,

We have a Manual Input Ready Query and in that currently we have columns this way. Example.

Compant Code ...... Material........ Unit.........Quantity

1001 ....... Mat1 ........ EA ........ 40

1002 ...... Mat2 ........ HS0 ....... 50

1002 ...... Mat3 ........ HS2 ....... 50

Now my user neads Unit Column to be not Visible. And it should look this way.

Compant Code ...... Material........ Quantity

1001 ....... Mat1 ........ 40

1002 ...... Mat2 ........ 50

1002 ...... Mat3 ........ 50

And as this is the manual input ready report , we have an empty record at the bottom of the report where users can enter data directly. When User enters material ,Unit value has to be picked automatically. 0Unit is an Attribut of Material here.

I guess we have to use characteristic relation...but i am not sure how to do that.

Your help is appreciated.

Please help !!

Thanks,

Edited by: Reddy on Sep 12, 2008 3:39 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Values not comming in to Quantity.

Former Member
0 Kudos

What is the operand display for this function (which shows at the bottom of the fox editor).

Did you run the function with trace in the planning modeler and see what records it operates on?

Former Member
0 Kudos

Mayank,

is the one which is displayed.

Operand:{Key figure name, 0UNIT}

Just now i ran the Trace with no errors, but i dont what i am looking at.

I can see

Block Number ... No. of Messages..No of Reference data Recods.. etc.. but i dont see what records are changed are effected.

I know its been a while you have been replying , i appreciate your help very much.

Please help me

Thanks,

Former Member
0 Kudos

If you click on any block in the trace, you will see the detailed records in that block. Identify one block for one of the materials and try to see what is going wrong with your function. Try to give some more details about the problem if you cannot solve it.

Former Member
0 Kudos

Hi Mayank,

I opend the Block and able to see Data Before and Data After and also the Reference Data, but i dont why the 0Quantity is not getting values.

I guess we should take this discussion out of this. If it is ok can you give me your email id so that we can communicate. and once the solution is achieved i will post the solution in here.

Thanks,

Former Member
0 Kudos

Hi,

Give the details of the trace of one of the blocks where it should have worked but didn't.

And a few points just to make sure you are not having some basic issue - you have all the required characteristics in your aggregation level? And the filter restrictions are same as those for the input query?

Former Member
0 Kudos

Hi Mayank,

I guess i solved my problem. As i said before the simple statement in Planning function is enough.

0QUANTITY=ZQTY

But the catch is on while saving in the WAD.

Under Save BUTTON Properties(WAD) i had save command first and then Planning Function,

By this what happening was, Data was saved to Cube first and then the planning function was executed, so when the planning function executed the changed records were store in Planning buffer. Thats the reason i was able to see the data when i ran on Aggregation level 2. But when i go and look in Cube there was no data in 0Quantity.

SO what i did was Under Save Button i Placed my Planning Function First and then Save command. And its all working no.

Because here Planning Function is executed First and then save command. so the changed records from planning function also saved to Cube.

SO my Problem sovled.

Thank for your precious Help Mayank. You Rock!!

Former Member
0 Kudos

Hi,

So the final issue was basically due to problem with Save command, eh? Not bad, you found it. That is what I was hoping you would be able to to do.

Answers (1)

Answers (1)

Former Member
0 Kudos

Can you tell us do you have the 0unit in the rows or cols. If you have it just drop it.

As I know when you have 0quantity in your report, the 0unit will act as reference char and will be automatically displayed but not in the separate column. Here if you don't want to show the units, you can select the quantity column then goto Format menubar--->Style,go to number tab and set property where it just displays the numbers with no units.

Former Member
0 Kudos

Hi Nazeer,

Thanks for your reply.

I am using the "Unit" in Rows.

IF i drop the Unit from Rows it is not allwoing me to input the values manually. Because it is included in Aggregation Level. As we know if the object is used in Aggregation level it should aslo be used in query.

Here unit is not only for display purpose but also when users enter new record this Unit object should also be filled with unit. Unit can be captured if the Unit filed is used inthe report, but my user dosent want to enter units, user want the units to be automatically populated as soon as Material is entered.

Hope i am clear on my question, if not please ask me i will clarify.

Your help is appreciated.

Thanks,

Former Member
0 Kudos

If in your report, if the unit is coming separately means, its a different column you used in the characteristics list. Inorder to enable the user to enter the value, there is no need to put that in the characteristics list.

If its coming aling with the quantity value, then make use of NODIM().

Then again the unit won't get displayed

Former Member
0 Kudos

Hi Mathew,

The unit is automatically selected in the Aggregation Level when i select Quantity, And in Query designer i am forced to use the Unit in Rows , or else i am not able to enter new record.

We cannt us NODIM() function...if we use it we cant input quantity value.

Any other suggestions !!

Thanks,

Former Member
0 Kudos

Then you can hide the Unit na...So it wont get displayed

Former Member
0 Kudos

Hi Mathew,

Thanks for immediate reply

I tried that and i am able to change the value of Quantity also.

But issue is i am not able to enter new record if i Hide 0Unit.

System saying thta all the characteristics should be available if new record has to be entered.

Thanks,

Former Member
0 Kudos

This is a known restriction I think (new rows would not appear if a field is hidden in rows).

See if the ideas discussed in following thread are useful for you -

Edited by: Mayank Gupta

Former Member
0 Kudos

Hi Mayank,

Thanks for a nice lik you provided, there the solution was not defined,

Also in that link at the end Sunil proposed one solution saying that we have to restrict with the Unit , But here in my case users dosent have good idea on units, and they would feel much difficult to know SAP units (i guess u know that ).

Can you propose any ideas !!

Thanks

Former Member
0 Kudos

You don't want the unit to display, but you want it populated in data and also, you want new input ready rows - is that correct?

In that thread, I made a suggestion about using a key figure for input in the layout which does not have a unit and then copying the values entered to the key figure with unit using a formula planning function. This should work for you.

Edited by: Mayank Gupta

Former Member
0 Kudos

That Sounds Good, I will try and work around and get back to you. Thanks for your suggestion.

Former Member
0 Kudos

Hi Mayank,

The suggestion you gave was good.

But i am struggling a bit here in identifying on how to capture 0Unit by using Fox Formula.

I can capture 0Quantity as i am using ZQTY as keyfigure where it is input ready so i can easily assign ZQTY to 0Quantity.

Only problem here is how to capture 0Unit which is an attribute of Material.

Please help me on this.

Thanks,

Former Member
0 Kudos

Use the ATRV statement to read the unit from material masterdata.

Refer to pseudo-code below -

material_num = OBJV().

Unit = ATRV(0UNIT, material_num).

Former Member
0 Kudos

I am getting follworing error

Formula error: ) was expected

Below is the code i am using.

DATA ZMAT TYPE 0MATERIAL.

DATA ZUNIT TYPE 0UNIT.

DATA ZFPY TYPE 0FISCPER.

DATA ZCC TYPE 0COMP_CODE.

ZMAT = OBJV(0MATERIAL).

ZUNIT = ATRV(0UNIT,ZSTST).

{0MATERIAL,0UNIT,0QUANTITY} = (ZMAT,ZUNIT,ZQTY}.

I am not aboe to figure out where the error is .

Please help

Thanks

Former Member
0 Kudos

{0MATERIAL,0UNIT,0QUANTITY} = (ZMAT,ZUNIT,ZQTY}.

The error is here ---> ( ZMAT,ZUNIT,ZQTY}. You need a flower braces {

Former Member
0 Kudos

Nazeer,

Thanks for that.

But after correcting that error..i am still getting same error message.

Formula error: ) was expected

Below is the code i am using.

DATA ZMAT TYPE 0MATERIAL.

DATA ZUNIT TYPE 0UNIT.

DATA ZFPY TYPE 0FISCPER.

DATA ZCC TYPE 0COMP_CODE.

ZMAT = OBJV(0MATERIAL).

ZUNIT = ATRV(0UNIT,ZSTST).

{0MATERIAL,0UNIT,0QUANTITY} = {ZMAT,ZUNIT,ZQTY}.

I am not able to figure out where the error is .

Please help

Please Help

Edited by: Kumar on Sep 15, 2008 10:37 PM

Former Member
0 Kudos

Hi,

OBJV() does not take any argument. And what is ZSTST? I don't see it defined anywhere. Use the below lines of code. The code seems simple - just make sure you also see the line number its pointing the error on - you'll be able to correct it easily.

ZMAT = OBJV().

ZUNIT = ATRV(0UNIT, ZMAT).

Former Member
0 Kudos

Mayank,

I made the change you suggested and it worked, but after that i am having one more error.

Formula error: Formula element 0MATERIAL could not be recognized

DATA ZMAT TYPE 0MATERIAL.

DATA ZUNIT TYPE 0UNIT.

DATA ZFPY TYPE 0FISCPER.

DATA ZCC TYPE 0COMP_CODE.

ZMAT = OBJV().

ZUNIT = ATRV(0UNIT,ZMAT).

Formula error: Formula element 0MATERIAL could not be recognized

{0MATERIAL,0UNIT,0QUANTITY} = {ZMAT,ZUNIT,ZQTY}.

Please your help. Your help is appreciated and i appreciate your suggestions.

Thanks,

Edited by: Kumar on Sep 15, 2008 11:31 PM

Edited by: Kumar on Sep 15, 2008 11:42 PM

Edited by: Kumar on Sep 15, 2008 11:43 PM

Former Member
0 Kudos

Hi,

You cannot use infoobject name directly inside curly brackets ({}).

I think the correct statement would look something like below. Adjust it according to your requirement.

{ZMAT, ZUNIT, <new keyfig>} = {ZMAT, #, <old keyfig>}.

Former Member
0 Kudos

Hi Mayank,

I really appreciate your patience by answering to my problems.

I was trying your suggestion but i was not working.

here i have a doubt let me keep it clear.

My Aggregation Level has following Infoobjects.

1. Company Code , 2. Controlling Area, 3.Material, 4.FiscalPeriod/Year, 5. ZQTY (KeyFigure).

So here as there is no 0Quantity (Key Figure), in this Aggregation level, i guess i cant use 0Quantity in Planning Function for value passing from ZQTY to 0Quantity.

if so can you please suggest me an alternative.

You have been so great in answering all this time.

Please help.

Thanks,

Former Member
0 Kudos

That is correct - you need to create this fox function in another aggregation level which also include the 0Quantity keyfigure.

Former Member
0 Kudos

Hey Mayank,

Thank you very much it worked, my problem solved with just a simple step.

Under Aggregation Level 2 created a planning Function and just included the below statement and its all working good.

0QUANTITY = ZQTY.

I need not worry about the 0unit copying because as it is already an attribut of ZMATERIAL so it is automatically populated in the report i guess it is taking the values from masterdata.

So all i needed to do was TO creat a Planning function on Aggregation level 2.

Aggregation Level 1 has ZQTY

Aggregation Level 2 has ZQTY and 0QUANTITY

So created PF on AL 2 and gave this statement

0QUANTITY = ZQTY.

And in web template under save butten i included this Planning function from AL2 and its working good.

Hope this will help others.

Thanks for Mayank Gupta for helping be on this issue.

I assigned full pints to you Mayank.

Take Care .

Edited by: Kumar on Sep 16, 2008 6:02 PM

Former Member
0 Kudos

Hi,

Did you check if unit is getting populated in the cube? I don't think it can get populated automatically... even if you have a characteristic relationship defined, derivation would not work becuase unit is included in aggregation level. I feel you will still need to use the statements which we discussed earlier to populate the unit.

Former Member
0 Kudos

Mayank,

Fortunately unit values are getting stored in Infocube and also the values of 0Quantity ( but only after i press the save button twice. First time when i press save button only 0 value is stored and after that when i click save for the second time then the value is stored from ZQTY to 0Quantity.)

I took you suggestion and tried to do it in PF. but i am getting the error.

DATA ZMAT TYPE 0MATERIAL.

ZMAT = OBJV().

Formula error: } expected

{0QUANTITY,ZMAT ,ZUNIT} = {ZQTY,ZMAT ,#}.

How do i proceed now.

Thanks,

Former Member
0 Kudos

Have you marked material in fields to be changed? You don't need that - use the logic as below. Just try to understand the fundamentals of Fox clearly and you won't face these issues.

ZMAT = OBJV().

zunit = atrv(________

{0QUANTITY, ZUNIT} = {ZQTY, #}.

Former Member
0 Kudos

Mayank,

I was getting the following error

  • Formula error: } expected*

Untill i setup 0Unit characteristic to Changed. So then that error was resolved.

But there is one more problem here. My Quantity values are not copying from ZQTY to 0Quantity.

Below is the code i created based on ur suggestion.

DATA ZMAT TYPE 0MATERIAL.

DATA ZUNIT TYPE 0UNIT.

ZMAT = OBJV().

ZUNIT = ATRV(0UNIT,ZMAT).

{0QUANTITY,ZUNIT} = {ZQTY,#}.

Please help.

When i used statement " 0Quantity = ZQTY" values were copied after i click save twice. But here it is not happening.

Not able to understand where how to recolve this issue.

Thanks,