cancel
Showing results for 
Search instead for 
Did you mean: 

Automate Data manager Package - Load from BW to BPC - Time Variable - How to pass variable values

Former Member
0 Kudos

Hi All,

I am loading the transnational data from BW to BPC by manually selecting the time period. Is there anyway I can automate the time variable. Now I manually select the time period when I execute the DM .Is there anyway to derive the time period based on the system date ? I want to automate this by deriving the time period values based on the system date.

I can see it can be done through the UJD_TEST_PACKAGE and prompt file.Like update the UJFS file once a month when ever the job is executed.

Is there any ABAP BADI's exist to do this or any other solution to pass the variable in the DM package based on the system date ?

For example : I enter 2017/012 for time period in DM package. I want this 2017/012 has to be derived based on the system date automatically when ever the job executed monthly.

Thanks in advance for the help and much appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor

I have answered this question number of times - WHY NOT TO SEARCH?

Very short answer:

Create a copy of UJD_TEST_PACKAGE like ZUJD_TEST_PACKAGE

In the abap code read the system date and fill table LTH_ANSWER_PROMPT with correct values including Time period from system date.

Create chain with ZUJD_TEST_PACKAGE

Run it!

Another option is to use VBA to pass answer prompt from Excel: https://blogs.sap.com/2017/06/16/simple-vba-function-to-pass-parameters-to-dm-packages/

Former Member
0 Kudos

Excellent. Thanks Vadim.

Former Member
0 Kudos

Vadim,

LTH_ANSWER_PROMPT contains the whole prompt file as a string. Is there any function module to read the XML file and replace the Fiscal Period by the derived system values.

LTH_ANSWER_PROMPT - contains

Infoprovider....

Selections......

TRANSFORMATION = \ROOT\WEBFOLDERS\NV\GM\DATAMANAGER\TRANSFORMATIONFILE

TARGETMODE = Yes

RUNLOGIC = No

CHECKLCK = No

All the above appears as a string in the LTH_ANSWER_PROMPT and I am trying to replace the FISPER based on the derivation in the selections. Is there any method or function module to read the string(Prompt XML file) and replace the filed FISPER with the low and high value.

Thanks in advance for the help.

former_member186338
Active Contributor
0 Kudos

You don't need to parse xml file, just replace a text string in the Selections line!

former_member186338
Active Contributor
0 Kudos

Or you can create this line as a fixed text string... What's the issue?

Can you post the selection string you have?

Former Member
0 Kudos

Thanks Vadim for the quick reply and much appreciated.

The LTH_ANSWER_PROMPT contains the whole string like

InforProvide = Z* SELECTION = <?xml version="1.0" encoding="utf-16"?><Selections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Selection Type="Selection"><Attribute><ID>0FISCPER</ID><Operator>3</Operator><LowValue>001.2014</LowValue><HighValue>002.2014</HighValue></Attribute><Attribute><ID>0FISCVARNT</ID><Operator>1</Operator><LowValue>Z4</LowValue><HighValue /></Attribute><Attribute><ID>0FISCYEAR</ID><Operator>1</Operator><LowValue>2014</LowValue><HighValue /></Attribute></Selection><Selection Type="FieldList"><FieldID>0BUS_AREA</FieldID><FieldID>0CHNGID</FieldID>**************TRANSFORMATION = \ROOT\WEBFOLDERS\NV\GM\DATAMANAGER\TRANSFORMATIONFILES\z*.xls TARGETMODE = Yes RUNLOGIC = No CHECKLCK = No

I just want to replace the

<ID>0FISCPER</ID><Operator>3</Operator><LowValue>001.2014</LowValue><HighValue>002.2014</HighValue>

with the derived fiscal period value.

Is there any function module to find and replace it ? Thanks again.

former_member186338
Active Contributor
0 Kudos

Why do you need to replace anything???

Your answer prompt is fixed (to my mind)

You have strings:

SEL1 = "http: ... <ID>0FISCPER</ID><Operator>3</Operator><LowValue>".

SEL2 = "</LowValue><HighValue /> ...".

and TIME = "004.2017".

RESULT = SEL1 && TIME && SEL2.

Former Member
0 Kudos

Thanks always for the quick reply . I will try and keep you posted.Thanks again.

Answers (0)