Está en la página 1de 5

Multiple Script Logics in Default Logic..

order of execution... Commit


This question is Assumed Answered.
http://scn.sap.com/thread/1688436

May 18, 2010 12:47 AM

Hi,
I have a situation where I need to perform two activities...
i) Perform a multiplication operation on the data input by the user - Script Logic A
ii) Send the data at a summary level to another application. - Script Logic B
Both Script logics are in the Default Logic
User opens an input template and makes changes to a few Products (more than 1). I want the
script logicA to execute completely (i.e. for all the models) and THEN Script Logic B to execute
since Script Logic B summarises the data
It seems like this is not how the system works.. Rather it goes thru Script Logic A and Script
LogicB for the 1st Product, then the 2nd Product and so on...
I tried using a commit after Script Logic A / before Script logic B and a few other options but to no
avail... Any suggestions ???
The other option is not to put Script Logic B in the Default Logic but to execute it separately...
Worse case situation I'll use that option..
thanks

Ans 1:
there is one more option, buti don't know whether it will work or not.

Write your second logic in second script and in default logic call the second logic.

Ans 2:
Have you defined the scope of the product for the two logics independently.
Try that by including commit after the first logic. This should work.
*XDIM_MEMBERSET PRODUCT=BAS(ALL)
Script 1
*COMMIT

*XDIM_MEMBERSET PRODUCT=BAS(ALL)
Script 2
*COMMIT
Hope this helps,

Ans 3:
Pls try using *FOR in the first logic. Something like the one below..

*FOR %PROD%= BAS(PRODUCT)


//Put your LOGIC A
*NEXT
*COMMIT
//Put your LOGIC B
*COMMIT

Also specify the scope correctly for product as mentioned above. Hope this helps.

http://scn.sap.com/thread/1647391

Multiple script logics in default logic... can


you control execution ?
My default logic consists of two .LGF files both of which do two different Logics functions e.g. A and B
For one input template when the user saves the data I would like Logic A be run and not Logic B.

For the second input template I would like the Logic B to be executed and not Logic A.

Is there a way to achieve this ?


thanks

Ans:
If you have included 2 lgf files in the default logic, both of them will run everytime data is sent to the database,
irrespective of which input schedule you use.
I can suggest you to create 2 DM packages for 2 of the script logics, and you can embed the required DM
package to the corresponding input schedule. But in this case, you will need to remove both the logics from
default.
If you need to have both the scripts in the default, then you cant control the execution.

Ans:
why don't you combine the default.lgf with a UJ_Custom Logic then you can handle how the data should be
written or what ever you want to do.

There is a quite good How to: I think its called how to pass parameters to BAdi Uj_Custom_Logic.

Thats the way we started implementing varios calculation methods.

Ans:
The point is that his question not seems related to the data itself but to the screen, maybe a special
operation for a screen?
First scenario where the data itself have the reference of the operation. He might be then be able to
distinguish even in a scriptlogic.

Second scenario: The calculation is driven by the screen itself. Then he have several oportunities.
1) Add extra information if possible in one unused dimension for the purpose of this calculation and
use this information to distinguish the operation
2) trigger the calculation on the default script logic of another application and bypass the calculation
with a change of destination_app
3) In a routing schema in a BADI you will still need to implement one of the two above points or as
you know drive the operations through the dimension file ;).

Ques:
Basically the two functions are operating on the same set of data and I want the results to happen in a certain
way.. hence my requirement.

I want to be able to control the execution from the Input Template itself and not control it based on another
dimension / flag being filled up. I toyed with the idea of using an unused dimension but will have to make it
really robust.

Nilanjan.. could you explain a bit more on how you can "embed" the DM package. I do not mind creating the
"DM package" as long as I can call it from the Input template.
thank you all for the prompt replies

Ans:
You can create a button in your input schedule. Then assign the menu command,
EVMNU_eDATA_SELECTPACKAGE to that button. This menu function has few parameters. Once this is
assigned to the button, you can click on the button to execute the DM package. The DM package will in turn
execute the script logic. It will look like

"MNU_eDATA_SELECTPACKAGE", "Allocate Budget", "My Files/Allocate Budget.dtsx", "Company", "Data


Management"

Where Allocate Budget is the DM package name. Next parameter is the path where I have saved this DTSX.
This path is relative to the "package files" folder. Next parameter is the team to which the package is assigned.
Last parameter is the folder under which I am creating the DM package.

Hope this helps.

También podría gustarte